Skip to content

Instantly share code, notes, and snippets.

View MissAllSunday's full-sized avatar

Michel Mendiola MissAllSunday

  • Ohara
  • CDMX
View GitHub Profile
<?php
array (size=12)
'enable_wall' => string '1' (length=1)
'pagination_number' => string '5' (length=1)
'load_more' => string '0' (length=1)
'how_many_mentions' => string '5' (length=1)
'kick_ignored' => string '0' (length=1)
'enable_activityLog' => string '0' (length=1)
'enable_buddies' => string '0' (length=1)
// Get the right sort method depending on the cust field type.
if ($row['field_type'] != 'check')
$cpf['columns'][$row['col_name']]['sort'] = array(
'down' => 'LENGTH(t' . $row['col_name'] . '.value) > 0 ASC, IFNULL(t' . $row['col_name'] . '.value, 1=1) DESC, t' . $row['col_name'] . '.value DESC',
'up' => 'LENGTH(t' . $row['col_name'] . '.value) > 0 DESC, IFNULL(t' . $row['col_name'] . '.value, 1=1) ASC, t' . $row['col_name'] . '.value ASC'
);
else
$cpf['columns'][$row['col_name']]['sort'] = array(
'down' => 't' . $row['col_name'] . '.value DESC',
if (substr($field, 0, 5) == 'cust_' && isset($context['custom_search_fields'][$row['col_name']]))
{
$customJoin[] = 'LEFT JOIN {db_prefix}themes AS t' . $row['col_name'] . ' ON (t' . $row['col_name'] . '.variable = {string:t' . $row['col_name'] . '} AND t' . $row['col_name'] . '.id_theme = 1 AND t' . $row['col_name'] . '.id_member = mem.id_member)';
$query_parameters['t' . $row['col_name']] = $row['col_name'];
$fields += array($customCount++ => 'IFNULL(t' . $row['col_name'] . '.value, {string:blank_string})');
}
@MissAllSunday
MissAllSunday / gist:0cc0f67438d1a991c0df
Created May 11, 2015 23:36
fileUpload configuration
function smf_fileUpload(oOptions)
{
// Default values in case oOptions isn't defined.
var dOptions = {
url: smf_prepareScriptUrl(smf_scripturl) + 'action=uploadAttach;sa=add;' + smf_session_var + '=' + smf_session_id,
dataType: 'json',
dropZone: $('.drop_zone'),
singleFileUploads:false,
forceIframeTransport: false,
autoUpload: false,
<?php
return PhpCsFixer\Config::create()
->setUsingCache(false)
->setRules([
'array_syntax' => [
'syntax' => 'long'
],
'ordered_imports' => true,
'binary_operator_spaces' => true,