@@ -2605,7 +2605,7 @@ |
||
| 2605 | 2605 | * @param int $start Which item to start with (for pagination purposes) |
| 2606 | 2606 | * @param int $items_per_page How many items to show on each page |
| 2607 | 2607 | * @param string $sort A string indicating how to sort the results |
| 2608 | - * @param int $memID The ID of the member |
|
| 2608 | + * @param string $memID The ID of the member |
|
| 2609 | 2609 | * @return array An array of information about the user's group requests |
| 2610 | 2610 | */ |
| 2611 | 2611 | function list_getGroupRequests($start, $items_per_page, $sort, $memID) |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $context['member'] = &$memberContext[$memID]; |
| 38 | 38 | |
| 39 | 39 | // Set a canonical URL for this page. |
| 40 | - $context['canonical_url'] = $scripturl . '?action=profile;u=' . $memID; |
|
| 40 | + $context['canonical_url'] = $scripturl.'?action=profile;u='.$memID; |
|
| 41 | 41 | |
| 42 | 42 | // Are there things we don't show? |
| 43 | 43 | $context['disabled_fields'] = isset($modSettings['disabled_profile_fields']) ? array_flip(explode(',', $modSettings['disabled_profile_fields'])) : array(); |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | if (!empty($modSettings['who_enabled']) && $context['member']['show_last_login']) |
| 102 | 102 | { |
| 103 | - include_once($sourcedir . '/Who.php'); |
|
| 103 | + include_once($sourcedir.'/Who.php'); |
|
| 104 | 104 | $action = determineActions($user_profile[$memID]['url']); |
| 105 | 105 | |
| 106 | 106 | if ($action !== false) |
@@ -115,13 +115,13 @@ discard block |
||
| 115 | 115 | $context['activate_link_text'] = in_array($context['member']['is_activated'], array(3, 4, 5, 13, 14, 15)) ? $txt['account_approve'] : $txt['account_activate']; |
| 116 | 116 | |
| 117 | 117 | // Should we show a custom message? |
| 118 | - $context['activate_message'] = isset($txt['account_activate_method_' . $context['member']['is_activated'] % 10]) ? $txt['account_activate_method_' . $context['member']['is_activated'] % 10] : $txt['account_not_activated']; |
|
| 118 | + $context['activate_message'] = isset($txt['account_activate_method_'.$context['member']['is_activated'] % 10]) ? $txt['account_activate_method_'.$context['member']['is_activated'] % 10] : $txt['account_not_activated']; |
|
| 119 | 119 | |
| 120 | 120 | // If they can be approved, we need to set up a token for them. |
| 121 | - $context['token_check'] = 'profile-aa' . $memID; |
|
| 121 | + $context['token_check'] = 'profile-aa'.$memID; |
|
| 122 | 122 | createToken($context['token_check'], 'get'); |
| 123 | 123 | |
| 124 | - $context['activate_link'] = $scripturl . '?action=profile;save;area=activateaccount;u=' . $context['id_member'] . ';' . $context['session_var'] . '=' . $context['session_id'] . ';' . $context[$context['token_check'] . '_token_var'] . '=' . $context[$context['token_check'] . '_token']; |
|
| 124 | + $context['activate_link'] = $scripturl.'?action=profile;save;area=activateaccount;u='.$context['id_member'].';'.$context['session_var'].'='.$context['session_id'].';'.$context[$context['token_check'].'_token_var'].'='.$context[$context['token_check'].'_token']; |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | // Is the signature even enabled on this forum? |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | |
| 136 | 136 | if (!empty($sig_limits[5]) || !empty($sig_limits[6])) |
| 137 | 137 | addInlineCss(' |
| 138 | - .signature img { ' . (!empty($sig_limits[5]) ? 'max-width: ' . (int) $sig_limits[5] . 'px; ' : '') . (!empty($sig_limits[6]) ? 'max-height: ' . (int) $sig_limits[6] . 'px; ' : '') . '}'); |
|
| 138 | + .signature img { ' . (!empty($sig_limits[5]) ? 'max-width: '.(int) $sig_limits[5].'px; ' : '').(!empty($sig_limits[6]) ? 'max-height: '.(int) $sig_limits[6].'px; ' : '').'}'); |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | // How about, are they banned? |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $ban_query_vars = array( |
| 150 | 150 | 'time' => time(), |
| 151 | 151 | ); |
| 152 | - $ban_query[] = 'id_member = ' . $context['member']['id']; |
|
| 152 | + $ban_query[] = 'id_member = '.$context['member']['id']; |
|
| 153 | 153 | $ban_query[] = ' {inet:ip} BETWEEN bi.ip_low and bi.ip_high'; |
| 154 | 154 | $ban_query_vars['ip'] = $memberContext[$memID]['ip']; |
| 155 | 155 | // Do we have a hostname already? |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | bg.cannot_login, bg.reason |
| 172 | 172 | FROM {db_prefix}ban_items AS bi |
| 173 | 173 | INNER JOIN {db_prefix}ban_groups AS bg ON (bg.id_ban_group = bi.id_ban_group AND (bg.expire_time IS NULL OR bg.expire_time > {int:time})) |
| 174 | - WHERE (' . implode(' OR ', $ban_query) . ')', |
|
| 174 | + WHERE (' . implode(' OR ', $ban_query).')', |
|
| 175 | 175 | $ban_query_vars |
| 176 | 176 | ); |
| 177 | 177 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
@@ -179,18 +179,18 @@ discard block |
||
| 179 | 179 | // Work out what restrictions we actually have. |
| 180 | 180 | $ban_restrictions = array(); |
| 181 | 181 | foreach (array('access', 'login', 'post') as $type) |
| 182 | - if ($row['cannot_' . $type]) |
|
| 183 | - $ban_restrictions[] = $txt['ban_type_' . $type]; |
|
| 182 | + if ($row['cannot_'.$type]) |
|
| 183 | + $ban_restrictions[] = $txt['ban_type_'.$type]; |
|
| 184 | 184 | |
| 185 | 185 | // No actual ban in place? |
| 186 | 186 | if (empty($ban_restrictions)) |
| 187 | 187 | continue; |
| 188 | 188 | |
| 189 | 189 | // Prepare the link for context. |
| 190 | - $ban_explanation = sprintf($txt['user_cannot_due_to'], implode(', ', $ban_restrictions), '<a href="' . $scripturl . '?action=admin;area=ban;sa=edit;bg=' . $row['id_ban_group'] . '">' . $row['name'] . '</a>'); |
|
| 190 | + $ban_explanation = sprintf($txt['user_cannot_due_to'], implode(', ', $ban_restrictions), '<a href="'.$scripturl.'?action=admin;area=ban;sa=edit;bg='.$row['id_ban_group'].'">'.$row['name'].'</a>'); |
|
| 191 | 191 | |
| 192 | 192 | $context['member']['bans'][$row['id_ban_group']] = array( |
| 193 | - 'reason' => empty($row['reason']) ? '' : '<br><br><strong>' . $txt['ban_reason'] . ':</strong> ' . $row['reason'], |
|
| 193 | + 'reason' => empty($row['reason']) ? '' : '<br><br><strong>'.$txt['ban_reason'].':</strong> '.$row['reason'], |
|
| 194 | 194 | 'cannot' => array( |
| 195 | 195 | 'access' => !empty($row['cannot_access']), |
| 196 | 196 | 'post' => !empty($row['cannot_post']), |
@@ -245,9 +245,9 @@ discard block |
||
| 245 | 245 | FROM {db_prefix}user_alerts AS ua |
| 246 | 246 | LEFT JOIN {db_prefix}members AS mem ON (ua.id_member_started = mem.id_member) |
| 247 | 247 | WHERE ua.id_member = {int:id_member}' . (!$all ? ' |
| 248 | - AND is_read = 0' : '') . ' |
|
| 248 | + AND is_read = 0' : '').' |
|
| 249 | 249 | ORDER BY id_alert DESC' . (!empty($counter) && empty($pagination) ? ' |
| 250 | - LIMIT {int:counter}' : '') . (!empty($pagination) && empty($counter) ? ' |
|
| 250 | + LIMIT {int:counter}' : '').(!empty($pagination) && empty($counter) ? ' |
|
| 251 | 251 | LIMIT {int:start}, {int:maxIndex}' : ''), |
| 252 | 252 | array( |
| 253 | 253 | 'id_member' => $memID, |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | } |
| 271 | 271 | $smcFunc['db_free_result']($request); |
| 272 | 272 | |
| 273 | - if($withSender) |
|
| 273 | + if ($withSender) |
|
| 274 | 274 | { |
| 275 | 275 | $senders = loadMemberData($senders); |
| 276 | 276 | foreach ($senders as $member) |
@@ -303,14 +303,14 @@ discard block |
||
| 303 | 303 | $request = $smcFunc['db_query']('', ' |
| 304 | 304 | SELECT id_board, name |
| 305 | 305 | FROM {db_prefix}boards AS b |
| 306 | - WHERE ' . $query_see_board . ' |
|
| 306 | + WHERE ' . $query_see_board.' |
|
| 307 | 307 | AND id_board IN ({array_int:boards})', |
| 308 | 308 | array( |
| 309 | 309 | 'boards' => array_keys($boards), |
| 310 | 310 | ) |
| 311 | 311 | ); |
| 312 | 312 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 313 | - $boards[$row['id_board']] = '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0">' . $row['name'] . '</a>'; |
|
| 313 | + $boards[$row['id_board']] = '<a href="'.$scripturl.'?board='.$row['id_board'].'.0">'.$row['name'].'</a>'; |
|
| 314 | 314 | } |
| 315 | 315 | if (!empty($topics)) |
| 316 | 316 | { |
@@ -319,14 +319,14 @@ discard block |
||
| 319 | 319 | FROM {db_prefix}topics AS t |
| 320 | 320 | INNER JOIN {db_prefix}messages AS m ON (t.id_first_msg = m.id_msg) |
| 321 | 321 | INNER JOIN {db_prefix}boards AS b ON (t.id_board = b.id_board) |
| 322 | - WHERE ' . $query_see_board . ' |
|
| 322 | + WHERE ' . $query_see_board.' |
|
| 323 | 323 | AND t.id_topic IN ({array_int:topics})', |
| 324 | 324 | array( |
| 325 | 325 | 'topics' => array_keys($topics), |
| 326 | 326 | ) |
| 327 | 327 | ); |
| 328 | 328 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 329 | - $topics[$row['id_topic']] = '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0">' . $row['subject'] . '</a>'; |
|
| 329 | + $topics[$row['id_topic']] = '<a href="'.$scripturl.'?topic='.$row['id_topic'].'.0">'.$row['subject'].'</a>'; |
|
| 330 | 330 | } |
| 331 | 331 | if (!empty($msgs)) |
| 332 | 332 | { |
@@ -335,14 +335,14 @@ discard block |
||
| 335 | 335 | FROM {db_prefix}messages AS m |
| 336 | 336 | INNER JOIN {db_prefix}topics AS t ON (t.id_topic = m.id_topic) |
| 337 | 337 | INNER JOIN {db_prefix}boards AS b ON (m.id_board = b.id_board) |
| 338 | - WHERE ' . $query_see_board . ' |
|
| 338 | + WHERE ' . $query_see_board.' |
|
| 339 | 339 | AND m.id_msg IN ({array_int:msgs})', |
| 340 | 340 | array( |
| 341 | 341 | 'msgs' => array_keys($msgs), |
| 342 | 342 | ) |
| 343 | 343 | ); |
| 344 | 344 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 345 | - $msgs[$row['id_msg']] = '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . '#msg' . $row['id_msg'] . '">' . $row['subject'] . '</a>'; |
|
| 345 | + $msgs[$row['id_msg']] = '<a href="'.$scripturl.'?topic='.$row['id_topic'].'.msg'.$row['id_msg'].'#msg'.$row['id_msg'].'">'.$row['subject'].'</a>'; |
|
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | // Now to go back through the alerts, reattach this extra information and then try to build the string out of it (if a hook didn't already) |
@@ -375,20 +375,20 @@ discard block |
||
| 375 | 375 | else |
| 376 | 376 | $alerts[$id_alert]['extra']['msg_msg'] = $msgs[$alert['content_id']]; |
| 377 | 377 | if ($alert['content_type'] == 'profile') |
| 378 | - $alerts[$id_alert]['extra']['profile_msg'] = '<a href="' . $scripturl . '?action=profile;u=' . $alerts[$id_alert]['content_id'] . '">' . $alerts[$id_alert]['extra']['user_name'] . '</a>'; |
|
| 378 | + $alerts[$id_alert]['extra']['profile_msg'] = '<a href="'.$scripturl.'?action=profile;u='.$alerts[$id_alert]['content_id'].'">'.$alerts[$id_alert]['extra']['user_name'].'</a>'; |
|
| 379 | 379 | |
| 380 | 380 | if (!empty($memberContext[$alert['sender_id']])) |
| 381 | 381 | $alerts[$id_alert]['sender'] = &$memberContext[$alert['sender_id']]; |
| 382 | 382 | |
| 383 | - $string = 'alert_' . $alert['content_type'] . '_' . $alert['content_action']; |
|
| 383 | + $string = 'alert_'.$alert['content_type'].'_'.$alert['content_action']; |
|
| 384 | 384 | if (isset($txt[$string])) |
| 385 | 385 | { |
| 386 | 386 | $extra = $alerts[$id_alert]['extra']; |
| 387 | 387 | $search = array('{member_link}', '{scripturl}'); |
| 388 | - $repl = array(!empty($alert['sender_id']) ? '<a href="' . $scripturl . '?action=profile;u=' . $alert['sender_id'] . '">' . $alert['sender_name'] . '</a>' : $alert['sender_name'], $scripturl); |
|
| 388 | + $repl = array(!empty($alert['sender_id']) ? '<a href="'.$scripturl.'?action=profile;u='.$alert['sender_id'].'">'.$alert['sender_name'].'</a>' : $alert['sender_name'], $scripturl); |
|
| 389 | 389 | foreach ($extra as $k => $v) |
| 390 | 390 | { |
| 391 | - $search[] = '{' . $k . '}'; |
|
| 391 | + $search[] = '{'.$k.'}'; |
|
| 392 | 392 | $repl[] = $v; |
| 393 | 393 | } |
| 394 | 394 | $alerts[$id_alert]['text'] = str_replace($search, $repl, $txt[$string]); |
@@ -409,7 +409,7 @@ discard block |
||
| 409 | 409 | { |
| 410 | 410 | global $context, $smcFunc, $txt, $sourcedir, $scripturl, $options; |
| 411 | 411 | |
| 412 | - require_once($sourcedir . '/Profile-Modify.php'); |
|
| 412 | + require_once($sourcedir.'/Profile-Modify.php'); |
|
| 413 | 413 | |
| 414 | 414 | // Prepare the pagination vars. |
| 415 | 415 | $maxIndex = 10; |
@@ -425,7 +425,7 @@ discard block |
||
| 425 | 425 | $context['showCheckboxes'] = !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1; |
| 426 | 426 | |
| 427 | 427 | // Create the pagination. |
| 428 | - $context['pagination'] = constructPageIndex($scripturl . '?action=profile;area=showalerts;u=' . $memID, $start, $count, $maxIndex, false); |
|
| 428 | + $context['pagination'] = constructPageIndex($scripturl.'?action=profile;area=showalerts;u='.$memID, $start, $count, $maxIndex, false); |
|
| 429 | 429 | |
| 430 | 430 | // Set some JavaScript for checking all alerts at once. |
| 431 | 431 | if ($context['showCheckboxes']) |
@@ -482,7 +482,7 @@ discard block |
||
| 482 | 482 | $_SESSION['update_message'] = true; |
| 483 | 483 | |
| 484 | 484 | // Redirect. |
| 485 | - redirectexit('action=profile;area=showalerts;u=' . $memID); |
|
| 485 | + redirectexit('action=profile;area=showalerts;u='.$memID); |
|
| 486 | 486 | } |
| 487 | 487 | } |
| 488 | 488 | |
@@ -527,11 +527,11 @@ discard block |
||
| 527 | 527 | |
| 528 | 528 | // Set the page title |
| 529 | 529 | if (isset($_GET['sa']) && array_key_exists($_GET['sa'], $title)) |
| 530 | - $context['page_title'] = $txt['show' . $title[$_GET['sa']]]; |
|
| 530 | + $context['page_title'] = $txt['show'.$title[$_GET['sa']]]; |
|
| 531 | 531 | else |
| 532 | 532 | $context['page_title'] = $txt['showPosts']; |
| 533 | 533 | |
| 534 | - $context['page_title'] .= ' - ' . $user_profile[$memID]['real_name']; |
|
| 534 | + $context['page_title'] .= ' - '.$user_profile[$memID]['real_name']; |
|
| 535 | 535 | |
| 536 | 536 | // Is the load average too high to allow searching just now? |
| 537 | 537 | if (!empty($context['load_average']) && !empty($modSettings['loadavg_show_posts']) && $context['load_average'] >= $modSettings['loadavg_show_posts']) |
@@ -566,10 +566,10 @@ discard block |
||
| 566 | 566 | |
| 567 | 567 | // Trying to remove a message that doesn't exist. |
| 568 | 568 | if (empty($info)) |
| 569 | - redirectexit('action=profile;u=' . $memID . ';area=showposts;start=' . $_GET['start']); |
|
| 569 | + redirectexit('action=profile;u='.$memID.';area=showposts;start='.$_GET['start']); |
|
| 570 | 570 | |
| 571 | 571 | // We can be lazy, since removeMessage() will check the permissions for us. |
| 572 | - require_once($sourcedir . '/RemoveTopic.php'); |
|
| 572 | + require_once($sourcedir.'/RemoveTopic.php'); |
|
| 573 | 573 | removeMessage((int) $_GET['delete']); |
| 574 | 574 | |
| 575 | 575 | // Add it to the mod log. |
@@ -577,7 +577,7 @@ discard block |
||
| 577 | 577 | logAction('delete', array('topic' => $info[2], 'subject' => $info[0], 'member' => $info[1], 'board' => $info[3])); |
| 578 | 578 | |
| 579 | 579 | // Back to... where we are now ;). |
| 580 | - redirectexit('action=profile;u=' . $memID . ';area=showposts;start=' . $_GET['start']); |
|
| 580 | + redirectexit('action=profile;u='.$memID.';area=showposts;start='.$_GET['start']); |
|
| 581 | 581 | } |
| 582 | 582 | |
| 583 | 583 | // Default to 10. |
@@ -588,9 +588,9 @@ discard block |
||
| 588 | 588 | $request = $smcFunc['db_query']('', ' |
| 589 | 589 | SELECT COUNT(*) |
| 590 | 590 | FROM {db_prefix}topics AS t' . ($user_info['query_see_board'] == '1=1' ? '' : ' |
| 591 | - INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board AND {query_see_board})') . ' |
|
| 591 | + INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board AND {query_see_board})').' |
|
| 592 | 592 | WHERE t.id_member_started = {int:current_member}' . (!empty($board) ? ' |
| 593 | - AND t.id_board = {int:board}' : '') . (!$modSettings['postmod_active'] || $context['user']['is_owner'] ? '' : ' |
|
| 593 | + AND t.id_board = {int:board}' : '').(!$modSettings['postmod_active'] || $context['user']['is_owner'] ? '' : ' |
|
| 594 | 594 | AND t.approved = {int:is_approved}'), |
| 595 | 595 | array( |
| 596 | 596 | 'current_member' => $memID, |
@@ -602,9 +602,9 @@ discard block |
||
| 602 | 602 | $request = $smcFunc['db_query']('', ' |
| 603 | 603 | SELECT COUNT(*) |
| 604 | 604 | FROM {db_prefix}messages AS m' . ($user_info['query_see_board'] == '1=1' ? '' : ' |
| 605 | - INNER JOIN {db_prefix}boards AS b ON (b.id_board = m.id_board AND {query_see_board})') . ' |
|
| 605 | + INNER JOIN {db_prefix}boards AS b ON (b.id_board = m.id_board AND {query_see_board})').' |
|
| 606 | 606 | WHERE m.id_member = {int:current_member}' . (!empty($board) ? ' |
| 607 | - AND m.id_board = {int:board}' : '') . (!$modSettings['postmod_active'] || $context['user']['is_owner'] ? '' : ' |
|
| 607 | + AND m.id_board = {int:board}' : '').(!$modSettings['postmod_active'] || $context['user']['is_owner'] ? '' : ' |
|
| 608 | 608 | AND m.approved = {int:is_approved}'), |
| 609 | 609 | array( |
| 610 | 610 | 'current_member' => $memID, |
@@ -619,7 +619,7 @@ discard block |
||
| 619 | 619 | SELECT MIN(id_msg), MAX(id_msg) |
| 620 | 620 | FROM {db_prefix}messages AS m |
| 621 | 621 | WHERE m.id_member = {int:current_member}' . (!empty($board) ? ' |
| 622 | - AND m.id_board = {int:board}' : '') . (!$modSettings['postmod_active'] || $context['user']['is_owner'] ? '' : ' |
|
| 622 | + AND m.id_board = {int:board}' : '').(!$modSettings['postmod_active'] || $context['user']['is_owner'] ? '' : ' |
|
| 623 | 623 | AND m.approved = {int:is_approved}'), |
| 624 | 624 | array( |
| 625 | 625 | 'current_member' => $memID, |
@@ -640,7 +640,7 @@ discard block |
||
| 640 | 640 | $maxIndex = $maxPerPage; |
| 641 | 641 | |
| 642 | 642 | // Make sure the starting place makes sense and construct our friend the page index. |
| 643 | - $context['page_index'] = constructPageIndex($scripturl . '?action=profile;u=' . $memID . ';area=showposts' . ($context['is_topics'] ? ';sa=topics' : '') . (!empty($board) ? ';board=' . $board : ''), $context['start'], $msgCount, $maxIndex); |
|
| 643 | + $context['page_index'] = constructPageIndex($scripturl.'?action=profile;u='.$memID.';area=showposts'.($context['is_topics'] ? ';sa=topics' : '').(!empty($board) ? ';board='.$board : ''), $context['start'], $msgCount, $maxIndex); |
|
| 644 | 644 | $context['current_page'] = $context['start'] / $maxIndex; |
| 645 | 645 | |
| 646 | 646 | // Reverse the query if we're past 50% of the pages for better performance. |
@@ -660,10 +660,10 @@ discard block |
||
| 660 | 660 | if ($context['is_topics']) |
| 661 | 661 | { |
| 662 | 662 | $margin *= 5; |
| 663 | - $range_limit = $reverse ? 't.id_first_msg < ' . ($min_msg_member + $margin) : 't.id_first_msg > ' . ($max_msg_member - $margin); |
|
| 663 | + $range_limit = $reverse ? 't.id_first_msg < '.($min_msg_member + $margin) : 't.id_first_msg > '.($max_msg_member - $margin); |
|
| 664 | 664 | } |
| 665 | 665 | else |
| 666 | - $range_limit = $reverse ? 'm.id_msg < ' . ($min_msg_member + $margin) : 'm.id_msg > ' . ($max_msg_member - $margin); |
|
| 666 | + $range_limit = $reverse ? 'm.id_msg < '.($min_msg_member + $margin) : 'm.id_msg > '.($max_msg_member - $margin); |
|
| 667 | 667 | } |
| 668 | 668 | |
| 669 | 669 | // Find this user's posts. The left join on categories somehow makes this faster, weird as it looks. |
@@ -681,11 +681,11 @@ discard block |
||
| 681 | 681 | LEFT JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat) |
| 682 | 682 | INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg) |
| 683 | 683 | WHERE t.id_member_started = {int:current_member}' . (!empty($board) ? ' |
| 684 | - AND t.id_board = {int:board}' : '') . (empty($range_limit) ? '' : ' |
|
| 685 | - AND ' . $range_limit) . ' |
|
| 684 | + AND t.id_board = {int:board}' : '').(empty($range_limit) ? '' : ' |
|
| 685 | + AND ' . $range_limit).' |
|
| 686 | 686 | AND {query_see_board}' . (!$modSettings['postmod_active'] || $context['user']['is_owner'] ? '' : ' |
| 687 | - AND t.approved = {int:is_approved} AND m.approved = {int:is_approved}') . ' |
|
| 688 | - ORDER BY t.id_first_msg ' . ($reverse ? 'ASC' : 'DESC') . ' |
|
| 687 | + AND t.approved = {int:is_approved} AND m.approved = {int:is_approved}').' |
|
| 688 | + ORDER BY t.id_first_msg ' . ($reverse ? 'ASC' : 'DESC').' |
|
| 689 | 689 | LIMIT {int:start}, {int:max}', |
| 690 | 690 | array( |
| 691 | 691 | 'current_member' => $memID, |
@@ -708,11 +708,11 @@ discard block |
||
| 708 | 708 | INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board) |
| 709 | 709 | LEFT JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat) |
| 710 | 710 | WHERE m.id_member = {int:current_member}' . (!empty($board) ? ' |
| 711 | - AND b.id_board = {int:board}' : '') . (empty($range_limit) ? '' : ' |
|
| 712 | - AND ' . $range_limit) . ' |
|
| 711 | + AND b.id_board = {int:board}' : '').(empty($range_limit) ? '' : ' |
|
| 712 | + AND ' . $range_limit).' |
|
| 713 | 713 | AND {query_see_board}' . (!$modSettings['postmod_active'] || $context['user']['is_owner'] ? '' : ' |
| 714 | - AND t.approved = {int:is_approved} AND m.approved = {int:is_approved}') . ' |
|
| 715 | - ORDER BY m.id_msg ' . ($reverse ? 'ASC' : 'DESC') . ' |
|
| 714 | + AND t.approved = {int:is_approved} AND m.approved = {int:is_approved}').' |
|
| 715 | + ORDER BY m.id_msg ' . ($reverse ? 'ASC' : 'DESC').' |
|
| 716 | 716 | LIMIT {int:start}, {int:max}', |
| 717 | 717 | array( |
| 718 | 718 | 'current_member' => $memID, |
@@ -758,7 +758,7 @@ discard block |
||
| 758 | 758 | ), |
| 759 | 759 | 'topic' => $row['id_topic'], |
| 760 | 760 | 'subject' => $row['subject'], |
| 761 | - 'start' => 'msg' . $row['id_msg'], |
|
| 761 | + 'start' => 'msg'.$row['id_msg'], |
|
| 762 | 762 | 'time' => timeformat($row['poster_time']), |
| 763 | 763 | 'timestamp' => forum_time(true, $row['poster_time']), |
| 764 | 764 | 'id' => $row['id_msg'], |
@@ -857,7 +857,7 @@ discard block |
||
| 857 | 857 | if (empty($boardsAllowed)) |
| 858 | 858 | $boardsAllowed = array(-1); |
| 859 | 859 | |
| 860 | - require_once($sourcedir . '/Subs-List.php'); |
|
| 860 | + require_once($sourcedir.'/Subs-List.php'); |
|
| 861 | 861 | |
| 862 | 862 | // This is all the information required to list attachments. |
| 863 | 863 | $listOptions = array( |
@@ -865,7 +865,7 @@ discard block |
||
| 865 | 865 | 'width' => '100%', |
| 866 | 866 | 'items_per_page' => $modSettings['defaultMaxListItems'], |
| 867 | 867 | 'no_items_label' => $txt['show_attachments_none'], |
| 868 | - 'base_href' => $scripturl . '?action=profile;area=showposts;sa=attach;u=' . $memID, |
|
| 868 | + 'base_href' => $scripturl.'?action=profile;area=showposts;sa=attach;u='.$memID, |
|
| 869 | 869 | 'default_sort_col' => 'filename', |
| 870 | 870 | 'get_items' => array( |
| 871 | 871 | 'function' => 'list_getAttachments', |
@@ -896,7 +896,7 @@ discard block |
||
| 896 | 896 | ), |
| 897 | 897 | 'data' => array( |
| 898 | 898 | 'sprintf' => array( |
| 899 | - 'format' => '<a href="' . $scripturl . '?action=dlattach;topic=%1$d.0;attach=%2$d">%3$s</a>', |
|
| 899 | + 'format' => '<a href="'.$scripturl.'?action=dlattach;topic=%1$d.0;attach=%2$d">%3$s</a>', |
|
| 900 | 900 | 'params' => array( |
| 901 | 901 | 'topic' => true, |
| 902 | 902 | 'id' => true, |
@@ -931,7 +931,7 @@ discard block |
||
| 931 | 931 | ), |
| 932 | 932 | 'data' => array( |
| 933 | 933 | 'sprintf' => array( |
| 934 | - 'format' => '<a href="' . $scripturl . '?msg=%1$d">%2$s</a>', |
|
| 934 | + 'format' => '<a href="'.$scripturl.'?msg=%1$d">%2$s</a>', |
|
| 935 | 935 | 'params' => array( |
| 936 | 936 | 'msg' => true, |
| 937 | 937 | 'subject' => false, |
@@ -988,9 +988,9 @@ discard block |
||
| 988 | 988 | WHERE a.attachment_type = {int:attachment_type} |
| 989 | 989 | AND a.id_msg != {int:no_message} |
| 990 | 990 | AND m.id_member = {int:current_member}' . (!empty($board) ? ' |
| 991 | - AND b.id_board = {int:board}' : '') . (!in_array(0, $boardsAllowed) ? ' |
|
| 992 | - AND b.id_board IN ({array_int:boards_list})' : '') . (!$modSettings['postmod_active'] || $context['user']['is_owner'] ? '' : ' |
|
| 993 | - AND m.approved = {int:is_approved}') . ' |
|
| 991 | + AND b.id_board = {int:board}' : '').(!in_array(0, $boardsAllowed) ? ' |
|
| 992 | + AND b.id_board IN ({array_int:boards_list})' : '').(!$modSettings['postmod_active'] || $context['user']['is_owner'] ? '' : ' |
|
| 993 | + AND m.approved = {int:is_approved}').' |
|
| 994 | 994 | ORDER BY {raw:sort} |
| 995 | 995 | LIMIT {int:offset}, {int:limit}', |
| 996 | 996 | array( |
@@ -1045,8 +1045,8 @@ discard block |
||
| 1045 | 1045 | WHERE a.attachment_type = {int:attachment_type} |
| 1046 | 1046 | AND a.id_msg != {int:no_message} |
| 1047 | 1047 | AND m.id_member = {int:current_member}' . (!empty($board) ? ' |
| 1048 | - AND b.id_board = {int:board}' : '') . (!in_array(0, $boardsAllowed) ? ' |
|
| 1049 | - AND b.id_board IN ({array_int:boards_list})' : '') . (!$modSettings['postmod_active'] || $context['user']['is_owner'] ? '' : ' |
|
| 1048 | + AND b.id_board = {int:board}' : '').(!in_array(0, $boardsAllowed) ? ' |
|
| 1049 | + AND b.id_board IN ({array_int:boards_list})' : '').(!$modSettings['postmod_active'] || $context['user']['is_owner'] ? '' : ' |
|
| 1050 | 1050 | AND m.approved = {int:is_approved}'), |
| 1051 | 1051 | array( |
| 1052 | 1052 | 'boards_list' => $boardsAllowed, |
@@ -1076,7 +1076,7 @@ discard block |
||
| 1076 | 1076 | if ($user_info['id'] != $memID) |
| 1077 | 1077 | return; |
| 1078 | 1078 | |
| 1079 | - require_once($sourcedir . '/Subs-List.php'); |
|
| 1079 | + require_once($sourcedir.'/Subs-List.php'); |
|
| 1080 | 1080 | |
| 1081 | 1081 | // And here they are: the topics you don't like |
| 1082 | 1082 | $listOptions = array( |
@@ -1084,7 +1084,7 @@ discard block |
||
| 1084 | 1084 | 'width' => '100%', |
| 1085 | 1085 | 'items_per_page' => (empty($modSettings['disableCustomPerPage']) && !empty($options['topics_per_page'])) ? $options['topics_per_page'] : $modSettings['defaultMaxTopics'], |
| 1086 | 1086 | 'no_items_label' => $txt['unwatched_topics_none'], |
| 1087 | - 'base_href' => $scripturl . '?action=profile;area=showposts;sa=unwatchedtopics;u=' . $memID, |
|
| 1087 | + 'base_href' => $scripturl.'?action=profile;area=showposts;sa=unwatchedtopics;u='.$memID, |
|
| 1088 | 1088 | 'default_sort_col' => 'started_on', |
| 1089 | 1089 | 'get_items' => array( |
| 1090 | 1090 | 'function' => 'list_getUnwatched', |
@@ -1107,7 +1107,7 @@ discard block |
||
| 1107 | 1107 | ), |
| 1108 | 1108 | 'data' => array( |
| 1109 | 1109 | 'sprintf' => array( |
| 1110 | - 'format' => '<a href="' . $scripturl . '?topic=%1$d.0">%2$s</a>', |
|
| 1110 | + 'format' => '<a href="'.$scripturl.'?topic=%1$d.0">%2$s</a>', |
|
| 1111 | 1111 | 'params' => array( |
| 1112 | 1112 | 'id_topic' => false, |
| 1113 | 1113 | 'subject' => false, |
@@ -1205,7 +1205,7 @@ discard block |
||
| 1205 | 1205 | LEFT JOIN {db_prefix}topics as t ON (lt.id_topic = t.id_topic) |
| 1206 | 1206 | LEFT JOIN {db_prefix}boards as b ON (t.id_board = b.id_board) |
| 1207 | 1207 | LEFT JOIN {db_prefix}messages as m ON (t.id_first_msg = m.id_msg)' . (in_array($sort, array('mem.real_name', 'mem.real_name DESC', 'mem.poster_time', 'mem.poster_time DESC')) ? ' |
| 1208 | - LEFT JOIN {db_prefix}members as mem ON (m.id_member = mem.id_member)' : '') . ' |
|
| 1208 | + LEFT JOIN {db_prefix}members as mem ON (m.id_member = mem.id_member)' : '').' |
|
| 1209 | 1209 | WHERE lt.id_member = {int:current_member} |
| 1210 | 1210 | AND unwatched = 1 |
| 1211 | 1211 | AND {query_see_board} |
@@ -1287,7 +1287,7 @@ discard block |
||
| 1287 | 1287 | { |
| 1288 | 1288 | global $txt, $scripturl, $context, $user_profile, $user_info, $modSettings, $smcFunc; |
| 1289 | 1289 | |
| 1290 | - $context['page_title'] = $txt['statPanel_showStats'] . ' ' . $user_profile[$memID]['real_name']; |
|
| 1290 | + $context['page_title'] = $txt['statPanel_showStats'].' '.$user_profile[$memID]['real_name']; |
|
| 1291 | 1291 | |
| 1292 | 1292 | // Is the load average too high to allow searching just now? |
| 1293 | 1293 | if (!empty($context['load_average']) && !empty($modSettings['loadavg_userstats']) && $context['load_average'] >= $modSettings['loadavg_userstats']) |
@@ -1296,11 +1296,11 @@ discard block |
||
| 1296 | 1296 | // General user statistics. |
| 1297 | 1297 | $timeDays = floor($user_profile[$memID]['total_time_logged_in'] / 86400); |
| 1298 | 1298 | $timeHours = floor(($user_profile[$memID]['total_time_logged_in'] % 86400) / 3600); |
| 1299 | - $context['time_logged_in'] = ($timeDays > 0 ? $timeDays . $txt['totalTimeLogged2'] : '') . ($timeHours > 0 ? $timeHours . $txt['totalTimeLogged3'] : '') . floor(($user_profile[$memID]['total_time_logged_in'] % 3600) / 60) . $txt['totalTimeLogged4']; |
|
| 1299 | + $context['time_logged_in'] = ($timeDays > 0 ? $timeDays.$txt['totalTimeLogged2'] : '').($timeHours > 0 ? $timeHours.$txt['totalTimeLogged3'] : '').floor(($user_profile[$memID]['total_time_logged_in'] % 3600) / 60).$txt['totalTimeLogged4']; |
|
| 1300 | 1300 | $context['num_posts'] = comma_format($user_profile[$memID]['posts']); |
| 1301 | 1301 | // Menu tab |
| 1302 | 1302 | $context[$context['profile_menu_name']]['tab_data'] = array( |
| 1303 | - 'title' => $txt['statPanel_generalStats'] . ' - ' . $context['member']['name'], |
|
| 1303 | + 'title' => $txt['statPanel_generalStats'].' - '.$context['member']['name'], |
|
| 1304 | 1304 | 'icon' => 'stats_info.png' |
| 1305 | 1305 | ); |
| 1306 | 1306 | |
@@ -1359,8 +1359,8 @@ discard block |
||
| 1359 | 1359 | $context['popular_boards'][$row['id_board']] = array( |
| 1360 | 1360 | 'id' => $row['id_board'], |
| 1361 | 1361 | 'posts' => $row['message_count'], |
| 1362 | - 'href' => $scripturl . '?board=' . $row['id_board'] . '.0', |
|
| 1363 | - 'link' => '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0">' . $row['name'] . '</a>', |
|
| 1362 | + 'href' => $scripturl.'?board='.$row['id_board'].'.0', |
|
| 1363 | + 'link' => '<a href="'.$scripturl.'?board='.$row['id_board'].'.0">'.$row['name'].'</a>', |
|
| 1364 | 1364 | 'posts_percent' => $user_profile[$memID]['posts'] == 0 ? 0 : ($row['message_count'] * 100) / $user_profile[$memID]['posts'], |
| 1365 | 1365 | 'total_posts' => $row['num_posts'], |
| 1366 | 1366 | 'total_posts_member' => $user_profile[$memID]['posts'], |
@@ -1390,8 +1390,8 @@ discard block |
||
| 1390 | 1390 | $context['board_activity'][$row['id_board']] = array( |
| 1391 | 1391 | 'id' => $row['id_board'], |
| 1392 | 1392 | 'posts' => $row['message_count'], |
| 1393 | - 'href' => $scripturl . '?board=' . $row['id_board'] . '.0', |
|
| 1394 | - 'link' => '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0">' . $row['name'] . '</a>', |
|
| 1393 | + 'href' => $scripturl.'?board='.$row['id_board'].'.0', |
|
| 1394 | + 'link' => '<a href="'.$scripturl.'?board='.$row['id_board'].'.0">'.$row['name'].'</a>', |
|
| 1395 | 1395 | 'percent' => comma_format((float) $row['percentage'], 2), |
| 1396 | 1396 | 'posts_percent' => (float) $row['percentage'], |
| 1397 | 1397 | 'total_posts' => $row['num_posts'], |
@@ -1406,7 +1406,7 @@ discard block |
||
| 1406 | 1406 | COUNT(*) AS post_count |
| 1407 | 1407 | FROM {db_prefix}messages |
| 1408 | 1408 | WHERE id_member = {int:current_member}' . ($modSettings['totalMessages'] > 100000 ? ' |
| 1409 | - AND id_topic > {int:top_ten_thousand_topics}' : '') . ' |
|
| 1409 | + AND id_topic > {int:top_ten_thousand_topics}' : '').' |
|
| 1410 | 1410 | GROUP BY hour', |
| 1411 | 1411 | array( |
| 1412 | 1412 | 'current_member' => $memID, |
@@ -1471,18 +1471,18 @@ discard block |
||
| 1471 | 1471 | 'text' => $context['time_logged_in'], |
| 1472 | 1472 | ), |
| 1473 | 1473 | 'total_posts' => array( |
| 1474 | - 'text' => $context['num_posts'] . ' ' . $txt['statPanel_posts'], |
|
| 1475 | - 'url' => $scripturl . '?action=profile;area=showposts;sa=messages;u=' . $memID |
|
| 1474 | + 'text' => $context['num_posts'].' '.$txt['statPanel_posts'], |
|
| 1475 | + 'url' => $scripturl.'?action=profile;area=showposts;sa=messages;u='.$memID |
|
| 1476 | 1476 | ), |
| 1477 | 1477 | 'total_topics' => array( |
| 1478 | - 'text' => $context['num_topics'] . ' ' . $txt['statPanel_topics'], |
|
| 1479 | - 'url' => $scripturl . '?action=profile;area=showposts;sa=topics;u=' . $memID |
|
| 1478 | + 'text' => $context['num_topics'].' '.$txt['statPanel_topics'], |
|
| 1479 | + 'url' => $scripturl.'?action=profile;area=showposts;sa=topics;u='.$memID |
|
| 1480 | 1480 | ), |
| 1481 | 1481 | 'users_polls' => array( |
| 1482 | - 'text' => $context['num_polls'] . ' ' . $txt['statPanel_polls'], |
|
| 1482 | + 'text' => $context['num_polls'].' '.$txt['statPanel_polls'], |
|
| 1483 | 1483 | ), |
| 1484 | 1484 | 'users_votes' => array( |
| 1485 | - 'text' => $context['num_votes'] . ' ' . $txt['statPanel_votes'] |
|
| 1485 | + 'text' => $context['num_votes'].' '.$txt['statPanel_votes'] |
|
| 1486 | 1486 | ) |
| 1487 | 1487 | ); |
| 1488 | 1488 | |
@@ -1543,7 +1543,7 @@ discard block |
||
| 1543 | 1543 | $context['tracking_area'] = isset($_GET['sa']) && isset($subActions[$_GET['sa']]) ? $_GET['sa'] : $default; |
| 1544 | 1544 | |
| 1545 | 1545 | // Set a page title. |
| 1546 | - $context['page_title'] = $txt['trackUser'] . ' - ' . $subActions[$context['tracking_area']][1] . ' - ' . $user_profile[$memID]['real_name']; |
|
| 1546 | + $context['page_title'] = $txt['trackUser'].' - '.$subActions[$context['tracking_area']][1].' - '.$user_profile[$memID]['real_name']; |
|
| 1547 | 1547 | |
| 1548 | 1548 | // Pass on to the actual function. |
| 1549 | 1549 | $context['sub_template'] = $subActions[$context['tracking_area']][0]; |
@@ -1574,10 +1574,10 @@ discard block |
||
| 1574 | 1574 | // Set the options for the list component. |
| 1575 | 1575 | $listOptions = array( |
| 1576 | 1576 | 'id' => 'track_user_list', |
| 1577 | - 'title' => $txt['errors_by'] . ' ' . $context['member']['name'], |
|
| 1577 | + 'title' => $txt['errors_by'].' '.$context['member']['name'], |
|
| 1578 | 1578 | 'items_per_page' => $modSettings['defaultMaxListItems'], |
| 1579 | 1579 | 'no_items_label' => $txt['no_errors_from_user'], |
| 1580 | - 'base_href' => $scripturl . '?action=profile;area=tracking;sa=user;u=' . $memID, |
|
| 1580 | + 'base_href' => $scripturl.'?action=profile;area=tracking;sa=user;u='.$memID, |
|
| 1581 | 1581 | 'default_sort_col' => 'date', |
| 1582 | 1582 | 'get_items' => array( |
| 1583 | 1583 | 'function' => 'list_getUserErrors', |
@@ -1600,7 +1600,7 @@ discard block |
||
| 1600 | 1600 | ), |
| 1601 | 1601 | 'data' => array( |
| 1602 | 1602 | 'sprintf' => array( |
| 1603 | - 'format' => '<a href="' . $scripturl . '?action=profile;area=tracking;sa=ip;searchip=%1$s;u=' . $memID . '">%1$s</a>', |
|
| 1603 | + 'format' => '<a href="'.$scripturl.'?action=profile;area=tracking;sa=ip;searchip=%1$s;u='.$memID.'">%1$s</a>', |
|
| 1604 | 1604 | 'params' => array( |
| 1605 | 1605 | 'ip' => false, |
| 1606 | 1606 | ), |
@@ -1647,7 +1647,7 @@ discard block |
||
| 1647 | 1647 | ); |
| 1648 | 1648 | |
| 1649 | 1649 | // Create the list for viewing. |
| 1650 | - require_once($sourcedir . '/Subs-List.php'); |
|
| 1650 | + require_once($sourcedir.'/Subs-List.php'); |
|
| 1651 | 1651 | createList($listOptions); |
| 1652 | 1652 | |
| 1653 | 1653 | // @todo cache this |
@@ -1682,7 +1682,7 @@ discard block |
||
| 1682 | 1682 | FROM {db_prefix}messages |
| 1683 | 1683 | WHERE id_member = {int:current_member} |
| 1684 | 1684 | ' . (isset($min_msg_member) ? ' |
| 1685 | - AND id_msg >= {int:min_msg_member} AND id_msg <= {int:max_msg_member}' : '') . ' |
|
| 1685 | + AND id_msg >= {int:min_msg_member} AND id_msg <= {int:max_msg_member}' : '').' |
|
| 1686 | 1686 | GROUP BY poster_ip', |
| 1687 | 1687 | array( |
| 1688 | 1688 | 'current_member' => $memID, |
@@ -1693,7 +1693,7 @@ discard block |
||
| 1693 | 1693 | $context['ips'] = array(); |
| 1694 | 1694 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 1695 | 1695 | { |
| 1696 | - $context['ips'][] = '<a href="' . $scripturl . '?action=profile;area=tracking;sa=ip;searchip=' . inet_dtop($row['poster_ip']) . ';u=' . $memID . '">' . inet_dtop($row['poster_ip']) . '</a>'; |
|
| 1696 | + $context['ips'][] = '<a href="'.$scripturl.'?action=profile;area=tracking;sa=ip;searchip='.inet_dtop($row['poster_ip']).';u='.$memID.'">'.inet_dtop($row['poster_ip']).'</a>'; |
|
| 1697 | 1697 | $ips[] = inet_dtop($row['poster_ip']); |
| 1698 | 1698 | } |
| 1699 | 1699 | $smcFunc['db_free_result']($request); |
@@ -1712,7 +1712,7 @@ discard block |
||
| 1712 | 1712 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 1713 | 1713 | { |
| 1714 | 1714 | $row['ip'] = inet_dtop($row['ip']); |
| 1715 | - $context['error_ips'][] = '<a href="' . $scripturl . '?action=profile;area=tracking;sa=ip;searchip=' . $row['ip'] . ';u=' . $memID . '">' . $row['ip'] . '</a>'; |
|
| 1715 | + $context['error_ips'][] = '<a href="'.$scripturl.'?action=profile;area=tracking;sa=ip;searchip='.$row['ip'].';u='.$memID.'">'.$row['ip'].'</a>'; |
|
| 1716 | 1716 | $ips[] = $row['ip']; |
| 1717 | 1717 | } |
| 1718 | 1718 | $smcFunc['db_free_result']($request); |
@@ -1752,7 +1752,7 @@ discard block |
||
| 1752 | 1752 | ) |
| 1753 | 1753 | ); |
| 1754 | 1754 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 1755 | - $context['members_in_range'][$row['id_member']] = '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>'; |
|
| 1755 | + $context['members_in_range'][$row['id_member']] = '<a href="'.$scripturl.'?action=profile;u='.$row['id_member'].'">'.$row['real_name'].'</a>'; |
|
| 1756 | 1756 | $smcFunc['db_free_result']($request); |
| 1757 | 1757 | } |
| 1758 | 1758 | |
@@ -1767,7 +1767,7 @@ discard block |
||
| 1767 | 1767 | ) |
| 1768 | 1768 | ); |
| 1769 | 1769 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 1770 | - $context['members_in_range'][$row['id_member']] = '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>'; |
|
| 1770 | + $context['members_in_range'][$row['id_member']] = '<a href="'.$scripturl.'?action=profile;u='.$row['id_member'].'">'.$row['real_name'].'</a>'; |
|
| 1771 | 1771 | $smcFunc['db_free_result']($request); |
| 1772 | 1772 | } |
| 1773 | 1773 | } |
@@ -1816,7 +1816,7 @@ discard block |
||
| 1816 | 1816 | COALESCE(mem.real_name, {string:guest_title}) AS display_name, mem.member_name |
| 1817 | 1817 | FROM {db_prefix}log_errors AS le |
| 1818 | 1818 | LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = le.id_member) |
| 1819 | - WHERE ' . $where . ' |
|
| 1819 | + WHERE ' . $where.' |
|
| 1820 | 1820 | ORDER BY {raw:sort} |
| 1821 | 1821 | LIMIT {int:start}, {int:max}', |
| 1822 | 1822 | array_merge($where_vars, array( |
@@ -1830,7 +1830,7 @@ discard block |
||
| 1830 | 1830 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 1831 | 1831 | $error_messages[] = array( |
| 1832 | 1832 | 'ip' => inet_dtop($row['ip']), |
| 1833 | - 'member_link' => $row['id_member'] > 0 ? '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['display_name'] . '</a>' : $row['display_name'], |
|
| 1833 | + 'member_link' => $row['id_member'] > 0 ? '<a href="'.$scripturl.'?action=profile;u='.$row['id_member'].'">'.$row['display_name'].'</a>' : $row['display_name'], |
|
| 1834 | 1834 | 'message' => strtr($row['message'], array('<span class="remove">' => '', '</span>' => '')), |
| 1835 | 1835 | 'url' => $row['url'], |
| 1836 | 1836 | 'time' => timeformat($row['log_time']), |
@@ -1888,7 +1888,7 @@ discard block |
||
| 1888 | 1888 | FROM {db_prefix}messages AS m |
| 1889 | 1889 | INNER JOIN {db_prefix}boards AS b ON (b.id_board = m.id_board) |
| 1890 | 1890 | LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member) |
| 1891 | - WHERE {query_see_board} AND ' . $where . ' |
|
| 1891 | + WHERE {query_see_board} AND ' . $where.' |
|
| 1892 | 1892 | ORDER BY {raw:sort} |
| 1893 | 1893 | LIMIT {int:start}, {int:max}', |
| 1894 | 1894 | array_merge($where_vars, array( |
@@ -1901,10 +1901,10 @@ discard block |
||
| 1901 | 1901 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 1902 | 1902 | $messages[] = array( |
| 1903 | 1903 | 'ip' => inet_dtop($row['poster_ip']), |
| 1904 | - 'member_link' => empty($row['id_member']) ? $row['display_name'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['display_name'] . '</a>', |
|
| 1904 | + 'member_link' => empty($row['id_member']) ? $row['display_name'] : '<a href="'.$scripturl.'?action=profile;u='.$row['id_member'].'">'.$row['display_name'].'</a>', |
|
| 1905 | 1905 | 'board' => array( |
| 1906 | 1906 | 'id' => $row['id_board'], |
| 1907 | - 'href' => $scripturl . '?board=' . $row['id_board'] |
|
| 1907 | + 'href' => $scripturl.'?board='.$row['id_board'] |
|
| 1908 | 1908 | ), |
| 1909 | 1909 | 'topic' => $row['id_topic'], |
| 1910 | 1910 | 'id' => $row['id_msg'], |
@@ -1937,12 +1937,12 @@ discard block |
||
| 1937 | 1937 | loadLanguage('Profile'); |
| 1938 | 1938 | $context['sub_template'] = 'trackIP'; |
| 1939 | 1939 | $context['page_title'] = $txt['profile']; |
| 1940 | - $context['base_url'] = $scripturl . '?action=trackip'; |
|
| 1940 | + $context['base_url'] = $scripturl.'?action=trackip'; |
|
| 1941 | 1941 | } |
| 1942 | 1942 | else |
| 1943 | 1943 | { |
| 1944 | 1944 | $context['ip'] = ip2range($user_profile[$memID]['member_ip']); |
| 1945 | - $context['base_url'] = $scripturl . '?action=profile;area=tracking;sa=ip;u=' . $memID; |
|
| 1945 | + $context['base_url'] = $scripturl.'?action=profile;area=tracking;sa=ip;u='.$memID; |
|
| 1946 | 1946 | } |
| 1947 | 1947 | |
| 1948 | 1948 | // Searching? |
@@ -1952,7 +1952,7 @@ discard block |
||
| 1952 | 1952 | if (count($context['ip']) !== 2) |
| 1953 | 1953 | fatal_lang_error('invalid_tracking_ip', false); |
| 1954 | 1954 | |
| 1955 | - $ip_string = array('{inet:ip_address_low}','{inet:ip_address_high}'); |
|
| 1955 | + $ip_string = array('{inet:ip_address_low}', '{inet:ip_address_high}'); |
|
| 1956 | 1956 | $fields = array( |
| 1957 | 1957 | 'ip_address_low' => $context['ip']['low'], |
| 1958 | 1958 | 'ip_address_high' => $context['ip']['high'], |
@@ -1960,23 +1960,23 @@ discard block |
||
| 1960 | 1960 | |
| 1961 | 1961 | $ip_var = $context['ip']; |
| 1962 | 1962 | |
| 1963 | - if ($context['ip']['low'] !== $context['ip']['high']) |
|
| 1964 | - $context['ip'] = $context['ip']['low'] . ' - ' . $context['ip']['high']; |
|
| 1963 | + if ($context['ip']['low'] !== $context['ip']['high']) |
|
| 1964 | + $context['ip'] = $context['ip']['low'].' - '.$context['ip']['high']; |
|
| 1965 | 1965 | else |
| 1966 | 1966 | $context['ip'] = $context['ip']['low']; |
| 1967 | 1967 | |
| 1968 | 1968 | if (empty($context['tracking_area'])) |
| 1969 | - $context['page_title'] = $txt['trackIP'] . ' - ' . $context['ip']; |
|
| 1969 | + $context['page_title'] = $txt['trackIP'].' - '.$context['ip']; |
|
| 1970 | 1970 | |
| 1971 | 1971 | $request = $smcFunc['db_query']('', ' |
| 1972 | 1972 | SELECT id_member, real_name AS display_name, member_ip |
| 1973 | 1973 | FROM {db_prefix}members |
| 1974 | - WHERE member_ip >= ' . $ip_string[0] . ' and member_ip <= ' . $ip_string[1], |
|
| 1974 | + WHERE member_ip >= ' . $ip_string[0].' and member_ip <= '.$ip_string[1], |
|
| 1975 | 1975 | $fields |
| 1976 | 1976 | ); |
| 1977 | 1977 | $context['ips'] = array(); |
| 1978 | 1978 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 1979 | - $context['ips'][inet_dtop($row['member_ip'])][] = '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['display_name'] . '</a>'; |
|
| 1979 | + $context['ips'][inet_dtop($row['member_ip'])][] = '<a href="'.$scripturl.'?action=profile;u='.$row['id_member'].'">'.$row['display_name'].'</a>'; |
|
| 1980 | 1980 | $smcFunc['db_free_result']($request); |
| 1981 | 1981 | |
| 1982 | 1982 | ksort($context['ips']); |
@@ -1985,28 +1985,28 @@ discard block |
||
| 1985 | 1985 | $maxPerPage = empty($modSettings['disableCustomPerPage']) && !empty($options['messages_per_page']) ? $options['messages_per_page'] : $modSettings['defaultMaxMessages']; |
| 1986 | 1986 | |
| 1987 | 1987 | // Gonna want this for the list. |
| 1988 | - require_once($sourcedir . '/Subs-List.php'); |
|
| 1988 | + require_once($sourcedir.'/Subs-List.php'); |
|
| 1989 | 1989 | |
| 1990 | 1990 | // Start with the user messages. |
| 1991 | 1991 | $listOptions = array( |
| 1992 | 1992 | 'id' => 'track_message_list', |
| 1993 | - 'title' => $txt['messages_from_ip'] . ' ' . $context['ip'], |
|
| 1993 | + 'title' => $txt['messages_from_ip'].' '.$context['ip'], |
|
| 1994 | 1994 | 'start_var_name' => 'messageStart', |
| 1995 | 1995 | 'items_per_page' => $maxPerPage, |
| 1996 | 1996 | 'no_items_label' => $txt['no_messages_from_ip'], |
| 1997 | - 'base_href' => $context['base_url'] . ';searchip=' . $context['ip'], |
|
| 1997 | + 'base_href' => $context['base_url'].';searchip='.$context['ip'], |
|
| 1998 | 1998 | 'default_sort_col' => 'date', |
| 1999 | 1999 | 'get_items' => array( |
| 2000 | 2000 | 'function' => 'list_getIPMessages', |
| 2001 | 2001 | 'params' => array( |
| 2002 | - 'm.poster_ip >= ' . $ip_string[0] . ' and m.poster_ip <= ' . $ip_string[1], |
|
| 2002 | + 'm.poster_ip >= '.$ip_string[0].' and m.poster_ip <= '.$ip_string[1], |
|
| 2003 | 2003 | $fields, |
| 2004 | 2004 | ), |
| 2005 | 2005 | ), |
| 2006 | 2006 | 'get_count' => array( |
| 2007 | 2007 | 'function' => 'list_getIPMessageCount', |
| 2008 | 2008 | 'params' => array( |
| 2009 | - 'm.poster_ip >= ' . $ip_string[0] . ' and m.poster_ip <= ' . $ip_string[1], |
|
| 2009 | + 'm.poster_ip >= '.$ip_string[0].' and m.poster_ip <= '.$ip_string[1], |
|
| 2010 | 2010 | $fields, |
| 2011 | 2011 | ), |
| 2012 | 2012 | ), |
@@ -2017,7 +2017,7 @@ discard block |
||
| 2017 | 2017 | ), |
| 2018 | 2018 | 'data' => array( |
| 2019 | 2019 | 'sprintf' => array( |
| 2020 | - 'format' => '<a href="' . $context['base_url'] . ';searchip=%1$s">%1$s</a>', |
|
| 2020 | + 'format' => '<a href="'.$context['base_url'].';searchip=%1$s">%1$s</a>', |
|
| 2021 | 2021 | 'params' => array( |
| 2022 | 2022 | 'ip' => false, |
| 2023 | 2023 | ), |
@@ -2042,7 +2042,7 @@ discard block |
||
| 2042 | 2042 | ), |
| 2043 | 2043 | 'data' => array( |
| 2044 | 2044 | 'sprintf' => array( |
| 2045 | - 'format' => '<a href="' . $scripturl . '?topic=%1$s.msg%2$s#msg%2$s" rel="nofollow">%3$s</a>', |
|
| 2045 | + 'format' => '<a href="'.$scripturl.'?topic=%1$s.msg%2$s#msg%2$s" rel="nofollow">%3$s</a>', |
|
| 2046 | 2046 | 'params' => array( |
| 2047 | 2047 | 'topic' => false, |
| 2048 | 2048 | 'id' => false, |
@@ -2078,23 +2078,23 @@ discard block |
||
| 2078 | 2078 | // Set the options for the error lists. |
| 2079 | 2079 | $listOptions = array( |
| 2080 | 2080 | 'id' => 'track_user_list', |
| 2081 | - 'title' => $txt['errors_from_ip'] . ' ' . $context['ip'], |
|
| 2081 | + 'title' => $txt['errors_from_ip'].' '.$context['ip'], |
|
| 2082 | 2082 | 'start_var_name' => 'errorStart', |
| 2083 | 2083 | 'items_per_page' => $modSettings['defaultMaxListItems'], |
| 2084 | 2084 | 'no_items_label' => $txt['no_errors_from_ip'], |
| 2085 | - 'base_href' => $context['base_url'] . ';searchip=' . $context['ip'], |
|
| 2085 | + 'base_href' => $context['base_url'].';searchip='.$context['ip'], |
|
| 2086 | 2086 | 'default_sort_col' => 'date2', |
| 2087 | 2087 | 'get_items' => array( |
| 2088 | 2088 | 'function' => 'list_getUserErrors', |
| 2089 | 2089 | 'params' => array( |
| 2090 | - 'le.ip >= ' . $ip_string[0] . ' and le.ip <= ' . $ip_string[1], |
|
| 2090 | + 'le.ip >= '.$ip_string[0].' and le.ip <= '.$ip_string[1], |
|
| 2091 | 2091 | $fields, |
| 2092 | 2092 | ), |
| 2093 | 2093 | ), |
| 2094 | 2094 | 'get_count' => array( |
| 2095 | 2095 | 'function' => 'list_getUserErrorCount', |
| 2096 | 2096 | 'params' => array( |
| 2097 | - 'ip >= ' . $ip_string[0] . ' and ip <= ' . $ip_string[1], |
|
| 2097 | + 'ip >= '.$ip_string[0].' and ip <= '.$ip_string[1], |
|
| 2098 | 2098 | $fields, |
| 2099 | 2099 | ), |
| 2100 | 2100 | ), |
@@ -2105,7 +2105,7 @@ discard block |
||
| 2105 | 2105 | ), |
| 2106 | 2106 | 'data' => array( |
| 2107 | 2107 | 'sprintf' => array( |
| 2108 | - 'format' => '<a href="' . $context['base_url'] . ';searchip=%1$s">%1$s</a>', |
|
| 2108 | + 'format' => '<a href="'.$context['base_url'].';searchip=%1$s">%1$s</a>', |
|
| 2109 | 2109 | 'params' => array( |
| 2110 | 2110 | 'ip' => false, |
| 2111 | 2111 | ), |
@@ -2172,23 +2172,23 @@ discard block |
||
| 2172 | 2172 | $context['whois_servers'] = array( |
| 2173 | 2173 | 'afrinic' => array( |
| 2174 | 2174 | 'name' => $txt['whois_afrinic'], |
| 2175 | - 'url' => 'https://www.afrinic.net/cgi-bin/whois?searchtext=' . $context['ip'], |
|
| 2175 | + 'url' => 'https://www.afrinic.net/cgi-bin/whois?searchtext='.$context['ip'], |
|
| 2176 | 2176 | ), |
| 2177 | 2177 | 'apnic' => array( |
| 2178 | 2178 | 'name' => $txt['whois_apnic'], |
| 2179 | - 'url' => 'https://wq.apnic.net/apnic-bin/whois.pl?searchtext=' . $context['ip'], |
|
| 2179 | + 'url' => 'https://wq.apnic.net/apnic-bin/whois.pl?searchtext='.$context['ip'], |
|
| 2180 | 2180 | ), |
| 2181 | 2181 | 'arin' => array( |
| 2182 | 2182 | 'name' => $txt['whois_arin'], |
| 2183 | - 'url' => 'https://whois.arin.net/rest/ip/' . $context['ip'], |
|
| 2183 | + 'url' => 'https://whois.arin.net/rest/ip/'.$context['ip'], |
|
| 2184 | 2184 | ), |
| 2185 | 2185 | 'lacnic' => array( |
| 2186 | 2186 | 'name' => $txt['whois_lacnic'], |
| 2187 | - 'url' => 'https://lacnic.net/cgi-bin/lacnic/whois?query=' . $context['ip'], |
|
| 2187 | + 'url' => 'https://lacnic.net/cgi-bin/lacnic/whois?query='.$context['ip'], |
|
| 2188 | 2188 | ), |
| 2189 | 2189 | 'ripe' => array( |
| 2190 | 2190 | 'name' => $txt['whois_ripe'], |
| 2191 | - 'url' => 'https://apps.db.ripe.net/search/query.html?searchtext=' . $context['ip'], |
|
| 2191 | + 'url' => 'https://apps.db.ripe.net/search/query.html?searchtext='.$context['ip'], |
|
| 2192 | 2192 | ), |
| 2193 | 2193 | ); |
| 2194 | 2194 | } |
@@ -2204,12 +2204,12 @@ discard block |
||
| 2204 | 2204 | global $scripturl, $txt, $sourcedir, $context; |
| 2205 | 2205 | |
| 2206 | 2206 | // Gonna want this for the list. |
| 2207 | - require_once($sourcedir . '/Subs-List.php'); |
|
| 2207 | + require_once($sourcedir.'/Subs-List.php'); |
|
| 2208 | 2208 | |
| 2209 | 2209 | if ($memID == 0) |
| 2210 | - $context['base_url'] = $scripturl . '?action=trackip'; |
|
| 2210 | + $context['base_url'] = $scripturl.'?action=trackip'; |
|
| 2211 | 2211 | else |
| 2212 | - $context['base_url'] = $scripturl . '?action=profile;area=tracking;sa=ip;u=' . $memID; |
|
| 2212 | + $context['base_url'] = $scripturl.'?action=profile;area=tracking;sa=ip;u='.$memID; |
|
| 2213 | 2213 | |
| 2214 | 2214 | // Start with the user messages. |
| 2215 | 2215 | $listOptions = array( |
@@ -2246,7 +2246,7 @@ discard block |
||
| 2246 | 2246 | ), |
| 2247 | 2247 | 'data' => array( |
| 2248 | 2248 | 'sprintf' => array( |
| 2249 | - 'format' => '<a href="' . $context['base_url'] . ';searchip=%1$s">%1$s</a> (<a href="' . $context['base_url'] . ';searchip=%2$s">%2$s</a>) ', |
|
| 2249 | + 'format' => '<a href="'.$context['base_url'].';searchip=%1$s">%1$s</a> (<a href="'.$context['base_url'].';searchip=%2$s">%2$s</a>) ', |
|
| 2250 | 2250 | 'params' => array( |
| 2251 | 2251 | 'ip' => false, |
| 2252 | 2252 | 'ip2' => false |
@@ -2339,7 +2339,7 @@ discard block |
||
| 2339 | 2339 | { |
| 2340 | 2340 | global $scripturl, $txt, $modSettings, $sourcedir, $context, $smcFunc; |
| 2341 | 2341 | |
| 2342 | - require_once($sourcedir . '/Subs-List.php'); |
|
| 2342 | + require_once($sourcedir.'/Subs-List.php'); |
|
| 2343 | 2343 | |
| 2344 | 2344 | // Get the names of any custom fields. |
| 2345 | 2345 | $request = $smcFunc['db_query']('', ' |
@@ -2350,7 +2350,7 @@ discard block |
||
| 2350 | 2350 | ); |
| 2351 | 2351 | $context['custom_field_titles'] = array(); |
| 2352 | 2352 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 2353 | - $context['custom_field_titles']['customfield_' . $row['col_name']] = array( |
|
| 2353 | + $context['custom_field_titles']['customfield_'.$row['col_name']] = array( |
|
| 2354 | 2354 | 'title' => $row['field_name'], |
| 2355 | 2355 | 'parse_bbc' => $row['bbc'], |
| 2356 | 2356 | ); |
@@ -2362,7 +2362,7 @@ discard block |
||
| 2362 | 2362 | 'title' => $txt['trackEdits'], |
| 2363 | 2363 | 'items_per_page' => $modSettings['defaultMaxListItems'], |
| 2364 | 2364 | 'no_items_label' => $txt['trackEdit_no_edits'], |
| 2365 | - 'base_href' => $scripturl . '?action=profile;area=tracking;sa=edits;u=' . $memID, |
|
| 2365 | + 'base_href' => $scripturl.'?action=profile;area=tracking;sa=edits;u='.$memID, |
|
| 2366 | 2366 | 'default_sort_col' => 'time', |
| 2367 | 2367 | 'get_items' => array( |
| 2368 | 2368 | 'function' => 'list_getProfileEdits', |
@@ -2496,8 +2496,8 @@ discard block |
||
| 2496 | 2496 | $members[] = $extra['applicator']; |
| 2497 | 2497 | |
| 2498 | 2498 | // Work out what the name of the action is. |
| 2499 | - if (isset($txt['trackEdit_action_' . $row['action']])) |
|
| 2500 | - $action_text = $txt['trackEdit_action_' . $row['action']]; |
|
| 2499 | + if (isset($txt['trackEdit_action_'.$row['action']])) |
|
| 2500 | + $action_text = $txt['trackEdit_action_'.$row['action']]; |
|
| 2501 | 2501 | elseif (isset($txt[$row['action']])) |
| 2502 | 2502 | $action_text = $txt[$row['action']]; |
| 2503 | 2503 | // Custom field? |
@@ -2542,7 +2542,7 @@ discard block |
||
| 2542 | 2542 | |
| 2543 | 2543 | foreach ($edits as $key => $value) |
| 2544 | 2544 | if (isset($members[$value['id_member']])) |
| 2545 | - $edits[$key]['member_link'] = '<a href="' . $scripturl . '?action=profile;u=' . $value['id_member'] . '">' . $members[$value['id_member']] . '</a>'; |
|
| 2545 | + $edits[$key]['member_link'] = '<a href="'.$scripturl.'?action=profile;u='.$value['id_member'].'">'.$members[$value['id_member']].'</a>'; |
|
| 2546 | 2546 | } |
| 2547 | 2547 | |
| 2548 | 2548 | return $edits; |
@@ -2557,7 +2557,7 @@ discard block |
||
| 2557 | 2557 | { |
| 2558 | 2558 | global $scripturl, $txt, $modSettings, $sourcedir, $context; |
| 2559 | 2559 | |
| 2560 | - require_once($sourcedir . '/Subs-List.php'); |
|
| 2560 | + require_once($sourcedir.'/Subs-List.php'); |
|
| 2561 | 2561 | |
| 2562 | 2562 | // Set the options for the error lists. |
| 2563 | 2563 | $listOptions = array( |
@@ -2565,7 +2565,7 @@ discard block |
||
| 2565 | 2565 | 'title' => sprintf($txt['trackGroupRequests_title'], $context['member']['name']), |
| 2566 | 2566 | 'items_per_page' => $modSettings['defaultMaxListItems'], |
| 2567 | 2567 | 'no_items_label' => $txt['requested_none'], |
| 2568 | - 'base_href' => $scripturl . '?action=profile;area=tracking;sa=groupreq;u=' . $memID, |
|
| 2568 | + 'base_href' => $scripturl.'?action=profile;area=tracking;sa=groupreq;u='.$memID, |
|
| 2569 | 2569 | 'default_sort_col' => 'time_applied', |
| 2570 | 2570 | 'get_items' => array( |
| 2571 | 2571 | 'function' => 'list_getGroupRequests', |
@@ -2641,7 +2641,7 @@ discard block |
||
| 2641 | 2641 | SELECT COUNT(*) AS req_count |
| 2642 | 2642 | FROM {db_prefix}log_group_requests AS lgr |
| 2643 | 2643 | WHERE id_member = {int:memID} |
| 2644 | - AND ' . ($user_info['mod_cache']['gq'] == '1=1' ? $user_info['mod_cache']['gq'] : 'lgr.' . $user_info['mod_cache']['gq']), |
|
| 2644 | + AND ' . ($user_info['mod_cache']['gq'] == '1=1' ? $user_info['mod_cache']['gq'] : 'lgr.'.$user_info['mod_cache']['gq']), |
|
| 2645 | 2645 | array( |
| 2646 | 2646 | 'memID' => $memID, |
| 2647 | 2647 | ) |
@@ -2675,7 +2675,7 @@ discard block |
||
| 2675 | 2675 | LEFT JOIN {db_prefix}members AS ma ON (lgr.id_member_acted = ma.id_member) |
| 2676 | 2676 | INNER JOIN {db_prefix}membergroups AS mg ON (lgr.id_group = mg.id_group) |
| 2677 | 2677 | WHERE lgr.id_member = {int:memID} |
| 2678 | - AND ' . ($user_info['mod_cache']['gq'] == '1=1' ? $user_info['mod_cache']['gq'] : 'lgr.' . $user_info['mod_cache']['gq']) . ' |
|
| 2678 | + AND ' . ($user_info['mod_cache']['gq'] == '1=1' ? $user_info['mod_cache']['gq'] : 'lgr.'.$user_info['mod_cache']['gq']).' |
|
| 2679 | 2679 | ORDER BY {raw:sort} |
| 2680 | 2680 | LIMIT {int:start}, {int:max}', |
| 2681 | 2681 | array( |
@@ -2688,7 +2688,7 @@ discard block |
||
| 2688 | 2688 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 2689 | 2689 | { |
| 2690 | 2690 | $this_req = array( |
| 2691 | - 'group_name' => empty($row['online_color']) ? $row['group_name'] : '<span style="color:' . $row['online_color'] . '">' . $row['group_name'] . '</span>', |
|
| 2691 | + 'group_name' => empty($row['online_color']) ? $row['group_name'] : '<span style="color:'.$row['online_color'].'">'.$row['group_name'].'</span>', |
|
| 2692 | 2692 | 'group_reason' => $row['reason'], |
| 2693 | 2693 | 'time_applied' => $row['time_applied'], |
| 2694 | 2694 | ); |
@@ -2698,11 +2698,11 @@ discard block |
||
| 2698 | 2698 | $this_req['outcome'] = $txt['outcome_pending']; |
| 2699 | 2699 | break; |
| 2700 | 2700 | case 1: |
| 2701 | - $member_link = empty($row['id_member_acted']) ? $row['act_name'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member_acted'] . '">' . $row['act_name'] . '</a>'; |
|
| 2701 | + $member_link = empty($row['id_member_acted']) ? $row['act_name'] : '<a href="'.$scripturl.'?action=profile;u='.$row['id_member_acted'].'">'.$row['act_name'].'</a>'; |
|
| 2702 | 2702 | $this_req['outcome'] = sprintf($txt['outcome_approved'], $member_link, timeformat($row['time_acted'])); |
| 2703 | 2703 | break; |
| 2704 | 2704 | case 2: |
| 2705 | - $member_link = empty($row['id_member_acted']) ? $row['act_name'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member_acted'] . '">' . $row['act_name'] . '</a>'; |
|
| 2705 | + $member_link = empty($row['id_member_acted']) ? $row['act_name'] : '<a href="'.$scripturl.'?action=profile;u='.$row['id_member_acted'].'">'.$row['act_name'].'</a>'; |
|
| 2706 | 2706 | $this_req['outcome'] = sprintf(!empty($row['act_reason']) ? $txt['outcome_refused_reason'] : $txt['outcome_refused'], $member_link, timeformat($row['time_acted']), $row['act_reason']); |
| 2707 | 2707 | break; |
| 2708 | 2708 | } |
@@ -2732,7 +2732,7 @@ discard block |
||
| 2732 | 2732 | loadTemplate('ManageMembers'); |
| 2733 | 2733 | |
| 2734 | 2734 | // Load all the permission profiles. |
| 2735 | - require_once($sourcedir . '/ManagePermissions.php'); |
|
| 2735 | + require_once($sourcedir.'/ManagePermissions.php'); |
|
| 2736 | 2736 | loadPermissionProfiles(); |
| 2737 | 2737 | |
| 2738 | 2738 | $context['member']['id'] = $memID; |
@@ -2783,7 +2783,7 @@ discard block |
||
| 2783 | 2783 | } |
| 2784 | 2784 | $smcFunc['db_free_result']($request); |
| 2785 | 2785 | |
| 2786 | - require_once($sourcedir . '/Subs-Boards.php'); |
|
| 2786 | + require_once($sourcedir.'/Subs-Boards.php'); |
|
| 2787 | 2787 | sortBoards($context['boards']); |
| 2788 | 2788 | |
| 2789 | 2789 | if (!empty($context['no_access_boards'])) |
@@ -2816,17 +2816,17 @@ discard block |
||
| 2816 | 2816 | while ($row = $smcFunc['db_fetch_assoc']($result)) |
| 2817 | 2817 | { |
| 2818 | 2818 | // We don't know about this permission, it doesn't exist :P. |
| 2819 | - if (!isset($txt['permissionname_' . $row['permission']])) |
|
| 2819 | + if (!isset($txt['permissionname_'.$row['permission']])) |
|
| 2820 | 2820 | continue; |
| 2821 | 2821 | |
| 2822 | 2822 | if (empty($row['add_deny'])) |
| 2823 | 2823 | $denied[] = $row['permission']; |
| 2824 | 2824 | |
| 2825 | 2825 | // Permissions that end with _own or _any consist of two parts. |
| 2826 | - if (in_array(substr($row['permission'], -4), array('_own', '_any')) && isset($txt['permissionname_' . substr($row['permission'], 0, -4)])) |
|
| 2827 | - $name = $txt['permissionname_' . substr($row['permission'], 0, -4)] . ' - ' . $txt['permissionname_' . $row['permission']]; |
|
| 2826 | + if (in_array(substr($row['permission'], -4), array('_own', '_any')) && isset($txt['permissionname_'.substr($row['permission'], 0, -4)])) |
|
| 2827 | + $name = $txt['permissionname_'.substr($row['permission'], 0, -4)].' - '.$txt['permissionname_'.$row['permission']]; |
|
| 2828 | 2828 | else |
| 2829 | - $name = $txt['permissionname_' . $row['permission']]; |
|
| 2829 | + $name = $txt['permissionname_'.$row['permission']]; |
|
| 2830 | 2830 | |
| 2831 | 2831 | // Add this permission if it doesn't exist yet. |
| 2832 | 2832 | if (!isset($context['member']['permissions']['general'][$row['permission']])) |
@@ -2852,11 +2852,11 @@ discard block |
||
| 2852 | 2852 | $request = $smcFunc['db_query']('', ' |
| 2853 | 2853 | SELECT |
| 2854 | 2854 | bp.add_deny, bp.permission, bp.id_group, mg.group_name' . (empty($board) ? '' : ', |
| 2855 | - b.id_profile, CASE WHEN (mods.id_member IS NULL AND modgs.id_group IS NULL) THEN 0 ELSE 1 END AS is_moderator') . ' |
|
| 2855 | + b.id_profile, CASE WHEN (mods.id_member IS NULL AND modgs.id_group IS NULL) THEN 0 ELSE 1 END AS is_moderator').' |
|
| 2856 | 2856 | FROM {db_prefix}board_permissions AS bp' . (empty($board) ? '' : ' |
| 2857 | 2857 | INNER JOIN {db_prefix}boards AS b ON (b.id_board = {int:current_board}) |
| 2858 | 2858 | LEFT JOIN {db_prefix}moderators AS mods ON (mods.id_board = b.id_board AND mods.id_member = {int:current_member}) |
| 2859 | - LEFT JOIN {db_prefix}moderator_groups AS modgs ON (modgs.id_board = b.id_board AND modgs.id_group IN ({array_int:group_list}))') . ' |
|
| 2859 | + LEFT JOIN {db_prefix}moderator_groups AS modgs ON (modgs.id_board = b.id_board AND modgs.id_group IN ({array_int:group_list}))').' |
|
| 2860 | 2860 | LEFT JOIN {db_prefix}membergroups AS mg ON (mg.id_group = bp.id_group) |
| 2861 | 2861 | WHERE bp.id_profile = {raw:current_profile} |
| 2862 | 2862 | AND bp.id_group IN ({array_int:group_list}' . (empty($board) ? ')' : ', {int:moderator_group}) |
@@ -2873,14 +2873,14 @@ discard block |
||
| 2873 | 2873 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 2874 | 2874 | { |
| 2875 | 2875 | // We don't know about this permission, it doesn't exist :P. |
| 2876 | - if (!isset($txt['permissionname_' . $row['permission']])) |
|
| 2876 | + if (!isset($txt['permissionname_'.$row['permission']])) |
|
| 2877 | 2877 | continue; |
| 2878 | 2878 | |
| 2879 | 2879 | // The name of the permission using the format 'permission name' - 'own/any topic/event/etc.'. |
| 2880 | - if (in_array(substr($row['permission'], -4), array('_own', '_any')) && isset($txt['permissionname_' . substr($row['permission'], 0, -4)])) |
|
| 2881 | - $name = $txt['permissionname_' . substr($row['permission'], 0, -4)] . ' - ' . $txt['permissionname_' . $row['permission']]; |
|
| 2880 | + if (in_array(substr($row['permission'], -4), array('_own', '_any')) && isset($txt['permissionname_'.substr($row['permission'], 0, -4)])) |
|
| 2881 | + $name = $txt['permissionname_'.substr($row['permission'], 0, -4)].' - '.$txt['permissionname_'.$row['permission']]; |
|
| 2882 | 2882 | else |
| 2883 | - $name = $txt['permissionname_' . $row['permission']]; |
|
| 2883 | + $name = $txt['permissionname_'.$row['permission']]; |
|
| 2884 | 2884 | |
| 2885 | 2885 | // Create the structure for this permission. |
| 2886 | 2886 | if (!isset($context['member']['permissions']['board'][$row['permission']])) |
@@ -2921,15 +2921,15 @@ discard block |
||
| 2921 | 2921 | $modSettings['warning_mute'] = !empty($modSettings['warning_mute']) ? $modSettings['warning_mute'] : 110; |
| 2922 | 2922 | |
| 2923 | 2923 | // Let's use a generic list to get all the current warnings, and use the issue warnings grab-a-granny thing. |
| 2924 | - require_once($sourcedir . '/Subs-List.php'); |
|
| 2925 | - require_once($sourcedir . '/Profile-Actions.php'); |
|
| 2924 | + require_once($sourcedir.'/Subs-List.php'); |
|
| 2925 | + require_once($sourcedir.'/Profile-Actions.php'); |
|
| 2926 | 2926 | |
| 2927 | 2927 | $listOptions = array( |
| 2928 | 2928 | 'id' => 'view_warnings', |
| 2929 | 2929 | 'title' => $txt['profile_viewwarning_previous_warnings'], |
| 2930 | 2930 | 'items_per_page' => $modSettings['defaultMaxListItems'], |
| 2931 | 2931 | 'no_items_label' => $txt['profile_viewwarning_no_warnings'], |
| 2932 | - 'base_href' => $scripturl . '?action=profile;area=viewwarning;sa=user;u=' . $memID, |
|
| 2932 | + 'base_href' => $scripturl.'?action=profile;area=viewwarning;sa=user;u='.$memID, |
|
| 2933 | 2933 | 'default_sort_col' => 'log_time', |
| 2934 | 2934 | 'get_items' => array( |
| 2935 | 2935 | 'function' => 'list_getUserWarnings', |
@@ -2989,7 +2989,7 @@ discard block |
||
| 2989 | 2989 | ); |
| 2990 | 2990 | |
| 2991 | 2991 | // Create the list for viewing. |
| 2992 | - require_once($sourcedir . '/Subs-List.php'); |
|
| 2992 | + require_once($sourcedir.'/Subs-List.php'); |
|
| 2993 | 2993 | createList($listOptions); |
| 2994 | 2994 | |
| 2995 | 2995 | // Create some common text bits for the template. |
@@ -1491,7 +1491,7 @@ |
||
| 1491 | 1491 | |
| 1492 | 1492 | /** |
| 1493 | 1493 | * Try to determine if the topic has already been deleted by another user. |
| 1494 | - * @return bool False if it can't be deleted (recycling not enabled or no recycling board set), true if we've confirmed it can be deleted. Dies with an error if it's already been deleted. |
|
| 1494 | + * @return boolean|null False if it can't be deleted (recycling not enabled or no recycling board set), true if we've confirmed it can be deleted. Dies with an error if it's already been deleted. |
|
| 1495 | 1495 | */ |
| 1496 | 1496 | function removeDeleteConcurrence() |
| 1497 | 1497 | { |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | checkSession('get'); |
| 35 | 35 | |
| 36 | 36 | // This file needs to be included for sendNotifications(). |
| 37 | - require_once($sourcedir . '/Subs-Post.php'); |
|
| 37 | + require_once($sourcedir.'/Subs-Post.php'); |
|
| 38 | 38 | |
| 39 | 39 | // Trying to fool us around, are we? |
| 40 | 40 | if (empty($topic)) |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | if (allowedTo('remove_any') || (allowedTo('remove_own') && $starter == $user_info['id'])) |
| 81 | 81 | logAction('remove', array((empty($modSettings['recycle_enable']) || $modSettings['recycle_board'] != $board ? 'topic' : 'old_topic_id') => $topic, 'subject' => $subject, 'member' => $starter, 'board' => $board)); |
| 82 | 82 | |
| 83 | - redirectexit('board=' . $board . '.0'); |
|
| 83 | + redirectexit('board='.$board.'.0'); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | /** |
@@ -148,11 +148,11 @@ discard block |
||
| 148 | 148 | elseif (isset($_REQUEST['recent'])) |
| 149 | 149 | redirectexit('action=recent'); |
| 150 | 150 | elseif (isset($_REQUEST['profile'], $_REQUEST['start'], $_REQUEST['u'])) |
| 151 | - redirectexit('action=profile;u=' . $_REQUEST['u'] . ';area=showposts;start=' . $_REQUEST['start']); |
|
| 151 | + redirectexit('action=profile;u='.$_REQUEST['u'].';area=showposts;start='.$_REQUEST['start']); |
|
| 152 | 152 | elseif ($full_topic) |
| 153 | - redirectexit('board=' . $board . '.0'); |
|
| 153 | + redirectexit('board='.$board.'.0'); |
|
| 154 | 154 | else |
| 155 | - redirectexit('topic=' . $topic . '.' . $_REQUEST['start']); |
|
| 155 | + redirectexit('topic='.$topic.'.'.$_REQUEST['start']); |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | /** |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | FROM {db_prefix}topics AS t |
| 218 | 218 | INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_last_msg) |
| 219 | 219 | WHERE |
| 220 | - m.poster_time < {int:poster_time}' . $condition . ' |
|
| 220 | + m.poster_time < {int:poster_time}' . $condition.' |
|
| 221 | 221 | AND t.id_board IN ({array_int:boards})', |
| 222 | 222 | $condition_params |
| 223 | 223 | ); |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | FROM {db_prefix}messages AS m |
| 264 | 264 | INNER JOIN {db_prefix}boards AS b ON (b.id_board = m.id_board) |
| 265 | 265 | WHERE m.id_topic IN ({array_int:topics})' . (!empty($recycle_board) ? ' |
| 266 | - AND m.id_board != {int:recycled_board}' : '') . ' |
|
| 266 | + AND m.id_board != {int:recycled_board}' : '').' |
|
| 267 | 267 | AND b.count_posts = {int:do_count_posts} |
| 268 | 268 | AND m.approved = {int:is_approved} |
| 269 | 269 | GROUP BY m.id_member', |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | if ($smcFunc['db_num_rows']($requestMembers) > 0) |
| 278 | 278 | { |
| 279 | 279 | while ($rowMembers = $smcFunc['db_fetch_assoc']($requestMembers)) |
| 280 | - updateMemberData($rowMembers['id_member'], array('posts' => 'posts - ' . $rowMembers['posts'])); |
|
| 280 | + updateMemberData($rowMembers['id_member'], array('posts' => 'posts - '.$rowMembers['posts'])); |
|
| 281 | 281 | } |
| 282 | 282 | $smcFunc['db_free_result']($requestMembers); |
| 283 | 283 | } |
@@ -323,11 +323,11 @@ discard block |
||
| 323 | 323 | $smcFunc['db_free_result']($request); |
| 324 | 324 | |
| 325 | 325 | // Move the topics to the recycle board. |
| 326 | - require_once($sourcedir . '/MoveTopic.php'); |
|
| 326 | + require_once($sourcedir.'/MoveTopic.php'); |
|
| 327 | 327 | moveTopics($recycleTopics, $modSettings['recycle_board']); |
| 328 | 328 | |
| 329 | 329 | // Close reports that are being recycled. |
| 330 | - require_once($sourcedir . '/ModerationCenter.php'); |
|
| 330 | + require_once($sourcedir.'/ModerationCenter.php'); |
|
| 331 | 331 | |
| 332 | 332 | $smcFunc['db_query']('', ' |
| 333 | 333 | UPDATE {db_prefix}log_reported |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | |
| 342 | 342 | updateSettings(array('last_mod_report_action' => time())); |
| 343 | 343 | |
| 344 | - require_once($sourcedir . '/Subs-ReportedContent.php'); |
|
| 344 | + require_once($sourcedir.'/Subs-ReportedContent.php'); |
|
| 345 | 345 | recountOpenReports('posts'); |
| 346 | 346 | |
| 347 | 347 | // Topics that were recycled don't need to be deleted, so subtract them. |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | return; |
| 357 | 357 | |
| 358 | 358 | // Callback for search APIs to do their thing |
| 359 | - require_once($sourcedir . '/Search.php'); |
|
| 359 | + require_once($sourcedir.'/Search.php'); |
|
| 360 | 360 | $searchAPI = findSearchAPI(); |
| 361 | 361 | if ($searchAPI->supportsMethod('topicsRemoved')) |
| 362 | 362 | $searchAPI->topicsRemoved($topics); |
@@ -468,7 +468,7 @@ discard block |
||
| 468 | 468 | } |
| 469 | 469 | |
| 470 | 470 | // Get rid of the attachment, if it exists. |
| 471 | - require_once($sourcedir . '/ManageAttachments.php'); |
|
| 471 | + require_once($sourcedir.'/ManageAttachments.php'); |
|
| 472 | 472 | $attachmentQuery = array( |
| 473 | 473 | 'attachment_type' => 0, |
| 474 | 474 | 'id_topic' => $topics, |
@@ -567,7 +567,7 @@ discard block |
||
| 567 | 567 | 'calendar_updated' => time(), |
| 568 | 568 | )); |
| 569 | 569 | |
| 570 | - require_once($sourcedir . '/Subs-Post.php'); |
|
| 570 | + require_once($sourcedir.'/Subs-Post.php'); |
|
| 571 | 571 | $updates = array(); |
| 572 | 572 | foreach ($adjustBoards as $stats) |
| 573 | 573 | $updates[] = $stats['id_board']; |
@@ -594,7 +594,7 @@ discard block |
||
| 594 | 594 | |
| 595 | 595 | $request = $smcFunc['db_query']('', ' |
| 596 | 596 | SELECT |
| 597 | - m.id_member, m.icon, m.poster_time, m.subject,' . (empty($modSettings['search_custom_index_config']) ? '' : ' m.body,') . ' |
|
| 597 | + m.id_member, m.icon, m.poster_time, m.subject,' . (empty($modSettings['search_custom_index_config']) ? '' : ' m.body,').' |
|
| 598 | 598 | m.approved, t.id_topic, t.id_first_msg, t.id_last_msg, t.num_replies, t.id_board, |
| 599 | 599 | t.id_member_started AS id_member_poster, |
| 600 | 600 | b.count_posts |
@@ -727,7 +727,7 @@ discard block |
||
| 727 | 727 | FROM {db_prefix}messages |
| 728 | 728 | WHERE id_topic = {int:id_topic} |
| 729 | 729 | AND id_msg != {int:id_msg} |
| 730 | - ORDER BY ' . ($modSettings['postmod_active'] ? 'approved DESC, ' : '') . 'id_msg DESC |
|
| 730 | + ORDER BY ' . ($modSettings['postmod_active'] ? 'approved DESC, ' : '').'id_msg DESC |
|
| 731 | 731 | LIMIT 1', |
| 732 | 732 | array( |
| 733 | 733 | 'id_topic' => $row['id_topic'], |
@@ -743,7 +743,7 @@ discard block |
||
| 743 | 743 | id_last_msg = {int:id_last_msg}, |
| 744 | 744 | id_member_updated = {int:id_member_updated}' . (!$modSettings['postmod_active'] || $row['approved'] ? ', |
| 745 | 745 | num_replies = CASE WHEN num_replies = {int:no_replies} THEN 0 ELSE num_replies - 1 END' : ', |
| 746 | - unapproved_posts = CASE WHEN unapproved_posts = {int:no_unapproved} THEN 0 ELSE unapproved_posts - 1 END') . ' |
|
| 746 | + unapproved_posts = CASE WHEN unapproved_posts = {int:no_unapproved} THEN 0 ELSE unapproved_posts - 1 END').' |
|
| 747 | 747 | WHERE id_topic = {int:id_topic}', |
| 748 | 748 | array( |
| 749 | 749 | 'id_last_msg' => $row2['id_msg'], |
@@ -760,7 +760,7 @@ discard block |
||
| 760 | 760 | UPDATE {db_prefix}topics |
| 761 | 761 | SET ' . ($row['approved'] ? ' |
| 762 | 762 | num_replies = CASE WHEN num_replies = {int:no_replies} THEN 0 ELSE num_replies - 1 END' : ' |
| 763 | - unapproved_posts = CASE WHEN unapproved_posts = {int:no_unapproved} THEN 0 ELSE unapproved_posts - 1 END') . ' |
|
| 763 | + unapproved_posts = CASE WHEN unapproved_posts = {int:no_unapproved} THEN 0 ELSE unapproved_posts - 1 END').' |
|
| 764 | 764 | WHERE id_topic = {int:id_topic}', |
| 765 | 765 | array( |
| 766 | 766 | 'no_replies' => 0, |
@@ -881,7 +881,7 @@ discard block |
||
| 881 | 881 | SET |
| 882 | 882 | num_topics = num_topics + {int:num_topics_inc}, |
| 883 | 883 | num_posts = num_posts + 1' . |
| 884 | - ($message > $last_board_msg ? ', id_last_msg = {int:id_merged_msg}' : '') . ' |
|
| 884 | + ($message > $last_board_msg ? ', id_last_msg = {int:id_merged_msg}' : '').' |
|
| 885 | 885 | WHERE id_board = {int:recycle_board}', |
| 886 | 886 | array( |
| 887 | 887 | 'num_topics_inc' => empty($id_recycle_topic) ? 1 : 0, |
@@ -895,8 +895,8 @@ discard block |
||
| 895 | 895 | $smcFunc['db_query']('', ' |
| 896 | 896 | UPDATE {db_prefix}topics |
| 897 | 897 | SET num_replies = num_replies + 1' . |
| 898 | - ($message > $last_topic_msg ? ', id_last_msg = {int:id_merged_msg}' : '') . |
|
| 899 | - ($message < $first_topic_msg ? ', id_first_msg = {int:id_merged_msg}' : '') . ' |
|
| 898 | + ($message > $last_topic_msg ? ', id_last_msg = {int:id_merged_msg}' : ''). |
|
| 899 | + ($message < $first_topic_msg ? ', id_first_msg = {int:id_merged_msg}' : '').' |
|
| 900 | 900 | WHERE id_topic = {int:id_recycle_topic}', |
| 901 | 901 | array( |
| 902 | 902 | 'id_recycle_topic' => $id_recycle_topic, |
@@ -928,7 +928,7 @@ discard block |
||
| 928 | 928 | UPDATE {db_prefix}boards |
| 929 | 929 | SET ' . ($row['approved'] ? ' |
| 930 | 930 | num_posts = CASE WHEN num_posts = {int:no_posts} THEN 0 ELSE num_posts - 1 END' : ' |
| 931 | - unapproved_posts = CASE WHEN unapproved_posts = {int:no_unapproved} THEN 0 ELSE unapproved_posts - 1 END') . ' |
|
| 931 | + unapproved_posts = CASE WHEN unapproved_posts = {int:no_unapproved} THEN 0 ELSE unapproved_posts - 1 END').' |
|
| 932 | 932 | WHERE id_board = {int:id_board}', |
| 933 | 933 | array( |
| 934 | 934 | 'no_posts' => 0, |
@@ -946,7 +946,7 @@ discard block |
||
| 946 | 946 | if (!$recycle) |
| 947 | 947 | { |
| 948 | 948 | // Callback for search APIs to do their thing |
| 949 | - require_once($sourcedir . '/Search.php'); |
|
| 949 | + require_once($sourcedir.'/Search.php'); |
|
| 950 | 950 | $searchAPI = findSearchAPI(); |
| 951 | 951 | if ($searchAPI->supportsMethod('postRemoved')) |
| 952 | 952 | $searchAPI->postRemoved($message); |
@@ -977,7 +977,7 @@ discard block |
||
| 977 | 977 | } |
| 978 | 978 | |
| 979 | 979 | // Delete attachment(s) if they exist. |
| 980 | - require_once($sourcedir . '/ManageAttachments.php'); |
|
| 980 | + require_once($sourcedir.'/ManageAttachments.php'); |
|
| 981 | 981 | $attachmentQuery = array( |
| 982 | 982 | 'attachment_type' => 0, |
| 983 | 983 | 'id_msg' => $message, |
@@ -996,7 +996,7 @@ discard block |
||
| 996 | 996 | )); |
| 997 | 997 | |
| 998 | 998 | // And now to update the last message of each board we messed with. |
| 999 | - require_once($sourcedir . '/Subs-Post.php'); |
|
| 999 | + require_once($sourcedir.'/Subs-Post.php'); |
|
| 1000 | 1000 | if ($recycle) |
| 1001 | 1001 | updateLastMessages(array($row['id_board'], $modSettings['recycle_board'])); |
| 1002 | 1002 | else |
@@ -1014,7 +1014,7 @@ discard block |
||
| 1014 | 1014 | ); |
| 1015 | 1015 | if ($smcFunc['db_affected_rows']() != 0) |
| 1016 | 1016 | { |
| 1017 | - require_once($sourcedir . '/ModerationCenter.php'); |
|
| 1017 | + require_once($sourcedir.'/ModerationCenter.php'); |
|
| 1018 | 1018 | updateSettings(array('last_mod_report_action' => time())); |
| 1019 | 1019 | recountOpenReports('posts'); |
| 1020 | 1020 | } |
@@ -1040,7 +1040,7 @@ discard block |
||
| 1040 | 1040 | isAllowedTo('move_any', $modSettings['recycle_board']); |
| 1041 | 1041 | |
| 1042 | 1042 | // We need this file. |
| 1043 | - require_once($sourcedir . '/MoveTopic.php'); |
|
| 1043 | + require_once($sourcedir.'/MoveTopic.php'); |
|
| 1044 | 1044 | |
| 1045 | 1045 | $unfound_messages = array(); |
| 1046 | 1046 | $topics_to_restore = array(); |
@@ -1215,7 +1215,7 @@ discard block |
||
| 1215 | 1215 | ); |
| 1216 | 1216 | |
| 1217 | 1217 | while ($member = $smcFunc['db_fetch_assoc']($request2)) |
| 1218 | - updateMemberData($member['id_member'], array('posts' => 'posts + ' . $member['post_count'])); |
|
| 1218 | + updateMemberData($member['id_member'], array('posts' => 'posts + '.$member['post_count'])); |
|
| 1219 | 1219 | $smcFunc['db_free_result']($request2); |
| 1220 | 1220 | } |
| 1221 | 1221 | |
@@ -1459,7 +1459,7 @@ discard block |
||
| 1459 | 1459 | ); |
| 1460 | 1460 | |
| 1461 | 1461 | // Need it to update some stats. |
| 1462 | - require_once($sourcedir . '/Subs-Post.php'); |
|
| 1462 | + require_once($sourcedir.'/Subs-Post.php'); |
|
| 1463 | 1463 | |
| 1464 | 1464 | // Update stats. |
| 1465 | 1465 | updateStats('topic'); |
@@ -1512,9 +1512,9 @@ discard block |
||
| 1512 | 1512 | if ($modSettings['recycle_board'] != $board) |
| 1513 | 1513 | return true; |
| 1514 | 1514 | elseif (isset($_REQUEST['msg'])) |
| 1515 | - $confirm_url = $scripturl . '?action=deletemsg;confirm_delete;topic=' . $context['current_topic'] . '.0;msg=' . $_REQUEST['msg'] . ';' . $context['session_var'] . '=' . $context['session_id']; |
|
| 1515 | + $confirm_url = $scripturl.'?action=deletemsg;confirm_delete;topic='.$context['current_topic'].'.0;msg='.$_REQUEST['msg'].';'.$context['session_var'].'='.$context['session_id']; |
|
| 1516 | 1516 | else |
| 1517 | - $confirm_url = $scripturl . '?action=removetopic2;confirm_delete;topic=' . $context['current_topic'] . '.0;' . $context['session_var'] . '=' . $context['session_id']; |
|
| 1517 | + $confirm_url = $scripturl.'?action=removetopic2;confirm_delete;topic='.$context['current_topic'].'.0;'.$context['session_var'].'='.$context['session_id']; |
|
| 1518 | 1518 | |
| 1519 | 1519 | fatal_lang_error('post_already_deleted', false, array($confirm_url)); |
| 1520 | 1520 | } |
@@ -1013,7 +1013,7 @@ |
||
| 1013 | 1013 | * @param string $title The title of the separator |
| 1014 | 1014 | * @param null|string $custom_table The ID of the custom table |
| 1015 | 1015 | * |
| 1016 | - * @return void|bool Returns false if there are no tables |
|
| 1016 | + * @return null|false Returns false if there are no tables |
|
| 1017 | 1017 | */ |
| 1018 | 1018 | function addSeparator($title = '', $custom_table = null) |
| 1019 | 1019 | { |
@@ -72,8 +72,8 @@ discard block |
||
| 72 | 72 | foreach ($context['report_types'] as $k => $temp) |
| 73 | 73 | $context['report_types'][$k] = array( |
| 74 | 74 | 'id' => $k, |
| 75 | - 'title' => isset($txt['gr_type_' . $k]) ? $txt['gr_type_' . $k] : $k, |
|
| 76 | - 'description' => isset($txt['gr_type_desc_' . $k]) ? $txt['gr_type_desc_' . $k] : null, |
|
| 75 | + 'title' => isset($txt['gr_type_'.$k]) ? $txt['gr_type_'.$k] : $k, |
|
| 76 | + 'description' => isset($txt['gr_type_desc_'.$k]) ? $txt['gr_type_desc_'.$k] : null, |
|
| 77 | 77 | 'function' => $temp, |
| 78 | 78 | 'is_first' => $is_first++ == 0, |
| 79 | 79 | ); |
@@ -107,12 +107,12 @@ discard block |
||
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | // Make the page title more descriptive. |
| 110 | - $context['page_title'] .= ' - ' . (isset($txt['gr_type_' . $context['report_type']]) ? $txt['gr_type_' . $context['report_type']] : $context['report_type']); |
|
| 110 | + $context['page_title'] .= ' - '.(isset($txt['gr_type_'.$context['report_type']]) ? $txt['gr_type_'.$context['report_type']] : $context['report_type']); |
|
| 111 | 111 | |
| 112 | 112 | // Build the reports button array. |
| 113 | 113 | $context['report_buttons'] = array( |
| 114 | - 'generate_reports' => array('text' => 'generate_reports', 'image' => 'print.png', 'url' => $scripturl . '?action=admin;area=reports', 'active' => true), |
|
| 115 | - 'print' => array('text' => 'print', 'image' => 'print.png', 'url' => $scripturl . '?action=admin;area=reports;rt=' . $context['report_type'] . ';st=print', 'custom' => 'target="_blank"'), |
|
| 114 | + 'generate_reports' => array('text' => 'generate_reports', 'image' => 'print.png', 'url' => $scripturl.'?action=admin;area=reports', 'active' => true), |
|
| 115 | + 'print' => array('text' => 'print', 'image' => 'print.png', 'url' => $scripturl.'?action=admin;area=reports;rt='.$context['report_type'].';st=print', 'custom' => 'target="_blank"'), |
|
| 116 | 116 | ); |
| 117 | 117 | |
| 118 | 118 | // Allow mods to add additional buttons here |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | global $context, $txt, $sourcedir, $smcFunc, $modSettings; |
| 139 | 139 | |
| 140 | 140 | // Load the permission profiles. |
| 141 | - require_once($sourcedir . '/ManagePermissions.php'); |
|
| 141 | + require_once($sourcedir.'/ManagePermissions.php'); |
|
| 142 | 142 | loadLanguage('ManagePermissions'); |
| 143 | 143 | loadPermissionProfiles(); |
| 144 | 144 | |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | ); |
| 178 | 178 | $groups = array(-1 => $txt['guest_title'], 0 => $txt['full_member']); |
| 179 | 179 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 180 | - $groups[$row['id_group']] = empty($row['online_color']) ? $row['group_name'] : '<span style="color: ' . $row['online_color'] . '">' . $row['group_name'] . '</span>'; |
|
| 180 | + $groups[$row['id_group']] = empty($row['online_color']) ? $row['group_name'] : '<span style="color: '.$row['online_color'].'">'.$row['group_name'].'</span>'; |
|
| 181 | 181 | $smcFunc['db_free_result']($request); |
| 182 | 182 | |
| 183 | 183 | // All the fields we'll show. |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | $request = $smcFunc['db_query']('', ' |
| 322 | 322 | SELECT id_board, name, id_profile |
| 323 | 323 | FROM {db_prefix}boards |
| 324 | - WHERE ' . $board_clause . ' |
|
| 324 | + WHERE ' . $board_clause.' |
|
| 325 | 325 | ORDER BY id_board', |
| 326 | 326 | array( |
| 327 | 327 | 'boards' => isset($_REQUEST['boards']) ? $_REQUEST['boards'] : array(), |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | $request = $smcFunc['db_query']('', ' |
| 345 | 345 | SELECT id_board, id_group |
| 346 | 346 | FROM {db_prefix}moderator_groups |
| 347 | - WHERE ' . $board_clause . ' AND ' . $group_clause, |
|
| 347 | + WHERE ' . $board_clause.' AND '.$group_clause, |
|
| 348 | 348 | array( |
| 349 | 349 | ) |
| 350 | 350 | ); |
@@ -358,9 +358,9 @@ discard block |
||
| 358 | 358 | $request = $smcFunc['db_query']('', ' |
| 359 | 359 | SELECT id_group, group_name |
| 360 | 360 | FROM {db_prefix}membergroups |
| 361 | - WHERE ' . $group_clause . ' |
|
| 361 | + WHERE ' . $group_clause.' |
|
| 362 | 362 | AND id_group != {int:admin_group}' . (empty($modSettings['permission_enable_postgroups']) ? ' |
| 363 | - AND min_posts = {int:min_posts}' : '') . ' |
|
| 363 | + AND min_posts = {int:min_posts}' : '').' |
|
| 364 | 364 | ORDER BY min_posts, CASE WHEN id_group < {int:newbie_group} THEN id_group ELSE 4 END, group_name', |
| 365 | 365 | array( |
| 366 | 366 | 'admin_group' => 1, |
@@ -400,8 +400,8 @@ discard block |
||
| 400 | 400 | SELECT id_profile, id_group, add_deny, permission |
| 401 | 401 | FROM {db_prefix}board_permissions |
| 402 | 402 | WHERE id_profile IN ({array_int:profile_list}) |
| 403 | - AND ' . $group_clause . (empty($modSettings['permission_enable_deny']) ? ' |
|
| 404 | - AND add_deny = {int:not_deny}' : '') . ' |
|
| 403 | + AND ' . $group_clause.(empty($modSettings['permission_enable_deny']) ? ' |
|
| 404 | + AND add_deny = {int:not_deny}' : '').' |
|
| 405 | 405 | ORDER BY id_profile, permission', |
| 406 | 406 | array( |
| 407 | 407 | 'profile_list' => $profiles, |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | { |
| 424 | 424 | // This will be reused on other boards. |
| 425 | 425 | $permissions[$row['permission']] = array( |
| 426 | - 'title' => isset($txt['board_perms_name_' . $row['permission']]) ? $txt['board_perms_name_' . $row['permission']] : $row['permission'], |
|
| 426 | + 'title' => isset($txt['board_perms_name_'.$row['permission']]) ? $txt['board_perms_name_'.$row['permission']] : $row['permission'], |
|
| 427 | 427 | ); |
| 428 | 428 | } |
| 429 | 429 | } |
@@ -475,15 +475,15 @@ discard block |
||
| 475 | 475 | |
| 476 | 476 | // Now actually make the data for the group look right. |
| 477 | 477 | if (empty($curData[$id_group])) |
| 478 | - $curData[$id_group] = '<span class="red">' . $txt['board_perms_deny'] . '</span>'; |
|
| 478 | + $curData[$id_group] = '<span class="red">'.$txt['board_perms_deny'].'</span>'; |
|
| 479 | 479 | elseif ($curData[$id_group] == 1) |
| 480 | - $curData[$id_group] = '<span style="color: darkgreen;">' . $txt['board_perms_allow'] . '</span>'; |
|
| 480 | + $curData[$id_group] = '<span style="color: darkgreen;">'.$txt['board_perms_allow'].'</span>'; |
|
| 481 | 481 | else |
| 482 | 482 | $curData[$id_group] = 'x'; |
| 483 | 483 | |
| 484 | 484 | // Embolden those permissions different from global (makes it a lot easier!) |
| 485 | 485 | if (@$board_permissions[0][$id_group][$ID_PERM] != @$group_permissions[$ID_PERM]) |
| 486 | - $curData[$id_group] = '<strong>' . $curData[$id_group] . '</strong>'; |
|
| 486 | + $curData[$id_group] = '<strong>'.$curData[$id_group].'</strong>'; |
|
| 487 | 487 | } |
| 488 | 488 | |
| 489 | 489 | // Now add the data for this permission. |
@@ -546,7 +546,7 @@ discard block |
||
| 546 | 546 | |
| 547 | 547 | // Add on the boards! |
| 548 | 548 | foreach ($boards as $board) |
| 549 | - $mgSettings['board_' . $board['id']] = $board['name']; |
|
| 549 | + $mgSettings['board_'.$board['id']] = $board['name']; |
|
| 550 | 550 | |
| 551 | 551 | // Add all the membergroup settings, plus we'll be adding in columns! |
| 552 | 552 | setKeys('cols', $mgSettings); |
@@ -601,15 +601,15 @@ discard block |
||
| 601 | 601 | |
| 602 | 602 | $group = array( |
| 603 | 603 | 'name' => $row['group_name'], |
| 604 | - 'color' => empty($row['online_color']) ? '-' : '<span style="color: ' . $row['online_color'] . ';">' . $row['online_color'] . '</span>', |
|
| 604 | + 'color' => empty($row['online_color']) ? '-' : '<span style="color: '.$row['online_color'].';">'.$row['online_color'].'</span>', |
|
| 605 | 605 | 'min_posts' => $row['min_posts'] == -1 ? 'N/A' : $row['min_posts'], |
| 606 | 606 | 'max_messages' => $row['max_messages'], |
| 607 | - 'icons' => !empty($row['icons'][0]) && !empty($row['icons'][1]) ? str_repeat('<img src="' . $settings['images_url'] . '/membericons/' . $row['icons'][1] . '" alt="*">', $row['icons'][0]) : '', |
|
| 607 | + 'icons' => !empty($row['icons'][0]) && !empty($row['icons'][1]) ? str_repeat('<img src="'.$settings['images_url'].'/membericons/'.$row['icons'][1].'" alt="*">', $row['icons'][0]) : '', |
|
| 608 | 608 | ); |
| 609 | 609 | |
| 610 | 610 | // Board permissions. |
| 611 | 611 | foreach ($boards as $board) |
| 612 | - $group['board_' . $board['id']] = in_array($row['id_group'], $board['groups']) ? '<span class="success">' . $txt['board_perms_allow'] . '</span>' : (!empty($modSettings['deny_boards_access']) && in_array($row['id_group'], $board['deny_groups']) ? '<span class="alert">' . $txt['board_perms_deny'] . '</span>' : 'x'); |
|
| 612 | + $group['board_'.$board['id']] = in_array($row['id_group'], $board['groups']) ? '<span class="success">'.$txt['board_perms_allow'].'</span>' : (!empty($modSettings['deny_boards_access']) && in_array($row['id_group'], $board['deny_groups']) ? '<span class="alert">'.$txt['board_perms_deny'].'</span>' : 'x'); |
|
| 613 | 613 | |
| 614 | 614 | addData($group); |
| 615 | 615 | } |
@@ -644,9 +644,9 @@ discard block |
||
| 644 | 644 | $request = $smcFunc['db_query']('', ' |
| 645 | 645 | SELECT id_group, group_name |
| 646 | 646 | FROM {db_prefix}membergroups |
| 647 | - WHERE ' . $clause . ' |
|
| 647 | + WHERE ' . $clause.' |
|
| 648 | 648 | AND id_group != {int:admin_group}' . (empty($modSettings['permission_enable_postgroups']) ? ' |
| 649 | - AND min_posts = {int:min_posts}' : '') . ' |
|
| 649 | + AND min_posts = {int:min_posts}' : '').' |
|
| 650 | 650 | ORDER BY min_posts, CASE WHEN id_group < {int:newbie_group} THEN id_group ELSE 4 END, group_name', |
| 651 | 651 | array( |
| 652 | 652 | 'admin_group' => 1, |
@@ -694,8 +694,8 @@ discard block |
||
| 694 | 694 | $request = $smcFunc['db_query']('', ' |
| 695 | 695 | SELECT id_group, add_deny, permission |
| 696 | 696 | FROM {db_prefix}permissions |
| 697 | - WHERE ' . $clause . (empty($modSettings['permission_enable_deny']) ? ' |
|
| 698 | - AND add_deny = {int:not_denied}' : '') . ' |
|
| 697 | + WHERE ' . $clause.(empty($modSettings['permission_enable_deny']) ? ' |
|
| 698 | + AND add_deny = {int:not_denied}' : '').' |
|
| 699 | 699 | ORDER BY permission', |
| 700 | 700 | array( |
| 701 | 701 | 'not_denied' => 1, |
@@ -718,16 +718,16 @@ discard block |
||
| 718 | 718 | addData($curData); |
| 719 | 719 | |
| 720 | 720 | // Add the permission name in the left column. |
| 721 | - $curData = array('col' => isset($txt['group_perms_name_' . $row['permission']]) ? $txt['group_perms_name_' . $row['permission']] : $row['permission']); |
|
| 721 | + $curData = array('col' => isset($txt['group_perms_name_'.$row['permission']]) ? $txt['group_perms_name_'.$row['permission']] : $row['permission']); |
|
| 722 | 722 | |
| 723 | 723 | $lastPermission = $row['permission']; |
| 724 | 724 | } |
| 725 | 725 | |
| 726 | 726 | // Good stuff - add the permission to the list! |
| 727 | 727 | if ($row['add_deny']) |
| 728 | - $curData[$row['id_group']] = '<span style="color: darkgreen;">' . $txt['board_perms_allow'] . '</span>'; |
|
| 728 | + $curData[$row['id_group']] = '<span style="color: darkgreen;">'.$txt['board_perms_allow'].'</span>'; |
|
| 729 | 729 | else |
| 730 | - $curData[$row['id_group']] = '<span class="red">' . $txt['board_perms_deny'] . '</span>'; |
|
| 730 | + $curData[$row['id_group']] = '<span class="red">'.$txt['board_perms_deny'].'</span>'; |
|
| 731 | 731 | } |
| 732 | 732 | $smcFunc['db_free_result']($request); |
| 733 | 733 | |
@@ -747,7 +747,7 @@ discard block |
||
| 747 | 747 | { |
| 748 | 748 | global $sourcedir, $txt, $smcFunc; |
| 749 | 749 | |
| 750 | - require_once($sourcedir . '/Subs-Members.php'); |
|
| 750 | + require_once($sourcedir.'/Subs-Members.php'); |
|
| 751 | 751 | |
| 752 | 752 | // Fetch all the board names. |
| 753 | 753 | $request = $smcFunc['db_query']('', ' |
@@ -820,7 +820,7 @@ discard block |
||
| 820 | 820 | ); |
| 821 | 821 | $groups = array(0 => $txt['full_member']); |
| 822 | 822 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 823 | - $groups[$row['id_group']] = empty($row['online_color']) ? $row['group_name'] : '<span style="color: ' . $row['online_color'] . '">' . $row['group_name'] . '</span>'; |
|
| 823 | + $groups[$row['id_group']] = empty($row['online_color']) ? $row['group_name'] : '<span style="color: '.$row['online_color'].'">'.$row['group_name'].'</span>'; |
|
| 824 | 824 | $smcFunc['db_free_result']($request); |
| 825 | 825 | |
| 826 | 826 | // All the fields we'll show. |
@@ -862,7 +862,7 @@ discard block |
||
| 862 | 862 | |
| 863 | 863 | // What do they moderate? |
| 864 | 864 | if (in_array($row['id_member'], $global_mods)) |
| 865 | - $staffData['moderates'] = '<em>' . $txt['report_staff_all_boards'] . '</em>'; |
|
| 865 | + $staffData['moderates'] = '<em>'.$txt['report_staff_all_boards'].'</em>'; |
|
| 866 | 866 | elseif (isset($moderators[$row['id_member']])) |
| 867 | 867 | { |
| 868 | 868 | // Get the names |
@@ -873,7 +873,7 @@ discard block |
||
| 873 | 873 | $staffData['moderates'] = implode(', ', $staffData['moderates']); |
| 874 | 874 | } |
| 875 | 875 | else |
| 876 | - $staffData['moderates'] = '<em>' . $txt['report_staff_no_boards'] . '</em>'; |
|
| 876 | + $staffData['moderates'] = '<em>'.$txt['report_staff_no_boards'].'</em>'; |
|
| 877 | 877 | |
| 878 | 878 | // Next add the main data. |
| 879 | 879 | addData($staffData); |
@@ -807,7 +807,7 @@ |
||
| 807 | 807 | /** |
| 808 | 808 | * Send a group of emails from the mail queue. |
| 809 | 809 | * |
| 810 | - * @param bool|int $number The number to send each loop through or false to use the standard limits |
|
| 810 | + * @param integer $number The number to send each loop through or false to use the standard limits |
|
| 811 | 811 | * @param bool $override_limit Whether to bypass the limit |
| 812 | 812 | * @param bool $force_send Whether to forcibly send the messages now (useful when using cron jobs) |
| 813 | 813 | * @return bool Whether things were sent |
@@ -85,8 +85,8 @@ discard block |
||
| 85 | 85 | $task_string = $row['callable']; |
| 86 | 86 | |
| 87 | 87 | // Default SMF task or old mods? |
| 88 | - elseif (function_exists('scheduled_' . $row['task'])) |
|
| 89 | - $task_string = 'scheduled_' . $row['task']; |
|
| 88 | + elseif (function_exists('scheduled_'.$row['task'])) |
|
| 89 | + $task_string = 'scheduled_'.$row['task']; |
|
| 90 | 90 | |
| 91 | 91 | // One last resource, the task name. |
| 92 | 92 | elseif (!empty($row['task'])) |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | |
| 154 | 154 | // Finally, send some stuff... |
| 155 | 155 | header('expires: Mon, 26 Jul 1997 05:00:00 GMT'); |
| 156 | - header('last-modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); |
|
| 156 | + header('last-modified: '.gmdate('D, d M Y H:i:s').' GMT'); |
|
| 157 | 157 | header('content-type: image/gif'); |
| 158 | 158 | die("\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x21\xF9\x04\x01\x00\x00\x00\x00\x2C\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02\x44\x01\x00\x3B"); |
| 159 | 159 | } |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | // Add it to the array otherwise. |
| 196 | 196 | $notices[$row['id_board']][$type][] = array( |
| 197 | 197 | 'subject' => $row['subject'], |
| 198 | - 'href' => $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . '#msg' . $row['id_msg'], |
|
| 198 | + 'href' => $scripturl.'?topic='.$row['id_topic'].'.msg'.$row['id_msg'].'#msg'.$row['id_msg'], |
|
| 199 | 199 | ); |
| 200 | 200 | |
| 201 | 201 | // Store the profile for a bit later. |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | FROM {db_prefix}members |
| 269 | 269 | WHERE id_group IN ({array_int:additional_group_list}) |
| 270 | 270 | OR FIND_IN_SET({raw:additional_group_list_implode}, additional_groups) != 0' . (empty($members) ? '' : ' |
| 271 | - OR id_member IN ({array_int:member_list})') . ' |
|
| 271 | + OR id_member IN ({array_int:member_list})').' |
|
| 272 | 272 | ORDER BY lngfile', |
| 273 | 273 | array( |
| 274 | 274 | 'additional_group_list' => $addGroups, |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | $smcFunc['db_free_result']($request); |
| 299 | 299 | |
| 300 | 300 | // Get the mailing stuff. |
| 301 | - require_once($sourcedir . '/Subs-Post.php'); |
|
| 301 | + require_once($sourcedir.'/Subs-Post.php'); |
|
| 302 | 302 | // Need the below for loadLanguage to work! |
| 303 | 303 | loadEssentialThemeData(); |
| 304 | 304 | |
@@ -345,11 +345,11 @@ discard block |
||
| 345 | 345 | foreach ($notice as $type => $items) |
| 346 | 346 | { |
| 347 | 347 | // Build up the top of this section. |
| 348 | - $emailbody .= $txt['scheduled_approval_email_' . $type] . "\n" . |
|
| 349 | - '------------------------------------------------------' . "\n"; |
|
| 348 | + $emailbody .= $txt['scheduled_approval_email_'.$type]."\n". |
|
| 349 | + '------------------------------------------------------'."\n"; |
|
| 350 | 350 | |
| 351 | 351 | foreach ($items as $item) |
| 352 | - $emailbody .= $item['subject'] . ' - ' . $item['href'] . "\n"; |
|
| 352 | + $emailbody .= $item['subject'].' - '.$item['href']."\n"; |
|
| 353 | 353 | |
| 354 | 354 | $emailbody .= "\n"; |
| 355 | 355 | } |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | clean_cache(); |
| 385 | 385 | |
| 386 | 386 | // If warning decrement is enabled and we have people who have not had a new warning in 24 hours, lower their warning level. |
| 387 | - list (, , $modSettings['warning_decrement']) = explode(',', $modSettings['warning_settings']); |
|
| 387 | + list (,, $modSettings['warning_decrement']) = explode(',', $modSettings['warning_settings']); |
|
| 388 | 388 | if ($modSettings['warning_decrement']) |
| 389 | 389 | { |
| 390 | 390 | // Find every member who has a warning level... |
@@ -446,7 +446,7 @@ discard block |
||
| 446 | 446 | // Do any spider stuff. |
| 447 | 447 | if (!empty($modSettings['spider_mode']) && $modSettings['spider_mode'] > 1) |
| 448 | 448 | { |
| 449 | - require_once($sourcedir . '/ManageSearchEngines.php'); |
|
| 449 | + require_once($sourcedir.'/ManageSearchEngines.php'); |
|
| 450 | 450 | consolidateSpiderStats(); |
| 451 | 451 | } |
| 452 | 452 | |
@@ -464,7 +464,7 @@ discard block |
||
| 464 | 464 | global $proxyhousekeeping; |
| 465 | 465 | $proxyhousekeeping = true; |
| 466 | 466 | |
| 467 | - require_once($boarddir . '/proxy.php'); |
|
| 467 | + require_once($boarddir.'/proxy.php'); |
|
| 468 | 468 | $proxy = new ProxyServer(); |
| 469 | 469 | $proxy->housekeeping(); |
| 470 | 470 | |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | global $is_weekly, $txt, $mbname, $scripturl, $sourcedir, $smcFunc, $context, $modSettings; |
| 484 | 484 | |
| 485 | 485 | // We'll want this... |
| 486 | - require_once($sourcedir . '/Subs-Post.php'); |
|
| 486 | + require_once($sourcedir.'/Subs-Post.php'); |
|
| 487 | 487 | loadEssentialThemeData(); |
| 488 | 488 | |
| 489 | 489 | $is_weekly = !empty($is_weekly) ? 1 : 0; |
@@ -619,9 +619,9 @@ discard block |
||
| 619 | 619 | loadLanguage('index', $lang); |
| 620 | 620 | loadLanguage('EmailTemplates', $lang); |
| 621 | 621 | $langtxt[$lang] = array( |
| 622 | - 'subject' => $txt['digest_subject_' . ($is_weekly ? 'weekly' : 'daily')], |
|
| 622 | + 'subject' => $txt['digest_subject_'.($is_weekly ? 'weekly' : 'daily')], |
|
| 623 | 623 | 'char_set' => $txt['lang_character_set'], |
| 624 | - 'intro' => sprintf($txt['digest_intro_' . ($is_weekly ? 'weekly' : 'daily')], $mbname), |
|
| 624 | + 'intro' => sprintf($txt['digest_intro_'.($is_weekly ? 'weekly' : 'daily')], $mbname), |
|
| 625 | 625 | 'new_topics' => $txt['digest_new_topics'], |
| 626 | 626 | 'topic_lines' => $txt['digest_new_topics_line'], |
| 627 | 627 | 'new_replies' => $txt['digest_new_replies'], |
@@ -640,7 +640,7 @@ discard block |
||
| 640 | 640 | } |
| 641 | 641 | |
| 642 | 642 | // The preferred way... |
| 643 | - require_once($sourcedir . '/Subs-Notify.php'); |
|
| 643 | + require_once($sourcedir.'/Subs-Notify.php'); |
|
| 644 | 644 | $prefs = getNotifyPrefs(array_keys($members), array('msg_notify_type', 'msg_notify_pref'), true); |
| 645 | 645 | |
| 646 | 646 | // Right - send out the silly things - this will take quite some space! |
@@ -659,8 +659,8 @@ discard block |
||
| 659 | 659 | |
| 660 | 660 | // Do the start stuff! |
| 661 | 661 | $email = array( |
| 662 | - 'subject' => $mbname . ' - ' . $langtxt[$lang]['subject'], |
|
| 663 | - 'body' => $member['name'] . ',' . "\n\n" . $langtxt[$lang]['intro'] . "\n" . $scripturl . '?action=profile;area=notification;u=' . $member['id'] . "\n", |
|
| 662 | + 'subject' => $mbname.' - '.$langtxt[$lang]['subject'], |
|
| 663 | + 'body' => $member['name'].','."\n\n".$langtxt[$lang]['intro']."\n".$scripturl.'?action=profile;area=notification;u='.$member['id']."\n", |
|
| 664 | 664 | 'email' => $member['email'], |
| 665 | 665 | ); |
| 666 | 666 | |
@@ -674,10 +674,10 @@ discard block |
||
| 674 | 674 | { |
| 675 | 675 | if (!$titled) |
| 676 | 676 | { |
| 677 | - $email['body'] .= "\n" . $langtxt[$lang]['new_topics'] . ':' . "\n" . '-----------------------------------------------'; |
|
| 677 | + $email['body'] .= "\n".$langtxt[$lang]['new_topics'].':'."\n".'-----------------------------------------------'; |
|
| 678 | 678 | $titled = true; |
| 679 | 679 | } |
| 680 | - $email['body'] .= "\n" . sprintf($langtxt[$lang]['topic_lines'], $topic['subject'], $board['name']); |
|
| 680 | + $email['body'] .= "\n".sprintf($langtxt[$lang]['topic_lines'], $topic['subject'], $board['name']); |
|
| 681 | 681 | } |
| 682 | 682 | if ($titled) |
| 683 | 683 | $email['body'] .= "\n"; |
@@ -693,10 +693,10 @@ discard block |
||
| 693 | 693 | { |
| 694 | 694 | if (!$titled) |
| 695 | 695 | { |
| 696 | - $email['body'] .= "\n" . $langtxt[$lang]['new_replies'] . ':' . "\n" . '-----------------------------------------------'; |
|
| 696 | + $email['body'] .= "\n".$langtxt[$lang]['new_replies'].':'."\n".'-----------------------------------------------'; |
|
| 697 | 697 | $titled = true; |
| 698 | 698 | } |
| 699 | - $email['body'] .= "\n" . ($topic['count'] == 1 ? sprintf($langtxt[$lang]['replies_one'], $topic['subject']) : sprintf($langtxt[$lang]['replies_many'], $topic['count'], $topic['subject'])); |
|
| 699 | + $email['body'] .= "\n".($topic['count'] == 1 ? sprintf($langtxt[$lang]['replies_one'], $topic['subject']) : sprintf($langtxt[$lang]['replies_many'], $topic['count'], $topic['subject'])); |
|
| 700 | 700 | } |
| 701 | 701 | |
| 702 | 702 | if ($titled) |
@@ -718,10 +718,10 @@ discard block |
||
| 718 | 718 | { |
| 719 | 719 | if (!$titled) |
| 720 | 720 | { |
| 721 | - $email['body'] .= "\n" . $langtxt[$lang]['mod_actions'] . ':' . "\n" . '-----------------------------------------------'; |
|
| 721 | + $email['body'] .= "\n".$langtxt[$lang]['mod_actions'].':'."\n".'-----------------------------------------------'; |
|
| 722 | 722 | $titled = true; |
| 723 | 723 | } |
| 724 | - $email['body'] .= "\n" . sprintf($langtxt[$lang][$note_type], $topic['subject']); |
|
| 724 | + $email['body'] .= "\n".sprintf($langtxt[$lang][$note_type], $topic['subject']); |
|
| 725 | 725 | } |
| 726 | 726 | } |
| 727 | 727 | } |
@@ -729,7 +729,7 @@ discard block |
||
| 729 | 729 | $email['body'] .= "\n"; |
| 730 | 730 | |
| 731 | 731 | // Then just say our goodbyes! |
| 732 | - $email['body'] .= "\n\n" . $txt['regards_team']; |
|
| 732 | + $email['body'] .= "\n\n".$txt['regards_team']; |
|
| 733 | 733 | |
| 734 | 734 | // Send it - low priority! |
| 735 | 735 | sendmail($email['email'], $email['subject'], $email['body'], null, 'digest', false, 4); |
@@ -873,7 +873,7 @@ discard block |
||
| 873 | 873 | return false; |
| 874 | 874 | |
| 875 | 875 | // Reflect that we're about to send some, do it now to be safe. |
| 876 | - updateSettings(array('mail_recent' => $mt . '|' . $mn)); |
|
| 876 | + updateSettings(array('mail_recent' => $mt.'|'.$mn)); |
|
| 877 | 877 | } |
| 878 | 878 | |
| 879 | 879 | // Now we know how many we're sending, let's send them. |
@@ -934,7 +934,7 @@ discard block |
||
| 934 | 934 | return false; |
| 935 | 935 | |
| 936 | 936 | if (!empty($modSettings['mail_type']) && $modSettings['smtp_host'] != '') |
| 937 | - require_once($sourcedir . '/Subs-Post.php'); |
|
| 937 | + require_once($sourcedir.'/Subs-Post.php'); |
|
| 938 | 938 | |
| 939 | 939 | // Send each email, yea! |
| 940 | 940 | $failed_emails = array(); |
@@ -1174,7 +1174,7 @@ discard block |
||
| 1174 | 1174 | |
| 1175 | 1175 | // Is this the default theme? |
| 1176 | 1176 | if (in_array($row['variable'], array('theme_dir', 'theme_url', 'images_url')) && $row['id_theme'] == '1') |
| 1177 | - $settings['default_' . $row['variable']] = $row['value']; |
|
| 1177 | + $settings['default_'.$row['variable']] = $row['value']; |
|
| 1178 | 1178 | } |
| 1179 | 1179 | $smcFunc['db_free_result']($result); |
| 1180 | 1180 | |
@@ -1198,8 +1198,8 @@ discard block |
||
| 1198 | 1198 | // Check loadLanguage actually exists! |
| 1199 | 1199 | if (!function_exists('loadLanguage')) |
| 1200 | 1200 | { |
| 1201 | - require_once($sourcedir . '/Load.php'); |
|
| 1202 | - require_once($sourcedir . '/Subs.php'); |
|
| 1201 | + require_once($sourcedir.'/Load.php'); |
|
| 1202 | + require_once($sourcedir.'/Subs.php'); |
|
| 1203 | 1203 | } |
| 1204 | 1204 | |
| 1205 | 1205 | loadLanguage('index+Modifications'); |
@@ -1249,7 +1249,7 @@ discard block |
||
| 1249 | 1249 | { |
| 1250 | 1250 | // Create the url |
| 1251 | 1251 | $server = empty($file['path']) || (substr($file['path'], 0, 7) != 'http://' && substr($file['path'], 0, 8) != 'https://') ? 'https://www.simplemachines.org' : ''; |
| 1252 | - $url = $server . (!empty($file['path']) ? $file['path'] : $file['path']) . $file['filename'] . (!empty($file['parameters']) ? '?' . $file['parameters'] : ''); |
|
| 1252 | + $url = $server.(!empty($file['path']) ? $file['path'] : $file['path']).$file['filename'].(!empty($file['parameters']) ? '?'.$file['parameters'] : ''); |
|
| 1253 | 1253 | |
| 1254 | 1254 | // Get the file |
| 1255 | 1255 | $file_data = fetch_web_data($url); |
@@ -1515,7 +1515,7 @@ discard block |
||
| 1515 | 1515 | ); |
| 1516 | 1516 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 1517 | 1517 | { |
| 1518 | - require_once($sourcedir . '/ManagePaid.php'); |
|
| 1518 | + require_once($sourcedir.'/ManagePaid.php'); |
|
| 1519 | 1519 | removeSubscription($row['id_subscribe'], $row['id_member']); |
| 1520 | 1520 | } |
| 1521 | 1521 | $smcFunc['db_free_result']($request); |
@@ -1544,7 +1544,7 @@ discard block |
||
| 1544 | 1544 | // If this is the first one load the important bits. |
| 1545 | 1545 | if (empty($subs_reminded)) |
| 1546 | 1546 | { |
| 1547 | - require_once($sourcedir . '/Subs-Post.php'); |
|
| 1547 | + require_once($sourcedir.'/Subs-Post.php'); |
|
| 1548 | 1548 | // Need the below for loadLanguage to work! |
| 1549 | 1549 | loadEssentialThemeData(); |
| 1550 | 1550 | } |
@@ -1555,13 +1555,13 @@ discard block |
||
| 1555 | 1555 | $smcFunc['db_free_result']($request); |
| 1556 | 1556 | |
| 1557 | 1557 | // Load alert preferences |
| 1558 | - require_once($sourcedir . '/Subs-Notify.php'); |
|
| 1558 | + require_once($sourcedir.'/Subs-Notify.php'); |
|
| 1559 | 1559 | $notifyPrefs = getNotifyPrefs(array_keys($members), 'paidsubs_expiring', true); |
| 1560 | 1560 | $alert_rows = array(); |
| 1561 | 1561 | foreach ($members as $row) |
| 1562 | 1562 | { |
| 1563 | 1563 | $replacements = array( |
| 1564 | - 'PROFILE_LINK' => $scripturl . '?action=profile;area=subscriptions;u=' . $row['id_member'], |
|
| 1564 | + 'PROFILE_LINK' => $scripturl.'?action=profile;area=subscriptions;u='.$row['id_member'], |
|
| 1565 | 1565 | 'REALNAME' => $row['member_name'], |
| 1566 | 1566 | 'SUBSCRIPTION' => $row['name'], |
| 1567 | 1567 | 'END_DATE' => strip_tags(timeformat($row['end_time'])), |
@@ -1647,8 +1647,8 @@ discard block |
||
| 1647 | 1647 | { |
| 1648 | 1648 | loadEssentialThemeData(); |
| 1649 | 1649 | loadLanguage('Post'); |
| 1650 | - $context['scheduled_errors']['remove_temp_attachments'][] = $txt['cant_access_upload_path'] . ' (' . $attach_dir . ')'; |
|
| 1651 | - log_error($txt['cant_access_upload_path'] . ' (' . $attach_dir . ')', 'critical'); |
|
| 1650 | + $context['scheduled_errors']['remove_temp_attachments'][] = $txt['cant_access_upload_path'].' ('.$attach_dir.')'; |
|
| 1651 | + log_error($txt['cant_access_upload_path'].' ('.$attach_dir.')', 'critical'); |
|
| 1652 | 1652 | return false; |
| 1653 | 1653 | } |
| 1654 | 1654 | |
@@ -1660,8 +1660,8 @@ discard block |
||
| 1660 | 1660 | if (strpos($file, 'post_tmp_') !== false) |
| 1661 | 1661 | { |
| 1662 | 1662 | // Temp file is more than 5 hours old! |
| 1663 | - if (filemtime($attach_dir . '/' . $file) < time() - 18000) |
|
| 1664 | - @unlink($attach_dir . '/' . $file); |
|
| 1663 | + if (filemtime($attach_dir.'/'.$file) < time() - 18000) |
|
| 1664 | + @unlink($attach_dir.'/'.$file); |
|
| 1665 | 1665 | } |
| 1666 | 1666 | } |
| 1667 | 1667 | closedir($dir); |
@@ -1701,7 +1701,7 @@ discard block |
||
| 1701 | 1701 | // Zap, your gone |
| 1702 | 1702 | if (count($topics) > 0) |
| 1703 | 1703 | { |
| 1704 | - require_once($sourcedir . '/RemoveTopic.php'); |
|
| 1704 | + require_once($sourcedir.'/RemoveTopic.php'); |
|
| 1705 | 1705 | removeTopics($topics, false, true); |
| 1706 | 1706 | } |
| 1707 | 1707 | |
@@ -1741,7 +1741,7 @@ discard block |
||
| 1741 | 1741 | // If we have old one, remove them |
| 1742 | 1742 | if (count($drafts) > 0) |
| 1743 | 1743 | { |
| 1744 | - require_once($sourcedir . '/Drafts.php'); |
|
| 1744 | + require_once($sourcedir.'/Drafts.php'); |
|
| 1745 | 1745 | DeleteDraft($drafts, false); |
| 1746 | 1746 | } |
| 1747 | 1747 | |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * Get a list of versions that are currently installed on the server. |
| 21 | - * @param array $checkFor An array of what to check versions for - can contain one or more of 'gd', 'imagemagick', 'db_server', 'phpa', 'memcache', 'xcache', 'apc', 'php' or 'server' |
|
| 21 | + * @param string[] $checkFor An array of what to check versions for - can contain one or more of 'gd', 'imagemagick', 'db_server', 'phpa', 'memcache', 'xcache', 'apc', 'php' or 'server' |
|
| 22 | 22 | * @return array An array of versions (keys are same as what was in $checkFor, values are the versions) |
| 23 | 23 | */ |
| 24 | 24 | function getServerVersions($checkFor) |
@@ -44,17 +44,17 @@ discard block |
||
| 44 | 44 | $temp = New Imagick; |
| 45 | 45 | $temp2 = $temp->getVersion(); |
| 46 | 46 | $im_version = $temp2['versionString']; |
| 47 | - $extension_version = 'Imagick ' . phpversion('Imagick'); |
|
| 47 | + $extension_version = 'Imagick '.phpversion('Imagick'); |
|
| 48 | 48 | } |
| 49 | 49 | else |
| 50 | 50 | { |
| 51 | 51 | $im_version = MagickGetVersionString(); |
| 52 | - $extension_version = 'MagickWand ' . phpversion('MagickWand'); |
|
| 52 | + $extension_version = 'MagickWand '.phpversion('MagickWand'); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | // We already know it's ImageMagick and the website isn't needed... |
| 56 | 56 | $im_version = str_replace(array('ImageMagick ', ' https://www.imagemagick.org'), '', $im_version); |
| 57 | - $versions['imagemagick'] = array('title' => $txt['support_versions_imagemagick'], 'version' => $im_version . ' (' . $extension_version . ')'); |
|
| 57 | + $versions['imagemagick'] = array('title' => $txt['support_versions_imagemagick'], 'version' => $im_version.' ('.$extension_version.')'); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | // Now lets check for the Database. |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | global $boarddir, $sourcedir, $settings, $tasksdir; |
| 115 | 115 | |
| 116 | 116 | // Default place to find the languages would be the default theme dir. |
| 117 | - $lang_dir = $settings['default_theme_dir'] . '/languages'; |
|
| 117 | + $lang_dir = $settings['default_theme_dir'].'/languages'; |
|
| 118 | 118 | |
| 119 | 119 | $version_info = array( |
| 120 | 120 | 'file_versions' => array(), |
@@ -125,9 +125,9 @@ discard block |
||
| 125 | 125 | ); |
| 126 | 126 | |
| 127 | 127 | // Find the version in SSI.php's file header. |
| 128 | - if (!empty($versionOptions['include_ssi']) && file_exists($boarddir . '/SSI.php')) |
|
| 128 | + if (!empty($versionOptions['include_ssi']) && file_exists($boarddir.'/SSI.php')) |
|
| 129 | 129 | { |
| 130 | - $fp = fopen($boarddir . '/SSI.php', 'rb'); |
|
| 130 | + $fp = fopen($boarddir.'/SSI.php', 'rb'); |
|
| 131 | 131 | $header = fread($fp, 4096); |
| 132 | 132 | fclose($fp); |
| 133 | 133 | |
@@ -140,9 +140,9 @@ discard block |
||
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | // Do the paid subscriptions handler? |
| 143 | - if (!empty($versionOptions['include_subscriptions']) && file_exists($boarddir . '/subscriptions.php')) |
|
| 143 | + if (!empty($versionOptions['include_subscriptions']) && file_exists($boarddir.'/subscriptions.php')) |
|
| 144 | 144 | { |
| 145 | - $fp = fopen($boarddir . '/subscriptions.php', 'rb'); |
|
| 145 | + $fp = fopen($boarddir.'/subscriptions.php', 'rb'); |
|
| 146 | 146 | $header = fread($fp, 4096); |
| 147 | 147 | fclose($fp); |
| 148 | 148 | |
@@ -158,10 +158,10 @@ discard block |
||
| 158 | 158 | $sources_dir = dir($sourcedir); |
| 159 | 159 | while ($entry = $sources_dir->read()) |
| 160 | 160 | { |
| 161 | - if (substr($entry, -4) === '.php' && !is_dir($sourcedir . '/' . $entry) && $entry !== 'index.php') |
|
| 161 | + if (substr($entry, -4) === '.php' && !is_dir($sourcedir.'/'.$entry) && $entry !== 'index.php') |
|
| 162 | 162 | { |
| 163 | 163 | // Read the first 4k from the file.... enough for the header. |
| 164 | - $fp = fopen($sourcedir . '/' . $entry, 'rb'); |
|
| 164 | + $fp = fopen($sourcedir.'/'.$entry, 'rb'); |
|
| 165 | 165 | $header = fread($fp, 4096); |
| 166 | 166 | fclose($fp); |
| 167 | 167 | |
@@ -181,10 +181,10 @@ discard block |
||
| 181 | 181 | $tasks_dir = dir($tasksdir); |
| 182 | 182 | while ($entry = $tasks_dir->read()) |
| 183 | 183 | { |
| 184 | - if (substr($entry, -4) === '.php' && !is_dir($tasksdir . '/' . $entry) && $entry !== 'index.php') |
|
| 184 | + if (substr($entry, -4) === '.php' && !is_dir($tasksdir.'/'.$entry) && $entry !== 'index.php') |
|
| 185 | 185 | { |
| 186 | 186 | // Read the first 4k from the file.... enough for the header. |
| 187 | - $fp = fopen($tasksdir . '/' . $entry, 'rb'); |
|
| 187 | + $fp = fopen($tasksdir.'/'.$entry, 'rb'); |
|
| 188 | 188 | $header = fread($fp, 4096); |
| 189 | 189 | fclose($fp); |
| 190 | 190 | |
@@ -209,10 +209,10 @@ discard block |
||
| 209 | 209 | $this_dir = dir($dirname); |
| 210 | 210 | while ($entry = $this_dir->read()) |
| 211 | 211 | { |
| 212 | - if (substr($entry, -12) == 'template.php' && !is_dir($dirname . '/' . $entry)) |
|
| 212 | + if (substr($entry, -12) == 'template.php' && !is_dir($dirname.'/'.$entry)) |
|
| 213 | 213 | { |
| 214 | 214 | // Read the first 768 bytes from the file.... enough for the header. |
| 215 | - $fp = fopen($dirname . '/' . $entry, 'rb'); |
|
| 215 | + $fp = fopen($dirname.'/'.$entry, 'rb'); |
|
| 216 | 216 | $header = fread($fp, 768); |
| 217 | 217 | fclose($fp); |
| 218 | 218 | |
@@ -231,10 +231,10 @@ discard block |
||
| 231 | 231 | $this_dir = dir($lang_dir); |
| 232 | 232 | while ($entry = $this_dir->read()) |
| 233 | 233 | { |
| 234 | - if (substr($entry, -4) == '.php' && $entry != 'index.php' && !is_dir($lang_dir . '/' . $entry)) |
|
| 234 | + if (substr($entry, -4) == '.php' && $entry != 'index.php' && !is_dir($lang_dir.'/'.$entry)) |
|
| 235 | 235 | { |
| 236 | 236 | // Read the first 768 bytes from the file.... enough for the header. |
| 237 | - $fp = fopen($lang_dir . '/' . $entry, 'rb'); |
|
| 237 | + $fp = fopen($lang_dir.'/'.$entry, 'rb'); |
|
| 238 | 238 | $header = fread($fp, 768); |
| 239 | 239 | fclose($fp); |
| 240 | 240 | |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | list ($name, $language) = explode('.', $entry); |
| 243 | 243 | |
| 244 | 244 | // Look for the version comment in the file header. |
| 245 | - if (preg_match('~(?://|/\*)\s*Version:\s+(.+?);\s*' . preg_quote($name, '~') . '(?:[\s]{2}|\*/)~i', $header, $match) == 1) |
|
| 245 | + if (preg_match('~(?://|/\*)\s*Version:\s+(.+?);\s*'.preg_quote($name, '~').'(?:[\s]{2}|\*/)~i', $header, $match) == 1) |
|
| 246 | 246 | $version_info['default_language_versions'][$language][$name] = $match[1]; |
| 247 | 247 | // It wasn't found, but the file was... show a '??'. |
| 248 | 248 | else |
@@ -298,10 +298,10 @@ discard block |
||
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | // When was Settings.php last changed? |
| 301 | - $last_settings_change = filemtime($boarddir . '/Settings.php'); |
|
| 301 | + $last_settings_change = filemtime($boarddir.'/Settings.php'); |
|
| 302 | 302 | |
| 303 | 303 | // Load the settings file. |
| 304 | - $settingsArray = trim(file_get_contents($boarddir . '/Settings.php')); |
|
| 304 | + $settingsArray = trim(file_get_contents($boarddir.'/Settings.php')); |
|
| 305 | 305 | |
| 306 | 306 | // Break it up based on \r or \n, and then clean out extra characters. |
| 307 | 307 | if (strpos($settingsArray, "\n") !== false) |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | |
| 318 | 318 | // remove any /r's that made there way in here |
| 319 | 319 | foreach ($settingsArray as $k => $dummy) |
| 320 | - $settingsArray[$k] = strtr($dummy, array("\r" => '')) . "\n"; |
|
| 320 | + $settingsArray[$k] = strtr($dummy, array("\r" => ''))."\n"; |
|
| 321 | 321 | |
| 322 | 322 | // go line by line and see whats changing |
| 323 | 323 | for ($i = 0, $n = count($settingsArray); $i < $n; $i++) |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | if (substr($settingsArray[$i], 0, 1) != '$') |
| 327 | 327 | continue; |
| 328 | 328 | |
| 329 | - $settingsArray[$i] = trim($settingsArray[$i]) . "\n"; |
|
| 329 | + $settingsArray[$i] = trim($settingsArray[$i])."\n"; |
|
| 330 | 330 | |
| 331 | 331 | // Look through the variables to set.... |
| 332 | 332 | foreach ($config_vars as $var => $val) |
@@ -337,10 +337,10 @@ discard block |
||
| 337 | 337 | updateDbLastError($val); |
| 338 | 338 | unset($config_vars[$var]); |
| 339 | 339 | } |
| 340 | - elseif (strncasecmp($settingsArray[$i], '$' . $var, 1 + strlen($var)) == 0) |
|
| 340 | + elseif (strncasecmp($settingsArray[$i], '$'.$var, 1 + strlen($var)) == 0) |
|
| 341 | 341 | { |
| 342 | 342 | $comment = strstr(substr($settingsArray[$i], strpos($settingsArray[$i], ';')), '#'); |
| 343 | - $settingsArray[$i] = '$' . $var . ' = ' . $val . ';' . ($comment == '' ? '' : "\t\t" . rtrim($comment)) . "\n"; |
|
| 343 | + $settingsArray[$i] = '$'.$var.' = '.$val.';'.($comment == '' ? '' : "\t\t".rtrim($comment))."\n"; |
|
| 344 | 344 | |
| 345 | 345 | // This one's been 'used', so to speak. |
| 346 | 346 | unset($config_vars[$var]); |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | // End of the file ... maybe |
| 351 | - if (substr(trim($settingsArray[$i]), 0, 2) == '?' . '>') |
|
| 351 | + if (substr(trim($settingsArray[$i]), 0, 2) == '?'.'>') |
|
| 352 | 352 | $end = $i; |
| 353 | 353 | } |
| 354 | 354 | |
@@ -359,16 +359,16 @@ discard block |
||
| 359 | 359 | // Still more variables to go? Then lets add them at the end. |
| 360 | 360 | if (!empty($config_vars)) |
| 361 | 361 | { |
| 362 | - if (trim($settingsArray[$end]) == '?' . '>') |
|
| 362 | + if (trim($settingsArray[$end]) == '?'.'>') |
|
| 363 | 363 | $settingsArray[$end++] = ''; |
| 364 | 364 | else |
| 365 | 365 | $end++; |
| 366 | 366 | |
| 367 | 367 | // Add in any newly defined vars that were passed |
| 368 | 368 | foreach ($config_vars as $var => $val) |
| 369 | - $settingsArray[$end++] = '$' . $var . ' = ' . $val . ';' . "\n"; |
|
| 369 | + $settingsArray[$end++] = '$'.$var.' = '.$val.';'."\n"; |
|
| 370 | 370 | |
| 371 | - $settingsArray[$end] = '?' . '>'; |
|
| 371 | + $settingsArray[$end] = '?'.'>'; |
|
| 372 | 372 | } |
| 373 | 373 | else |
| 374 | 374 | $settingsArray[$end] = trim($settingsArray[$end]); |
@@ -383,15 +383,15 @@ discard block |
||
| 383 | 383 | // |
| 384 | 384 | // Check before you act: if cache is enabled, we can do a simple write test |
| 385 | 385 | // to validate that we even write things on this filesystem. |
| 386 | - if ((empty($cachedir) || !file_exists($cachedir)) && file_exists($boarddir . '/cache')) |
|
| 387 | - $cachedir = $boarddir . '/cache'; |
|
| 386 | + if ((empty($cachedir) || !file_exists($cachedir)) && file_exists($boarddir.'/cache')) |
|
| 387 | + $cachedir = $boarddir.'/cache'; |
|
| 388 | 388 | |
| 389 | - $test_fp = @fopen($cachedir . '/settings_update.tmp', "w+"); |
|
| 389 | + $test_fp = @fopen($cachedir.'/settings_update.tmp', "w+"); |
|
| 390 | 390 | if ($test_fp) |
| 391 | 391 | { |
| 392 | 392 | fclose($test_fp); |
| 393 | - $written_bytes = file_put_contents($cachedir . '/settings_update.tmp', 'test', LOCK_EX); |
|
| 394 | - @unlink($cachedir . '/settings_update.tmp'); |
|
| 393 | + $written_bytes = file_put_contents($cachedir.'/settings_update.tmp', 'test', LOCK_EX); |
|
| 394 | + @unlink($cachedir.'/settings_update.tmp'); |
|
| 395 | 395 | |
| 396 | 396 | if ($written_bytes !== 4) |
| 397 | 397 | { |
@@ -403,15 +403,15 @@ discard block |
||
| 403 | 403 | |
| 404 | 404 | // Protect me from what I want! :P |
| 405 | 405 | clearstatcache(); |
| 406 | - if (filemtime($boarddir . '/Settings.php') === $last_settings_change) |
|
| 406 | + if (filemtime($boarddir.'/Settings.php') === $last_settings_change) |
|
| 407 | 407 | { |
| 408 | 408 | // save the old before we do anything |
| 409 | - $settings_backup_fail = !@is_writable($boarddir . '/Settings_bak.php') || !@copy($boarddir . '/Settings.php', $boarddir . '/Settings_bak.php'); |
|
| 410 | - $settings_backup_fail = !$settings_backup_fail ? (!file_exists($boarddir . '/Settings_bak.php') || filesize($boarddir . '/Settings_bak.php') === 0) : $settings_backup_fail; |
|
| 409 | + $settings_backup_fail = !@is_writable($boarddir.'/Settings_bak.php') || !@copy($boarddir.'/Settings.php', $boarddir.'/Settings_bak.php'); |
|
| 410 | + $settings_backup_fail = !$settings_backup_fail ? (!file_exists($boarddir.'/Settings_bak.php') || filesize($boarddir.'/Settings_bak.php') === 0) : $settings_backup_fail; |
|
| 411 | 411 | |
| 412 | 412 | // write out the new |
| 413 | 413 | $write_settings = implode('', $settingsArray); |
| 414 | - $written_bytes = file_put_contents($boarddir . '/Settings.php', $write_settings, LOCK_EX); |
|
| 414 | + $written_bytes = file_put_contents($boarddir.'/Settings.php', $write_settings, LOCK_EX); |
|
| 415 | 415 | |
| 416 | 416 | // survey says ... |
| 417 | 417 | if ($written_bytes !== strlen($write_settings) && !$settings_backup_fail) |
@@ -419,15 +419,15 @@ discard block |
||
| 419 | 419 | // Well this is not good at all, lets see if we can save this |
| 420 | 420 | $context['settings_message'] = 'settings_error'; |
| 421 | 421 | |
| 422 | - if (file_exists($boarddir . '/Settings_bak.php')) |
|
| 423 | - @copy($boarddir . '/Settings_bak.php', $boarddir . '/Settings.php'); |
|
| 422 | + if (file_exists($boarddir.'/Settings_bak.php')) |
|
| 423 | + @copy($boarddir.'/Settings_bak.php', $boarddir.'/Settings.php'); |
|
| 424 | 424 | } |
| 425 | 425 | } |
| 426 | 426 | |
| 427 | 427 | // Even though on normal installations the filemtime should prevent this being used by the installer incorrectly |
| 428 | 428 | // it seems that there are times it might not. So let's MAKE it dump the cache. |
| 429 | 429 | if (function_exists('opcache_invalidate')) |
| 430 | - opcache_invalidate($boarddir . '/Settings.php', true); |
|
| 430 | + opcache_invalidate($boarddir.'/Settings.php', true); |
|
| 431 | 431 | } |
| 432 | 432 | |
| 433 | 433 | /** |
@@ -443,8 +443,8 @@ discard block |
||
| 443 | 443 | global $boarddir, $cachedir; |
| 444 | 444 | |
| 445 | 445 | // Write out the db_last_error file with the error timestamp |
| 446 | - file_put_contents($cachedir . '/db_last_error.php', '<' . '?' . "php\n" . '$db_last_error = ' . $time . ';' . "\n" . '?' . '>', LOCK_EX); |
|
| 447 | - @touch($boarddir . '/' . 'Settings.php'); |
|
| 446 | + file_put_contents($cachedir.'/db_last_error.php', '<'.'?'."php\n".'$db_last_error = '.$time.';'."\n".'?'.'>', LOCK_EX); |
|
| 447 | + @touch($boarddir.'/'.'Settings.php'); |
|
| 448 | 448 | } |
| 449 | 449 | /** |
| 450 | 450 | * Saves the admin's current preferences to the database. |
@@ -480,7 +480,7 @@ discard block |
||
| 480 | 480 | ); |
| 481 | 481 | |
| 482 | 482 | // Make sure we invalidate any cache. |
| 483 | - cache_put_data('theme_settings-' . $settings['theme_id'] . ':' . $user_info['id'], null, 0); |
|
| 483 | + cache_put_data('theme_settings-'.$settings['theme_id'].':'.$user_info['id'], null, 0); |
|
| 484 | 484 | } |
| 485 | 485 | |
| 486 | 486 | /** |
@@ -498,14 +498,14 @@ discard block |
||
| 498 | 498 | global $smcFunc, $sourcedir, $language, $modSettings; |
| 499 | 499 | |
| 500 | 500 | // We certainly want this. |
| 501 | - require_once($sourcedir . '/Subs-Post.php'); |
|
| 501 | + require_once($sourcedir.'/Subs-Post.php'); |
|
| 502 | 502 | |
| 503 | 503 | // Load all members which are effectively admins. |
| 504 | - require_once($sourcedir . '/Subs-Members.php'); |
|
| 504 | + require_once($sourcedir.'/Subs-Members.php'); |
|
| 505 | 505 | $members = membersAllowedTo('admin_forum'); |
| 506 | 506 | |
| 507 | 507 | // Load their alert preferences |
| 508 | - require_once($sourcedir . '/Subs-Notify.php'); |
|
| 508 | + require_once($sourcedir.'/Subs-Notify.php'); |
|
| 509 | 509 | $prefs = getNotifyPrefs($members, 'announcements', true); |
| 510 | 510 | |
| 511 | 511 | $request = $smcFunc['db_query']('', ' |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | { |
| 42 | 42 | if (class_exists('Imagick')) |
| 43 | 43 | { |
| 44 | - $temp = New Imagick; |
|
| 44 | + $temp = new Imagick; |
|
| 45 | 45 | $temp2 = $temp->getVersion(); |
| 46 | 46 | $im_version = $temp2['versionString']; |
| 47 | 47 | $extension_version = 'Imagick ' . phpversion('Imagick'); |
@@ -170,7 +170,7 @@ |
||
| 170 | 170 | * |
| 171 | 171 | * @param string $fileName The path to the file |
| 172 | 172 | * @param int $preferred_format The preferred format - 0 to automatically determine, 1 for gif, 2 for jpg, 3 for png, 6 for bmp and 15 for wbmp |
| 173 | - * @return boolean Whether the reencoding was successful |
|
| 173 | + * @return false|null Whether the reencoding was successful |
|
| 174 | 174 | */ |
| 175 | 175 | function reencodeImage($fileName, $preferred_format = 0) |
| 176 | 176 | { |
@@ -523,7 +523,6 @@ discard block |
||
| 523 | 523 | /** |
| 524 | 524 | * Copy image. |
| 525 | 525 | * Used when imagecopyresample() is not available. |
| 526 | - |
|
| 527 | 526 | * @param resource $dst_img The destination image - a GD image resource |
| 528 | 527 | * @param resource $src_img The source image - a GD image resource |
| 529 | 528 | * @param int $dst_x The "x" coordinate of the destination image |
@@ -754,7 +753,6 @@ discard block |
||
| 754 | 753 | |
| 755 | 754 | /** |
| 756 | 755 | * Writes a gif file to disk as a png file. |
| 757 | - |
|
| 758 | 756 | * @param resource $gif A gif image resource |
| 759 | 757 | * @param string $lpszFileName The name of the file |
| 760 | 758 | * @param int $background_color The background color |
@@ -41,13 +41,13 @@ discard block |
||
| 41 | 41 | global $modSettings, $sourcedir, $smcFunc; |
| 42 | 42 | |
| 43 | 43 | $ext = !empty($modSettings['avatar_download_png']) ? 'png' : 'jpeg'; |
| 44 | - $destName = 'avatar_' . $memID . '_' . time() . '.' . $ext; |
|
| 44 | + $destName = 'avatar_'.$memID.'_'.time().'.'.$ext; |
|
| 45 | 45 | |
| 46 | 46 | // Just making sure there is a non-zero member. |
| 47 | 47 | if (empty($memID)) |
| 48 | 48 | return false; |
| 49 | 49 | |
| 50 | - require_once($sourcedir . '/ManageAttachments.php'); |
|
| 50 | + require_once($sourcedir.'/ManageAttachments.php'); |
|
| 51 | 51 | removeAttachments(array('id_member' => $memID)); |
| 52 | 52 | |
| 53 | 53 | $id_folder = 1; |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | 'type' => 1, |
| 74 | 74 | ); |
| 75 | 75 | |
| 76 | - $destName = $modSettings['custom_avatar_dir'] . '/' . $destName . '.tmp'; |
|
| 76 | + $destName = $modSettings['custom_avatar_dir'].'/'.$destName.'.tmp'; |
|
| 77 | 77 | |
| 78 | 78 | // Resize it. |
| 79 | 79 | if (!empty($modSettings['avatar_download_png'])) |
@@ -87,11 +87,11 @@ discard block |
||
| 87 | 87 | if ($success) |
| 88 | 88 | { |
| 89 | 89 | // Remove the .tmp extension from the attachment. |
| 90 | - if (rename($destName . '.tmp', empty($avatar_hash) ? $destName : $path . '/' . $attachID . '_' . $avatar_hash . '.dat')) |
|
| 90 | + if (rename($destName.'.tmp', empty($avatar_hash) ? $destName : $path.'/'.$attachID.'_'.$avatar_hash.'.dat')) |
|
| 91 | 91 | { |
| 92 | - $destName = empty($avatar_hash) ? $destName : $path . '/' . $attachID . '_' . $avatar_hash . '.dat'; |
|
| 92 | + $destName = empty($avatar_hash) ? $destName : $path.'/'.$attachID.'_'.$avatar_hash.'.dat'; |
|
| 93 | 93 | list ($width, $height) = getimagesize($destName); |
| 94 | - $mime_type = 'image/' . $ext; |
|
| 94 | + $mime_type = 'image/'.$ext; |
|
| 95 | 95 | |
| 96 | 96 | // Write filesize in the database. |
| 97 | 97 | $smcFunc['db_query']('', ' |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | ) |
| 123 | 123 | ); |
| 124 | 124 | |
| 125 | - @unlink($destName . '.tmp'); |
|
| 125 | + @unlink($destName.'.tmp'); |
|
| 126 | 126 | return false; |
| 127 | 127 | } |
| 128 | 128 | } |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | { |
| 142 | 142 | global $modSettings; |
| 143 | 143 | |
| 144 | - $destName = $source . '_thumb.tmp'; |
|
| 144 | + $destName = $source.'_thumb.tmp'; |
|
| 145 | 145 | |
| 146 | 146 | // Do the actual resize. |
| 147 | 147 | if (!empty($modSettings['attachment_thumb_png'])) |
@@ -152,11 +152,11 @@ discard block |
||
| 152 | 152 | // Okay, we're done with the temporary stuff. |
| 153 | 153 | $destName = substr($destName, 0, -4); |
| 154 | 154 | |
| 155 | - if ($success && @rename($destName . '.tmp', $destName)) |
|
| 155 | + if ($success && @rename($destName.'.tmp', $destName)) |
|
| 156 | 156 | return true; |
| 157 | 157 | else |
| 158 | 158 | { |
| 159 | - @unlink($destName . '.tmp'); |
|
| 159 | + @unlink($destName.'.tmp'); |
|
| 160 | 160 | @touch($destName); |
| 161 | 161 | return false; |
| 162 | 162 | } |
@@ -174,10 +174,10 @@ discard block |
||
| 174 | 174 | */ |
| 175 | 175 | function reencodeImage($fileName, $preferred_format = 0) |
| 176 | 176 | { |
| 177 | - if (!resizeImageFile($fileName, $fileName . '.tmp', null, null, $preferred_format)) |
|
| 177 | + if (!resizeImageFile($fileName, $fileName.'.tmp', null, null, $preferred_format)) |
|
| 178 | 178 | { |
| 179 | - if (file_exists($fileName . '.tmp')) |
|
| 180 | - unlink($fileName . '.tmp'); |
|
| 179 | + if (file_exists($fileName.'.tmp')) |
|
| 180 | + unlink($fileName.'.tmp'); |
|
| 181 | 181 | |
| 182 | 182 | return false; |
| 183 | 183 | } |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | if (!unlink($fileName)) |
| 186 | 186 | return false; |
| 187 | 187 | |
| 188 | - if (!rename($fileName . '.tmp', $fileName)) |
|
| 188 | + if (!rename($fileName.'.tmp', $fileName)) |
|
| 189 | 189 | return false; |
| 190 | 190 | } |
| 191 | 191 | |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | { |
| 214 | 214 | // Paranoid check. Use this if you have reason to distrust your host's security config. |
| 215 | 215 | // Will result in MANY false positives, and is not suitable for photography sites. |
| 216 | - if (preg_match('~(iframe|\\<\\?|\\<%|html|eval|body|script\W|(?-i)[CFZ]WS[\x01-\x0E])~i', $prev_chunk . $cur_chunk) === 1) |
|
| 216 | + if (preg_match('~(iframe|\\<\\?|\\<%|html|eval|body|script\W|(?-i)[CFZ]WS[\x01-\x0E])~i', $prev_chunk.$cur_chunk) === 1) |
|
| 217 | 217 | { |
| 218 | 218 | fclose($fp); |
| 219 | 219 | return false; |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | { |
| 224 | 224 | // Check for potential infection - focus on clues for inline php & flash. |
| 225 | 225 | // Will result in significantly fewer false positives than the paranoid check. |
| 226 | - if (preg_match('~(\\<\\?php\s|(?-i)[CFZ]WS[\x01-\x0E])~i', $prev_chunk . $cur_chunk) === 1) |
|
| 226 | + if (preg_match('~(\\<\\?php\s|(?-i)[CFZ]WS[\x01-\x0E])~i', $prev_chunk.$cur_chunk) === 1) |
|
| 227 | 227 | { |
| 228 | 228 | fclose($fp); |
| 229 | 229 | return false; |
@@ -372,9 +372,9 @@ discard block |
||
| 372 | 372 | { |
| 373 | 373 | return resizeImage(null, $destination, null, null, $max_width, $max_height, true, $preferred_format); |
| 374 | 374 | } |
| 375 | - elseif (checkGD() && isset($default_formats[$sizes[2]]) && function_exists('imagecreatefrom' . $default_formats[$sizes[2]])) |
|
| 375 | + elseif (checkGD() && isset($default_formats[$sizes[2]]) && function_exists('imagecreatefrom'.$default_formats[$sizes[2]])) |
|
| 376 | 376 | { |
| 377 | - $imagecreatefrom = 'imagecreatefrom' . $default_formats[$sizes[2]]; |
|
| 377 | + $imagecreatefrom = 'imagecreatefrom'.$default_formats[$sizes[2]]; |
|
| 378 | 378 | if ($src_img = @$imagecreatefrom($destination)) |
| 379 | 379 | { |
| 380 | 380 | return resizeImage($src_img, $destination, imagesx($src_img), imagesy($src_img), $max_width === null ? imagesx($src_img) : $max_width, $max_height === null ? imagesy($src_img) : $max_height, true, $preferred_format); |
@@ -853,11 +853,11 @@ discard block |
||
| 853 | 853 | $foreground_color = $settings['verification_foreground']; |
| 854 | 854 | } |
| 855 | 855 | |
| 856 | - if (!is_dir($settings['default_theme_dir'] . '/fonts')) |
|
| 856 | + if (!is_dir($settings['default_theme_dir'].'/fonts')) |
|
| 857 | 857 | return false; |
| 858 | 858 | |
| 859 | 859 | // Get a list of the available fonts. |
| 860 | - $font_dir = dir($settings['default_theme_dir'] . '/fonts'); |
|
| 860 | + $font_dir = dir($settings['default_theme_dir'].'/fonts'); |
|
| 861 | 861 | $font_list = array(); |
| 862 | 862 | $ttfont_list = array(); |
| 863 | 863 | $endian = unpack('v', pack('S', 0x00FF)) === 0x00FF; |
@@ -901,7 +901,7 @@ discard block |
||
| 901 | 901 | |
| 902 | 902 | // Load all fonts and determine the maximum font height. |
| 903 | 903 | foreach ($loaded_fonts as $font_index => $dummy) |
| 904 | - $loaded_fonts[$font_index] = imageloadfont($settings['default_theme_dir'] . '/fonts/' . $font_list[$font_index]); |
|
| 904 | + $loaded_fonts[$font_index] = imageloadfont($settings['default_theme_dir'].'/fonts/'.$font_list[$font_index]); |
|
| 905 | 905 | |
| 906 | 906 | // Determine the dimensions of each character. |
| 907 | 907 | if ($imageType == 4 || $imageType == 5) |
@@ -1004,7 +1004,7 @@ discard block |
||
| 1004 | 1004 | |
| 1005 | 1005 | // What font face? |
| 1006 | 1006 | if (!empty($ttfont_list)) |
| 1007 | - $fontface = $settings['default_theme_dir'] . '/fonts/' . $ttfont_list[mt_rand(0, count($ttfont_list) - 1)]; |
|
| 1007 | + $fontface = $settings['default_theme_dir'].'/fonts/'.$ttfont_list[mt_rand(0, count($ttfont_list) - 1)]; |
|
| 1008 | 1008 | |
| 1009 | 1009 | // What color are we to do it in? |
| 1010 | 1010 | $is_reverse = $showReverseChars ? mt_rand(0, 1) : false; |
@@ -1132,14 +1132,14 @@ discard block |
||
| 1132 | 1132 | { |
| 1133 | 1133 | global $settings; |
| 1134 | 1134 | |
| 1135 | - if (!is_dir($settings['default_theme_dir'] . '/fonts')) |
|
| 1135 | + if (!is_dir($settings['default_theme_dir'].'/fonts')) |
|
| 1136 | 1136 | return false; |
| 1137 | 1137 | |
| 1138 | 1138 | // Get a list of the available font directories. |
| 1139 | - $font_dir = dir($settings['default_theme_dir'] . '/fonts'); |
|
| 1139 | + $font_dir = dir($settings['default_theme_dir'].'/fonts'); |
|
| 1140 | 1140 | $font_list = array(); |
| 1141 | 1141 | while ($entry = $font_dir->read()) |
| 1142 | - if ($entry[0] !== '.' && is_dir($settings['default_theme_dir'] . '/fonts/' . $entry) && file_exists($settings['default_theme_dir'] . '/fonts/' . $entry . '.gdf')) |
|
| 1142 | + if ($entry[0] !== '.' && is_dir($settings['default_theme_dir'].'/fonts/'.$entry) && file_exists($settings['default_theme_dir'].'/fonts/'.$entry.'.gdf')) |
|
| 1143 | 1143 | $font_list[] = $entry; |
| 1144 | 1144 | |
| 1145 | 1145 | if (empty($font_list)) |
@@ -1149,12 +1149,12 @@ discard block |
||
| 1149 | 1149 | $random_font = $font_list[array_rand($font_list)]; |
| 1150 | 1150 | |
| 1151 | 1151 | // Check if the given letter exists. |
| 1152 | - if (!file_exists($settings['default_theme_dir'] . '/fonts/' . $random_font . '/' . $letter . '.png')) |
|
| 1152 | + if (!file_exists($settings['default_theme_dir'].'/fonts/'.$random_font.'/'.$letter.'.png')) |
|
| 1153 | 1153 | return false; |
| 1154 | 1154 | |
| 1155 | 1155 | // Include it! |
| 1156 | 1156 | header('content-type: image/png'); |
| 1157 | - include($settings['default_theme_dir'] . '/fonts/' . $random_font . '/' . $letter . '.png'); |
|
| 1157 | + include($settings['default_theme_dir'].'/fonts/'.$random_font.'/'.$letter.'.png'); |
|
| 1158 | 1158 | |
| 1159 | 1159 | // Nothing more to come. |
| 1160 | 1160 | die(); |
@@ -419,7 +419,7 @@ |
||
| 419 | 419 | |
| 420 | 420 | if (checkImagick()) |
| 421 | 421 | { |
| 422 | - $imagick = New Imagick($destName); |
|
| 422 | + $imagick = new Imagick($destName); |
|
| 423 | 423 | $src_width = empty($src_width) ? $imagick->getImageWidth() : $src_width; |
| 424 | 424 | $src_height = empty($src_height) ? $imagick->getImageHeight() : $src_height; |
| 425 | 425 | $dest_width = empty($max_width) ? $src_width : $max_width; |
@@ -243,6 +243,7 @@ |
||
| 243 | 243 | * @param null|array The groups to remove the member(s) from. If null, the specified members are stripped from all their membergroups. |
| 244 | 244 | * @param bool $permissionCheckDone Whether we've already checked permissions prior to calling this function |
| 245 | 245 | * @param bool $ignoreProtected Whether to ignore protected groups |
| 246 | + * @param integer $groups |
|
| 246 | 247 | * @return bool Whether the operation was successful |
| 247 | 248 | */ |
| 248 | 249 | function removeMembersFromGroups($members, $groups = null, $permissionCheckDone = false, $ignoreProtected = false) |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | // Do the log. |
| 440 | 440 | if (!empty($log_inserts) && !empty($modSettings['modlog_enabled'])) |
| 441 | 441 | { |
| 442 | - require_once($sourcedir . '/Logging.php'); |
|
| 442 | + require_once($sourcedir.'/Logging.php'); |
|
| 443 | 443 | foreach ($log_inserts as $extra) |
| 444 | 444 | logAction('removed_from_group', $extra, 'admin'); |
| 445 | 445 | } |
@@ -555,7 +555,7 @@ discard block |
||
| 555 | 555 | 'member_list' => $members, |
| 556 | 556 | 'id_group' => $group, |
| 557 | 557 | 'id_group_string' => (string) $group, |
| 558 | - 'id_group_string_extend' => ',' . $group, |
|
| 558 | + 'id_group_string_extend' => ','.$group, |
|
| 559 | 559 | 'blank_string' => '', |
| 560 | 560 | ) |
| 561 | 561 | ); |
@@ -589,12 +589,12 @@ discard block |
||
| 589 | 589 | 'id_group' => $group, |
| 590 | 590 | 'blank_string' => '', |
| 591 | 591 | 'id_group_string' => (string) $group, |
| 592 | - 'id_group_string_extend' => ',' . $group, |
|
| 592 | + 'id_group_string_extend' => ','.$group, |
|
| 593 | 593 | ) |
| 594 | 594 | ); |
| 595 | 595 | // Ack!!? What happened? |
| 596 | 596 | else |
| 597 | - trigger_error('addMembersToGroup(): Unknown type \'' . $type . '\'', E_USER_WARNING); |
|
| 597 | + trigger_error('addMembersToGroup(): Unknown type \''.$type.'\'', E_USER_WARNING); |
|
| 598 | 598 | |
| 599 | 599 | call_integration_hook('integrate_add_members_to_group', array($members, $group, &$group_names)); |
| 600 | 600 | |
@@ -602,7 +602,7 @@ discard block |
||
| 602 | 602 | updateStats('postgroups', $members); |
| 603 | 603 | |
| 604 | 604 | // Log the data. |
| 605 | - require_once($sourcedir . '/Logging.php'); |
|
| 605 | + require_once($sourcedir.'/Logging.php'); |
|
| 606 | 606 | foreach ($members as $member) |
| 607 | 607 | logAction('added_to_group', array('group' => $group_names[$group], 'member_affected' => $member), 'admin'); |
| 608 | 608 | |
@@ -633,7 +633,7 @@ discard block |
||
| 633 | 633 | ); |
| 634 | 634 | $members = array(); |
| 635 | 635 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 636 | - $members[$row['id_member']] = '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>'; |
|
| 636 | + $members[$row['id_member']] = '<a href="'.$scripturl.'?action=profile;u='.$row['id_member'].'">'.$row['real_name'].'</a>'; |
|
| 637 | 637 | $smcFunc['db_free_result']($request); |
| 638 | 638 | |
| 639 | 639 | // If there are more than $limit members, add a 'more' link. |
@@ -670,13 +670,13 @@ discard block |
||
| 670 | 670 | ); |
| 671 | 671 | $groupCache = array(); |
| 672 | 672 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 673 | - $groupCache[] = '<a href="' . $scripturl . '?action=groups;sa=members;group=' . $row['id_group'] . '" ' . ($row['online_color'] ? 'style="color: ' . $row['online_color'] . '"' : '') . '>' . $row['group_name'] . '</a>'; |
|
| 673 | + $groupCache[] = '<a href="'.$scripturl.'?action=groups;sa=members;group='.$row['id_group'].'" '.($row['online_color'] ? 'style="color: '.$row['online_color'].'"' : '').'>'.$row['group_name'].'</a>'; |
|
| 674 | 674 | $smcFunc['db_free_result']($request); |
| 675 | 675 | |
| 676 | 676 | return array( |
| 677 | 677 | 'data' => $groupCache, |
| 678 | 678 | 'expires' => time() + 3600, |
| 679 | - 'refresh_eval' => 'return $GLOBALS[\'modSettings\'][\'settings_updated\'] > ' . time() . ';', |
|
| 679 | + 'refresh_eval' => 'return $GLOBALS[\'modSettings\'][\'settings_updated\'] > '.time().';', |
|
| 680 | 680 | ); |
| 681 | 681 | } |
| 682 | 682 | |
@@ -699,11 +699,11 @@ discard block |
||
| 699 | 699 | FROM {db_prefix}membergroups AS mg |
| 700 | 700 | LEFT JOIN {db_prefix}group_moderators AS gm ON (gm.id_group = mg.id_group AND gm.id_member = {int:current_member}) |
| 701 | 701 | WHERE mg.min_posts {raw:min_posts}' . (allowedTo('admin_forum') ? '' : ' |
| 702 | - AND mg.id_group != {int:mod_group}') . ' |
|
| 702 | + AND mg.id_group != {int:mod_group}').' |
|
| 703 | 703 | ORDER BY {raw:sort}', |
| 704 | 704 | array( |
| 705 | 705 | 'current_member' => $user_info['id'], |
| 706 | - 'min_posts' => ($membergroup_type === 'post_count' ? '!= ' : '= ') . -1, |
|
| 706 | + 'min_posts' => ($membergroup_type === 'post_count' ? '!= ' : '= ').-1, |
|
| 707 | 707 | 'mod_group' => 3, |
| 708 | 708 | 'sort' => $sort, |
| 709 | 709 | ) |
@@ -730,7 +730,7 @@ discard block |
||
| 730 | 730 | 'type' => $row['group_type'], |
| 731 | 731 | 'num_members' => $row['num_members'], |
| 732 | 732 | 'moderators' => array(), |
| 733 | - 'icons' => !empty($row['icons'][0]) && !empty($row['icons'][1]) ? str_repeat('<img src="' . $settings['images_url'] . '/membericons/' . $row['icons'][1] . '" alt="*">', $row['icons'][0]) : '', |
|
| 733 | + 'icons' => !empty($row['icons'][0]) && !empty($row['icons'][1]) ? str_repeat('<img src="'.$settings['images_url'].'/membericons/'.$row['icons'][1].'" alt="*">', $row['icons'][0]) : '', |
|
| 734 | 734 | ); |
| 735 | 735 | |
| 736 | 736 | $context['can_moderate'] |= $row['can_moderate']; |
@@ -804,7 +804,7 @@ discard block |
||
| 804 | 804 | ) |
| 805 | 805 | ); |
| 806 | 806 | while ($row = $smcFunc['db_fetch_assoc']($query)) |
| 807 | - $groups[$row['id_group']]['moderators'][] = '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>'; |
|
| 807 | + $groups[$row['id_group']]['moderators'][] = '<a href="'.$scripturl.'?action=profile;u='.$row['id_member'].'">'.$row['real_name'].'</a>'; |
|
| 808 | 808 | $smcFunc['db_free_result']($query); |
| 809 | 809 | } |
| 810 | 810 | |
@@ -756,7 +756,6 @@ |
||
| 756 | 756 | $groups[$row['id_group']]['num_members'] += $row['num_members']; |
| 757 | 757 | $smcFunc['db_free_result']($query); |
| 758 | 758 | } |
| 759 | - |
|
| 760 | 759 | else |
| 761 | 760 | { |
| 762 | 761 | $query = $smcFunc['db_query']('', ' |
@@ -286,7 +286,7 @@ |
||
| 286 | 286 | /** |
| 287 | 287 | * Delete a menu. |
| 288 | 288 | * @param string $menu_id The ID of the menu to destroy or 'last' for the most recent one |
| 289 | - * @return bool|void False if the menu doesn't exist, nothing otherwise |
|
| 289 | + * @return false|null False if the menu doesn't exist, nothing otherwise |
|
| 290 | 290 | */ |
| 291 | 291 | function destroyMenu($menu_id = 'last') |
| 292 | 292 | { |
@@ -57,15 +57,15 @@ discard block |
||
| 57 | 57 | $context['max_menu_id'] = isset($context['max_menu_id']) ? $context['max_menu_id'] + 1 : 1; |
| 58 | 58 | |
| 59 | 59 | // This will be all the data for this menu - and we'll make a shortcut to it to aid readability here. |
| 60 | - $context['menu_data_' . $context['max_menu_id']] = array(); |
|
| 61 | - $menu_context = &$context['menu_data_' . $context['max_menu_id']]; |
|
| 60 | + $context['menu_data_'.$context['max_menu_id']] = array(); |
|
| 61 | + $menu_context = &$context['menu_data_'.$context['max_menu_id']]; |
|
| 62 | 62 | |
| 63 | 63 | // What is the general action of this menu (i.e. $scripturl?action=XXXX. |
| 64 | 64 | $menu_context['current_action'] = isset($menuOptions['action']) ? $menuOptions['action'] : $context['current_action']; |
| 65 | 65 | |
| 66 | 66 | // Allow extend *any* menu with a single hook |
| 67 | 67 | if (!empty($menu_context['current_action'])) |
| 68 | - call_integration_hook('integrate_' . $menu_context['current_action'] . '_areas', array(&$menuData)); |
|
| 68 | + call_integration_hook('integrate_'.$menu_context['current_action'].'_areas', array(&$menuData)); |
|
| 69 | 69 | |
| 70 | 70 | // What is the current area selected? |
| 71 | 71 | if (isset($menuOptions['current_area']) || isset($_GET['area'])) |
@@ -75,11 +75,11 @@ discard block |
||
| 75 | 75 | $menu_context['extra_parameters'] = ''; |
| 76 | 76 | if (!empty($menuOptions['extra_url_parameters'])) |
| 77 | 77 | foreach ($menuOptions['extra_url_parameters'] as $key => $value) |
| 78 | - $menu_context['extra_parameters'] .= ';' . $key . '=' . $value; |
|
| 78 | + $menu_context['extra_parameters'] .= ';'.$key.'='.$value; |
|
| 79 | 79 | |
| 80 | 80 | // Only include the session ID in the URL if it's strictly necessary. |
| 81 | 81 | if (empty($menuOptions['disable_url_session_check'])) |
| 82 | - $menu_context['extra_parameters'] .= ';' . $context['session_var'] . '=' . $context['session_id']; |
|
| 82 | + $menu_context['extra_parameters'] .= ';'.$context['session_var'].'='.$context['session_id']; |
|
| 83 | 83 | |
| 84 | 84 | $include_data = array(); |
| 85 | 85 | |
@@ -135,42 +135,42 @@ discard block |
||
| 135 | 135 | } |
| 136 | 136 | elseif (isset($area['icon'])) |
| 137 | 137 | { |
| 138 | - if (file_exists($settings['theme_dir'] . '/images/admin/' . $area['icon'])) |
|
| 138 | + if (file_exists($settings['theme_dir'].'/images/admin/'.$area['icon'])) |
|
| 139 | 139 | { |
| 140 | - $menu_context['sections'][$section_id]['areas'][$area_id]['icon'] = '<img src="' . $settings['images_url'] . '/admin/' . $area['icon'] . '" alt="">'; |
|
| 140 | + $menu_context['sections'][$section_id]['areas'][$area_id]['icon'] = '<img src="'.$settings['images_url'].'/admin/'.$area['icon'].'" alt="">'; |
|
| 141 | 141 | } |
| 142 | - elseif (file_exists($settings['default_theme_dir'] . '/images/admin/' . $area['icon'])) |
|
| 142 | + elseif (file_exists($settings['default_theme_dir'].'/images/admin/'.$area['icon'])) |
|
| 143 | 143 | { |
| 144 | - $menu_context['sections'][$section_id]['areas'][$area_id]['icon'] = '<img src="' . $settings['default_images_url'] . '/admin/' . $area['icon'] . '" alt="">'; |
|
| 144 | + $menu_context['sections'][$section_id]['areas'][$area_id]['icon'] = '<img src="'.$settings['default_images_url'].'/admin/'.$area['icon'].'" alt="">'; |
|
| 145 | 145 | } |
| 146 | 146 | else |
| 147 | - $menu_context['sections'][$section_id]['areas'][$area_id]['icon'] = '<span class="generic_icons ' . $area['icon'] . '"></span>'; |
|
| 147 | + $menu_context['sections'][$section_id]['areas'][$area_id]['icon'] = '<span class="generic_icons '.$area['icon'].'"></span>'; |
|
| 148 | 148 | } |
| 149 | 149 | else |
| 150 | - $menu_context['sections'][$section_id]['areas'][$area_id]['icon'] = '<span class="generic_icons ' . $area_id . '"></span>'; |
|
| 150 | + $menu_context['sections'][$section_id]['areas'][$area_id]['icon'] = '<span class="generic_icons '.$area_id.'"></span>'; |
|
| 151 | 151 | |
| 152 | 152 | if (isset($area['icon_class']) && empty($menu_context['sections'][$section_id]['areas'][$area_id]['icon'])) |
| 153 | 153 | { |
| 154 | - $menu_context['sections'][$section_id]['areas'][$area_id]['icon_class'] = $menu_context['current_action'] . '_menu_icon ' . $area['icon_class']; |
|
| 154 | + $menu_context['sections'][$section_id]['areas'][$area_id]['icon_class'] = $menu_context['current_action'].'_menu_icon '.$area['icon_class']; |
|
| 155 | 155 | } |
| 156 | 156 | elseif (isset($area['icon'])) |
| 157 | 157 | { |
| 158 | 158 | if (substr($area['icon'], -4) === '.png' || substr($area['icon'], -4) === '.gif') |
| 159 | 159 | { |
| 160 | - if (file_exists($settings['theme_dir'] . '/images/admin/big/' . $area['icon'])) |
|
| 160 | + if (file_exists($settings['theme_dir'].'/images/admin/big/'.$area['icon'])) |
|
| 161 | 161 | { |
| 162 | - $menu_context['sections'][$section_id]['areas'][$area_id]['icon_file'] = $settings['theme_url'] . '/images/admin/big/' . $area['icon']; |
|
| 162 | + $menu_context['sections'][$section_id]['areas'][$area_id]['icon_file'] = $settings['theme_url'].'/images/admin/big/'.$area['icon']; |
|
| 163 | 163 | } |
| 164 | - elseif (file_exists($settings['default_theme_dir'] . '/images/admin/big/' . $area['icon'])) |
|
| 164 | + elseif (file_exists($settings['default_theme_dir'].'/images/admin/big/'.$area['icon'])) |
|
| 165 | 165 | { |
| 166 | - $menu_context['sections'][$section_id]['areas'][$area_id]['icon_file'] = $settings['default_theme_url'] . '/images/admin/big/' . $area['icon']; |
|
| 166 | + $menu_context['sections'][$section_id]['areas'][$area_id]['icon_file'] = $settings['default_theme_url'].'/images/admin/big/'.$area['icon']; |
|
| 167 | 167 | } |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | - $menu_context['sections'][$section_id]['areas'][$area_id]['icon_class'] = $menu_context['current_action'] . '_menu_icon ' . str_replace(array('.png', '.gif'), '', $area['icon']); |
|
| 170 | + $menu_context['sections'][$section_id]['areas'][$area_id]['icon_class'] = $menu_context['current_action'].'_menu_icon '.str_replace(array('.png', '.gif'), '', $area['icon']); |
|
| 171 | 171 | } |
| 172 | 172 | else |
| 173 | - $menu_context['sections'][$section_id]['areas'][$area_id]['icon_class'] = $menu_context['current_action'] . '_menu_icon ' . str_replace(array('.png', '.gif'), '', $area_id); |
|
| 173 | + $menu_context['sections'][$section_id]['areas'][$area_id]['icon_class'] = $menu_context['current_action'].'_menu_icon '.str_replace(array('.png', '.gif'), '', $area_id); |
|
| 174 | 174 | |
| 175 | 175 | // This is a shortcut for Font-Icon users so they don't have to re-do whole CSS. |
| 176 | 176 | $menu_context['sections'][$section_id]['areas'][$area_id]['plain_class'] = !empty($area['icon']) ? $area['icon'] : ''; |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | // Should we use a custom base url, or use the default? |
| 263 | - $menu_context['base_url'] = isset($menuOptions['base_url']) ? $menuOptions['base_url'] : $scripturl . '?action=' . $menu_context['current_action']; |
|
| 263 | + $menu_context['base_url'] = isset($menuOptions['base_url']) ? $menuOptions['base_url'] : $scripturl.'?action='.$menu_context['current_action']; |
|
| 264 | 264 | |
| 265 | 265 | // If we didn't find the area we were looking for go to a default one. |
| 266 | 266 | if (isset($backup_area) && empty($found_section)) |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | { |
| 280 | 280 | if (!isset($menu_context['sections'][$section_id]['url'])) |
| 281 | 281 | { |
| 282 | - $menu_context['sections'][$section_id]['url'] = isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $area_id; |
|
| 282 | + $menu_context['sections'][$section_id]['url'] = isset($area['url']) ? $area['url'] : $menu_context['base_url'].';area='.$area_id; |
|
| 283 | 283 | break; |
| 284 | 284 | } |
| 285 | 285 | } |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | |
| 299 | 299 | // Almost there - load the template and add to the template layers. |
| 300 | 300 | loadTemplate(isset($menuOptions['template_name']) ? $menuOptions['template_name'] : 'GenericMenu'); |
| 301 | - $menu_context['layer_name'] = (isset($menuOptions['layer_name']) ? $menuOptions['layer_name'] : 'generic_menu') . '_dropdown'; |
|
| 301 | + $menu_context['layer_name'] = (isset($menuOptions['layer_name']) ? $menuOptions['layer_name'] : 'generic_menu').'_dropdown'; |
|
| 302 | 302 | $context['template_layers'][] = $menu_context['layer_name']; |
| 303 | 303 | |
| 304 | 304 | // Check we had something - for sanity sake. |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | { |
| 326 | 326 | global $context; |
| 327 | 327 | |
| 328 | - $menu_name = $menu_id == 'last' && isset($context['max_menu_id']) && isset($context['menu_data_' . $context['max_menu_id']]) ? 'menu_data_' . $context['max_menu_id'] : 'menu_data_' . $menu_id; |
|
| 328 | + $menu_name = $menu_id == 'last' && isset($context['max_menu_id']) && isset($context['menu_data_'.$context['max_menu_id']]) ? 'menu_data_'.$context['max_menu_id'] : 'menu_data_'.$menu_id; |
|
| 329 | 329 | if (!isset($context[$menu_name])) |
| 330 | 330 | return false; |
| 331 | 331 | |
@@ -1451,7 +1451,7 @@ discard block |
||
| 1451 | 1451 | * @param resource $socket Socket to send on |
| 1452 | 1452 | * @param string $code The expected response code |
| 1453 | 1453 | * @param string $response The response from the SMTP server |
| 1454 | - * @return bool Whether it responded as such. |
|
| 1454 | + * @return string|boolean Whether it responded as such. |
|
| 1455 | 1455 | */ |
| 1456 | 1456 | function server_parse($message, $socket, $code, &$response = null) |
| 1457 | 1457 | { |
@@ -2265,7 +2265,7 @@ discard block |
||
| 2265 | 2265 | * @param array $msgs Array of message ids |
| 2266 | 2266 | * @param bool $approve Whether to approve the posts (if false, posts are unapproved) |
| 2267 | 2267 | * @param bool $notify Whether to notify users |
| 2268 | - * @return bool Whether the operation was successful |
|
| 2268 | + * @return null|boolean Whether the operation was successful |
|
| 2269 | 2269 | */ |
| 2270 | 2270 | function approvePosts($msgs, $approve = true, $notify = true) |
| 2271 | 2271 | { |
@@ -2518,7 +2518,7 @@ discard block |
||
| 2518 | 2518 | * |
| 2519 | 2519 | * @param array $topics Array of topic ids |
| 2520 | 2520 | * @param bool $approve Whether to approve the topics. If false, unapproves them instead |
| 2521 | - * @return bool Whether the operation was successful |
|
| 2521 | + * @return null|boolean Whether the operation was successful |
|
| 2522 | 2522 | */ |
| 2523 | 2523 | function approveTopics($topics, $approve = true) |
| 2524 | 2524 | { |
@@ -2908,7 +2908,7 @@ discard block |
||
| 2908 | 2908 | * |
| 2909 | 2909 | * @param resource $dict An enchant or pspell dictionary resource set up by {@link spell_init()} |
| 2910 | 2910 | * @param string $word A word to check the spelling of |
| 2911 | - * @return bool Whether or not the specified word is spelled properly |
|
| 2911 | + * @return boolean|null Whether or not the specified word is spelled properly |
|
| 2912 | 2912 | */ |
| 2913 | 2913 | function spell_check($dict, $word) |
| 2914 | 2914 | { |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | // Clean up after nobbc ;). |
| 38 | 38 | $message = preg_replace_callback('~\[nobbc\](.+?)\[/nobbc\]~is', function($a) |
| 39 | 39 | { |
| 40 | - return '[nobbc]' . strtr($a[1], array('[' => '[', ']' => ']', ':' => ':', '@' => '@')) . '[/nobbc]'; |
|
| 40 | + return '[nobbc]'.strtr($a[1], array('[' => '[', ']' => ']', ':' => ':', '@' => '@')).'[/nobbc]'; |
|
| 41 | 41 | }, $message); |
| 42 | 42 | |
| 43 | 43 | // Remove \r's... they're evil! |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | $message .= '[/code]'; |
| 84 | 84 | // Open any ones that need to be open, only if we've never had a tag. |
| 85 | 85 | if ($codeopen && !$had_tag) |
| 86 | - $message = '[code]' . $message; |
|
| 86 | + $message = '[code]'.$message; |
|
| 87 | 87 | |
| 88 | 88 | // Replace code BBC with placeholders. We'll restore them at the end. |
| 89 | 89 | $parts = preg_split('~(\[/code\]|\[code(?:=[^\]]+)?\])~i', $message, -1, PREG_SPLIT_DELIM_CAPTURE); |
@@ -92,8 +92,8 @@ discard block |
||
| 92 | 92 | // It goes 0 = outside, 1 = begin tag, 2 = inside, 3 = close tag, repeat. |
| 93 | 93 | if ($i % 4 == 2) |
| 94 | 94 | { |
| 95 | - $code_tag = $parts[$i - 1] . $parts[$i] . $parts[$i + 1]; |
|
| 96 | - $substitute = $parts[$i - 1] . $i . $parts[$i + 1]; |
|
| 95 | + $code_tag = $parts[$i - 1].$parts[$i].$parts[$i + 1]; |
|
| 96 | + $substitute = $parts[$i - 1].$i.$parts[$i + 1]; |
|
| 97 | 97 | $code_tags[$substitute] = $code_tag; |
| 98 | 98 | $parts[$i] = $i; |
| 99 | 99 | } |
@@ -109,15 +109,15 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | // Replace /me.+?\n with [me=name]dsf[/me]\n. |
| 111 | 111 | if (strpos($user_info['name'], '[') !== false || strpos($user_info['name'], ']') !== false || strpos($user_info['name'], '\'') !== false || strpos($user_info['name'], '"') !== false) |
| 112 | - $message = preg_replace('~(\A|\n)/me(?: | )([^\n]*)(?:\z)?~i', '$1[me="' . $user_info['name'] . '"]$2[/me]', $message); |
|
| 112 | + $message = preg_replace('~(\A|\n)/me(?: | )([^\n]*)(?:\z)?~i', '$1[me="'.$user_info['name'].'"]$2[/me]', $message); |
|
| 113 | 113 | else |
| 114 | - $message = preg_replace('~(\A|\n)/me(?: | )([^\n]*)(?:\z)?~i', '$1[me=' . $user_info['name'] . ']$2[/me]', $message); |
|
| 114 | + $message = preg_replace('~(\A|\n)/me(?: | )([^\n]*)(?:\z)?~i', '$1[me='.$user_info['name'].']$2[/me]', $message); |
|
| 115 | 115 | |
| 116 | 116 | if (!$previewing && strpos($message, '[html]') !== false) |
| 117 | 117 | { |
| 118 | 118 | if (allowedTo('admin_forum')) |
| 119 | 119 | $message = preg_replace_callback('~\[html\](.+?)\[/html\]~is', function($m) { |
| 120 | - return '[html]' . strtr(un_htmlspecialchars($m[1]), array("\n" => ' ', ' ' => '  ', '[' => '[', ']' => ']')) . '[/html]'; |
|
| 120 | + return '[html]'.strtr(un_htmlspecialchars($m[1]), array("\n" => ' ', ' ' => '  ', '[' => '[', ']' => ']')).'[/html]'; |
|
| 121 | 121 | }, $message); |
| 122 | 122 | |
| 123 | 123 | // We should edit them out, or else if an admin edits the message they will get shown... |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | // Let's look at the time tags... |
| 132 | 132 | $message = preg_replace_callback('~\[time(?:=(absolute))*\](.+?)\[/time\]~i', function($m) use ($modSettings, $user_info) |
| 133 | 133 | { |
| 134 | - return "[time]" . (is_numeric("$m[2]") || @strtotime("$m[2]") == 0 ? "$m[2]" : strtotime("$m[2]") - ("$m[1]" == "absolute" ? 0 : (($modSettings["time_offset"] + $user_info["time_offset"]) * 3600))) . "[/time]"; |
|
| 134 | + return "[time]".(is_numeric("$m[2]") || @strtotime("$m[2]") == 0 ? "$m[2]" : strtotime("$m[2]") - ("$m[1]" == "absolute" ? 0 : (($modSettings["time_offset"] + $user_info["time_offset"]) * 3600)))."[/time]"; |
|
| 135 | 135 | }, $message); |
| 136 | 136 | |
| 137 | 137 | // Change the color specific tags to [color=the color]. |
@@ -141,37 +141,37 @@ discard block |
||
| 141 | 141 | // Make sure all tags are lowercase. |
| 142 | 142 | $message = preg_replace_callback('~\[([/]?)(list|li|table|tr|td)((\s[^\]]+)*)\]~i', function($m) |
| 143 | 143 | { |
| 144 | - return "[$m[1]" . strtolower("$m[2]") . "$m[3]]"; |
|
| 144 | + return "[$m[1]".strtolower("$m[2]")."$m[3]]"; |
|
| 145 | 145 | }, $message); |
| 146 | 146 | |
| 147 | 147 | $list_open = substr_count($message, '[list]') + substr_count($message, '[list '); |
| 148 | 148 | $list_close = substr_count($message, '[/list]'); |
| 149 | 149 | if ($list_close - $list_open > 0) |
| 150 | - $message = str_repeat('[list]', $list_close - $list_open) . $message; |
|
| 150 | + $message = str_repeat('[list]', $list_close - $list_open).$message; |
|
| 151 | 151 | if ($list_open - $list_close > 0) |
| 152 | - $message = $message . str_repeat('[/list]', $list_open - $list_close); |
|
| 152 | + $message = $message.str_repeat('[/list]', $list_open - $list_close); |
|
| 153 | 153 | |
| 154 | 154 | $mistake_fixes = array( |
| 155 | 155 | // Find [table]s not followed by [tr]. |
| 156 | - '~\[table\](?![\s' . $non_breaking_space . ']*\[tr\])~s' . ($context['utf8'] ? 'u' : '') => '[table][tr]', |
|
| 156 | + '~\[table\](?![\s'.$non_breaking_space.']*\[tr\])~s'.($context['utf8'] ? 'u' : '') => '[table][tr]', |
|
| 157 | 157 | // Find [tr]s not followed by [td]. |
| 158 | - '~\[tr\](?![\s' . $non_breaking_space . ']*\[td\])~s' . ($context['utf8'] ? 'u' : '') => '[tr][td]', |
|
| 158 | + '~\[tr\](?![\s'.$non_breaking_space.']*\[td\])~s'.($context['utf8'] ? 'u' : '') => '[tr][td]', |
|
| 159 | 159 | // Find [/td]s not followed by something valid. |
| 160 | - '~\[/td\](?![\s' . $non_breaking_space . ']*(?:\[td\]|\[/tr\]|\[/table\]))~s' . ($context['utf8'] ? 'u' : '') => '[/td][/tr]', |
|
| 160 | + '~\[/td\](?![\s'.$non_breaking_space.']*(?:\[td\]|\[/tr\]|\[/table\]))~s'.($context['utf8'] ? 'u' : '') => '[/td][/tr]', |
|
| 161 | 161 | // Find [/tr]s not followed by something valid. |
| 162 | - '~\[/tr\](?![\s' . $non_breaking_space . ']*(?:\[tr\]|\[/table\]))~s' . ($context['utf8'] ? 'u' : '') => '[/tr][/table]', |
|
| 162 | + '~\[/tr\](?![\s'.$non_breaking_space.']*(?:\[tr\]|\[/table\]))~s'.($context['utf8'] ? 'u' : '') => '[/tr][/table]', |
|
| 163 | 163 | // Find [/td]s incorrectly followed by [/table]. |
| 164 | - '~\[/td\][\s' . $non_breaking_space . ']*\[/table\]~s' . ($context['utf8'] ? 'u' : '') => '[/td][/tr][/table]', |
|
| 164 | + '~\[/td\][\s'.$non_breaking_space.']*\[/table\]~s'.($context['utf8'] ? 'u' : '') => '[/td][/tr][/table]', |
|
| 165 | 165 | // Find [table]s, [tr]s, and [/td]s (possibly correctly) followed by [td]. |
| 166 | - '~\[(table|tr|/td)\]([\s' . $non_breaking_space . ']*)\[td\]~s' . ($context['utf8'] ? 'u' : '') => '[$1]$2[_td_]', |
|
| 166 | + '~\[(table|tr|/td)\]([\s'.$non_breaking_space.']*)\[td\]~s'.($context['utf8'] ? 'u' : '') => '[$1]$2[_td_]', |
|
| 167 | 167 | // Now, any [td]s left should have a [tr] before them. |
| 168 | 168 | '~\[td\]~s' => '[tr][td]', |
| 169 | 169 | // Look for [tr]s which are correctly placed. |
| 170 | - '~\[(table|/tr)\]([\s' . $non_breaking_space . ']*)\[tr\]~s' . ($context['utf8'] ? 'u' : '') => '[$1]$2[_tr_]', |
|
| 170 | + '~\[(table|/tr)\]([\s'.$non_breaking_space.']*)\[tr\]~s'.($context['utf8'] ? 'u' : '') => '[$1]$2[_tr_]', |
|
| 171 | 171 | // Any remaining [tr]s should have a [table] before them. |
| 172 | 172 | '~\[tr\]~s' => '[table][tr]', |
| 173 | 173 | // Look for [/td]s followed by [/tr]. |
| 174 | - '~\[/td\]([\s' . $non_breaking_space . ']*)\[/tr\]~s' . ($context['utf8'] ? 'u' : '') => '[/td]$1[_/tr_]', |
|
| 174 | + '~\[/td\]([\s'.$non_breaking_space.']*)\[/tr\]~s'.($context['utf8'] ? 'u' : '') => '[/td]$1[_/tr_]', |
|
| 175 | 175 | // Any remaining [/tr]s should have a [/td]. |
| 176 | 176 | '~\[/tr\]~s' => '[/td][/tr]', |
| 177 | 177 | // Look for properly opened [li]s which aren't closed. |
@@ -179,14 +179,14 @@ discard block |
||
| 179 | 179 | '~\[li\]([^\[\]]+?)\[/list\]~s' => '[_li_]$1[_/li_][/list]', |
| 180 | 180 | '~\[li\]([^\[\]]+?)$~s' => '[li]$1[/li]', |
| 181 | 181 | // Lists - find correctly closed items/lists. |
| 182 | - '~\[/li\]([\s' . $non_breaking_space . ']*)\[/list\]~s' . ($context['utf8'] ? 'u' : '') => '[_/li_]$1[/list]', |
|
| 182 | + '~\[/li\]([\s'.$non_breaking_space.']*)\[/list\]~s'.($context['utf8'] ? 'u' : '') => '[_/li_]$1[/list]', |
|
| 183 | 183 | // Find list items closed and then opened. |
| 184 | - '~\[/li\]([\s' . $non_breaking_space . ']*)\[li\]~s' . ($context['utf8'] ? 'u' : '') => '[_/li_]$1[_li_]', |
|
| 184 | + '~\[/li\]([\s'.$non_breaking_space.']*)\[li\]~s'.($context['utf8'] ? 'u' : '') => '[_/li_]$1[_li_]', |
|
| 185 | 185 | // Now, find any [list]s or [/li]s followed by [li]. |
| 186 | - '~\[(list(?: [^\]]*?)?|/li)\]([\s' . $non_breaking_space . ']*)\[li\]~s' . ($context['utf8'] ? 'u' : '') => '[$1]$2[_li_]', |
|
| 186 | + '~\[(list(?: [^\]]*?)?|/li)\]([\s'.$non_breaking_space.']*)\[li\]~s'.($context['utf8'] ? 'u' : '') => '[$1]$2[_li_]', |
|
| 187 | 187 | // Allow for sub lists. |
| 188 | - '~\[/li\]([\s' . $non_breaking_space . ']*)\[list\]~' . ($context['utf8'] ? 'u' : '') => '[_/li_]$1[list]', |
|
| 189 | - '~\[/list\]([\s' . $non_breaking_space . ']*)\[li\]~' . ($context['utf8'] ? 'u' : '') => '[/list]$1[_li_]', |
|
| 188 | + '~\[/li\]([\s'.$non_breaking_space.']*)\[list\]~'.($context['utf8'] ? 'u' : '') => '[_/li_]$1[list]', |
|
| 189 | + '~\[/list\]([\s'.$non_breaking_space.']*)\[li\]~'.($context['utf8'] ? 'u' : '') => '[/list]$1[_li_]', |
|
| 190 | 190 | // Any remaining [li]s weren't inside a [list]. |
| 191 | 191 | '~\[li\]~' => '[list][li]', |
| 192 | 192 | // Any remaining [/li]s weren't before a [/list]. |
@@ -207,17 +207,17 @@ discard block |
||
| 207 | 207 | 'td', |
| 208 | 208 | ); |
| 209 | 209 | |
| 210 | - require_once($sourcedir . '/Subs.php'); |
|
| 210 | + require_once($sourcedir.'/Subs.php'); |
|
| 211 | 211 | |
| 212 | 212 | $alltags = array(); |
| 213 | 213 | foreach (($codes = parse_bbc(false)) as $code) |
| 214 | 214 | if (!in_array($code['tag'], $allowedEmpty)) |
| 215 | 215 | $alltags[] = $code['tag']; |
| 216 | 216 | |
| 217 | - $alltags_regex = '\b' . implode("\b|\b", array_unique($alltags)) . '\b'; |
|
| 217 | + $alltags_regex = '\b'.implode("\b|\b", array_unique($alltags)).'\b'; |
|
| 218 | 218 | |
| 219 | - while (preg_match('~\[(' . $alltags_regex . ')[^\]]*\]\s*\[/\1\]\s?~i', $message)) |
|
| 220 | - $message = preg_replace('~\[(' . $alltags_regex . ')[^\]]*\]\s*\[/\1\]\s?~i', '', $message); |
|
| 219 | + while (preg_match('~\[('.$alltags_regex.')[^\]]*\]\s*\[/\1\]\s?~i', $message)) |
|
| 220 | + $message = preg_replace('~\[('.$alltags_regex.')[^\]]*\]\s*\[/\1\]\s?~i', '', $message); |
|
| 221 | 221 | |
| 222 | 222 | // Restore code blocks |
| 223 | 223 | if (!empty($code_tags)) |
@@ -250,8 +250,8 @@ discard block |
||
| 250 | 250 | // If $i is a multiple of four (0, 4, 8, ...) then it's not a code section... |
| 251 | 251 | if ($i % 4 == 2) |
| 252 | 252 | { |
| 253 | - $code_tag = $parts[$i - 1] . $parts[$i] . $parts[$i + 1]; |
|
| 254 | - $substitute = $parts[$i - 1] . $i . $parts[$i + 1]; |
|
| 253 | + $code_tag = $parts[$i - 1].$parts[$i].$parts[$i + 1]; |
|
| 254 | + $substitute = $parts[$i - 1].$i.$parts[$i + 1]; |
|
| 255 | 255 | $code_tags[$substitute] = $code_tag; |
| 256 | 256 | $parts[$i] = $i; |
| 257 | 257 | } |
@@ -261,20 +261,20 @@ discard block |
||
| 261 | 261 | |
| 262 | 262 | $message = preg_replace_callback('~\[html\](.+?)\[/html\]~i', function($m) use ($smcFunc) |
| 263 | 263 | { |
| 264 | - return "[html]" . strtr($smcFunc['htmlspecialchars']("$m[1]", ENT_QUOTES), array("\\"" => """, "&#13;" => "<br>", "&#32;" => " ", "&#91;" => "[", "&#93;" => "]")) . "[/html]"; |
|
| 264 | + return "[html]".strtr($smcFunc['htmlspecialchars']("$m[1]", ENT_QUOTES), array("\\"" => """, "&#13;" => "<br>", "&#32;" => " ", "&#91;" => "[", "&#93;" => "]"))."[/html]"; |
|
| 265 | 265 | }, $message); |
| 266 | 266 | |
| 267 | 267 | // Attempt to un-parse the time to something less awful. |
| 268 | 268 | $message = preg_replace_callback('~\[time\](\d{0,10})\[/time\]~i', function($m) |
| 269 | 269 | { |
| 270 | - return "[time]" . timeformat("$m[1]", false) . "[/time]"; |
|
| 270 | + return "[time]".timeformat("$m[1]", false)."[/time]"; |
|
| 271 | 271 | }, $message); |
| 272 | 272 | |
| 273 | 273 | if (!empty($code_tags)) |
| 274 | 274 | $message = str_replace(array_keys($code_tags), array_values($code_tags), $message); |
| 275 | 275 | |
| 276 | 276 | // Change breaks back to \n's and &nsbp; back to spaces. |
| 277 | - return preg_replace('~<br( /)?' . '>~', "\n", str_replace(' ', ' ', $message)); |
|
| 277 | + return preg_replace('~<br( /)?'.'>~', "\n", str_replace(' ', ' ', $message)); |
|
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | /** |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | // Now fix possible security problems with images loading links automatically... |
| 359 | 359 | $message = preg_replace_callback('~(\[img.*?\])(.+?)\[/img\]~is', function($m) |
| 360 | 360 | { |
| 361 | - return "$m[1]" . preg_replace("~action(=|%3d)(?!dlattach)~i", "action-", "$m[2]") . "[/img]"; |
|
| 361 | + return "$m[1]".preg_replace("~action(=|%3d)(?!dlattach)~i", "action-", "$m[2]")."[/img]"; |
|
| 362 | 362 | }, $message); |
| 363 | 363 | |
| 364 | 364 | } |
@@ -381,19 +381,19 @@ discard block |
||
| 381 | 381 | if (preg_match('~^([^:]+://[^/]+)~', $boardurl, $match) != 0) |
| 382 | 382 | $domain_url = $match[1]; |
| 383 | 383 | else |
| 384 | - $domain_url = $boardurl . '/'; |
|
| 384 | + $domain_url = $boardurl.'/'; |
|
| 385 | 385 | |
| 386 | 386 | $replaces = array(); |
| 387 | 387 | |
| 388 | 388 | if ($hasEqualSign && $embeddedUrl) |
| 389 | 389 | { |
| 390 | - $quoted = preg_match('~\[(' . $myTag . ')="~', $message); |
|
| 391 | - preg_match_all('~\[(' . $myTag . ')=' . ($quoted ? '"(.*?)"' : '([^\]]*?)') . '\](?:(.+?)\[/(' . $myTag . ')\])?~is', $message, $matches); |
|
| 390 | + $quoted = preg_match('~\[('.$myTag.')="~', $message); |
|
| 391 | + preg_match_all('~\[('.$myTag.')='.($quoted ? '"(.*?)"' : '([^\]]*?)').'\](?:(.+?)\[/('.$myTag.')\])?~is', $message, $matches); |
|
| 392 | 392 | } |
| 393 | 393 | elseif ($hasEqualSign) |
| 394 | - preg_match_all('~\[(' . $myTag . ')=([^\]]*?)\](?:(.+?)\[/(' . $myTag . ')\])?~is', $message, $matches); |
|
| 394 | + preg_match_all('~\[('.$myTag.')=([^\]]*?)\](?:(.+?)\[/('.$myTag.')\])?~is', $message, $matches); |
|
| 395 | 395 | else |
| 396 | - preg_match_all('~\[(' . $myTag . ($hasExtra ? '(?:[^\]]*?)' : '') . ')\](.+?)\[/(' . $myTag . ')\]~is', $message, $matches); |
|
| 396 | + preg_match_all('~\[('.$myTag.($hasExtra ? '(?:[^\]]*?)' : '').')\](.+?)\[/('.$myTag.')\]~is', $message, $matches); |
|
| 397 | 397 | |
| 398 | 398 | foreach ($matches[0] as $k => $dummy) |
| 399 | 399 | { |
@@ -405,7 +405,7 @@ discard block |
||
| 405 | 405 | $found = false; |
| 406 | 406 | foreach ($protocols as $protocol) |
| 407 | 407 | { |
| 408 | - $found = strncasecmp($replace, $protocol . '://', strlen($protocol) + 3) === 0; |
|
| 408 | + $found = strncasecmp($replace, $protocol.'://', strlen($protocol) + 3) === 0; |
|
| 409 | 409 | if ($found) |
| 410 | 410 | break; |
| 411 | 411 | } |
@@ -413,31 +413,31 @@ discard block |
||
| 413 | 413 | if (!$found && $protocols[0] == 'http') |
| 414 | 414 | { |
| 415 | 415 | if (substr($replace, 0, 1) == '/' && substr($replace, 0, 2) != '//') |
| 416 | - $replace = $domain_url . $replace; |
|
| 416 | + $replace = $domain_url.$replace; |
|
| 417 | 417 | elseif (substr($replace, 0, 1) == '?') |
| 418 | - $replace = $scripturl . $replace; |
|
| 418 | + $replace = $scripturl.$replace; |
|
| 419 | 419 | elseif (substr($replace, 0, 1) == '#' && $embeddedUrl) |
| 420 | 420 | { |
| 421 | - $replace = '#' . preg_replace('~[^A-Za-z0-9_\-#]~', '', substr($replace, 1)); |
|
| 421 | + $replace = '#'.preg_replace('~[^A-Za-z0-9_\-#]~', '', substr($replace, 1)); |
|
| 422 | 422 | $this_tag = 'iurl'; |
| 423 | 423 | $this_close = 'iurl'; |
| 424 | 424 | } |
| 425 | 425 | elseif (substr($replace, 0, 2) != '//') |
| 426 | - $replace = $protocols[0] . '://' . $replace; |
|
| 426 | + $replace = $protocols[0].'://'.$replace; |
|
| 427 | 427 | } |
| 428 | 428 | elseif (!$found && $protocols[0] == 'ftp') |
| 429 | - $replace = $protocols[0] . '://' . preg_replace('~^(?!ftps?)[^:]+://~', '', $replace); |
|
| 429 | + $replace = $protocols[0].'://'.preg_replace('~^(?!ftps?)[^:]+://~', '', $replace); |
|
| 430 | 430 | elseif (!$found) |
| 431 | - $replace = $protocols[0] . '://' . $replace; |
|
| 431 | + $replace = $protocols[0].'://'.$replace; |
|
| 432 | 432 | |
| 433 | 433 | if ($hasEqualSign && $embeddedUrl) |
| 434 | - $replaces[$matches[0][$k]] = '[' . $this_tag . '="' . $replace . '"]' . (empty($matches[4][$k]) ? '' : $matches[3][$k] . '[/' . $this_close . ']'); |
|
| 434 | + $replaces[$matches[0][$k]] = '['.$this_tag.'="'.$replace.'"]'.(empty($matches[4][$k]) ? '' : $matches[3][$k].'[/'.$this_close.']'); |
|
| 435 | 435 | elseif ($hasEqualSign) |
| 436 | - $replaces['[' . $matches[1][$k] . '=' . $matches[2][$k] . ']'] = '[' . $this_tag . '=' . $replace . ']'; |
|
| 436 | + $replaces['['.$matches[1][$k].'='.$matches[2][$k].']'] = '['.$this_tag.'='.$replace.']'; |
|
| 437 | 437 | elseif ($embeddedUrl) |
| 438 | - $replaces['[' . $matches[1][$k] . ']' . $matches[2][$k] . '[/' . $matches[3][$k] . ']'] = '[' . $this_tag . '=' . $replace . ']' . $matches[2][$k] . '[/' . $this_close . ']'; |
|
| 438 | + $replaces['['.$matches[1][$k].']'.$matches[2][$k].'[/'.$matches[3][$k].']'] = '['.$this_tag.'='.$replace.']'.$matches[2][$k].'[/'.$this_close.']'; |
|
| 439 | 439 | else |
| 440 | - $replaces['[' . $matches[1][$k] . ']' . $matches[2][$k] . '[/' . $matches[3][$k] . ']'] = '[' . $this_tag . ']' . $replace . '[/' . $this_close . ']'; |
|
| 440 | + $replaces['['.$matches[1][$k].']'.$matches[2][$k].'[/'.$matches[3][$k].']'] = '['.$this_tag.']'.$replace.'[/'.$this_close.']'; |
|
| 441 | 441 | } |
| 442 | 442 | |
| 443 | 443 | foreach ($replaces as $k => $v) |
@@ -530,22 +530,22 @@ discard block |
||
| 530 | 530 | if ($hotmail_fix && !$send_html) |
| 531 | 531 | { |
| 532 | 532 | $send_html = true; |
| 533 | - $message = strtr($message, array($line_break => '<br>' . $line_break)); |
|
| 534 | - $message = preg_replace('~(' . preg_quote($scripturl, '~') . '(?:[?/][\w\-_%\.,\?&;=#]+)?)~', '<a href="$1">$1</a>', $message); |
|
| 533 | + $message = strtr($message, array($line_break => '<br>'.$line_break)); |
|
| 534 | + $message = preg_replace('~('.preg_quote($scripturl, '~').'(?:[?/][\w\-_%\.,\?&;=#]+)?)~', '<a href="$1">$1</a>', $message); |
|
| 535 | 535 | } |
| 536 | 536 | |
| 537 | 537 | list (, $from_name) = mimespecialchars(addcslashes($from !== null ? $from : $context['forum_name'], '<>()\'\\"'), true, $hotmail_fix, $line_break); |
| 538 | 538 | list (, $subject) = mimespecialchars($subject, true, $hotmail_fix, $line_break); |
| 539 | 539 | |
| 540 | 540 | // Construct the mail headers... |
| 541 | - $headers = 'From: ' . $from_name . ' <' . (empty($modSettings['mail_from']) ? $webmaster_email : $modSettings['mail_from']) . '>' . $line_break; |
|
| 542 | - $headers .= $from !== null ? 'Reply-To: <' . $from . '>' . $line_break : ''; |
|
| 543 | - $headers .= 'Return-Path: ' . (empty($modSettings['mail_from']) ? $webmaster_email : $modSettings['mail_from']) . $line_break; |
|
| 544 | - $headers .= 'Date: ' . gmdate('D, d M Y H:i:s') . ' -0000' . $line_break; |
|
| 541 | + $headers = 'From: '.$from_name.' <'.(empty($modSettings['mail_from']) ? $webmaster_email : $modSettings['mail_from']).'>'.$line_break; |
|
| 542 | + $headers .= $from !== null ? 'Reply-To: <'.$from.'>'.$line_break : ''; |
|
| 543 | + $headers .= 'Return-Path: '.(empty($modSettings['mail_from']) ? $webmaster_email : $modSettings['mail_from']).$line_break; |
|
| 544 | + $headers .= 'Date: '.gmdate('D, d M Y H:i:s').' -0000'.$line_break; |
|
| 545 | 545 | |
| 546 | 546 | if ($message_id !== null && empty($modSettings['mail_no_message_id'])) |
| 547 | - $headers .= 'Message-ID: <' . md5($scripturl . microtime()) . '-' . $message_id . strstr(empty($modSettings['mail_from']) ? $webmaster_email : $modSettings['mail_from'], '@') . '>' . $line_break; |
|
| 548 | - $headers .= 'X-Mailer: SMF' . $line_break; |
|
| 547 | + $headers .= 'Message-ID: <'.md5($scripturl.microtime()).'-'.$message_id.strstr(empty($modSettings['mail_from']) ? $webmaster_email : $modSettings['mail_from'], '@').'>'.$line_break; |
|
| 548 | + $headers .= 'X-Mailer: SMF'.$line_break; |
|
| 549 | 549 | |
| 550 | 550 | // Pass this to the integration before we start modifying the output -- it'll make it easier later. |
| 551 | 551 | if (in_array(false, call_integration_hook('integrate_outgoing_email', array(&$subject, &$message, &$headers, &$to_array)), true)) |
@@ -555,12 +555,12 @@ discard block |
||
| 555 | 555 | $orig_message = $message; |
| 556 | 556 | |
| 557 | 557 | // The mime boundary separates the different alternative versions. |
| 558 | - $mime_boundary = 'SMF-' . md5($message . time()); |
|
| 558 | + $mime_boundary = 'SMF-'.md5($message.time()); |
|
| 559 | 559 | |
| 560 | 560 | // Using mime, as it allows to send a plain unencoded alternative. |
| 561 | - $headers .= 'Mime-Version: 1.0' . $line_break; |
|
| 562 | - $headers .= 'content-type: multipart/alternative; boundary="' . $mime_boundary . '"' . $line_break; |
|
| 563 | - $headers .= 'content-transfer-encoding: 7bit' . $line_break; |
|
| 561 | + $headers .= 'Mime-Version: 1.0'.$line_break; |
|
| 562 | + $headers .= 'content-type: multipart/alternative; boundary="'.$mime_boundary.'"'.$line_break; |
|
| 563 | + $headers .= 'content-transfer-encoding: 7bit'.$line_break; |
|
| 564 | 564 | |
| 565 | 565 | // Sending HTML? Let's plop in some basic stuff, then. |
| 566 | 566 | if ($send_html) |
@@ -569,32 +569,32 @@ discard block |
||
| 569 | 569 | |
| 570 | 570 | // But, then, dump it and use a plain one for dinosaur clients. |
| 571 | 571 | list(, $plain_message) = mimespecialchars($no_html_message, false, true, $line_break); |
| 572 | - $message = $plain_message . $line_break . '--' . $mime_boundary . $line_break; |
|
| 572 | + $message = $plain_message.$line_break.'--'.$mime_boundary.$line_break; |
|
| 573 | 573 | |
| 574 | 574 | // This is the plain text version. Even if no one sees it, we need it for spam checkers. |
| 575 | 575 | list($charset, $plain_charset_message, $encoding) = mimespecialchars($no_html_message, false, false, $line_break); |
| 576 | - $message .= 'content-type: text/plain; charset=' . $charset . $line_break; |
|
| 577 | - $message .= 'content-transfer-encoding: ' . $encoding . $line_break . $line_break; |
|
| 578 | - $message .= $plain_charset_message . $line_break . '--' . $mime_boundary . $line_break; |
|
| 576 | + $message .= 'content-type: text/plain; charset='.$charset.$line_break; |
|
| 577 | + $message .= 'content-transfer-encoding: '.$encoding.$line_break.$line_break; |
|
| 578 | + $message .= $plain_charset_message.$line_break.'--'.$mime_boundary.$line_break; |
|
| 579 | 579 | |
| 580 | 580 | // This is the actual HTML message, prim and proper. If we wanted images, they could be inlined here (with multipart/related, etc.) |
| 581 | 581 | list($charset, $html_message, $encoding) = mimespecialchars($orig_message, false, $hotmail_fix, $line_break); |
| 582 | - $message .= 'content-type: text/html; charset=' . $charset . $line_break; |
|
| 583 | - $message .= 'content-transfer-encoding: ' . ($encoding == '' ? '7bit' : $encoding) . $line_break . $line_break; |
|
| 584 | - $message .= $html_message . $line_break . '--' . $mime_boundary . '--'; |
|
| 582 | + $message .= 'content-type: text/html; charset='.$charset.$line_break; |
|
| 583 | + $message .= 'content-transfer-encoding: '.($encoding == '' ? '7bit' : $encoding).$line_break.$line_break; |
|
| 584 | + $message .= $html_message.$line_break.'--'.$mime_boundary.'--'; |
|
| 585 | 585 | } |
| 586 | 586 | // Text is good too. |
| 587 | 587 | else |
| 588 | 588 | { |
| 589 | 589 | // Send a plain message first, for the older web clients. |
| 590 | 590 | list(, $plain_message) = mimespecialchars($orig_message, false, true, $line_break); |
| 591 | - $message = $plain_message . $line_break . '--' . $mime_boundary . $line_break; |
|
| 591 | + $message = $plain_message.$line_break.'--'.$mime_boundary.$line_break; |
|
| 592 | 592 | |
| 593 | 593 | // Now add an encoded message using the forum's character set. |
| 594 | 594 | list ($charset, $encoded_message, $encoding) = mimespecialchars($orig_message, false, false, $line_break); |
| 595 | - $message .= 'content-type: text/plain; charset=' . $charset . $line_break; |
|
| 596 | - $message .= 'content-transfer-encoding: ' . $encoding . $line_break . $line_break; |
|
| 597 | - $message .= $encoded_message . $line_break . '--' . $mime_boundary . '--'; |
|
| 595 | + $message .= 'content-type: text/plain; charset='.$charset.$line_break; |
|
| 596 | + $message .= 'content-transfer-encoding: '.$encoding.$line_break.$line_break; |
|
| 597 | + $message .= $encoded_message.$line_break.'--'.$mime_boundary.'--'; |
|
| 598 | 598 | } |
| 599 | 599 | |
| 600 | 600 | // Are we using the mail queue, if so this is where we butt in... |
@@ -606,9 +606,9 @@ discard block |
||
| 606 | 606 | { |
| 607 | 607 | list ($last_mail_time, $mails_this_minute) = @explode('|', $modSettings['mail_recent']); |
| 608 | 608 | if (empty($mails_this_minute) || time() > $last_mail_time + 60) |
| 609 | - $new_queue_stat = time() . '|' . 1; |
|
| 609 | + $new_queue_stat = time().'|'.1; |
|
| 610 | 610 | else |
| 611 | - $new_queue_stat = $last_mail_time . '|' . ((int) $mails_this_minute + 1); |
|
| 611 | + $new_queue_stat = $last_mail_time.'|'.((int) $mails_this_minute + 1); |
|
| 612 | 612 | |
| 613 | 613 | updateSettings(array('mail_recent' => $new_queue_stat)); |
| 614 | 614 | } |
@@ -643,7 +643,7 @@ discard block |
||
| 643 | 643 | $mail_result = false; |
| 644 | 644 | } |
| 645 | 645 | } |
| 646 | - catch(ErrorException $e) |
|
| 646 | + catch (ErrorException $e) |
|
| 647 | 647 | { |
| 648 | 648 | log_error($e->getMessage(), 'general', $e->getFile(), $e->getLine()); |
| 649 | 649 | log_error(sprintf($txt['mail_send_unable'], $to)); |
@@ -831,7 +831,7 @@ discard block |
||
| 831 | 831 | $request = $smcFunc['db_query']('pm_find_username', ' |
| 832 | 832 | SELECT id_member, member_name |
| 833 | 833 | FROM {db_prefix}members |
| 834 | - WHERE ' . ($smcFunc['db_case_sensitive'] ? 'LOWER(member_name)' : 'member_name') . ' IN ({array_string:usernames})', |
|
| 834 | + WHERE ' . ($smcFunc['db_case_sensitive'] ? 'LOWER(member_name)' : 'member_name').' IN ({array_string:usernames})', |
|
| 835 | 835 | array( |
| 836 | 836 | 'usernames' => array_keys($usernames), |
| 837 | 837 | ) |
@@ -919,14 +919,14 @@ discard block |
||
| 919 | 919 | } |
| 920 | 920 | |
| 921 | 921 | // Load the groups that are allowed to read PMs. |
| 922 | - require_once($sourcedir . '/Subs-Members.php'); |
|
| 922 | + require_once($sourcedir.'/Subs-Members.php'); |
|
| 923 | 923 | $pmReadGroups = groupsAllowedTo('pm_read'); |
| 924 | 924 | |
| 925 | 925 | if (empty($modSettings['permission_enable_deny'])) |
| 926 | 926 | $pmReadGroups['denied'] = array(); |
| 927 | 927 | |
| 928 | 928 | // Load their alert preferences |
| 929 | - require_once($sourcedir . '/Subs-Notify.php'); |
|
| 929 | + require_once($sourcedir.'/Subs-Notify.php'); |
|
| 930 | 930 | $notifyPrefs = getNotifyPrefs($all_to, array('pm_new', 'pm_reply', 'pm_notify'), true); |
| 931 | 931 | |
| 932 | 932 | $request = $smcFunc['db_query']('', ' |
@@ -935,7 +935,7 @@ discard block |
||
| 935 | 935 | instant_messages,' . (allowedTo('moderate_forum') ? ' 0' : ' |
| 936 | 936 | (pm_receive_from = {int:admins_only}' . (empty($modSettings['enable_buddylist']) ? '' : ' OR |
| 937 | 937 | (pm_receive_from = {int:buddies_only} AND FIND_IN_SET({string:from_id}, buddy_list) = 0) OR |
| 938 | - (pm_receive_from = {int:not_on_ignore_list} AND FIND_IN_SET({string:from_id}, pm_ignore_list) != 0)') . ')') . ' AS ignored, |
|
| 938 | + (pm_receive_from = {int:not_on_ignore_list} AND FIND_IN_SET({string:from_id}, pm_ignore_list) != 0)').')').' AS ignored, |
|
| 939 | 939 | FIND_IN_SET({string:from_id}, buddy_list) != 0 AS is_buddy, is_activated, |
| 940 | 940 | additional_groups, id_group, id_post_group |
| 941 | 941 | FROM {db_prefix}members |
@@ -1114,18 +1114,18 @@ discard block |
||
| 1114 | 1114 | 'SUBJECT' => $subject, |
| 1115 | 1115 | 'MESSAGE' => $message, |
| 1116 | 1116 | 'SENDER' => un_htmlspecialchars($from['name']), |
| 1117 | - 'READLINK' => $scripturl . '?action=pm;pmsg=' . $id_pm . '#msg' . $id_pm, |
|
| 1118 | - 'REPLYLINK' => $scripturl . '?action=pm;sa=send;f=inbox;pmsg=' . $id_pm . ';quote;u=' . $from['id'], |
|
| 1117 | + 'READLINK' => $scripturl.'?action=pm;pmsg='.$id_pm.'#msg'.$id_pm, |
|
| 1118 | + 'REPLYLINK' => $scripturl.'?action=pm;sa=send;f=inbox;pmsg='.$id_pm.';quote;u='.$from['id'], |
|
| 1119 | 1119 | 'TOLIST' => implode(', ', $to_names), |
| 1120 | 1120 | ); |
| 1121 | - $email_template = 'new_pm' . (empty($modSettings['disallow_sendBody']) ? '_body' : '') . (!empty($to_names) ? '_tolist' : ''); |
|
| 1121 | + $email_template = 'new_pm'.(empty($modSettings['disallow_sendBody']) ? '_body' : '').(!empty($to_names) ? '_tolist' : ''); |
|
| 1122 | 1122 | |
| 1123 | 1123 | foreach ($notifications as $lang => $notification_list) |
| 1124 | 1124 | { |
| 1125 | 1125 | $emaildata = loadEmailTemplate($email_template, $replacements, $lang); |
| 1126 | 1126 | |
| 1127 | 1127 | // Off the notification email goes! |
| 1128 | - sendmail($notification_list, $emaildata['subject'], $emaildata['body'], null, 'p' . $id_pm, $emaildata['is_html'], 2, null, true); |
|
| 1128 | + sendmail($notification_list, $emaildata['subject'], $emaildata['body'], null, 'p'.$id_pm, $emaildata['is_html'], 2, null, true); |
|
| 1129 | 1129 | } |
| 1130 | 1130 | |
| 1131 | 1131 | // Integrated After PMs |
@@ -1212,11 +1212,11 @@ discard block |
||
| 1212 | 1212 | if (strlen($c) === 1 && ord($c[0]) <= 0x7F) |
| 1213 | 1213 | return $c; |
| 1214 | 1214 | elseif (strlen($c) === 2 && ord($c[0]) >= 0xC0 && ord($c[0]) <= 0xDF) |
| 1215 | - return "&#" . (((ord($c[0]) ^ 0xC0) << 6) + (ord($c[1]) ^ 0x80)) . ";"; |
|
| 1215 | + return "&#".(((ord($c[0]) ^ 0xC0) << 6) + (ord($c[1]) ^ 0x80)).";"; |
|
| 1216 | 1216 | elseif (strlen($c) === 3 && ord($c[0]) >= 0xE0 && ord($c[0]) <= 0xEF) |
| 1217 | - return "&#" . (((ord($c[0]) ^ 0xE0) << 12) + ((ord($c[1]) ^ 0x80) << 6) + (ord($c[2]) ^ 0x80)) . ";"; |
|
| 1217 | + return "&#".(((ord($c[0]) ^ 0xE0) << 12) + ((ord($c[1]) ^ 0x80) << 6) + (ord($c[2]) ^ 0x80)).";"; |
|
| 1218 | 1218 | elseif (strlen($c) === 4 && ord($c[0]) >= 0xF0 && ord($c[0]) <= 0xF7) |
| 1219 | - return "&#" . (((ord($c[0]) ^ 0xF0) << 18) + ((ord($c[1]) ^ 0x80) << 12) + ((ord($c[2]) ^ 0x80) << 6) + (ord($c[3]) ^ 0x80)) . ";"; |
|
| 1219 | + return "&#".(((ord($c[0]) ^ 0xF0) << 18) + ((ord($c[1]) ^ 0x80) << 12) + ((ord($c[2]) ^ 0x80) << 6) + (ord($c[3]) ^ 0x80)).";"; |
|
| 1220 | 1220 | else |
| 1221 | 1221 | return ""; |
| 1222 | 1222 | }; |
@@ -1233,7 +1233,7 @@ discard block |
||
| 1233 | 1233 | |
| 1234 | 1234 | // Show the characterset and the transfer-encoding for header strings. |
| 1235 | 1235 | if ($with_charset) |
| 1236 | - $string = '=?' . $charset . '?B?' . $string . '?='; |
|
| 1236 | + $string = '=?'.$charset.'?B?'.$string.'?='; |
|
| 1237 | 1237 | |
| 1238 | 1238 | // Break it up in lines (mail body). |
| 1239 | 1239 | else |
@@ -1276,11 +1276,11 @@ discard block |
||
| 1276 | 1276 | if ($socket) |
| 1277 | 1277 | { |
| 1278 | 1278 | fgets($socket, 256); |
| 1279 | - fputs($socket, 'USER ' . $modSettings['smtp_username'] . "\r\n"); |
|
| 1279 | + fputs($socket, 'USER '.$modSettings['smtp_username']."\r\n"); |
|
| 1280 | 1280 | fgets($socket, 256); |
| 1281 | - fputs($socket, 'PASS ' . base64_decode($modSettings['smtp_password']) . "\r\n"); |
|
| 1281 | + fputs($socket, 'PASS '.base64_decode($modSettings['smtp_password'])."\r\n"); |
|
| 1282 | 1282 | fgets($socket, 256); |
| 1283 | - fputs($socket, 'QUIT' . "\r\n"); |
|
| 1283 | + fputs($socket, 'QUIT'."\r\n"); |
|
| 1284 | 1284 | |
| 1285 | 1285 | fclose($socket); |
| 1286 | 1286 | } |
@@ -1303,7 +1303,7 @@ discard block |
||
| 1303 | 1303 | // Unable to connect! Don't show any error message, but just log one and try to continue anyway. |
| 1304 | 1304 | if (!$socket) |
| 1305 | 1305 | { |
| 1306 | - log_error($txt['smtp_no_connect'] . ': ' . $errno . ' : ' . $errstr); |
|
| 1306 | + log_error($txt['smtp_no_connect'].': '.$errno.' : '.$errstr); |
|
| 1307 | 1307 | return false; |
| 1308 | 1308 | } |
| 1309 | 1309 | } |
@@ -1323,7 +1323,7 @@ discard block |
||
| 1323 | 1323 | $helo = php_uname('n'); |
| 1324 | 1324 | |
| 1325 | 1325 | // If the hostname isn't a fully qualified domain name, we can use the host name from $boardurl instead |
| 1326 | - if (empty($helo) || strpos($helo, '.') === false || substr_compare($helo, '.local', -6) === 0 || (!empty($modSettings['tld_regex']) && !preg_match('/\.' . $modSettings['tld_regex'] . '$/u', $helo))) |
|
| 1326 | + if (empty($helo) || strpos($helo, '.') === false || substr_compare($helo, '.local', -6) === 0 || (!empty($modSettings['tld_regex']) && !preg_match('/\.'.$modSettings['tld_regex'].'$/u', $helo))) |
|
| 1327 | 1327 | $helo = parse_url($boardurl, PHP_URL_HOST); |
| 1328 | 1328 | |
| 1329 | 1329 | // This is one of those situations where 'www.' is undesirable |
@@ -1335,7 +1335,7 @@ discard block |
||
| 1335 | 1335 | if (in_array($modSettings['mail_type'], array(1, 2)) && $modSettings['smtp_username'] != '' && $modSettings['smtp_password'] != '') |
| 1336 | 1336 | { |
| 1337 | 1337 | // EHLO could be understood to mean encrypted hello... |
| 1338 | - if (server_parse('EHLO ' . $helo, $socket, null, $response) == '250') |
|
| 1338 | + if (server_parse('EHLO '.$helo, $socket, null, $response) == '250') |
|
| 1339 | 1339 | { |
| 1340 | 1340 | // Are we using STARTTLS and does the server support STARTTLS? |
| 1341 | 1341 | if ($modSettings['mail_type'] == 2 && preg_match("~250( |-)STARTTLS~mi", $response)) |
@@ -1356,7 +1356,7 @@ discard block |
||
| 1356 | 1356 | if (!@stream_socket_enable_crypto($socket, true, $crypto_method)) |
| 1357 | 1357 | return false; |
| 1358 | 1358 | // Send the EHLO command again |
| 1359 | - if (!server_parse('EHLO ' . $helo, $socket, null) == '250') |
|
| 1359 | + if (!server_parse('EHLO '.$helo, $socket, null) == '250') |
|
| 1360 | 1360 | return false; |
| 1361 | 1361 | } |
| 1362 | 1362 | |
@@ -1369,18 +1369,18 @@ discard block |
||
| 1369 | 1369 | if (!server_parse($modSettings['smtp_password'], $socket, '235')) |
| 1370 | 1370 | return false; |
| 1371 | 1371 | } |
| 1372 | - elseif (!server_parse('HELO ' . $helo, $socket, '250')) |
|
| 1372 | + elseif (!server_parse('HELO '.$helo, $socket, '250')) |
|
| 1373 | 1373 | return false; |
| 1374 | 1374 | } |
| 1375 | 1375 | else |
| 1376 | 1376 | { |
| 1377 | 1377 | // Just say "helo". |
| 1378 | - if (!server_parse('HELO ' . $helo, $socket, '250')) |
|
| 1378 | + if (!server_parse('HELO '.$helo, $socket, '250')) |
|
| 1379 | 1379 | return false; |
| 1380 | 1380 | } |
| 1381 | 1381 | |
| 1382 | 1382 | // Fix the message for any lines beginning with a period! (the first is ignored, you see.) |
| 1383 | - $message = strtr($message, array("\r\n" . '.' => "\r\n" . '..')); |
|
| 1383 | + $message = strtr($message, array("\r\n".'.' => "\r\n".'..')); |
|
| 1384 | 1384 | |
| 1385 | 1385 | // !! Theoretically, we should be able to just loop the RCPT TO. |
| 1386 | 1386 | $mail_to_array = array_values($mail_to_array); |
@@ -1394,17 +1394,17 @@ discard block |
||
| 1394 | 1394 | } |
| 1395 | 1395 | |
| 1396 | 1396 | // From, to, and then start the data... |
| 1397 | - if (!server_parse('MAIL FROM: <' . (empty($modSettings['mail_from']) ? $webmaster_email : $modSettings['mail_from']) . '>', $socket, '250')) |
|
| 1397 | + if (!server_parse('MAIL FROM: <'.(empty($modSettings['mail_from']) ? $webmaster_email : $modSettings['mail_from']).'>', $socket, '250')) |
|
| 1398 | 1398 | return false; |
| 1399 | - if (!server_parse('RCPT TO: <' . $mail_to . '>', $socket, '250')) |
|
| 1399 | + if (!server_parse('RCPT TO: <'.$mail_to.'>', $socket, '250')) |
|
| 1400 | 1400 | return false; |
| 1401 | 1401 | if (!server_parse('DATA', $socket, '354')) |
| 1402 | 1402 | return false; |
| 1403 | - fputs($socket, 'Subject: ' . $subject . "\r\n"); |
|
| 1403 | + fputs($socket, 'Subject: '.$subject."\r\n"); |
|
| 1404 | 1404 | if (strlen($mail_to) > 0) |
| 1405 | - fputs($socket, 'To: <' . $mail_to . '>' . "\r\n"); |
|
| 1406 | - fputs($socket, $headers . "\r\n\r\n"); |
|
| 1407 | - fputs($socket, $message . "\r\n"); |
|
| 1405 | + fputs($socket, 'To: <'.$mail_to.'>'."\r\n"); |
|
| 1406 | + fputs($socket, $headers."\r\n\r\n"); |
|
| 1407 | + fputs($socket, $message."\r\n"); |
|
| 1408 | 1408 | |
| 1409 | 1409 | // Send a ., or in other words "end of data". |
| 1410 | 1410 | if (!server_parse('.', $socket, '250')) |
@@ -1415,7 +1415,7 @@ discard block |
||
| 1415 | 1415 | if (function_exists('apache_reset_timeout')) |
| 1416 | 1416 | @apache_reset_timeout(); |
| 1417 | 1417 | } |
| 1418 | - fputs($socket, 'QUIT' . "\r\n"); |
|
| 1418 | + fputs($socket, 'QUIT'."\r\n"); |
|
| 1419 | 1419 | fclose($socket); |
| 1420 | 1420 | |
| 1421 | 1421 | return true; |
@@ -1438,7 +1438,7 @@ discard block |
||
| 1438 | 1438 | global $txt; |
| 1439 | 1439 | |
| 1440 | 1440 | if ($message !== null) |
| 1441 | - fputs($socket, $message . "\r\n"); |
|
| 1441 | + fputs($socket, $message."\r\n"); |
|
| 1442 | 1442 | |
| 1443 | 1443 | // No response yet. |
| 1444 | 1444 | $server_response = ''; |
@@ -1459,7 +1459,7 @@ discard block |
||
| 1459 | 1459 | |
| 1460 | 1460 | if (substr($server_response, 0, 3) != $code) |
| 1461 | 1461 | { |
| 1462 | - log_error($txt['smtp_error'] . $server_response); |
|
| 1462 | + log_error($txt['smtp_error'].$server_response); |
|
| 1463 | 1463 | return false; |
| 1464 | 1464 | } |
| 1465 | 1465 | |
@@ -1490,7 +1490,7 @@ discard block |
||
| 1490 | 1490 | |
| 1491 | 1491 | // Construct a bit of Javascript code. |
| 1492 | 1492 | $context['spell_js'] = ' |
| 1493 | - var txt = {"done": "' . $txt['spellcheck_done'] . '"}; |
|
| 1493 | + var txt = {"done": "' . $txt['spellcheck_done'].'"}; |
|
| 1494 | 1494 | var mispstr = window.opener.spellCheckGetText(spell_fieldname); |
| 1495 | 1495 | var misps = Array('; |
| 1496 | 1496 | |
@@ -1512,7 +1512,7 @@ discard block |
||
| 1512 | 1512 | |
| 1513 | 1513 | // Add on the javascript for this misspelling. |
| 1514 | 1514 | $context['spell_js'] .= ' |
| 1515 | - new misp("' . strtr($check_word[0], array('\\' => '\\\\', '"' => '\\"', '<' => '', '>' => '')) . '", ' . (int) $check_word[1] . ', ' . (int) $check_word[2] . ', ['; |
|
| 1515 | + new misp("' . strtr($check_word[0], array('\\' => '\\\\', '"' => '\\"', '<' => '', '>' => '')).'", '.(int) $check_word[1].', '.(int) $check_word[2].', ['; |
|
| 1516 | 1516 | |
| 1517 | 1517 | // If there are suggestions, add them in... |
| 1518 | 1518 | $suggestions = spell_suggest($dict, $check_word[0]); |
@@ -1524,7 +1524,7 @@ discard block |
||
| 1524 | 1524 | unset($suggestions[$k]); |
| 1525 | 1525 | |
| 1526 | 1526 | if (!empty($suggestions)) |
| 1527 | - $context['spell_js'] .= '"' . implode('", "', $suggestions) . '"'; |
|
| 1527 | + $context['spell_js'] .= '"'.implode('", "', $suggestions).'"'; |
|
| 1528 | 1528 | } |
| 1529 | 1529 | |
| 1530 | 1530 | $context['spell_js'] .= ']),'; |
@@ -1644,7 +1644,7 @@ discard block |
||
| 1644 | 1644 | { |
| 1645 | 1645 | global $user_info, $txt, $modSettings, $smcFunc, $sourcedir; |
| 1646 | 1646 | |
| 1647 | - require_once($sourcedir . '/Mentions.php'); |
|
| 1647 | + require_once($sourcedir.'/Mentions.php'); |
|
| 1648 | 1648 | |
| 1649 | 1649 | // Set optional parameters to the default value. |
| 1650 | 1650 | $msgOptions['icon'] = empty($msgOptions['icon']) ? 'xx' : $msgOptions['icon']; |
@@ -1704,7 +1704,7 @@ discard block |
||
| 1704 | 1704 | // Couldn't find the current poster? |
| 1705 | 1705 | if ($smcFunc['db_num_rows']($request) == 0) |
| 1706 | 1706 | { |
| 1707 | - trigger_error('createPost(): Invalid member id ' . $posterOptions['id'], E_USER_NOTICE); |
|
| 1707 | + trigger_error('createPost(): Invalid member id '.$posterOptions['id'], E_USER_NOTICE); |
|
| 1708 | 1708 | $posterOptions['id'] = 0; |
| 1709 | 1709 | $posterOptions['name'] = $txt['guest_title']; |
| 1710 | 1710 | $posterOptions['email'] = ''; |
@@ -1733,7 +1733,7 @@ discard block |
||
| 1733 | 1733 | $new_topic = empty($topicOptions['id']); |
| 1734 | 1734 | |
| 1735 | 1735 | $message_columns = array( |
| 1736 | - 'id_board' => 'int', 'id_topic' => 'int', 'id_member' => 'int', 'subject' => 'string-255', 'body' => (!empty($modSettings['max_messageLength']) && $modSettings['max_messageLength'] > 65534 ? 'string-' . $modSettings['max_messageLength'] : (empty($modSettings['max_messageLength']) ? 'string' : 'string-65534')), |
|
| 1736 | + 'id_board' => 'int', 'id_topic' => 'int', 'id_member' => 'int', 'subject' => 'string-255', 'body' => (!empty($modSettings['max_messageLength']) && $modSettings['max_messageLength'] > 65534 ? 'string-'.$modSettings['max_messageLength'] : (empty($modSettings['max_messageLength']) ? 'string' : 'string-65534')), |
|
| 1737 | 1737 | 'poster_name' => 'string-255', 'poster_email' => 'string-255', 'poster_time' => 'int', 'poster_ip' => 'inet', |
| 1738 | 1738 | 'smileys_enabled' => 'int', 'modified_name' => 'string', 'icon' => 'string-16', 'approved' => 'int', |
| 1739 | 1739 | ); |
@@ -1868,7 +1868,7 @@ discard block |
||
| 1868 | 1868 | $smcFunc['db_query']('', ' |
| 1869 | 1869 | UPDATE {db_prefix}topics |
| 1870 | 1870 | SET |
| 1871 | - ' . implode(', ', $topics_columns) . ' |
|
| 1871 | + ' . implode(', ', $topics_columns).' |
|
| 1872 | 1872 | WHERE id_topic = {int:id_topic}', |
| 1873 | 1873 | $update_parameters |
| 1874 | 1874 | ); |
@@ -1892,7 +1892,7 @@ discard block |
||
| 1892 | 1892 | if ($msgOptions['approved']) |
| 1893 | 1893 | $smcFunc['db_query']('', ' |
| 1894 | 1894 | UPDATE {db_prefix}boards |
| 1895 | - SET num_posts = num_posts + 1' . ($new_topic ? ', num_topics = num_topics + 1' : '') . ' |
|
| 1895 | + SET num_posts = num_posts + 1' . ($new_topic ? ', num_topics = num_topics + 1' : '').' |
|
| 1896 | 1896 | WHERE id_board = {int:id_board}', |
| 1897 | 1897 | array( |
| 1898 | 1898 | 'id_board' => $topicOptions['board'], |
@@ -1902,7 +1902,7 @@ discard block |
||
| 1902 | 1902 | { |
| 1903 | 1903 | $smcFunc['db_query']('', ' |
| 1904 | 1904 | UPDATE {db_prefix}boards |
| 1905 | - SET unapproved_posts = unapproved_posts + 1' . ($new_topic ? ', unapproved_topics = unapproved_topics + 1' : '') . ' |
|
| 1905 | + SET unapproved_posts = unapproved_posts + 1' . ($new_topic ? ', unapproved_topics = unapproved_topics + 1' : '').' |
|
| 1906 | 1906 | WHERE id_board = {int:id_board}', |
| 1907 | 1907 | array( |
| 1908 | 1908 | 'id_board' => $topicOptions['board'], |
@@ -1983,7 +1983,7 @@ discard block |
||
| 1983 | 1983 | ); |
| 1984 | 1984 | |
| 1985 | 1985 | // If there's a custom search index, it may need updating... |
| 1986 | - require_once($sourcedir . '/Search.php'); |
|
| 1986 | + require_once($sourcedir.'/Search.php'); |
|
| 1987 | 1987 | $searchAPI = findSearchAPI(); |
| 1988 | 1988 | if (is_callable(array($searchAPI, 'postCreated'))) |
| 1989 | 1989 | $searchAPI->postCreated($msgOptions, $topicOptions, $posterOptions); |
@@ -2094,14 +2094,14 @@ discard block |
||
| 2094 | 2094 | ); |
| 2095 | 2095 | |
| 2096 | 2096 | // Update search api |
| 2097 | - require_once($sourcedir . '/Search.php'); |
|
| 2097 | + require_once($sourcedir.'/Search.php'); |
|
| 2098 | 2098 | $searchAPI = findSearchAPI(); |
| 2099 | 2099 | if ($searchAPI->supportsMethod('postRemoved')) |
| 2100 | 2100 | $searchAPI->postRemoved($msgOptions['id']); |
| 2101 | 2101 | |
| 2102 | 2102 | if (!empty($modSettings['enable_mentions']) && isset($msgOptions['body'])) |
| 2103 | 2103 | { |
| 2104 | - require_once($sourcedir . '/Mentions.php'); |
|
| 2104 | + require_once($sourcedir.'/Mentions.php'); |
|
| 2105 | 2105 | |
| 2106 | 2106 | $oldmentions = array(); |
| 2107 | 2107 | |
@@ -2150,8 +2150,8 @@ discard block |
||
| 2150 | 2150 | |
| 2151 | 2151 | foreach ($messages_columns as $var => $val) |
| 2152 | 2152 | { |
| 2153 | - $messages_columns[$var] = $var . ' = {' . (in_array($var, $messageInts) ? 'int' : 'string') . ':var_' . $var . '}'; |
|
| 2154 | - $update_parameters['var_' . $var] = $val; |
|
| 2153 | + $messages_columns[$var] = $var.' = {'.(in_array($var, $messageInts) ? 'int' : 'string').':var_'.$var.'}'; |
|
| 2154 | + $update_parameters['var_'.$var] = $val; |
|
| 2155 | 2155 | } |
| 2156 | 2156 | |
| 2157 | 2157 | // Nothing to do? |
@@ -2161,7 +2161,7 @@ discard block |
||
| 2161 | 2161 | // Change the post. |
| 2162 | 2162 | $smcFunc['db_query']('', ' |
| 2163 | 2163 | UPDATE {db_prefix}messages |
| 2164 | - SET ' . implode(', ', $messages_columns) . ' |
|
| 2164 | + SET ' . implode(', ', $messages_columns).' |
|
| 2165 | 2165 | WHERE id_msg = {int:id_msg}', |
| 2166 | 2166 | $update_parameters |
| 2167 | 2167 | ); |
@@ -2215,7 +2215,7 @@ discard block |
||
| 2215 | 2215 | } |
| 2216 | 2216 | |
| 2217 | 2217 | // If there's a custom search index, it needs to be modified... |
| 2218 | - require_once($sourcedir . '/Search.php'); |
|
| 2218 | + require_once($sourcedir.'/Search.php'); |
|
| 2219 | 2219 | $searchAPI = findSearchAPI(); |
| 2220 | 2220 | if (is_callable(array($searchAPI, 'postModified'))) |
| 2221 | 2221 | $searchAPI->postModified($msgOptions, $topicOptions, $posterOptions); |
@@ -2492,7 +2492,7 @@ discard block |
||
| 2492 | 2492 | // Post count for the members? |
| 2493 | 2493 | if (!empty($member_post_changes)) |
| 2494 | 2494 | foreach ($member_post_changes as $id_member => $count_change) |
| 2495 | - updateMemberData($id_member, array('posts' => 'posts ' . ($approve ? '+' : '-') . ' ' . $count_change)); |
|
| 2495 | + updateMemberData($id_member, array('posts' => 'posts '.($approve ? '+' : '-').' '.$count_change)); |
|
| 2496 | 2496 | |
| 2497 | 2497 | return true; |
| 2498 | 2498 | } |
@@ -2634,15 +2634,15 @@ discard block |
||
| 2634 | 2634 | |
| 2635 | 2635 | foreach ($lastMsg as $id => $msg) |
| 2636 | 2636 | { |
| 2637 | - if (!isset($board_updates[$msg . '-' . $lastModified[$id]])) |
|
| 2638 | - $board_updates[$msg . '-' . $lastModified[$id]] = array( |
|
| 2637 | + if (!isset($board_updates[$msg.'-'.$lastModified[$id]])) |
|
| 2638 | + $board_updates[$msg.'-'.$lastModified[$id]] = array( |
|
| 2639 | 2639 | 'id' => $msg, |
| 2640 | 2640 | 'updated' => $lastModified[$id], |
| 2641 | 2641 | 'boards' => array($id) |
| 2642 | 2642 | ); |
| 2643 | 2643 | |
| 2644 | 2644 | else |
| 2645 | - $board_updates[$msg . '-' . $lastModified[$id]]['boards'][] = $id; |
|
| 2645 | + $board_updates[$msg.'-'.$lastModified[$id]]['boards'][] = $id; |
|
| 2646 | 2646 | } |
| 2647 | 2647 | |
| 2648 | 2648 | // Now commit the changes! |
@@ -2737,13 +2737,13 @@ discard block |
||
| 2737 | 2737 | if ($loadLang) |
| 2738 | 2738 | loadLanguage('EmailTemplates', $lang); |
| 2739 | 2739 | |
| 2740 | - if (!isset($txt[$template . '_subject']) || !isset($txt[$template . '_body'])) |
|
| 2740 | + if (!isset($txt[$template.'_subject']) || !isset($txt[$template.'_body'])) |
|
| 2741 | 2741 | fatal_lang_error('email_no_template', 'template', array($template)); |
| 2742 | 2742 | |
| 2743 | 2743 | $ret = array( |
| 2744 | - 'subject' => $txt[$template . '_subject'], |
|
| 2745 | - 'body' => $txt[$template . '_body'], |
|
| 2746 | - 'is_html' => !empty($txt[$template . '_html']), |
|
| 2744 | + 'subject' => $txt[$template.'_subject'], |
|
| 2745 | + 'body' => $txt[$template.'_body'], |
|
| 2746 | + 'is_html' => !empty($txt[$template.'_html']), |
|
| 2747 | 2747 | ); |
| 2748 | 2748 | |
| 2749 | 2749 | // Add in the default replacements. |
@@ -2762,7 +2762,7 @@ discard block |
||
| 2762 | 2762 | |
| 2763 | 2763 | foreach ($replacements as $f => $r) |
| 2764 | 2764 | { |
| 2765 | - $find[] = '{' . $f . '}'; |
|
| 2765 | + $find[] = '{'.$f.'}'; |
|
| 2766 | 2766 | $replace[] = $r; |
| 2767 | 2767 | } |
| 2768 | 2768 | |
@@ -2942,7 +2942,7 @@ discard block |
||
| 2942 | 2942 | foreach ($suggestions as $index => $suggestion) |
| 2943 | 2943 | { |
| 2944 | 2944 | // //TRANSLIT makes it use similar-looking characters for incompatible ones... |
| 2945 | - $suggestions[$index] = iconv('UTF-8', $txt['lang_character_set'] . '//TRANSLIT', $suggestion); |
|
| 2945 | + $suggestions[$index] = iconv('UTF-8', $txt['lang_character_set'].'//TRANSLIT', $suggestion); |
|
| 2946 | 2946 | } |
| 2947 | 2947 | |
| 2948 | 2948 | return $suggestions; |
@@ -116,7 +116,8 @@ discard block |
||
| 116 | 116 | if (!$previewing && strpos($message, '[html]') !== false) |
| 117 | 117 | { |
| 118 | 118 | if (allowedTo('admin_forum')) |
| 119 | - $message = preg_replace_callback('~\[html\](.+?)\[/html\]~is', function($m) { |
|
| 119 | + $message = preg_replace_callback('~\[html\](.+?)\[/html\]~is', function($m) |
|
| 120 | + { |
|
| 120 | 121 | return '[html]' . strtr(un_htmlspecialchars($m[1]), array("\n" => ' ', ' ' => '  ', '[' => '[', ']' => ']')) . '[/html]'; |
| 121 | 122 | }, $message); |
| 122 | 123 | |
@@ -626,9 +627,10 @@ discard block |
||
| 626 | 627 | foreach ($to_array as $to) |
| 627 | 628 | { |
| 628 | 629 | set_error_handler(function($errno, $errstr, $errfile, $errline) |
| 629 | - { |
|
| 630 | + { |
|
| 630 | 631 | // error was suppressed with the @-operator |
| 631 | - if (0 === error_reporting()) { |
|
| 632 | + if (0 === error_reporting()) |
|
| 633 | + { |
|
| 632 | 634 | return false; |
| 633 | 635 | } |
| 634 | 636 | |
@@ -1241,7 +1243,6 @@ discard block |
||
| 1241 | 1243 | |
| 1242 | 1244 | return array($charset, $string, 'base64'); |
| 1243 | 1245 | } |
| 1244 | - |
|
| 1245 | 1246 | else |
| 1246 | 1247 | return array($charset, $string, '7bit'); |
| 1247 | 1248 | } |