@@ -199,7 +199,6 @@ |
||
| 199 | 199 | list ($context['attachments']['quantity'], $context['attachments']['total_size']) = $smcFunc['db_fetch_row']($request); |
| 200 | 200 | $smcFunc['db_free_result']($request); |
| 201 | 201 | } |
| 202 | - |
|
| 203 | 202 | else |
| 204 | 203 | $context['attachments'] = array( |
| 205 | 204 | 'quantity' => 0, |
@@ -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'); |
@@ -222,7 +222,6 @@ |
||
| 222 | 222 | |
| 223 | 223 | $this->_validLikes['can_like'] = ($this->_user['id'] == $topicOwner ? 'cannot_like_content' : (allowedTo('likes_like') ? true : 'cannot_like_content')); |
| 224 | 224 | } |
| 225 | - |
|
| 226 | 225 | else |
| 227 | 226 | { |
| 228 | 227 | // Modders: This will give you whatever the user offers up in terms of liking, e.g. $this->_type=msg, $this->_content=1 |
@@ -3219,7 +3219,7 @@ discard block |
||
| 3219 | 3219 | // Deleting an existing label? |
| 3220 | 3220 | elseif (isset($_POST['delete'], $_POST['delete_label'])) |
| 3221 | 3221 | { |
| 3222 | - foreach ($_POST['delete_label'] AS $label => $dummy) |
|
| 3222 | + foreach ($_POST['delete_label'] as $label => $dummy) |
|
| 3223 | 3223 | { |
| 3224 | 3224 | unset($the_labels[$label]); |
| 3225 | 3225 | $labels_to_remove[] = $label; |
@@ -3260,7 +3260,7 @@ discard block |
||
| 3260 | 3260 | if (!empty($labels_to_add)) |
| 3261 | 3261 | { |
| 3262 | 3262 | $inserts = array(); |
| 3263 | - foreach ($labels_to_add AS $label) |
|
| 3263 | + foreach ($labels_to_add as $label) |
|
| 3264 | 3264 | $inserts[] = array($user_info['id'], $label); |
| 3265 | 3265 | |
| 3266 | 3266 | $smcFunc['db_insert']('', '{db_prefix}pm_labels', array('id_member' => 'int', 'name' => 'string-30'), $inserts, array()); |
@@ -3269,7 +3269,7 @@ discard block |
||
| 3269 | 3269 | // Update existing labels as needed |
| 3270 | 3270 | if (!empty($label_upates)) |
| 3271 | 3271 | { |
| 3272 | - foreach ($label_updates AS $id => $name) |
|
| 3272 | + foreach ($label_updates as $id => $name) |
|
| 3273 | 3273 | { |
| 3274 | 3274 | $smcFunc['db_query']('', ' |
| 3275 | 3275 | UPDATE {db_prefix}labels |
@@ -1104,44 +1104,44 @@ |
||
| 1104 | 1104 | $output['quickbuttons'] = array( |
| 1105 | 1105 | 'reply_to_all' => array( |
| 1106 | 1106 | 'label' => $txt['reply_to_all'], |
| 1107 | - 'href' => $scripturl.'?action=pm;sa=send;f='.$context['folder'].($context['current_label_id'] != -1 ? ';l=' .$context['current_label_id'] : '').';pmsg='.$output['id'].';quote;u=all', |
|
| 1107 | + 'href' => $scripturl . '?action=pm;sa=send;f=' . $context['folder'] . ($context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '') . ';pmsg=' . $output['id'] . ';quote;u=all', |
|
| 1108 | 1108 | 'icon' => 'reply_all_button', |
| 1109 | 1109 | 'show' => $context['can_send_pm'] && !$output['member']['is_guest'] && $output['number_recipients'] > 1 |
| 1110 | 1110 | ), |
| 1111 | 1111 | 'reply' => array( |
| 1112 | 1112 | 'label' => $txt['reply'], |
| 1113 | - 'href' => $scripturl.'?action=pm;sa=send;f='.$context['folder'].($context['current_label_id'] != -1 ? ';l=' .$context['current_label_id'] : '').';pmsg='.$output['id'].';u='.$output['member']['id'], |
|
| 1113 | + 'href' => $scripturl . '?action=pm;sa=send;f=' . $context['folder'] . ($context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '') . ';pmsg=' . $output['id'] . ';u=' . $output['member']['id'], |
|
| 1114 | 1114 | 'icon' => 'reply_button', |
| 1115 | 1115 | 'show' => $context['can_send_pm'] && !$output['member']['is_guest'] |
| 1116 | 1116 | ), |
| 1117 | 1117 | 'quote' => array( |
| 1118 | 1118 | 'label' => $txt['quote_action'], |
| 1119 | - 'href' => $scripturl.'?action=pm;sa=send;f='.$context['folder'].($context['current_label_id'] != -1 ? ';l=' .$context['current_label_id'] : '').';pmsg='.$output['id'].';quote'.($context['folder'] == 'sent' ? '' : ';u=' .$output['member']['id']), |
|
| 1119 | + 'href' => $scripturl . '?action=pm;sa=send;f=' . $context['folder'] . ($context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '') . ';pmsg=' . $output['id'] . ';quote' . ($context['folder'] == 'sent' ? '' : ';u=' . $output['member']['id']), |
|
| 1120 | 1120 | 'icon' => 'quote', |
| 1121 | 1121 | 'show' => $context['can_send_pm'] && !$output['member']['is_guest'] |
| 1122 | 1122 | ), |
| 1123 | 1123 | 'reply_quote' => array( |
| 1124 | 1124 | 'label' => $txt['reply_quote'], |
| 1125 | - 'href' => $scripturl.'?action=pm;sa=send;f='.$context['folder'].($context['current_label_id'] != -1 ? ';l=' .$context['current_label_id'] : '').';pmsg='.$output['id'].';quote', |
|
| 1125 | + 'href' => $scripturl . '?action=pm;sa=send;f=' . $context['folder'] . ($context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '') . ';pmsg=' . $output['id'] . ';quote', |
|
| 1126 | 1126 | 'icon' => 'quote', |
| 1127 | 1127 | 'show' => $context['can_send_pm'] && $output['member']['is_guest'] |
| 1128 | 1128 | ), |
| 1129 | 1129 | 'delete' => array( |
| 1130 | 1130 | 'label' => $txt['delete'], |
| 1131 | - 'href' => $scripturl.'?action=pm;sa=pmactions;pm_actions%5b'.$output['id'].'%5D=delete;f='.$context['folder'].';start='.$context['start'].($context['current_label_id'] != -1 ? ';l=' .$context['current_label_id'] : '').';'.$context['session_var'].'='.$context['session_id'], |
|
| 1132 | - 'javascript' => 'data-confirm="'.addslashes($txt['remove_message_question']).'" class="you_sure"', |
|
| 1131 | + 'href' => $scripturl . '?action=pm;sa=pmactions;pm_actions%5b' . $output['id'] . '%5D=delete;f=' . $context['folder'] . ';start=' . $context['start'] . ($context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '') . ';' . $context['session_var'] . '=' . $context['session_id'], |
|
| 1132 | + 'javascript' => 'data-confirm="' . addslashes($txt['remove_message_question']) . '" class="you_sure"', |
|
| 1133 | 1133 | 'icon' => 'remove_button', |
| 1134 | 1134 | ), |
| 1135 | 1135 | 'more' => array( |
| 1136 | 1136 | 'report' => array( |
| 1137 | 1137 | 'label' => $txt['pm_report_to_admin'], |
| 1138 | - 'href' => $scripturl .'?action=pm;sa=report;l=' .$context['current_label_id'] .';pmsg=' .$output['id'], |
|
| 1138 | + 'href' => $scripturl . '?action=pm;sa=report;l=' . $context['current_label_id'] . ';pmsg=' . $output['id'], |
|
| 1139 | 1139 | 'icon' => 'error', |
| 1140 | 1140 | 'show' => $output['can_report'] |
| 1141 | 1141 | ), |
| 1142 | 1142 | ), |
| 1143 | 1143 | 'quickmod' => array( |
| 1144 | - 'content' => '<input type="checkbox" name="pms[]" id="deletedisplay'.$output['id'].'" value="'.$output['id'].'" onclick="document.getElementById(\'deletelisting'.$output['id'].'\').checked = this.checked;">', |
|
| 1144 | + 'content' => '<input type="checkbox" name="pms[]" id="deletedisplay' . $output['id'] . '" value="' . $output['id'] . '" onclick="document.getElementById(\'deletelisting' . $output['id'] . '\').checked = this.checked;">', |
|
| 1145 | 1145 | 'show' => empty($context['display_mode']) |
| 1146 | 1146 | ) |
| 1147 | 1147 | ); |
@@ -1252,7 +1252,6 @@ |
||
| 1252 | 1252 | if (!empty($modSettings['enableAllMessages']) && $topic_length < $modSettings['enableAllMessages']) |
| 1253 | 1253 | $pages .= ' <a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0;all">' . $txt['all'] . '</a>'; |
| 1254 | 1254 | } |
| 1255 | - |
|
| 1256 | 1255 | else |
| 1257 | 1256 | $pages = ''; |
| 1258 | 1257 | |
@@ -465,20 +465,20 @@ |
||
| 465 | 465 | $context['posts'][$key]['quickbuttons'] = array( |
| 466 | 466 | 'reply' => array( |
| 467 | 467 | 'label' => $txt['reply'], |
| 468 | - 'href' => $scripturl.'?action=post;topic='.$post['topic'].'.'.$post['start'], |
|
| 468 | + 'href' => $scripturl . '?action=post;topic=' . $post['topic'] . '.' . $post['start'], |
|
| 469 | 469 | 'icon' => 'reply_button', |
| 470 | 470 | 'show' => $post['can_reply'] |
| 471 | 471 | ), |
| 472 | 472 | 'quote' => array( |
| 473 | 473 | 'label' => $txt['quote_action'], |
| 474 | - 'href' => $scripturl.'?action=post;topic='.$post['topic'].'.'.$post['start'].';quote='.$post['id'], |
|
| 474 | + 'href' => $scripturl . '?action=post;topic=' . $post['topic'] . '.' . $post['start'] . ';quote=' . $post['id'], |
|
| 475 | 475 | 'icon' => 'quote', |
| 476 | 476 | 'show' => $post['can_quote'] |
| 477 | 477 | ), |
| 478 | 478 | 'delete' => array( |
| 479 | 479 | 'label' => $txt['remove'], |
| 480 | - 'href' => $scripturl.'?action=deletemsg;msg='.$post['id'].';topic='.$post['topic'].';recent;'.$context['session_var'].'='.$context['session_id'], |
|
| 481 | - 'javascript' => 'data-confirm="'.$txt['remove_message'].'" class="you_sure"', |
|
| 480 | + 'href' => $scripturl . '?action=deletemsg;msg=' . $post['id'] . ';topic=' . $post['topic'] . ';recent;' . $context['session_var'] . '=' . $context['session_id'], |
|
| 481 | + 'javascript' => 'data-confirm="' . $txt['remove_message'] . '" class="you_sure"', |
|
| 482 | 482 | 'icon' => 'remove_button', |
| 483 | 483 | 'show' => $post['can_delete'] |
| 484 | 484 | ), |
@@ -722,12 +722,12 @@ |
||
| 722 | 722 | $where = ''; |
| 723 | 723 | $count_pk = 0; |
| 724 | 724 | |
| 725 | - If ($replace_support) |
|
| 725 | + if ($replace_support) |
|
| 726 | 726 | { |
| 727 | 727 | foreach ($columns as $columnName => $type) |
| 728 | 728 | { |
| 729 | 729 | //check pk fiel |
| 730 | - IF (in_array($columnName, $keys)) |
|
| 730 | + if (in_array($columnName, $keys)) |
|
| 731 | 731 | { |
| 732 | 732 | $key_str .= ($count_pk > 0 ? ',' : ''); |
| 733 | 733 | $key_str .= $columnName; |
@@ -73,7 +73,7 @@ |
||
| 73 | 73 | display_db_error(); |
| 74 | 74 | |
| 75 | 75 | // We need to escape ' and \ |
| 76 | - $db_passwd = str_replace(array('\\','\''), array('\\\\','\\\''), $db_passwd); |
|
| 76 | + $db_passwd = str_replace(array('\\', '\''), array('\\\\', '\\\''), $db_passwd); |
|
| 77 | 77 | |
| 78 | 78 | if (!empty($db_options['persist'])) |
| 79 | 79 | $connection = @pg_pconnect((empty($db_server) ? '' : 'host=' . $db_server . ' ') . 'dbname=' . $db_name . ' user=\'' . $db_user . '\' password=\'' . $db_passwd . '\'' . (empty($db_options['port']) ? '' : ' port=\'' . $db_options['port'] . '\'')); |
@@ -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; |
@@ -93,7 +93,6 @@ |
||
| 93 | 93 | |
| 94 | 94 | continue; |
| 95 | 95 | } |
| 96 | - |
|
| 97 | 96 | elseif (empty($row['show_online']) && empty($membersOnlineOptions['show_hidden'])) |
| 98 | 97 | { |
| 99 | 98 | // Just increase the stats and don't add this hidden user to any list. |
@@ -881,7 +881,6 @@ discard block |
||
| 881 | 881 | $is_writable = true; |
| 882 | 882 | break; |
| 883 | 883 | } |
| 884 | - |
|
| 885 | 884 | else |
| 886 | 885 | { |
| 887 | 886 | // Convert the chmod value from octal (0777) to text ("777"). |
@@ -935,8 +934,9 @@ discard block |
||
| 935 | 934 | { |
| 936 | 935 | // Wait for a response that isn't continued with -, but don't wait too long. |
| 937 | 936 | $time = time(); |
| 938 | - do |
|
| 939 | - $this->last_message = fgets($this->connection, 1024); |
|
| 937 | + do { |
|
| 938 | + $this->last_message = fgets($this->connection, 1024); |
|
| 939 | + } |
|
| 940 | 940 | while ((strlen($this->last_message) < 4 || strpos($this->last_message, ' ') === 0 || strpos($this->last_message, ' ', 3) !== 3) && time() - $time < 5); |
| 941 | 941 | |
| 942 | 942 | // Was the desired response returned? |
@@ -957,8 +957,9 @@ discard block |
||
| 957 | 957 | // Request a passive connection - this means, we'll talk to you, you don't talk to us. |
| 958 | 958 | @fwrite($this->connection, 'PASV' . "\r\n"); |
| 959 | 959 | $time = time(); |
| 960 | - do |
|
| 961 | - $response = fgets($this->connection, 1024); |
|
| 960 | + do { |
|
| 961 | + $response = fgets($this->connection, 1024); |
|
| 962 | + } |
|
| 962 | 963 | while (strpos($response, ' ', 3) !== 3 && time() - $time < 5); |
| 963 | 964 | |
| 964 | 965 | // If it's not 227, we weren't given an IP and port, which means it failed. |
@@ -1080,8 +1081,9 @@ discard block |
||
| 1080 | 1081 | |
| 1081 | 1082 | @fwrite($this->connection, 'PWD' . "\r\n"); |
| 1082 | 1083 | $time = time(); |
| 1083 | - do |
|
| 1084 | - $response = fgets($this->connection, 1024); |
|
| 1084 | + do { |
|
| 1085 | + $response = fgets($this->connection, 1024); |
|
| 1086 | + } |
|
| 1085 | 1087 | while ($response[3] != ' ' && time() - $time < 5); |
| 1086 | 1088 | |
| 1087 | 1089 | // Check for 257! |