@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | // @todo Tie in with bbc permissions ? |
| 41 | 41 | foreach (array('code', 'php', 'nobbc') as $code) |
| 42 | 42 | { |
| 43 | - if (strpos($text, '['. $code) !== false) |
|
| 43 | + if (strpos($text, '[' . $code) !== false) |
|
| 44 | 44 | { |
| 45 | 45 | $parts = preg_split('~(\[/' . $code . '\]|\[' . $code . '(?:=[^\]]+)?\])~i', $text, -1, PREG_SPLIT_DELIM_CAPTURE); |
| 46 | 46 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | // Parse unique ID's and disable javascript into the smileys - using the double space. |
| 78 | 78 | $i = 1; |
| 79 | 79 | $text = preg_replace_callback('~(?:\s| )?<(img\ssrc="' . preg_quote($modSettings['smileys_url'], '~') . '/[^<>]+?/([^<>]+?)"\s*)[^<>]*?class="smiley">~', |
| 80 | - function ($m) use (&$i) |
|
| 80 | + function($m) use (&$i) |
|
| 81 | 81 | { |
| 82 | 82 | return '<' . stripslashes($m[1]) . 'alt="" title="" onresizestart="return false;" id="smiley_' . $i++ . '_' . $m[2] . '" style="padding: 0 3px 0 3px;">'; |
| 83 | 83 | }, $text); |
@@ -605,10 +605,10 @@ discard block |
||
| 605 | 605 | // Inject closure for this list item first. |
| 606 | 606 | // The content of $parts[$i] is left as is! |
| 607 | 607 | array_splice($parts, $i + 1, 0, array( |
| 608 | - '', // $i + 1 |
|
| 609 | - '[/li]' . "\n", // $i + 2 |
|
| 610 | - '', // $i + 3 |
|
| 611 | - '', // $i + 4 |
|
| 608 | + '', // $i + 1 |
|
| 609 | + '[/li]' . "\n", // $i + 2 |
|
| 610 | + '', // $i + 3 |
|
| 611 | + '', // $i + 4 |
|
| 612 | 612 | )); |
| 613 | 613 | $numParts = count($parts) - 1; |
| 614 | 614 | |
@@ -726,167 +726,167 @@ discard block |
||
| 726 | 726 | |
| 727 | 727 | // The final bits are the easy ones - tags which map to tags which map to tags - etc etc. |
| 728 | 728 | $tags = array( |
| 729 | - '~<b(\s(.)*?)*?' . '>~i' => function () |
|
| 729 | + '~<b(\s(.)*?)*?' . '>~i' => function() |
|
| 730 | 730 | { |
| 731 | 731 | return '[b]'; |
| 732 | 732 | }, |
| 733 | - '~</b>~i' => function () |
|
| 733 | + '~</b>~i' => function() |
|
| 734 | 734 | { |
| 735 | 735 | return '[/b]'; |
| 736 | 736 | }, |
| 737 | - '~<i(\s(.)*?)*?' . '>~i' => function () |
|
| 737 | + '~<i(\s(.)*?)*?' . '>~i' => function() |
|
| 738 | 738 | { |
| 739 | 739 | return '[i]'; |
| 740 | 740 | }, |
| 741 | - '~</i>~i' => function () |
|
| 741 | + '~</i>~i' => function() |
|
| 742 | 742 | { |
| 743 | 743 | return '[/i]'; |
| 744 | 744 | }, |
| 745 | - '~<u(\s(.)*?)*?' . '>~i' => function () |
|
| 745 | + '~<u(\s(.)*?)*?' . '>~i' => function() |
|
| 746 | 746 | { |
| 747 | 747 | return '[u]'; |
| 748 | 748 | }, |
| 749 | - '~</u>~i' => function () |
|
| 749 | + '~</u>~i' => function() |
|
| 750 | 750 | { |
| 751 | 751 | return '[/u]'; |
| 752 | 752 | }, |
| 753 | - '~<strong(\s(.)*?)*?' . '>~i' => function () |
|
| 753 | + '~<strong(\s(.)*?)*?' . '>~i' => function() |
|
| 754 | 754 | { |
| 755 | 755 | return '[b]'; |
| 756 | 756 | }, |
| 757 | - '~</strong>~i' => function () |
|
| 757 | + '~</strong>~i' => function() |
|
| 758 | 758 | { |
| 759 | 759 | return '[/b]'; |
| 760 | 760 | }, |
| 761 | - '~<em(\s(.)*?)*?' . '>~i' => function () |
|
| 761 | + '~<em(\s(.)*?)*?' . '>~i' => function() |
|
| 762 | 762 | { |
| 763 | 763 | return '[i]'; |
| 764 | 764 | }, |
| 765 | - '~</em>~i' => function () |
|
| 765 | + '~</em>~i' => function() |
|
| 766 | 766 | { |
| 767 | 767 | return '[i]'; |
| 768 | 768 | }, |
| 769 | - '~<s(\s(.)*?)*?' . '>~i' => function () |
|
| 769 | + '~<s(\s(.)*?)*?' . '>~i' => function() |
|
| 770 | 770 | { |
| 771 | 771 | return "[s]"; |
| 772 | 772 | }, |
| 773 | - '~</s>~i' => function () |
|
| 773 | + '~</s>~i' => function() |
|
| 774 | 774 | { |
| 775 | 775 | return "[/s]"; |
| 776 | 776 | }, |
| 777 | - '~<strike(\s(.)*?)*?' . '>~i' => function () |
|
| 777 | + '~<strike(\s(.)*?)*?' . '>~i' => function() |
|
| 778 | 778 | { |
| 779 | 779 | return '[s]'; |
| 780 | 780 | }, |
| 781 | - '~</strike>~i' => function () |
|
| 781 | + '~</strike>~i' => function() |
|
| 782 | 782 | { |
| 783 | 783 | return '[/s]'; |
| 784 | 784 | }, |
| 785 | - '~<del(\s(.)*?)*?' . '>~i' => function () |
|
| 785 | + '~<del(\s(.)*?)*?' . '>~i' => function() |
|
| 786 | 786 | { |
| 787 | 787 | return '[s]'; |
| 788 | 788 | }, |
| 789 | - '~</del>~i' => function () |
|
| 789 | + '~</del>~i' => function() |
|
| 790 | 790 | { |
| 791 | 791 | return '[/s]'; |
| 792 | 792 | }, |
| 793 | - '~<center(\s(.)*?)*?' . '>~i' => function () |
|
| 793 | + '~<center(\s(.)*?)*?' . '>~i' => function() |
|
| 794 | 794 | { |
| 795 | 795 | return '[center]'; |
| 796 | 796 | }, |
| 797 | - '~</center>~i' => function () |
|
| 797 | + '~</center>~i' => function() |
|
| 798 | 798 | { |
| 799 | 799 | return '[/center]'; |
| 800 | 800 | }, |
| 801 | - '~<pre(\s(.)*?)*?' . '>~i' => function () |
|
| 801 | + '~<pre(\s(.)*?)*?' . '>~i' => function() |
|
| 802 | 802 | { |
| 803 | 803 | return '[pre]'; |
| 804 | 804 | }, |
| 805 | - '~</pre>~i' => function () |
|
| 805 | + '~</pre>~i' => function() |
|
| 806 | 806 | { |
| 807 | 807 | return '[/pre]'; |
| 808 | 808 | }, |
| 809 | - '~<sub(\s(.)*?)*?' . '>~i' => function () |
|
| 809 | + '~<sub(\s(.)*?)*?' . '>~i' => function() |
|
| 810 | 810 | { |
| 811 | 811 | return '[sub]'; |
| 812 | 812 | }, |
| 813 | - '~</sub>~i' => function () |
|
| 813 | + '~</sub>~i' => function() |
|
| 814 | 814 | { |
| 815 | 815 | return '[/sub]'; |
| 816 | 816 | }, |
| 817 | - '~<sup(\s(.)*?)*?' . '>~i' => function () |
|
| 817 | + '~<sup(\s(.)*?)*?' . '>~i' => function() |
|
| 818 | 818 | { |
| 819 | 819 | return '[sup]'; |
| 820 | 820 | }, |
| 821 | - '~</sup>~i' => function () |
|
| 821 | + '~</sup>~i' => function() |
|
| 822 | 822 | { |
| 823 | 823 | return '[/sup]'; |
| 824 | 824 | }, |
| 825 | - '~<tt(\s(.)*?)*?' . '>~i' => function () |
|
| 825 | + '~<tt(\s(.)*?)*?' . '>~i' => function() |
|
| 826 | 826 | { |
| 827 | 827 | return '[tt]'; |
| 828 | 828 | }, |
| 829 | - '~</tt>~i' => function () |
|
| 829 | + '~</tt>~i' => function() |
|
| 830 | 830 | { |
| 831 | 831 | return '[/tt]'; |
| 832 | 832 | }, |
| 833 | - '~<table(\s(.)*?)*?' . '>~i' => function () |
|
| 833 | + '~<table(\s(.)*?)*?' . '>~i' => function() |
|
| 834 | 834 | { |
| 835 | 835 | return '[table]'; |
| 836 | 836 | }, |
| 837 | - '~</table>~i' => function () |
|
| 837 | + '~</table>~i' => function() |
|
| 838 | 838 | { |
| 839 | 839 | return '[/table]'; |
| 840 | 840 | }, |
| 841 | - '~<tr(\s(.)*?)*?' . '>~i' => function () |
|
| 841 | + '~<tr(\s(.)*?)*?' . '>~i' => function() |
|
| 842 | 842 | { |
| 843 | 843 | return '[tr]'; |
| 844 | 844 | }, |
| 845 | - '~</tr>~i' => function () |
|
| 845 | + '~</tr>~i' => function() |
|
| 846 | 846 | { |
| 847 | 847 | return '[/tr]'; |
| 848 | 848 | }, |
| 849 | - '~<(td|th)\s[^<>]*?colspan="?(\d{1,2})"?.*?' . '>~i' => function ($matches) |
|
| 849 | + '~<(td|th)\s[^<>]*?colspan="?(\d{1,2})"?.*?' . '>~i' => function($matches) |
|
| 850 | 850 | { |
| 851 | 851 | return str_repeat('[td][/td]', $matches[2] - 1) . '[td]'; |
| 852 | 852 | }, |
| 853 | - '~<(td|th)(\s(.)*?)*?' . '>~i' => function () |
|
| 853 | + '~<(td|th)(\s(.)*?)*?' . '>~i' => function() |
|
| 854 | 854 | { |
| 855 | 855 | return '[td]'; |
| 856 | 856 | }, |
| 857 | - '~</(td|th)>~i' => function () |
|
| 857 | + '~</(td|th)>~i' => function() |
|
| 858 | 858 | { |
| 859 | 859 | return '[/td]'; |
| 860 | 860 | }, |
| 861 | - '~<br(?:\s[^<>]*?)?' . '>~i' => function () |
|
| 861 | + '~<br(?:\s[^<>]*?)?' . '>~i' => function() |
|
| 862 | 862 | { |
| 863 | 863 | return "\n"; |
| 864 | 864 | }, |
| 865 | - '~<hr[^<>]*>(\n)?~i' => function ($matches) |
|
| 865 | + '~<hr[^<>]*>(\n)?~i' => function($matches) |
|
| 866 | 866 | { |
| 867 | - return "[hr]\n". $matches[0]; |
|
| 867 | + return "[hr]\n" . $matches[0]; |
|
| 868 | 868 | }, |
| 869 | - '~(\n)?\\[hr\\]~i' => function () |
|
| 869 | + '~(\n)?\\[hr\\]~i' => function() |
|
| 870 | 870 | { |
| 871 | 871 | return "\n[hr]"; |
| 872 | 872 | }, |
| 873 | - '~^\n\\[hr\\]~i' => function () |
|
| 873 | + '~^\n\\[hr\\]~i' => function() |
|
| 874 | 874 | { |
| 875 | 875 | return "[hr]"; |
| 876 | 876 | }, |
| 877 | - '~<blockquote(\s(.)*?)*?' . '>~i' => function () |
|
| 877 | + '~<blockquote(\s(.)*?)*?' . '>~i' => function() |
|
| 878 | 878 | { |
| 879 | 879 | return "<blockquote>"; |
| 880 | 880 | }, |
| 881 | - '~</blockquote>~i' => function () |
|
| 881 | + '~</blockquote>~i' => function() |
|
| 882 | 882 | { |
| 883 | 883 | return "</blockquote>"; |
| 884 | 884 | }, |
| 885 | - '~<ins(\s(.)*?)*?' . '>~i' => function () |
|
| 885 | + '~<ins(\s(.)*?)*?' . '>~i' => function() |
|
| 886 | 886 | { |
| 887 | 887 | return "<ins>"; |
| 888 | 888 | }, |
| 889 | - '~</ins>~i' => function () |
|
| 889 | + '~</ins>~i' => function() |
|
| 890 | 890 | { |
| 891 | 891 | return "</ins>"; |
| 892 | 892 | }, |
@@ -2391,7 +2391,7 @@ discard block |
||
| 2391 | 2391 | array( |
| 2392 | 2392 | 'group_name' => $smcFunc['db_case_sensitive'] ? 'LOWER(group_name}' : 'group_name', |
| 2393 | 2393 | 'min_posts' => -1, |
| 2394 | - 'invalid_groups' => array(1,3), |
|
| 2394 | + 'invalid_groups' => array(1, 3), |
|
| 2395 | 2395 | 'hidden' => 2, |
| 2396 | 2396 | 'search' => $_REQUEST['search'], |
| 2397 | 2397 | ) |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | else |
| 238 | 238 | { |
| 239 | 239 | $query_this_board = '{query_wanna_see_board}' . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? ' |
| 240 | - AND b.id_board != {int:recycle_board}' : ''). ' |
|
| 240 | + AND b.id_board != {int:recycle_board}' : '') . ' |
|
| 241 | 241 | AND m.id_msg >= {int:max_id_msg}'; |
| 242 | 242 | $query_parameters['max_id_msg'] = max(0, $modSettings['maxMsgID'] - 100 - $_REQUEST['start'] * 6); |
| 243 | 243 | $query_parameters['recycle_board'] = $modSettings['recycle_board']; |
@@ -1124,7 +1124,7 @@ discard block |
||
| 1124 | 1124 | ); |
| 1125 | 1125 | else |
| 1126 | 1126 | $request = $smcFunc['db_query']('', ' |
| 1127 | - SELECT DISTINCT t.id_topic,'.$_REQUEST['sort'].' |
|
| 1127 | + SELECT DISTINCT t.id_topic,'.$_REQUEST['sort'] . ' |
|
| 1128 | 1128 | FROM {db_prefix}topics AS t |
| 1129 | 1129 | INNER JOIN {db_prefix}messages AS m ON (m.id_topic = t.id_topic AND m.id_member = {int:current_member})' . (strpos($_REQUEST['sort'], 'ms.') === false ? '' : ' |
| 1130 | 1130 | INNER JOIN {db_prefix}messages AS ms ON (ms.id_msg = t.id_first_msg)') . (strpos($_REQUEST['sort'], 'mems.') === false ? '' : ' |
@@ -1391,7 +1391,7 @@ discard block |
||
| 1391 | 1391 | if ($is_topics) |
| 1392 | 1392 | { |
| 1393 | 1393 | $context['recent_buttons'] = array( |
| 1394 | - 'markread' => array('text' => !empty($context['no_board_limits']) ? 'mark_as_read' : 'mark_read_short', 'image' => 'markread.png', 'custom' => 'data-confirm="'. $txt['are_sure_mark_read'] .'"', 'class' => 'you_sure', 'url' => $scripturl . '?action=markasread;sa=' . (!empty($context['no_board_limits']) ? 'all' : 'board' . $context['querystring_board_limits']) . ';' . $context['session_var'] . '=' . $context['session_id']), |
|
| 1394 | + 'markread' => array('text' => !empty($context['no_board_limits']) ? 'mark_as_read' : 'mark_read_short', 'image' => 'markread.png', 'custom' => 'data-confirm="' . $txt['are_sure_mark_read'] . '"', 'class' => 'you_sure', 'url' => $scripturl . '?action=markasread;sa=' . (!empty($context['no_board_limits']) ? 'all' : 'board' . $context['querystring_board_limits']) . ';' . $context['session_var'] . '=' . $context['session_id']), |
|
| 1395 | 1395 | ); |
| 1396 | 1396 | |
| 1397 | 1397 | if ($context['showCheckboxes']) |
@@ -1407,7 +1407,7 @@ discard block |
||
| 1407 | 1407 | elseif (!$is_topics && isset($context['topics_to_mark'])) |
| 1408 | 1408 | { |
| 1409 | 1409 | $context['recent_buttons'] = array( |
| 1410 | - 'markread' => array('text' => 'mark_as_read', 'image' => 'markread.png', 'custom' => 'data-confirm="'. $txt['are_sure_mark_read'] .'"', 'class' => 'you_sure', 'url' => $scripturl . '?action=markasread;sa=unreadreplies;topics=' . $context['topics_to_mark'] . ';' . $context['session_var'] . '=' . $context['session_id']), |
|
| 1410 | + 'markread' => array('text' => 'mark_as_read', 'image' => 'markread.png', 'custom' => 'data-confirm="' . $txt['are_sure_mark_read'] . '"', 'class' => 'you_sure', 'url' => $scripturl . '?action=markasread;sa=unreadreplies;topics=' . $context['topics_to_mark'] . ';' . $context['session_var'] . '=' . $context['session_id']), |
|
| 1411 | 1411 | ); |
| 1412 | 1412 | |
| 1413 | 1413 | if ($context['showCheckboxes']) |
@@ -798,7 +798,7 @@ discard block |
||
| 798 | 798 | { |
| 799 | 799 | // It goes 0 = outside, 1 = begin tag, 2 = inside, 3 = close tag, repeat. |
| 800 | 800 | if ($i % 4 == 0) |
| 801 | - $parts[$i] = preg_replace_callback('~\[html\](.+?)\[/html\]~is', function ($m) |
|
| 801 | + $parts[$i] = preg_replace_callback('~\[html\](.+?)\[/html\]~is', function($m) |
|
| 802 | 802 | { |
| 803 | 803 | return '[html]' . preg_replace('~<br\s?/?' . '>~i', '<br /><br>', "$m[1]") . '[/html]'; |
| 804 | 804 | }, $parts[$i]); |
@@ -895,7 +895,7 @@ discard block |
||
| 895 | 895 | { |
| 896 | 896 | // Since, they don't belong here. Let's inform the user that they exist.. |
| 897 | 897 | if (!empty($topic)) |
| 898 | - $delete_url = $scripturl . '?action=post' .(!empty($_REQUEST['msg']) ? (';msg=' . $_REQUEST['msg']) : '') . (!empty($_REQUEST['last_msg']) ? (';last_msg=' . $_REQUEST['last_msg']) : '') . ';topic=' . $topic . ';delete_temp'; |
|
| 898 | + $delete_url = $scripturl . '?action=post' . (!empty($_REQUEST['msg']) ? (';msg=' . $_REQUEST['msg']) : '') . (!empty($_REQUEST['last_msg']) ? (';last_msg=' . $_REQUEST['last_msg']) : '') . ';topic=' . $topic . ';delete_temp'; |
|
| 899 | 899 | else |
| 900 | 900 | $delete_url = $scripturl . '?action=post;board=' . $board . ';delete_temp'; |
| 901 | 901 | |
@@ -903,7 +903,7 @@ discard block |
||
| 903 | 903 | $file_list = array(); |
| 904 | 904 | foreach ($_SESSION['temp_attachments'] as $attachID => $attachment) |
| 905 | 905 | if (strpos($attachID, 'post_tmp_' . $user_info['id']) !== false) |
| 906 | - $file_list[] = $attachment['name']; |
|
| 906 | + $file_list[] = $attachment['name']; |
|
| 907 | 907 | |
| 908 | 908 | $_SESSION['temp_attachments']['post']['files'] = $file_list; |
| 909 | 909 | $file_list = '<div class="attachments">' . implode('<br>', $file_list) . '</div>'; |
@@ -911,7 +911,7 @@ discard block |
||
| 911 | 911 | if (!empty($_SESSION['temp_attachments']['post']['msg'])) |
| 912 | 912 | { |
| 913 | 913 | // We have a message id, so we can link back to the old topic they were trying to edit.. |
| 914 | - $goback_url = $scripturl . '?action=post' .(!empty($_SESSION['temp_attachments']['post']['msg']) ? (';msg=' . $_SESSION['temp_attachments']['post']['msg']) : '') . (!empty($_SESSION['temp_attachments']['post']['last_msg']) ? (';last_msg=' . $_SESSION['temp_attachments']['post']['last_msg']) : '') . ';topic=' . $_SESSION['temp_attachments']['post']['topic'] . ';additionalOptions'; |
|
| 914 | + $goback_url = $scripturl . '?action=post' . (!empty($_SESSION['temp_attachments']['post']['msg']) ? (';msg=' . $_SESSION['temp_attachments']['post']['msg']) : '') . (!empty($_SESSION['temp_attachments']['post']['last_msg']) ? (';last_msg=' . $_SESSION['temp_attachments']['post']['last_msg']) : '') . ';topic=' . $_SESSION['temp_attachments']['post']['topic'] . ';additionalOptions'; |
|
| 915 | 915 | |
| 916 | 916 | $post_errors[] = array('temp_attachments_found', array($delete_url, $goback_url, $file_list)); |
| 917 | 917 | $context['ignore_temp_attachments'] = true; |
@@ -1198,55 +1198,55 @@ discard block |
||
| 1198 | 1198 | foreach ($context['current_attachments'] as $key => $mock) |
| 1199 | 1199 | addInlineJavaScript(' |
| 1200 | 1200 | current_attachments.push({ |
| 1201 | - name: '. JavaScriptEscape($mock['name']) .', |
|
| 1202 | - size: '. $mock['size'] .', |
|
| 1203 | - attachID: '. $mock['attachID'] .', |
|
| 1204 | - approved: '. $mock['approved'] .', |
|
| 1205 | - type: '. JavaScriptEscape(!empty($mock['mime_type']) ? $mock['mime_type'] : '') .', |
|
| 1206 | - thumbID: '. (!empty($mock['thumb']) ? $mock['thumb'] : 0) .' |
|
| 1201 | + name: '. JavaScriptEscape($mock['name']) . ', |
|
| 1202 | + size: '. $mock['size'] . ', |
|
| 1203 | + attachID: '. $mock['attachID'] . ', |
|
| 1204 | + approved: '. $mock['approved'] . ', |
|
| 1205 | + type: '. JavaScriptEscape(!empty($mock['mime_type']) ? $mock['mime_type'] : '') . ', |
|
| 1206 | + thumbID: '. (!empty($mock['thumb']) ? $mock['thumb'] : 0) . ' |
|
| 1207 | 1207 | });', true); |
| 1208 | 1208 | } |
| 1209 | 1209 | |
| 1210 | 1210 | // File Upload. |
| 1211 | 1211 | if ($context['can_post_attachment']) |
| 1212 | 1212 | { |
| 1213 | - $acceptedFiles = implode(',', array_map(function($val) use($smcFunc) { return '.'. $smcFunc['htmltrim']($val);} , explode(',', $context['allowed_extensions']))); |
|
| 1213 | + $acceptedFiles = implode(',', array_map(function($val) use($smcFunc) { return '.' . $smcFunc['htmltrim']($val); } , explode(',', $context['allowed_extensions']))); |
|
| 1214 | 1214 | |
| 1215 | 1215 | loadJavaScriptFile('dropzone.min.js', array('defer' => true), 'smf_dropzone'); |
| 1216 | 1216 | loadJavaScriptFile('smf_fileUpload.js', array('defer' => true), 'smf_fileUpload'); |
| 1217 | 1217 | addInlineJavaScript(' |
| 1218 | 1218 | $(function() { |
| 1219 | 1219 | smf_fileUpload({ |
| 1220 | - dictDefaultMessage : '. JavaScriptEscape($txt['attach_drop_zone']) .', |
|
| 1221 | - dictFallbackMessage : '. JavaScriptEscape($txt['attach_drop_zone_no']) .', |
|
| 1222 | - dictCancelUpload : '. JavaScriptEscape($txt['modify_cancel']) .', |
|
| 1223 | - genericError: '. JavaScriptEscape($txt['attach_php_error']) .', |
|
| 1224 | - text_attachLeft: '. JavaScriptEscape($txt['attached_attachedLeft']) .', |
|
| 1225 | - text_deleteAttach: '. JavaScriptEscape($txt['attached_file_delete']) .', |
|
| 1226 | - text_attachDeleted: '. JavaScriptEscape($txt['attached_file_deleted']) .', |
|
| 1227 | - text_insertBBC: '. JavaScriptEscape($txt['attached_insertBBC']) .', |
|
| 1228 | - text_attachUploaded: '. JavaScriptEscape($txt['attached_file_uploaded']) .', |
|
| 1229 | - text_attach_unlimited: '. JavaScriptEscape($txt['attach_drop_unlimited']) .', |
|
| 1230 | - dictMaxFilesExceeded: '. JavaScriptEscape($txt['more_attachments_error']) .', |
|
| 1231 | - dictInvalidFileType: '. JavaScriptEscape(sprintf($txt['cant_upload_type'], $context['allowed_extensions'])) .', |
|
| 1232 | - dictFileTooBig: '. JavaScriptEscape(sprintf($txt['file_too_big'], comma_format($modSettings['attachmentSizeLimit'], 0))) .', |
|
| 1233 | - maxTotalSize: '. JavaScriptEscape($txt['attach_max_total_file_size_current']) .', |
|
| 1234 | - acceptedFiles: '. JavaScriptEscape($acceptedFiles) .', |
|
| 1235 | - maxFilesize: '. (!empty($modSettings['attachmentSizeLimit']) ? $modSettings['attachmentSizeLimit'] : 'null') .', |
|
| 1236 | - thumbnailWidth: '.(!empty($modSettings['attachmentThumbWidth']) ? $modSettings['attachmentThumbWidth'] : 'null') .', |
|
| 1237 | - thumbnailHeight: '.(!empty($modSettings['attachmentThumbHeight']) ? $modSettings['attachmentThumbHeight'] : 'null') .', |
|
| 1238 | - maxFiles: '. (!empty($context['num_allowed_attachments']) ? $context['num_allowed_attachments'] : 'null') .', |
|
| 1239 | - text_totalMaxSize: '. JavaScriptEscape($txt['attach_max_total_file_size_current']) .', |
|
| 1240 | - text_max_size_progress: '. JavaScriptEscape($txt['attach_max_size_progress']) .', |
|
| 1241 | - limitMultiFileUploadSize:'. round(max($modSettings['attachmentPostLimit'] - ($context['attachments']['total_size'] / 1024), 0)) * 1024 .', |
|
| 1242 | - maxLimitReferenceUploadSize: '. $modSettings['attachmentPostLimit'] * 1024 .', |
|
| 1220 | + dictDefaultMessage : '. JavaScriptEscape($txt['attach_drop_zone']) . ', |
|
| 1221 | + dictFallbackMessage : '. JavaScriptEscape($txt['attach_drop_zone_no']) . ', |
|
| 1222 | + dictCancelUpload : '. JavaScriptEscape($txt['modify_cancel']) . ', |
|
| 1223 | + genericError: '. JavaScriptEscape($txt['attach_php_error']) . ', |
|
| 1224 | + text_attachLeft: '. JavaScriptEscape($txt['attached_attachedLeft']) . ', |
|
| 1225 | + text_deleteAttach: '. JavaScriptEscape($txt['attached_file_delete']) . ', |
|
| 1226 | + text_attachDeleted: '. JavaScriptEscape($txt['attached_file_deleted']) . ', |
|
| 1227 | + text_insertBBC: '. JavaScriptEscape($txt['attached_insertBBC']) . ', |
|
| 1228 | + text_attachUploaded: '. JavaScriptEscape($txt['attached_file_uploaded']) . ', |
|
| 1229 | + text_attach_unlimited: '. JavaScriptEscape($txt['attach_drop_unlimited']) . ', |
|
| 1230 | + dictMaxFilesExceeded: '. JavaScriptEscape($txt['more_attachments_error']) . ', |
|
| 1231 | + dictInvalidFileType: '. JavaScriptEscape(sprintf($txt['cant_upload_type'], $context['allowed_extensions'])) . ', |
|
| 1232 | + dictFileTooBig: '. JavaScriptEscape(sprintf($txt['file_too_big'], comma_format($modSettings['attachmentSizeLimit'], 0))) . ', |
|
| 1233 | + maxTotalSize: '. JavaScriptEscape($txt['attach_max_total_file_size_current']) . ', |
|
| 1234 | + acceptedFiles: '. JavaScriptEscape($acceptedFiles) . ', |
|
| 1235 | + maxFilesize: '. (!empty($modSettings['attachmentSizeLimit']) ? $modSettings['attachmentSizeLimit'] : 'null') . ', |
|
| 1236 | + thumbnailWidth: '.(!empty($modSettings['attachmentThumbWidth']) ? $modSettings['attachmentThumbWidth'] : 'null') . ', |
|
| 1237 | + thumbnailHeight: '.(!empty($modSettings['attachmentThumbHeight']) ? $modSettings['attachmentThumbHeight'] : 'null') . ', |
|
| 1238 | + maxFiles: '. (!empty($context['num_allowed_attachments']) ? $context['num_allowed_attachments'] : 'null') . ', |
|
| 1239 | + text_totalMaxSize: '. JavaScriptEscape($txt['attach_max_total_file_size_current']) . ', |
|
| 1240 | + text_max_size_progress: '. JavaScriptEscape($txt['attach_max_size_progress']) . ', |
|
| 1241 | + limitMultiFileUploadSize:'. round(max($modSettings['attachmentPostLimit'] - ($context['attachments']['total_size'] / 1024), 0)) * 1024 . ', |
|
| 1242 | + maxLimitReferenceUploadSize: '. $modSettings['attachmentPostLimit'] * 1024 . ', |
|
| 1243 | 1243 | }); |
| 1244 | 1244 | });', true); |
| 1245 | 1245 | } |
| 1246 | 1246 | |
| 1247 | 1247 | // Knowing the current board ID might be handy. |
| 1248 | 1248 | addInlineJavaScript(' |
| 1249 | - var current_board = '. (empty($context['current_board']) ? 'null' : $context['current_board']) .';', false); |
|
| 1249 | + var current_board = '. (empty($context['current_board']) ? 'null' : $context['current_board']) . ';', false); |
|
| 1250 | 1250 | |
| 1251 | 1251 | // Finally, load the template. |
| 1252 | 1252 | if (!isset($_REQUEST['xml'])) |
@@ -1664,7 +1664,7 @@ discard block |
||
| 1664 | 1664 | } |
| 1665 | 1665 | |
| 1666 | 1666 | // Coming from the quickReply? |
| 1667 | - if(isset($_POST['quickReply'])) |
|
| 1667 | + if (isset($_POST['quickReply'])) |
|
| 1668 | 1668 | $_POST['message'] = $_POST['quickReply']; |
| 1669 | 1669 | |
| 1670 | 1670 | // Check the subject and message. |
@@ -2456,7 +2456,7 @@ discard block |
||
| 2456 | 2456 | FROM {db_prefix}messages AS m |
| 2457 | 2457 | LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member) |
| 2458 | 2458 | WHERE m.id_topic = {int:current_topic}' . (isset($_REQUEST['msg']) ? ' |
| 2459 | - AND m.id_msg < {int:id_msg}' : '') .(!$modSettings['postmod_active'] || allowedTo('approve_posts') ? '' : ' |
|
| 2459 | + AND m.id_msg < {int:id_msg}' : '') . (!$modSettings['postmod_active'] || allowedTo('approve_posts') ? '' : ' |
|
| 2460 | 2460 | AND m.approved = {int:approved}') . ' |
| 2461 | 2461 | ORDER BY m.id_msg DESC' . $limit, |
| 2462 | 2462 | array( |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | LEFT JOIN {db_prefix}membergroups AS mg ON (mg.id_group = CASE WHEN mem.id_group = {int:regular_id_group} THEN mem.id_post_group ELSE mem.id_group END)' . |
| 511 | 511 | (empty($customJoin) ? '' : implode(' |
| 512 | 512 | ', $customJoin)) . ' |
| 513 | - WHERE (' . implode( ' ' . $query . ' OR ', $fields) . ' ' . $query . ') |
|
| 513 | + WHERE (' . implode(' ' . $query . ' OR ', $fields) . ' ' . $query . ') |
|
| 514 | 514 | AND mem.is_activated = {int:is_activated}', |
| 515 | 515 | $query_parameters |
| 516 | 516 | ); |
@@ -527,7 +527,7 @@ discard block |
||
| 527 | 527 | LEFT JOIN {db_prefix}membergroups AS mg ON (mg.id_group = CASE WHEN mem.id_group = {int:regular_id_group} THEN mem.id_post_group ELSE mem.id_group END)' . |
| 528 | 528 | (empty($customJoin) ? '' : implode(' |
| 529 | 529 | ', $customJoin)) . ' |
| 530 | - WHERE (' . implode( ' ' . $query . ' OR ', $fields) . ' ' . $query . ') |
|
| 530 | + WHERE (' . implode(' ' . $query . ' OR ', $fields) . ' ' . $query . ') |
|
| 531 | 531 | AND mem.is_activated = {int:is_activated} |
| 532 | 532 | ORDER BY {raw:sort} |
| 533 | 533 | LIMIT {int:start}, {int:max}', |
@@ -700,7 +700,7 @@ discard block |
||
| 700 | 700 | 'up' => 't' . $row['col_name'] . '.value ASC' |
| 701 | 701 | ); |
| 702 | 702 | |
| 703 | - $cpf['join'][$row['col_name']] = 'LEFT JOIN {db_prefix}themes AS t' . $row['col_name'] . ' ON (t' . $row['col_name'] . '.variable = {literal:' . $row['col_name'] . '} AND t' . $row['col_name'] . '.id_theme = 1 AND t' . $row['col_name'] . '.id_member = mem.id_member)'; |
|
| 703 | + $cpf['join'][$row['col_name']] = 'LEFT JOIN {db_prefix}themes AS t' . $row['col_name'] . ' ON (t' . $row['col_name'] . '.variable = {literal:' . $row['col_name'] . '} AND t' . $row['col_name'] . '.id_theme = 1 AND t' . $row['col_name'] . '.id_member = mem.id_member)'; |
|
| 704 | 704 | } |
| 705 | 705 | $smcFunc['db_free_result']($request); |
| 706 | 706 | |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | ) |
| 232 | 232 | ); |
| 233 | 233 | |
| 234 | - $request = $smcFunc['db_query']('',' |
|
| 234 | + $request = $smcFunc['db_query']('', ' |
|
| 235 | 235 | SHOW default_text_search_config', |
| 236 | 236 | array() |
| 237 | 237 | ); |
@@ -426,8 +426,8 @@ discard block |
||
| 426 | 426 | WHERE t.schemaname= {string:schema} and ( |
| 427 | 427 | indexname = {string:messages_ftx} OR indexname = {string:log_search_words} )', |
| 428 | 428 | array( |
| 429 | - 'messages_ftx' => $db_prefix. 'messages_ftx', |
|
| 430 | - 'log_search_words' => $db_prefix. 'log_search_words', |
|
| 429 | + 'messages_ftx' => $db_prefix . 'messages_ftx', |
|
| 430 | + 'log_search_words' => $db_prefix . 'log_search_words', |
|
| 431 | 431 | 'schema' => 'public', |
| 432 | 432 | ) |
| 433 | 433 | ); |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | $context['table_info']['index_length'] = (int) $row['index_size']; |
| 443 | 443 | $context['table_info']['fulltext_length'] = (int) $row['index_size']; |
| 444 | 444 | } |
| 445 | - elseif ($row['indexname'] == $db_prefix. 'log_search_words') |
|
| 445 | + elseif ($row['indexname'] == $db_prefix . 'log_search_words') |
|
| 446 | 446 | { |
| 447 | 447 | $context['table_info']['index_length'] = (int) $row['index_size']; |
| 448 | 448 | $context['table_info']['custom_index_length'] = (int) $row['index_size']; |
@@ -799,7 +799,7 @@ discard block |
||
| 799 | 799 | // We need this for db_get_version |
| 800 | 800 | db_extend(); |
| 801 | 801 | |
| 802 | - if ($smcFunc['db_title'] == 'PostgreSQL'){ |
|
| 802 | + if ($smcFunc['db_title'] == 'PostgreSQL') { |
|
| 803 | 803 | $request = $smcFunc['db_query']('', ' |
| 804 | 804 | SELECT |
| 805 | 805 | indexname |
@@ -814,7 +814,7 @@ discard block |
||
| 814 | 814 | WHERE t.schemaname= {string:schema} and indexname = {string:messages_ftx}', |
| 815 | 815 | array( |
| 816 | 816 | 'schema' => 'public', |
| 817 | - 'messages_ftx' => $db_prefix.'messages_ftx', |
|
| 817 | + 'messages_ftx' => $db_prefix . 'messages_ftx', |
|
| 818 | 818 | ) |
| 819 | 819 | ); |
| 820 | 820 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | */ |
| 115 | 115 | public function setInitKey($key) |
| 116 | 116 | { |
| 117 | - if (preg_match('/^['.implode('', array_keys($this->getLookup())).']+$/', $key) == false) { |
|
| 117 | + if (preg_match('/^[' . implode('', array_keys($this->getLookup())) . ']+$/', $key) == false) { |
|
| 118 | 118 | throw new \InvalidArgumentException('Invalid base32 hash!'); |
| 119 | 119 | } |
| 120 | 120 | $this->initKey = $key; |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | $initKey = ($initKey == null) ? $this->getInitKey() : $initKey; |
| 248 | 248 | $timestamp = ($timestamp == null) ? $this->generateTimestamp() : $timestamp; |
| 249 | 249 | |
| 250 | - $hash = hash_hmac ( |
|
| 250 | + $hash = hash_hmac( |
|
| 251 | 251 | 'sha1', |
| 252 | 252 | pack('N*', 0) . pack('N*', $timestamp), |
| 253 | 253 | $initKey, |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | $code = ''; |
| 271 | 271 | |
| 272 | 272 | for ($i = 0; $i < $length; $i++) { |
| 273 | - $code .= $lookup[mt_rand(0, strlen($lookup)-1)]; |
|
| 273 | + $code .= $lookup[mt_rand(0, strlen($lookup) - 1)]; |
|
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | return $code; |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | */ |
| 284 | 284 | public function generateTimestamp() |
| 285 | 285 | { |
| 286 | - return floor(microtime(true)/$this->getRefresh()); |
|
| 286 | + return floor(microtime(true) / $this->getRefresh()); |
|
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | /** |
@@ -297,10 +297,10 @@ discard block |
||
| 297 | 297 | $offset = ord($hash[19]) & 0xf; |
| 298 | 298 | |
| 299 | 299 | return ( |
| 300 | - ((ord($hash[$offset+0]) & 0x7f) << 24 ) | |
|
| 301 | - ((ord($hash[$offset+1]) & 0xff) << 16 ) | |
|
| 302 | - ((ord($hash[$offset+2]) & 0xff) << 8 ) | |
|
| 303 | - (ord($hash[$offset+3]) & 0xff) |
|
| 300 | + ((ord($hash[$offset + 0]) & 0x7f) << 24) | |
|
| 301 | + ((ord($hash[$offset + 1]) & 0xff) << 16) | |
|
| 302 | + ((ord($hash[$offset + 2]) & 0xff) << 8) | |
|
| 303 | + (ord($hash[$offset + 3]) & 0xff) |
|
| 304 | 304 | ) % pow(10, $this->getCodeLength()); |
| 305 | 305 | } |
| 306 | 306 | |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | { |
| 316 | 316 | $lookup = $this->getLookup(); |
| 317 | 317 | |
| 318 | - if (preg_match('/^['.implode('', array_keys($lookup)).']+$/', $hash) == false) { |
|
| 318 | + if (preg_match('/^[' . implode('', array_keys($lookup)) . ']+$/', $hash) == false) { |
|
| 319 | 319 | throw new \InvalidArgumentException('Invalid base32 hash!'); |
| 320 | 320 | } |
| 321 | 321 | |
@@ -555,7 +555,7 @@ |
||
| 555 | 555 | 'subject' => $row_liked_message['subject'], |
| 556 | 556 | 'num' => $row_liked_message['likes'], |
| 557 | 557 | 'href' => $scripturl . '?msg=' . $row_liked_message['id_msg'], |
| 558 | - 'link' => '<a href="' . $scripturl . '?msg=' . $row_liked_message['id_msg'] .'">' . $row_liked_message['subject'] . '</a>' |
|
| 558 | + 'link' => '<a href="' . $scripturl . '?msg=' . $row_liked_message['id_msg'] . '">' . $row_liked_message['subject'] . '</a>' |
|
| 559 | 559 | ); |
| 560 | 560 | |
| 561 | 561 | if ($max_liked_message < $row_liked_message['likes']) |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | 'class' => 'centercol', |
| 257 | 257 | ), |
| 258 | 258 | 'data' => array( |
| 259 | - 'function' => function ($entry) |
|
| 259 | + 'function' => function($entry) |
|
| 260 | 260 | { |
| 261 | 261 | return '<input type="checkbox" class="input_check" name="delete[]" value="' . $entry['id'] . '"' . ($entry['editable'] ? '' : ' disabled') . '>'; |
| 262 | 262 | }, |
@@ -638,7 +638,7 @@ discard block |
||
| 638 | 638 | if (empty($entries[$k]['action_text'])) |
| 639 | 639 | $entries[$k]['action_text'] = isset($txt['modlog_ac_' . $entry['action']]) ? $txt['modlog_ac_' . $entry['action']] : $entry['action']; |
| 640 | 640 | $entries[$k]['action_text'] = preg_replace_callback('~\{([A-Za-z\d_]+)\}~i', |
| 641 | - function ($matches) use ($entries, $k) |
|
| 641 | + function($matches) use ($entries, $k) |
|
| 642 | 642 | { |
| 643 | 643 | return isset($entries[$k]['extra'][$matches[1]]) ? $entries[$k]['extra'][$matches[1]] : ''; |
| 644 | 644 | }, $entries[$k]['action_text']); |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | $table = str_replace('{db_prefix}', $db_prefix, $table); |
| 94 | 94 | |
| 95 | - $pg_tables = array('pg_catalog','information_schema'); |
|
| 95 | + $pg_tables = array('pg_catalog', 'information_schema'); |
|
| 96 | 96 | |
| 97 | 97 | $request = $smcFunc['db_query']('', ' |
| 98 | 98 | SELECT pg_relation_size(C.oid) AS "size" |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | { |
| 370 | 370 | static $ver; |
| 371 | 371 | |
| 372 | - if(!empty($ver)) |
|
| 372 | + if (!empty($ver)) |
|
| 373 | 373 | return $ver; |
| 374 | 374 | |
| 375 | 375 | global $smcFunc; |