@@ -104,14 +104,14 @@ discard block |
||
104 | 104 | $context['valid_upload_dir'] = is_dir($context['attachmentUploadDir']) && is_writable($context['attachmentUploadDir']); |
105 | 105 | |
106 | 106 | if (!empty($modSettings['automanage_attachments'])) |
107 | - $context['valid_basedirectory'] = !empty($modSettings['basedirectory_for_attachments']) && is_writable($modSettings['basedirectory_for_attachments']); |
|
107 | + $context['valid_basedirectory'] = !empty($modSettings['basedirectory_for_attachments']) && is_writable($modSettings['basedirectory_for_attachments']); |
|
108 | 108 | |
109 | 109 | else |
110 | 110 | $context['valid_basedirectory'] = true; |
111 | 111 | |
112 | 112 | // A bit of razzle dazzle with the $txt strings. :) |
113 | 113 | $txt['attachment_path'] = $context['attachmentUploadDir']; |
114 | - $txt['basedirectory_for_attachments_path']= isset($modSettings['basedirectory_for_attachments']) ? $modSettings['basedirectory_for_attachments'] : ''; |
|
114 | + $txt['basedirectory_for_attachments_path'] = isset($modSettings['basedirectory_for_attachments']) ? $modSettings['basedirectory_for_attachments'] : ''; |
|
115 | 115 | $txt['use_subdirectories_for_attachments_note'] = empty($modSettings['attachment_basedirectories']) || empty($modSettings['use_subdirectories_for_attachments']) ? $txt['use_subdirectories_for_attachments_note'] : ''; |
116 | 116 | $txt['attachmentUploadDir_multiple_configure'] = '<a href="' . $scripturl . '?action=admin;area=manageattachments;sa=attachpaths">[' . $txt['attachmentUploadDir_multiple_configure'] . ']</a>'; |
117 | 117 | $txt['attach_current_dir'] = empty($modSettings['automanage_attachments']) ? $txt['attach_current_dir'] : $txt['attach_last_dir']; |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | array('select', 'automanage_attachments', array(0 => $txt['attachments_normal'], 1 => $txt['attachments_auto_space'], 2 => $txt['attachments_auto_years'], 3 => $txt['attachments_auto_months'], 4 => $txt['attachments_auto_16'])), |
137 | 137 | array('check', 'use_subdirectories_for_attachments', 'subtext' => $txt['use_subdirectories_for_attachments_note']), |
138 | 138 | (empty($modSettings['attachment_basedirectories']) ? array('text', 'basedirectory_for_attachments', 40,) : array('var_message', 'basedirectory_for_attachments', 'message' => 'basedirectory_for_attachments_path', 'invalid' => empty($context['valid_basedirectory']), 'text_label' => (!empty($context['valid_basedirectory']) ? $txt['basedirectory_for_attachments_current'] : $txt['basedirectory_for_attachments_warning']))), |
139 | - empty($modSettings['attachment_basedirectories']) && $modSettings['currentAttachmentUploadDir'] == 1 && count($modSettings['attachmentUploadDir']) == 1 ? array('json', 'attachmentUploadDir', 'subtext' => $txt['attachmentUploadDir_multiple_configure'], 40, 'invalid' => !$context['valid_upload_dir'], 'disabled' => true) : array('var_message', 'attach_current_directory', 'subtext' => $txt['attachmentUploadDir_multiple_configure'], 'message' => 'attachment_path', 'invalid' => empty($context['valid_upload_dir']), 'text_label' => (!empty($context['valid_upload_dir']) ? $txt['attach_current_dir'] : $txt['attach_current_dir_warning'])), |
|
139 | + empty($modSettings['attachment_basedirectories']) && $modSettings['currentAttachmentUploadDir'] == 1 && count($modSettings['attachmentUploadDir']) == 1 ? array('json', 'attachmentUploadDir', 'subtext' => $txt['attachmentUploadDir_multiple_configure'], 40, 'invalid' => !$context['valid_upload_dir'], 'disabled' => true) : array('var_message', 'attach_current_directory', 'subtext' => $txt['attachmentUploadDir_multiple_configure'], 'message' => 'attachment_path', 'invalid' => empty($context['valid_upload_dir']), 'text_label' => (!empty($context['valid_upload_dir']) ? $txt['attach_current_dir'] : $txt['attach_current_dir_warning'])), |
|
140 | 140 | array('int', 'attachmentDirFileLimit', 'subtext' => $txt['zero_for_no_limit'], 6), |
141 | 141 | array('int', 'attachmentDirSizeLimit', 'subtext' => $txt['zero_for_no_limit'], 6, 'postinput' => $txt['kilobyte']), |
142 | 142 | array('check', 'dont_show_attach_under_post', 'subtext' => $txt['dont_show_attach_under_post_sub']), |
@@ -349,16 +349,16 @@ discard block |
||
349 | 349 | |
350 | 350 | // These settings cannot be left empty! |
351 | 351 | if (empty($_POST['custom_avatar_dir'])) |
352 | - $_POST['custom_avatar_dir'] = $boarddir .'/custom_avatar'; |
|
352 | + $_POST['custom_avatar_dir'] = $boarddir . '/custom_avatar'; |
|
353 | 353 | |
354 | 354 | if (empty($_POST['custom_avatar_url'])) |
355 | - $_POST['custom_avatar_url'] = $boardurl .'/custom_avatar'; |
|
355 | + $_POST['custom_avatar_url'] = $boardurl . '/custom_avatar'; |
|
356 | 356 | |
357 | 357 | if (empty($_POST['avatar_directory'])) |
358 | - $_POST['avatar_directory'] = $boarddir .'/avatars'; |
|
358 | + $_POST['avatar_directory'] = $boarddir . '/avatars'; |
|
359 | 359 | |
360 | 360 | if (empty($_POST['avatar_url'])) |
361 | - $_POST['avatar_url'] = $boardurl .'/avatars'; |
|
361 | + $_POST['avatar_url'] = $boardurl . '/avatars'; |
|
362 | 362 | |
363 | 363 | call_integration_hook('integrate_save_avatar_settings'); |
364 | 364 | |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | 'items_per_page' => $modSettings['defaultMaxListItems'], |
423 | 423 | 'base_href' => $scripturl . '?action=admin;area=manageattachments;sa=browse' . ($context['browse_type'] === 'avatars' ? ';avatars' : ($context['browse_type'] === 'thumbs' ? ';thumbs' : '')), |
424 | 424 | 'default_sort_col' => 'name', |
425 | - 'no_items_label' => $txt['attachment_manager_' . ($context['browse_type'] === 'avatars' ? 'avatars' : ( $context['browse_type'] === 'thumbs' ? 'thumbs' : 'attachments')) . '_no_entries'], |
|
425 | + 'no_items_label' => $txt['attachment_manager_' . ($context['browse_type'] === 'avatars' ? 'avatars' : ($context['browse_type'] === 'thumbs' ? 'thumbs' : 'attachments')) . '_no_entries'], |
|
426 | 426 | 'get_items' => array( |
427 | 427 | 'function' => 'list_getFiles', |
428 | 428 | 'params' => array( |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | 'value' => $txt['attachment_name'], |
442 | 442 | ), |
443 | 443 | 'data' => array( |
444 | - 'function' => function ($rowData) use ($modSettings, $context, $scripturl, $smcFunc) |
|
444 | + 'function' => function($rowData) use ($modSettings, $context, $scripturl, $smcFunc) |
|
445 | 445 | { |
446 | 446 | $link = '<a href="'; |
447 | 447 | |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | 'value' => $txt['attachment_file_size'], |
483 | 483 | ), |
484 | 484 | 'data' => array( |
485 | - 'function' => function ($rowData) use ($txt) |
|
485 | + 'function' => function($rowData) use ($txt) |
|
486 | 486 | { |
487 | 487 | return sprintf('%1$s%2$s', round($rowData['size'] / 1024, 2), $txt['kilobyte']); |
488 | 488 | }, |
@@ -497,7 +497,7 @@ discard block |
||
497 | 497 | 'value' => $context['browse_type'] == 'avatars' ? $txt['attachment_manager_member'] : $txt['posted_by'], |
498 | 498 | ), |
499 | 499 | 'data' => array( |
500 | - 'function' => function ($rowData) use ($scripturl, $smcFunc) |
|
500 | + 'function' => function($rowData) use ($scripturl, $smcFunc) |
|
501 | 501 | { |
502 | 502 | // In case of an attachment, return the poster of the attachment. |
503 | 503 | if (empty($rowData['id_member'])) |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | 'value' => $context['browse_type'] == 'avatars' ? $txt['attachment_manager_last_active'] : $txt['date'], |
519 | 519 | ), |
520 | 520 | 'data' => array( |
521 | - 'function' => function ($rowData) use ($txt, $context, $scripturl) |
|
521 | + 'function' => function($rowData) use ($txt, $context, $scripturl) |
|
522 | 522 | { |
523 | 523 | // The date the message containing the attachment was posted or the owner of the avatar was active. |
524 | 524 | $date = empty($rowData['poster_time']) ? $txt['never'] : timeformat($rowData['poster_time']); |
@@ -1336,7 +1336,7 @@ discard block |
||
1336 | 1336 | if (!empty($modSettings['currentAttachmentUploadDir'])) |
1337 | 1337 | { |
1338 | 1338 | // Get the attachment name with out the folder. |
1339 | - $attachment_name = $row['id_attach'] . '_' . $row['file_hash'] .'.dat'; |
|
1339 | + $attachment_name = $row['id_attach'] . '_' . $row['file_hash'] . '.dat'; |
|
1340 | 1340 | |
1341 | 1341 | // Loop through the other folders. |
1342 | 1342 | foreach ($modSettings['attachmentUploadDir'] as $id => $dir) |
@@ -1952,7 +1952,7 @@ discard block |
||
1952 | 1952 | if (automanage_attachments_create_directory($path)) |
1953 | 1953 | $_POST['current_dir'] = $modSettings['currentAttachmentUploadDir']; |
1954 | 1954 | else |
1955 | - $errors[] = $path . ': ' . $txt[$context['dir_creation_error']]; |
|
1955 | + $errors[] = $path . ': ' . $txt[$context['dir_creation_error']]; |
|
1956 | 1956 | } |
1957 | 1957 | |
1958 | 1958 | // Changing a directory name? |
@@ -2074,7 +2074,7 @@ discard block |
||
2074 | 2074 | } |
2075 | 2075 | |
2076 | 2076 | // If the user wishes to go back, update the last_dir array |
2077 | - if ($_POST['current_dir'] != $modSettings['currentAttachmentUploadDir']&& !empty($modSettings['last_attachments_directory']) && (isset($modSettings['last_attachments_directory'][$_POST['current_dir']]) || isset($modSettings['last_attachments_directory'][0]))) |
|
2077 | + if ($_POST['current_dir'] != $modSettings['currentAttachmentUploadDir'] && !empty($modSettings['last_attachments_directory']) && (isset($modSettings['last_attachments_directory'][$_POST['current_dir']]) || isset($modSettings['last_attachments_directory'][0]))) |
|
2078 | 2078 | { |
2079 | 2079 | if (!is_array($modSettings['last_attachments_directory'])) |
2080 | 2080 | $modSettings['last_attachments_directory'] = smf_json_decode($modSettings['last_attachments_directory'], true); |
@@ -2087,7 +2087,7 @@ discard block |
||
2087 | 2087 | $use_subdirectories_for_attachments = 0; |
2088 | 2088 | if (!empty($modSettings['attachment_basedirectories'])) |
2089 | 2089 | foreach ($modSettings['attachment_basedirectories'] as $bid => $base) |
2090 | - if (strpos($modSettings['attachmentUploadDir'][$_POST['current_dir']], $base . DIRECTORY_SEPARATOR) !==false) |
|
2090 | + if (strpos($modSettings['attachmentUploadDir'][$_POST['current_dir']], $base . DIRECTORY_SEPARATOR) !== false) |
|
2091 | 2091 | { |
2092 | 2092 | $use_subdirectories_for_attachments = 1; |
2093 | 2093 | break; |
@@ -2263,7 +2263,7 @@ discard block |
||
2263 | 2263 | 'class' => 'centercol', |
2264 | 2264 | ), |
2265 | 2265 | 'data' => array( |
2266 | - 'function' => function ($rowData) |
|
2266 | + 'function' => function($rowData) |
|
2267 | 2267 | { |
2268 | 2268 | return '<input type="radio" name="current_dir" value="' . $rowData['id'] . '"' . ($rowData['current'] ? ' checked' : '') . (!empty($rowData['disable_current']) ? ' disabled' : '') . ' class="input_radio">'; |
2269 | 2269 | }, |
@@ -2276,7 +2276,7 @@ discard block |
||
2276 | 2276 | 'value' => $txt['attach_path'], |
2277 | 2277 | ), |
2278 | 2278 | 'data' => array( |
2279 | - 'function' => function ($rowData) |
|
2279 | + 'function' => function($rowData) |
|
2280 | 2280 | { |
2281 | 2281 | return '<input type="hidden" name="dirs[' . $rowData['id'] . ']" value="' . $rowData['path'] . '"><input type="text" size="40" name="dirs[' . $rowData['id'] . ']" value="' . $rowData['path'] . '"' . (!empty($rowData['disable_base_dir']) ? ' disabled' : '') . ' class="input_text" style="width: 100%">'; |
2282 | 2282 | }, |
@@ -2355,7 +2355,7 @@ discard block |
||
2355 | 2355 | 'class' => 'centercol', |
2356 | 2356 | ), |
2357 | 2357 | 'data' => array( |
2358 | - 'function' => function ($rowData) |
|
2358 | + 'function' => function($rowData) |
|
2359 | 2359 | { |
2360 | 2360 | return '<input type="radio" name="current_base_dir" value="' . $rowData['id'] . '"' . ($rowData['current'] ? ' checked' : '') . ' class="input_radio">'; |
2361 | 2361 | }, |
@@ -2726,7 +2726,7 @@ discard block |
||
2726 | 2726 | $dir_size += !empty($row['size']) ? $row['size'] : filesize($source); |
2727 | 2727 | |
2728 | 2728 | // If we've reached a limit. Do something. |
2729 | - if (!empty($modSettings['attachmentDirSizeLimit']) && $dir_size > $modSettings['attachmentDirSizeLimit'] * 1024 || (!empty($modSettings['attachmentDirFileLimit']) && $dir_files > $modSettings['attachmentDirFileLimit'])) |
|
2729 | + if (!empty($modSettings['attachmentDirSizeLimit']) && $dir_size > $modSettings['attachmentDirSizeLimit'] * 1024 || (!empty($modSettings['attachmentDirFileLimit']) && $dir_files > $modSettings['attachmentDirFileLimit'])) |
|
2730 | 2730 | { |
2731 | 2731 | if (!empty($_POST['auto'])) |
2732 | 2732 | { |
@@ -837,7 +837,7 @@ discard block |
||
837 | 837 | remove_dir($theme_info['theme_dir']); |
838 | 838 | |
839 | 839 | // Go back to the list page. |
840 | - redirectexit('action=admin;area=theme;sa=list;' . $context['session_var'] . '=' . $context['session_id'] .';done=removing'); |
|
840 | + redirectexit('action=admin;area=theme;sa=list;' . $context['session_var'] . '=' . $context['session_id'] . ';done=removing'); |
|
841 | 841 | } |
842 | 842 | |
843 | 843 | /** |
@@ -871,7 +871,7 @@ discard block |
||
871 | 871 | updateSettings(array('enableThemes' => $enableThemes)); |
872 | 872 | |
873 | 873 | // Done! |
874 | - redirectexit('action=admin;area=theme;sa=list;' . $context['session_var'] . '=' . $context['session_id'] .';done='. (isset($_GET['disabled']) ? 'disabling' : 'enabling')); |
|
874 | + redirectexit('action=admin;area=theme;sa=list;' . $context['session_var'] . '=' . $context['session_id'] . ';done=' . (isset($_GET['disabled']) ? 'disabling' : 'enabling')); |
|
875 | 875 | } |
876 | 876 | |
877 | 877 | /** |
@@ -1106,7 +1106,7 @@ discard block |
||
1106 | 1106 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
1107 | 1107 | { |
1108 | 1108 | // Figure out which theme it is they are REALLY using. |
1109 | - if (!empty($modSettings['knownThemes']) && !in_array($row['id_theme'], explode(',',$modSettings['knownThemes']))) |
|
1109 | + if (!empty($modSettings['knownThemes']) && !in_array($row['id_theme'], explode(',', $modSettings['knownThemes']))) |
|
1110 | 1110 | $row['id_theme'] = $guest_theme; |
1111 | 1111 | elseif (empty($modSettings['theme_allow'])) |
1112 | 1112 | $row['id_theme'] = $guest_theme; |
@@ -1254,10 +1254,10 @@ discard block |
||
1254 | 1254 | $action = $smcFunc['htmlspecialchars'](trim($_GET['do'])); |
1255 | 1255 | |
1256 | 1256 | // Got any info from the specific form? |
1257 | - if (!isset($_POST['save_'. $action])) |
|
1257 | + if (!isset($_POST['save_' . $action])) |
|
1258 | 1258 | fatal_lang_error('theme_install_no_action', false); |
1259 | 1259 | |
1260 | - validateToken('admin-t-'. $action); |
|
1260 | + validateToken('admin-t-' . $action); |
|
1261 | 1261 | |
1262 | 1262 | // Hopefully the themes directory is writable, or we might have a problem. |
1263 | 1263 | if (!is_writable($themedir)) |
@@ -1291,7 +1291,7 @@ discard block |
||
1291 | 1291 | global $themedir, $themeurl, $context; |
1292 | 1292 | |
1293 | 1293 | // Set a temp dir for dumping all required files on it. |
1294 | - $dirtemp = $themedir .'/temp'; |
|
1294 | + $dirtemp = $themedir . '/temp'; |
|
1295 | 1295 | |
1296 | 1296 | // Make sure the temp dir doesn't already exist |
1297 | 1297 | if (file_exists($dirtemp)) |
@@ -1317,7 +1317,7 @@ discard block |
||
1317 | 1317 | |
1318 | 1318 | // Another error check layer, something went wrong with the upload. |
1319 | 1319 | if (isset($_FILES['theme_gz']['error']) && $_FILES['theme_gz']['error'] != 0) |
1320 | - fatal_lang_error('theme_install_error_file_'. $_FILES['theme_gz']['error'], false); |
|
1320 | + fatal_lang_error('theme_install_error_file_' . $_FILES['theme_gz']['error'], false); |
|
1321 | 1321 | |
1322 | 1322 | // Get the theme's name. |
1323 | 1323 | $name = pathinfo($_FILES['theme_gz']['name'], PATHINFO_FILENAME); |
@@ -1373,7 +1373,7 @@ discard block |
||
1373 | 1373 | $name = preg_replace('~[^A-Za-z0-9_\- ]~', '', $_REQUEST['copy']); |
1374 | 1374 | |
1375 | 1375 | // Is there a theme already named like this? |
1376 | - if (file_exists($themedir .'/'. $name)) |
|
1376 | + if (file_exists($themedir . '/' . $name)) |
|
1377 | 1377 | fatal_lang_error('theme_install_already_dir', false); |
1378 | 1378 | |
1379 | 1379 | // This is a brand new theme so set all possible values. |
@@ -1383,7 +1383,7 @@ discard block |
||
1383 | 1383 | 'name' => $name, |
1384 | 1384 | 'images_url' => $themeurl . '/' . $name . '/images', |
1385 | 1385 | 'version' => '1.0', |
1386 | - 'install_for' => '2.1 - 2.1.99, '. strtr($forum_version, array('SMF ' => '')), |
|
1386 | + 'install_for' => '2.1 - 2.1.99, ' . strtr($forum_version, array('SMF ' => '')), |
|
1387 | 1387 | 'based_on' => '', |
1388 | 1388 | 'based_on_dir' => $themedir . '/default', |
1389 | 1389 | ); |
@@ -1454,7 +1454,7 @@ discard block |
||
1454 | 1454 | <!-- The theme\'s version, please try to use semantic versioning. --> |
1455 | 1455 | <version>1.0</version> |
1456 | 1456 | <!-- Install for, the SMF versions this theme was designed for. Uses the same wildcards used in the packager manager. This field is mandatory. --> |
1457 | -<install for="'. $context['to_install']['install_for'] .'" /> |
|
1457 | +<install for="'. $context['to_install']['install_for'] . '" /> |
|
1458 | 1458 | <!-- Theme name, used purely for aesthetics. --> |
1459 | 1459 | <name>' . $context['to_install']['name'] . '</name> |
1460 | 1460 | <!-- Author: your email address or contact information. The name attribute is optional. --> |
@@ -589,7 +589,7 @@ discard block |
||
589 | 589 | 'Shitiz "Dragooon" Garg', |
590 | 590 | 'Karl "RegularExpression" Benson', |
591 | 591 | 'Matthew "Labradoodle-360" Kerle', |
592 | - $user_info['is_admin'] ? 'Matt "Grudge" Wolf': 'Grudge', |
|
592 | + $user_info['is_admin'] ? 'Matt "Grudge" Wolf' : 'Grudge', |
|
593 | 593 | 'Michael "Thantos" Miller', |
594 | 594 | 'Norv', |
595 | 595 | 'Peter "Arantor" Spicer', |
@@ -813,13 +813,13 @@ discard block |
||
813 | 813 | $credit_info = smf_json_decode($row['credits'], true); |
814 | 814 | |
815 | 815 | $copyright = empty($credit_info['copyright']) ? '' : $txt['credits_copyright'] . ' © ' . $smcFunc['htmlspecialchars']($credit_info['copyright']); |
816 | - $license = empty($credit_info['license']) ? '' : $txt['credits_license'] . ': ' . (!empty($credit_info['licenseurl']) ? '<a href="'. $smcFunc['htmlspecialchars']($credit_info['licenseurl']) .'">'. $smcFunc['htmlspecialchars']($credit_info['license']) .'</a>' : $smcFunc['htmlspecialchars']($credit_info['license'])); |
|
816 | + $license = empty($credit_info['license']) ? '' : $txt['credits_license'] . ': ' . (!empty($credit_info['licenseurl']) ? '<a href="' . $smcFunc['htmlspecialchars']($credit_info['licenseurl']) . '">' . $smcFunc['htmlspecialchars']($credit_info['license']) . '</a>' : $smcFunc['htmlspecialchars']($credit_info['license'])); |
|
817 | 817 | $version = $txt['credits_version'] . ' ' . $row['version']; |
818 | 818 | $title = (empty($credit_info['title']) ? $row['name'] : $smcFunc['htmlspecialchars']($credit_info['title'])) . ': ' . $version; |
819 | 819 | |
820 | 820 | // build this one out and stash it away |
821 | 821 | $mod_name = empty($credit_info['url']) ? $title : '<a href="' . $credit_info['url'] . '">' . $title . '</a>'; |
822 | - $mods[] = $mod_name . (!empty($license) ? ' | ' . $license : '') . (!empty($copyright) ? ' | ' . $copyright : ''); |
|
822 | + $mods[] = $mod_name . (!empty($license) ? ' | ' . $license : '') . (!empty($copyright) ? ' | ' . $copyright : ''); |
|
823 | 823 | } |
824 | 824 | cache_put_data('mods_credits', $mods, 86400); |
825 | 825 | } |
@@ -443,7 +443,7 @@ |
||
443 | 443 | { |
444 | 444 | static $ver; |
445 | 445 | |
446 | - if(!empty($ver)) |
|
446 | + if (!empty($ver)) |
|
447 | 447 | return $ver; |
448 | 448 | |
449 | 449 | global $smcFunc; |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | 'type' => 'callback', |
87 | 87 | 'callback_func' => 'birthdate', |
88 | 88 | 'permission' => 'profile_extra', |
89 | - 'preload' => function () use ($cur_profile, &$context) |
|
89 | + 'preload' => function() use ($cur_profile, &$context) |
|
90 | 90 | { |
91 | 91 | // Split up the birthdate.... |
92 | 92 | list ($uyear, $umonth, $uday) = explode('-', empty($cur_profile['birthdate']) || $cur_profile['birthdate'] == '0001-01-01' ? '0000-00-00' : $cur_profile['birthdate']); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | return true; |
100 | 100 | }, |
101 | - 'input_validate' => function (&$value) use (&$cur_profile, &$profile_vars) |
|
101 | + 'input_validate' => function(&$value) use (&$cur_profile, &$profile_vars) |
|
102 | 102 | { |
103 | 103 | if (isset($_POST['bday2'], $_POST['bday3']) && $value > 0 && $_POST['bday2'] > 0) |
104 | 104 | { |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | 'birthdate' => array( |
121 | 121 | 'type' => 'hidden', |
122 | 122 | 'permission' => 'profile_extra', |
123 | - 'input_validate' => function (&$value) use ($cur_profile) |
|
123 | + 'input_validate' => function(&$value) use ($cur_profile) |
|
124 | 124 | { |
125 | 125 | // @todo Should we check for this year and tell them they made a mistake :P? (based on coppa at least?) |
126 | 126 | if (preg_match('/(\d{4})[\-\., ](\d{2})[\-\., ](\d{2})/', $value, $dates) === 1) |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | 'label' => $txt['date_registered'], |
142 | 142 | 'log_change' => true, |
143 | 143 | 'permission' => 'moderate_forum', |
144 | - 'input_validate' => function (&$value) use ($txt, $user_info, $modSettings, $cur_profile, $context) |
|
144 | + 'input_validate' => function(&$value) use ($txt, $user_info, $modSettings, $cur_profile, $context) |
|
145 | 145 | { |
146 | 146 | // Bad date! Go try again - please? |
147 | 147 | if (($value = strtotime($value)) === -1) |
@@ -167,13 +167,13 @@ discard block |
||
167 | 167 | 'js_submit' => !empty($modSettings['send_validation_onChange']) ? ' |
168 | 168 | form_handle.addEventListener(\'submit\', function(event) |
169 | 169 | { |
170 | - if (this.email_address.value != "'. $cur_profile['email_address'] .'") |
|
170 | + if (this.email_address.value != "'. $cur_profile['email_address'] . '") |
|
171 | 171 | { |
172 | - alert('. JavaScriptEscape($txt['email_change_logout']) .'); |
|
172 | + alert('. JavaScriptEscape($txt['email_change_logout']) . '); |
|
173 | 173 | return true; |
174 | 174 | } |
175 | 175 | }, false);' : '', |
176 | - 'input_validate' => function (&$value) |
|
176 | + 'input_validate' => function(&$value) |
|
177 | 177 | { |
178 | 178 | global $context, $old_profile, $profile_vars, $sourcedir, $modSettings; |
179 | 179 | |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | 'callback_func' => 'theme_pick', |
210 | 210 | 'permission' => 'profile_extra', |
211 | 211 | 'enabled' => $modSettings['theme_allow'] || allowedTo('admin_forum'), |
212 | - 'preload' => function () use ($smcFunc, &$context, $cur_profile, $txt) |
|
212 | + 'preload' => function() use ($smcFunc, &$context, $cur_profile, $txt) |
|
213 | 213 | { |
214 | 214 | $request = $smcFunc['db_query']('', ' |
215 | 215 | SELECT value |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | ); |
231 | 231 | return true; |
232 | 232 | }, |
233 | - 'input_validate' => function (&$value) |
|
233 | + 'input_validate' => function(&$value) |
|
234 | 234 | { |
235 | 235 | $value = (int) $value; |
236 | 236 | return true; |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | ), |
239 | 239 | 'lngfile' => array( |
240 | 240 | 'type' => 'select', |
241 | - 'options' => function () use (&$context) |
|
241 | + 'options' => function() use (&$context) |
|
242 | 242 | { |
243 | 243 | return $context['profile_languages']; |
244 | 244 | }, |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | 'preload' => 'profileLoadLanguages', |
248 | 248 | 'enabled' => !empty($modSettings['userLanguage']), |
249 | 249 | 'value' => empty($cur_profile['lngfile']) ? $language : $cur_profile['lngfile'], |
250 | - 'input_validate' => function (&$value) use (&$context, $cur_profile) |
|
250 | + 'input_validate' => function(&$value) use (&$context, $cur_profile) |
|
251 | 251 | { |
252 | 252 | // Load the languages. |
253 | 253 | profileLoadLanguages(); |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | 'log_change' => true, |
274 | 274 | 'permission' => 'profile_identity', |
275 | 275 | 'prehtml' => allowedTo('admin_forum') && isset($_GET['changeusername']) ? '<div class="alert">' . $txt['username_warning'] . '</div>' : '', |
276 | - 'input_validate' => function (&$value) use ($sourcedir, $context, $user_info, $cur_profile) |
|
276 | + 'input_validate' => function(&$value) use ($sourcedir, $context, $user_info, $cur_profile) |
|
277 | 277 | { |
278 | 278 | if (allowedTo('admin_forum')) |
279 | 279 | { |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | 'permission' => 'profile_password', |
310 | 310 | 'save_key' => 'passwd', |
311 | 311 | // Note this will only work if passwrd2 also exists! |
312 | - 'input_validate' => function (&$value) use ($sourcedir, $user_info, $smcFunc, $cur_profile) |
|
312 | + 'input_validate' => function(&$value) use ($sourcedir, $user_info, $smcFunc, $cur_profile) |
|
313 | 313 | { |
314 | 314 | // If we didn't try it then ignore it! |
315 | 315 | if ($value == '') |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | 'input_attr' => array('maxlength="50"'), |
349 | 349 | 'size' => 50, |
350 | 350 | 'permission' => 'profile_blurb', |
351 | - 'input_validate' => function (&$value) use ($smcFunc) |
|
351 | + 'input_validate' => function(&$value) use ($smcFunc) |
|
352 | 352 | { |
353 | 353 | if ($smcFunc['strlen']($value) > 50) |
354 | 354 | return 'personal_text_too_long'; |
@@ -361,14 +361,14 @@ discard block |
||
361 | 361 | 'type' => 'callback', |
362 | 362 | 'callback_func' => 'pm_settings', |
363 | 363 | 'permission' => 'pm_read', |
364 | - 'preload' => function () use (&$context, $cur_profile) |
|
364 | + 'preload' => function() use (&$context, $cur_profile) |
|
365 | 365 | { |
366 | 366 | $context['display_mode'] = $cur_profile['pm_prefs'] & 3; |
367 | 367 | $context['receive_from'] = !empty($cur_profile['pm_receive_from']) ? $cur_profile['pm_receive_from'] : 0; |
368 | 368 | |
369 | 369 | return true; |
370 | 370 | }, |
371 | - 'input_validate' => function (&$value) use (&$cur_profile, &$profile_vars) |
|
371 | + 'input_validate' => function(&$value) use (&$cur_profile, &$profile_vars) |
|
372 | 372 | { |
373 | 373 | // Simple validate and apply the two "sub settings" |
374 | 374 | $value = max(min($value, 2), 0); |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | 'log_change' => true, |
385 | 385 | 'size' => 7, |
386 | 386 | 'permission' => 'moderate_forum', |
387 | - 'input_validate' => function (&$value) |
|
387 | + 'input_validate' => function(&$value) |
|
388 | 388 | { |
389 | 389 | if (!is_numeric($value)) |
390 | 390 | return 'digits_only'; |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | 'input_attr' => array('maxlength="60"'), |
402 | 402 | 'permission' => 'profile_displayed_name', |
403 | 403 | 'enabled' => allowedTo('profile_displayed_name_own') || allowedTo('profile_displayed_name_any') || allowedTo('moderate_forum'), |
404 | - 'input_validate' => function (&$value) use ($context, $smcFunc, $sourcedir, $cur_profile) |
|
404 | + 'input_validate' => function(&$value) use ($context, $smcFunc, $sourcedir, $cur_profile) |
|
405 | 405 | { |
406 | 406 | $value = trim(preg_replace('~[\t\n\r \x0B\0' . ($context['utf8'] ? '\x{A0}\x{AD}\x{2000}-\x{200F}\x{201F}\x{202F}\x{3000}\x{FEFF}' : '\x00-\x08\x0B\x0C\x0E-\x19\xA0') . ']+~' . ($context['utf8'] ? 'u' : ''), ' ', $value)); |
407 | 407 | |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | 'postinput' => '<span class="smalltext"><a href="' . $scripturl . '?action=helpadmin;help=secret_why_blank" onclick="return reqOverlayDiv(this.href);"><span class="generic_icons help"></span> ' . $txt['secret_why_blank'] . '</a></span>', |
434 | 434 | 'value' => '', |
435 | 435 | 'permission' => 'profile_password', |
436 | - 'input_validate' => function (&$value) |
|
436 | + 'input_validate' => function(&$value) |
|
437 | 437 | { |
438 | 438 | $value = $value != '' ? md5($value) : ''; |
439 | 439 | return true; |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | 'callback_func' => 'smiley_pick', |
459 | 459 | 'enabled' => !empty($modSettings['smiley_sets_enable']), |
460 | 460 | 'permission' => 'profile_extra', |
461 | - 'preload' => function () use ($modSettings, &$context, $txt, $cur_profile, $smcFunc) |
|
461 | + 'preload' => function() use ($modSettings, &$context, $txt, $cur_profile, $smcFunc) |
|
462 | 462 | { |
463 | 463 | $context['member']['smiley_set']['id'] = empty($cur_profile['smiley_set']) ? '' : $cur_profile['smiley_set']; |
464 | 464 | $context['smiley_sets'] = explode(',', 'none,,' . $modSettings['smiley_sets_known']); |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | } |
477 | 477 | return true; |
478 | 478 | }, |
479 | - 'input_validate' => function (&$value) |
|
479 | + 'input_validate' => function(&$value) |
|
480 | 480 | { |
481 | 481 | global $modSettings; |
482 | 482 | |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | 'callback_func' => 'theme_settings', |
493 | 493 | 'permission' => 'profile_extra', |
494 | 494 | 'is_dummy' => true, |
495 | - 'preload' => function () use (&$context, $user_info, $modSettings) |
|
495 | + 'preload' => function() use (&$context, $user_info, $modSettings) |
|
496 | 496 | { |
497 | 497 | loadLanguage('Settings'); |
498 | 498 | |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | 'type' => 'callback', |
520 | 520 | 'callback_func' => 'timeformat_modify', |
521 | 521 | 'permission' => 'profile_extra', |
522 | - 'preload' => function () use (&$context, $user_info, $txt, $cur_profile, $modSettings) |
|
522 | + 'preload' => function() use (&$context, $user_info, $txt, $cur_profile, $modSettings) |
|
523 | 523 | { |
524 | 524 | $context['easy_timeformats'] = array( |
525 | 525 | array('format' => '', 'title' => $txt['timeformat_default']), |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | 'options' => smf_list_timezones(), |
543 | 543 | 'permission' => 'profile_extra', |
544 | 544 | 'label' => $txt['timezone'], |
545 | - 'input_validate' => function ($value) |
|
545 | + 'input_validate' => function($value) |
|
546 | 546 | { |
547 | 547 | $tz = smf_list_timezones(); |
548 | 548 | if (!isset($tz[$value])) |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | 'size' => 50, |
560 | 560 | 'permission' => 'profile_title', |
561 | 561 | 'enabled' => !empty($modSettings['titlesEnable']), |
562 | - 'input_validate' => function (&$value) use ($smcFunc) |
|
562 | + 'input_validate' => function(&$value) use ($smcFunc) |
|
563 | 563 | { |
564 | 564 | if ($smcFunc['strlen']($value) > 50) |
565 | 565 | return 'user_title_too_long'; |
@@ -582,7 +582,7 @@ discard block |
||
582 | 582 | 'size' => 50, |
583 | 583 | 'permission' => 'profile_website', |
584 | 584 | // Fix the URL... |
585 | - 'input_validate' => function (&$value) |
|
585 | + 'input_validate' => function(&$value) |
|
586 | 586 | { |
587 | 587 | if (strlen(trim($value)) > 0 && strpos($value, '://') === false) |
588 | 588 | $value = 'http://' . $value; |
@@ -707,7 +707,7 @@ discard block |
||
707 | 707 | if (this.oldpasswrd.value == "") |
708 | 708 | { |
709 | 709 | event.preventDefault(); |
710 | - alert('. (JavaScriptEscape($txt['required_security_reasons'])) .'); |
|
710 | + alert('. (JavaScriptEscape($txt['required_security_reasons'])) . '); |
|
711 | 711 | return false; |
712 | 712 | } |
713 | 713 | }, false);' : ''), true); |
@@ -906,7 +906,7 @@ discard block |
||
906 | 906 | if (isset($_POST['ignore_brd'])) |
907 | 907 | { |
908 | 908 | if (!is_array($_POST['ignore_brd'])) |
909 | - $_POST['ignore_brd'] = array ($_POST['ignore_brd']); |
|
909 | + $_POST['ignore_brd'] = array($_POST['ignore_brd']); |
|
910 | 910 | |
911 | 911 | foreach ($_POST['ignore_brd'] as $k => $d) |
912 | 912 | { |
@@ -1872,7 +1872,7 @@ discard block |
||
1872 | 1872 | |
1873 | 1873 | // Now load all the values for this user. |
1874 | 1874 | require_once($sourcedir . '/Subs-Notify.php'); |
1875 | - $prefs = getNotifyPrefs($memID, '', $memID != 0); |
|
1875 | + $prefs = getNotifyPrefs($memID, '', $memID != 0); |
|
1876 | 1876 | |
1877 | 1877 | $context['alert_prefs'] = !empty($prefs[$memID]) ? $prefs[$memID] : array(); |
1878 | 1878 | |
@@ -2171,7 +2171,7 @@ discard block |
||
2171 | 2171 | ); |
2172 | 2172 | |
2173 | 2173 | // Gotta know how many unread alerts are left. |
2174 | - $count = alert_count($memID, true); |
|
2174 | + $count = alert_count($memID, true); |
|
2175 | 2175 | |
2176 | 2176 | updateMemberData($memID, array('alerts' => $count)); |
2177 | 2177 | |
@@ -2206,7 +2206,7 @@ discard block |
||
2206 | 2206 | // Gotta know how many unread alerts are left. |
2207 | 2207 | if ($memID) |
2208 | 2208 | { |
2209 | - $count = alert_count($memID, true); |
|
2209 | + $count = alert_count($memID, true); |
|
2210 | 2210 | |
2211 | 2211 | updateMemberData($memID, array('alerts' => $count)); |
2212 | 2212 | |
@@ -2242,7 +2242,7 @@ discard block |
||
2242 | 2242 | ) |
2243 | 2243 | ); |
2244 | 2244 | |
2245 | - $count = $smcFunc['db_num_rows']($request); |
|
2245 | + $count = $smcFunc['db_num_rows']($request); |
|
2246 | 2246 | $smcFunc['db_free_result']($request); |
2247 | 2247 | |
2248 | 2248 | return $count; |
@@ -2302,7 +2302,7 @@ discard block |
||
2302 | 2302 | 'class' => 'lefttext', |
2303 | 2303 | ), |
2304 | 2304 | 'data' => array( |
2305 | - 'function' => function ($topic) use ($txt) |
|
2305 | + 'function' => function($topic) use ($txt) |
|
2306 | 2306 | { |
2307 | 2307 | $link = $topic['link']; |
2308 | 2308 | |
@@ -2357,7 +2357,7 @@ discard block |
||
2357 | 2357 | 'class' => 'lefttext', |
2358 | 2358 | ), |
2359 | 2359 | 'data' => array( |
2360 | - 'function' => function ($topic) use ($txt) |
|
2360 | + 'function' => function($topic) use ($txt) |
|
2361 | 2361 | { |
2362 | 2362 | $pref = $topic['notify_pref']; |
2363 | 2363 | $mode = !empty($topic['unwatched']) ? 0 : ($pref & 0x02 ? 3 : ($pref & 0x01 ? 2 : 1)); |
@@ -2454,7 +2454,7 @@ discard block |
||
2454 | 2454 | 'class' => 'lefttext', |
2455 | 2455 | ), |
2456 | 2456 | 'data' => array( |
2457 | - 'function' => function ($board) use ($txt) |
|
2457 | + 'function' => function($board) use ($txt) |
|
2458 | 2458 | { |
2459 | 2459 | $link = $board['link']; |
2460 | 2460 | |
@@ -2475,7 +2475,7 @@ discard block |
||
2475 | 2475 | 'class' => 'lefttext', |
2476 | 2476 | ), |
2477 | 2477 | 'data' => array( |
2478 | - 'function' => function ($board) use ($txt) |
|
2478 | + 'function' => function($board) use ($txt) |
|
2479 | 2479 | { |
2480 | 2480 | $pref = $board['notify_pref']; |
2481 | 2481 | $mode = $pref & 0x02 ? 3 : ($pref & 0x01 ? 2 : 1); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $smcFunc['db_query']('', ' |
50 | 50 | UPDATE {db_prefix}log_reported |
51 | 51 | SET {raw:action} = {string:value} |
52 | - '. (is_array($report_id) ? 'WHERE id_report IN ({array_int:id_report})' : 'WHERE id_report = {int:id_report}') .' |
|
52 | + '. (is_array($report_id) ? 'WHERE id_report IN ({array_int:id_report})' : 'WHERE id_report = {int:id_report}') . ' |
|
53 | 53 | ' . $board_query, |
54 | 54 | array( |
55 | 55 | 'action' => $action, |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | ) |
98 | 98 | ); |
99 | 99 | |
100 | - while($row = $smcFunc['db_fetch_assoc']($request)) |
|
100 | + while ($row = $smcFunc['db_fetch_assoc']($request)) |
|
101 | 101 | $extra[$row['id_report']] = array( |
102 | 102 | 'report' => $row['id_report'], |
103 | 103 | 'member' => $row['id_member'], |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | |
248 | 248 | saveSettings($config_vars); |
249 | 249 | $_SESSION['adm-save'] = true; |
250 | - redirectexit('action=admin;area=serversettings;sa=database;' . $context['session_var'] . '=' . $context['session_id'] ); |
|
250 | + redirectexit('action=admin;area=serversettings;sa=database;' . $context['session_var'] . '=' . $context['session_id']); |
|
251 | 251 | } |
252 | 252 | |
253 | 253 | // Fill the config array. |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | array('localCookies', $txt['localCookies'], 'db', 'check', false, 'localCookies'), |
273 | 273 | array('globalCookies', $txt['globalCookies'], 'db', 'check', false, 'globalCookies'), |
274 | 274 | array('globalCookiesDomain', $txt['globalCookiesDomain'], 'db', 'text', false, 'globalCookiesDomain'), |
275 | - array('secureCookies', $txt['secureCookies'], 'db', 'check', false, 'secureCookies', 'disabled' => !isset($_SERVER['HTTPS']) || !(strtolower($_SERVER['HTTPS']) == 'on' || strtolower($_SERVER['HTTPS']) == '1')), |
|
275 | + array('secureCookies', $txt['secureCookies'], 'db', 'check', false, 'secureCookies', 'disabled' => !isset($_SERVER['HTTPS']) || !(strtolower($_SERVER['HTTPS']) == 'on' || strtolower($_SERVER['HTTPS']) == '1')), |
|
276 | 276 | array('httponlyCookies', $txt['httponlyCookies'], 'db', 'check', false, 'httponlyCookies'), |
277 | 277 | '', |
278 | 278 | // Sessions |
@@ -71,11 +71,11 @@ discard block |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | // Use cache when possible. |
74 | - if (($cache = cache_get_data('attachment_lookup_id-'. $attachId)) != null) |
|
74 | + if (($cache = cache_get_data('attachment_lookup_id-' . $attachId)) != null) |
|
75 | 75 | list($file, $thumbFile) = $cache; |
76 | 76 | |
77 | 77 | // Get the info from the DB. |
78 | - if(empty($file) || empty($thumbFile) && !empty($file['id_thumb'])) |
|
78 | + if (empty($file) || empty($thumbFile) && !empty($file['id_thumb'])) |
|
79 | 79 | { |
80 | 80 | // Do we have a hook wanting to use our attachment system? We use $attachRequest to prevent accidental usage of $request. |
81 | 81 | $attachRequest = null; |
@@ -144,8 +144,8 @@ discard block |
||
144 | 144 | $file['filePath'] = getAttachmentFilename($file['filename'], $attachId, $file['id_folder'], false, $file['file_hash']); |
145 | 145 | // ensure variant attachment compatibility |
146 | 146 | $filePath = pathinfo($file['filePath']); |
147 | - $file['filePath'] = !file_exists($file['filePath']) ? substr($file['filePath'], 0, -(strlen($filePath['extension'])+1)) : $file['filePath']; |
|
148 | - $file['etag'] = '"'. md5_file($file['filePath']) .'"'; |
|
147 | + $file['filePath'] = !file_exists($file['filePath']) ? substr($file['filePath'], 0, -(strlen($filePath['extension']) + 1)) : $file['filePath']; |
|
148 | + $file['etag'] = '"' . md5_file($file['filePath']) . '"'; |
|
149 | 149 | |
150 | 150 | // now get the thumbfile! |
151 | 151 | $thumbFile = array(); |
@@ -171,13 +171,13 @@ discard block |
||
171 | 171 | |
172 | 172 | // set filePath and ETag time |
173 | 173 | $thumbFile['filePath'] = getAttachmentFilename($thumbFile['filename'], $attachId, $thumbFile['id_folder'], false, $thumbFile['file_hash']); |
174 | - $thumbFile['etag'] = '"'. md5_file($thumbFile['filePath']) .'"'; |
|
174 | + $thumbFile['etag'] = '"' . md5_file($thumbFile['filePath']) . '"'; |
|
175 | 175 | } |
176 | 176 | } |
177 | 177 | |
178 | 178 | // Cache it. |
179 | - if(!empty($file) || !empty($thumbFile)) |
|
180 | - cache_put_data('attachment_lookup_id-'. $file['id_attach'], array($file, $thumbFile), mt_rand(850, 900)); |
|
179 | + if (!empty($file) || !empty($thumbFile)) |
|
180 | + cache_put_data('attachment_lookup_id-' . $file['id_attach'], array($file, $thumbFile), mt_rand(850, 900)); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | // Update the download counter (unless it's a thumbnail). |
@@ -289,17 +289,17 @@ discard block |
||
289 | 289 | if (!empty($modSettings['attachmentRecodeLineEndings']) && !isset($_REQUEST['image']) && in_array($file['fileext'], array('txt', 'css', 'htm', 'html', 'php', 'xml'))) |
290 | 290 | { |
291 | 291 | if (strpos($_SERVER['HTTP_USER_AGENT'], 'Windows') !== false) |
292 | - $callback = function ($buffer) |
|
292 | + $callback = function($buffer) |
|
293 | 293 | { |
294 | 294 | return preg_replace('~[\r]?\n~', "\r\n", $buffer); |
295 | 295 | }; |
296 | 296 | elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) |
297 | - $callback = function ($buffer) |
|
297 | + $callback = function($buffer) |
|
298 | 298 | { |
299 | 299 | return preg_replace('~[\r]?\n~', "\r", $buffer); |
300 | 300 | }; |
301 | 301 | else |
302 | - $callback = function ($buffer) |
|
302 | + $callback = function($buffer) |
|
303 | 303 | { |
304 | 304 | return preg_replace('~[\r]?\n~', "\n", $buffer); |
305 | 305 | }; |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | { |
151 | 151 | if (!@is_dir($directory)) |
152 | 152 | { |
153 | - if (!@mkdir($directory,0755)) |
|
153 | + if (!@mkdir($directory, 0755)) |
|
154 | 154 | { |
155 | 155 | $context['dir_creation_error'] = 'attachments_no_create'; |
156 | 156 | return false; |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | * |
249 | 249 | * @return array|bool An array of all the directories and subdirectories or false on failure |
250 | 250 | */ |
251 | -function get_directory_tree_elements ($directory) |
|
251 | +function get_directory_tree_elements($directory) |
|
252 | 252 | { |
253 | 253 | /* |
254 | 254 | In Windows server both \ and / can be used as directory separators in paths |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | if (substr($directory, 0, 1) != DIRECTORY_SEPARATOR) |
265 | 265 | return false; |
266 | 266 | |
267 | - $tree = explode(DIRECTORY_SEPARATOR, trim($directory,DIRECTORY_SEPARATOR)); |
|
267 | + $tree = explode(DIRECTORY_SEPARATOR, trim($directory, DIRECTORY_SEPARATOR)); |
|
268 | 268 | } |
269 | 269 | return $tree; |
270 | 270 | } |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | * |
278 | 278 | * @return string|bool The first part of the path or false on error |
279 | 279 | */ |
280 | -function attachments_init_dir (&$tree, &$count) |
|
280 | +function attachments_init_dir(&$tree, &$count) |
|
281 | 281 | { |
282 | 282 | $directory = ''; |
283 | 283 | // If on Windows servers the first part of the path is the drive (e.g. "C:") |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | //Better be sure that the first part of the path is actually a drive letter... |
287 | 287 | //...even if, I should check this in the admin page...isn't it? |
288 | 288 | //...NHAAA Let's leave space for users' complains! :P |
289 | - if (preg_match('/^[a-z]:$/i',$tree[0])) |
|
289 | + if (preg_match('/^[a-z]:$/i', $tree[0])) |
|
290 | 290 | $directory = array_shift($tree); |
291 | 291 | else |
292 | 292 | return false; |
@@ -484,7 +484,7 @@ discard block |
||
484 | 484 | global $modSettings, $context, $sourcedir, $smcFunc; |
485 | 485 | |
486 | 486 | // No data or missing data .... Not necessarily needed, but in case a mod author missed something. |
487 | - if ( empty($_SESSION['temp_attachments'][$attachID])) |
|
487 | + if (empty($_SESSION['temp_attachments'][$attachID])) |
|
488 | 488 | $error = '$_SESSION[\'temp_attachments\'][$attachID]'; |
489 | 489 | |
490 | 490 | elseif (empty($attachID)) |
@@ -911,9 +911,9 @@ discard block |
||
911 | 911 | $attachContext = $attachLoaded[$attachID]; |
912 | 912 | |
913 | 913 | // Fix the url to point out to showAvatar(). |
914 | - $attachContext['href'] = $scripturl . '?action=dlattach;attach=' . $attachID .';type=preview'; |
|
914 | + $attachContext['href'] = $scripturl . '?action=dlattach;attach=' . $attachID . ';type=preview'; |
|
915 | 915 | |
916 | - $attachContext['link'] = '<a href="' . $scripturl . '?action=dlattach;attach=' . $attachID .';type=preview'. (empty($attachContext['is_image']) ? ';file' : '') .'">' . $smcFunc['htmlspecialchars']($attachContext['name']) . '</a>'; |
|
916 | + $attachContext['link'] = '<a href="' . $scripturl . '?action=dlattach;attach=' . $attachID . ';type=preview' . (empty($attachContext['is_image']) ? ';file' : '') . '">' . $smcFunc['htmlspecialchars']($attachContext['name']) . '</a>'; |
|
917 | 917 | |
918 | 918 | // Fix the thumbnail too, if the image has one. |
919 | 919 | if (!empty($attachContext['thumbnail']) && !empty($attachContext['thumbnail']['has_thumb'])) |
@@ -1078,7 +1078,7 @@ discard block |
||
1078 | 1078 | LEFT JOIN {db_prefix}attachments AS thumb ON (thumb.id_attach = a.id_thumb)') . ' |
1079 | 1079 | LEFT JOIN {db_prefix}messages AS m ON (m.id_msg = a.id_msg) |
1080 | 1080 | WHERE a.attachment_type = {int:attachment_type} |
1081 | - '. (!empty($msgID) ? 'AND a.id_msg = {int:message_id}' : '') .'', |
|
1081 | + '. (!empty($msgID) ? 'AND a.id_msg = {int:message_id}' : '') . '', |
|
1082 | 1082 | array( |
1083 | 1083 | 'message_id' => $msgID, |
1084 | 1084 | 'attachment_type' => 0, |