@@ -14,8 +14,9 @@ discard block |
||
14 | 14 | * @version 2.1 Beta 4 |
15 | 15 | */ |
16 | 16 | |
17 | -if (!defined('SMF')) |
|
17 | +if (!defined('SMF')) { |
|
18 | 18 | die('No direct access...'); |
19 | +} |
|
19 | 20 | |
20 | 21 | /** |
21 | 22 | * Locks a topic... either by way of a moderator or the topic starter. |
@@ -32,8 +33,9 @@ discard block |
||
32 | 33 | global $topic, $user_info, $sourcedir, $board, $smcFunc; |
33 | 34 | |
34 | 35 | // Just quit if there's no topic to lock. |
35 | - if (empty($topic)) |
|
36 | - fatal_lang_error('not_a_topic', false); |
|
36 | + if (empty($topic)) { |
|
37 | + fatal_lang_error('not_a_topic', false); |
|
38 | + } |
|
37 | 39 | |
38 | 40 | checkSession('get'); |
39 | 41 | |
@@ -55,29 +57,35 @@ discard block |
||
55 | 57 | |
56 | 58 | // Can you lock topics here, mister? |
57 | 59 | $user_lock = !allowedTo('lock_any'); |
58 | - if ($user_lock && $starter == $user_info['id']) |
|
59 | - isAllowedTo('lock_own'); |
|
60 | - else |
|
61 | - isAllowedTo('lock_any'); |
|
60 | + if ($user_lock && $starter == $user_info['id']) { |
|
61 | + isAllowedTo('lock_own'); |
|
62 | + } else { |
|
63 | + isAllowedTo('lock_any'); |
|
64 | + } |
|
62 | 65 | |
63 | 66 | // Another moderator got the job done first? |
64 | - if (isset($_GET['sa']) && $_GET['sa'] == 'unlock' && $locked == '0') |
|
65 | - fatal_lang_error('error_topic_locked_already', false); |
|
66 | - elseif (isset($_GET['sa']) && $_GET['sa'] == 'lock' && ($locked == '1' || $locked == '2')) |
|
67 | - fatal_lang_error('error_topic_unlocked_already', false); |
|
67 | + if (isset($_GET['sa']) && $_GET['sa'] == 'unlock' && $locked == '0') { |
|
68 | + fatal_lang_error('error_topic_locked_already', false); |
|
69 | + } elseif (isset($_GET['sa']) && $_GET['sa'] == 'lock' && ($locked == '1' || $locked == '2')) { |
|
70 | + fatal_lang_error('error_topic_unlocked_already', false); |
|
71 | + } |
|
68 | 72 | |
69 | 73 | // Locking with high privileges. |
70 | - if ($locked == '0' && !$user_lock) |
|
71 | - $locked = '1'; |
|
74 | + if ($locked == '0' && !$user_lock) { |
|
75 | + $locked = '1'; |
|
76 | + } |
|
72 | 77 | // Locking with low privileges. |
73 | - elseif ($locked == '0') |
|
74 | - $locked = '2'; |
|
78 | + elseif ($locked == '0') { |
|
79 | + $locked = '2'; |
|
80 | + } |
|
75 | 81 | // Unlocking - make sure you don't unlock what you can't. |
76 | - elseif ($locked == '2' || ($locked == '1' && !$user_lock)) |
|
77 | - $locked = '0'; |
|
82 | + elseif ($locked == '2' || ($locked == '1' && !$user_lock)) { |
|
83 | + $locked = '0'; |
|
84 | + } |
|
78 | 85 | // You cannot unlock this! |
79 | - else |
|
80 | - fatal_lang_error('locked_by_admin', 'user'); |
|
86 | + else { |
|
87 | + fatal_lang_error('locked_by_admin', 'user'); |
|
88 | + } |
|
81 | 89 | |
82 | 90 | // Actually lock the topic in the database with the new value. |
83 | 91 | $smcFunc['db_query']('', ' |
@@ -91,8 +99,9 @@ discard block |
||
91 | 99 | ); |
92 | 100 | |
93 | 101 | // If they are allowed a "moderator" permission, log it in the moderator log. |
94 | - if (!$user_lock) |
|
95 | - logAction($locked ? 'lock' : 'unlock', array('topic' => $topic, 'board' => $board)); |
|
102 | + if (!$user_lock) { |
|
103 | + logAction($locked ? 'lock' : 'unlock', array('topic' => $topic, 'board' => $board)); |
|
104 | + } |
|
96 | 105 | // Notify people that this topic has been locked? |
97 | 106 | sendNotifications($topic, empty($locked) ? 'unlock' : 'lock'); |
98 | 107 | |
@@ -118,8 +127,9 @@ discard block |
||
118 | 127 | isAllowedTo('make_sticky'); |
119 | 128 | |
120 | 129 | // You can't sticky a board or something! |
121 | - if (empty($topic)) |
|
122 | - fatal_lang_error('not_a_topic', false); |
|
130 | + if (empty($topic)) { |
|
131 | + fatal_lang_error('not_a_topic', false); |
|
132 | + } |
|
123 | 133 | |
124 | 134 | checkSession('get'); |
125 | 135 | |
@@ -140,10 +150,11 @@ discard block |
||
140 | 150 | $smcFunc['db_free_result']($request); |
141 | 151 | |
142 | 152 | // Another moderator got the job done first? |
143 | - if (isset($_GET['sa']) && $_GET['sa'] == 'nonsticky' && $is_sticky == '0') |
|
144 | - fatal_lang_error('error_topic_nonsticky_already', false); |
|
145 | - elseif (isset($_GET['sa']) && $_GET['sa'] == 'sticky' && $is_sticky == '1') |
|
146 | - fatal_lang_error('error_topic_sticky_already', false); |
|
153 | + if (isset($_GET['sa']) && $_GET['sa'] == 'nonsticky' && $is_sticky == '0') { |
|
154 | + fatal_lang_error('error_topic_nonsticky_already', false); |
|
155 | + } elseif (isset($_GET['sa']) && $_GET['sa'] == 'sticky' && $is_sticky == '1') { |
|
156 | + fatal_lang_error('error_topic_sticky_already', false); |
|
157 | + } |
|
147 | 158 | |
148 | 159 | // Toggle the sticky value.... pretty simple ;). |
149 | 160 | $smcFunc['db_query']('', ' |
@@ -159,8 +170,9 @@ discard block |
||
159 | 170 | // Log this sticky action - always a moderator thing. |
160 | 171 | logAction(empty($is_sticky) ? 'sticky' : 'unsticky', array('topic' => $topic, 'board' => $board)); |
161 | 172 | // Notify people that this topic has been stickied? |
162 | - if (empty($is_sticky)) |
|
163 | - sendNotifications($topic, 'sticky'); |
|
173 | + if (empty($is_sticky)) { |
|
174 | + sendNotifications($topic, 'sticky'); |
|
175 | + } |
|
164 | 176 | |
165 | 177 | // Take them back to the now stickied topic. |
166 | 178 | redirectexit('topic=' . $topic . '.' . $_REQUEST['start'] . ';moderate'); |
@@ -28,15 +28,17 @@ discard block |
||
28 | 28 | <form class="login" action="', $context['login_url'], '" name="frmLogin" id="frmLogin" method="post" accept-charset="', $context['character_set'], '">'; |
29 | 29 | |
30 | 30 | // Did they make a mistake last time? |
31 | - if (!empty($context['login_errors'])) |
|
32 | - echo ' |
|
31 | + if (!empty($context['login_errors'])) { |
|
32 | + echo ' |
|
33 | 33 | <div class="errorbox">', implode('<br>', $context['login_errors']), '</div> |
34 | 34 | <br>'; |
35 | + } |
|
35 | 36 | |
36 | 37 | // Or perhaps there's some special description for this time? |
37 | - if (isset($context['description'])) |
|
38 | - echo ' |
|
38 | + if (isset($context['description'])) { |
|
39 | + echo ' |
|
39 | 40 | <div class="information">', $context['description'], '</div>'; |
41 | + } |
|
40 | 42 | |
41 | 43 | // Now just get the basic information - username, password, etc. |
42 | 44 | echo ' |
@@ -55,19 +57,21 @@ discard block |
||
55 | 57 | <dd> |
56 | 58 | <select name="cookielength" id="cookielength">'; |
57 | 59 | |
58 | - foreach ($context['login_cookie_times'] as $cookie_time => $cookie_txt) |
|
59 | - echo ' |
|
60 | + foreach ($context['login_cookie_times'] as $cookie_time => $cookie_txt) { |
|
61 | + echo ' |
|
60 | 62 | <option value="', $cookie_time, '"', $modSettings['cookieTime'] == $cookie_time ? ' selected' : '', '>', $txt[$cookie_txt], '</option>'; |
63 | + } |
|
61 | 64 | |
62 | 65 | echo ' |
63 | 66 | </select> |
64 | 67 | </dd>'; |
65 | 68 | |
66 | 69 | // If they have deleted their account, give them a chance to change their mind. |
67 | - if (isset($context['login_show_undelete'])) |
|
68 | - echo ' |
|
70 | + if (isset($context['login_show_undelete'])) { |
|
71 | + echo ' |
|
69 | 72 | <dt class="alert">', $txt['undelete_account'], ':</dt> |
70 | 73 | <dd><input type="checkbox" name="undelete"></dd>'; |
74 | + } |
|
71 | 75 | |
72 | 76 | echo ' |
73 | 77 | </dl> |
@@ -85,8 +89,8 @@ discard block |
||
85 | 89 | document.getElementById("', !empty($context['from_ajax']) ? 'ajax_' : '', isset($context['default_username']) && $context['default_username'] != '' ? 'loginpass' : 'loginuser', '").focus(); |
86 | 90 | }, 150);'; |
87 | 91 | |
88 | - if (!empty($context['from_ajax'])) |
|
89 | - echo ' |
|
92 | + if (!empty($context['from_ajax'])) { |
|
93 | + echo ' |
|
90 | 94 | form = $("#frmLogin"); |
91 | 95 | form.submit(function(e) { |
92 | 96 | e.preventDefault(); |
@@ -119,16 +123,18 @@ discard block |
||
119 | 123 | |
120 | 124 | return false; |
121 | 125 | });'; |
126 | + } |
|
122 | 127 | |
123 | 128 | echo ' |
124 | 129 | </script> |
125 | 130 | </form>'; |
126 | 131 | |
127 | 132 | // It is a long story as to why we have this when we're clearly not going to use it. |
128 | - if (!empty($context['from_ajax'])) |
|
129 | - echo ' |
|
133 | + if (!empty($context['from_ajax'])) { |
|
134 | + echo ' |
|
130 | 135 | <br> |
131 | 136 | <a href="javascript:self.close();"></a>'; |
137 | + } |
|
132 | 138 | |
133 | 139 | echo ' |
134 | 140 | </div><!-- .roundframe --> |
@@ -151,11 +157,12 @@ discard block |
||
151 | 157 | </div> |
152 | 158 | <div class="roundframe">'; |
153 | 159 | |
154 | - if (!empty($context['tfa_error']) || !empty($context['tfa_backup_error'])) |
|
155 | - echo ' |
|
160 | + if (!empty($context['tfa_error']) || !empty($context['tfa_backup_error'])) { |
|
161 | + echo ' |
|
156 | 162 | <div class="error"> |
157 | 163 | ', $txt['tfa_' . (!empty($context['tfa_error']) ? 'code_' : 'backup_') . 'invalid'], ' |
158 | 164 | </div>'; |
165 | + } |
|
159 | 166 | |
160 | 167 | echo ' |
161 | 168 | <form action="', $context['tfa_url'], '" method="post" id="frmTfa"> |
@@ -183,8 +190,8 @@ discard block |
||
183 | 190 | <script> |
184 | 191 | form = $("#frmTfa");'; |
185 | 192 | |
186 | - if (!empty($context['from_ajax'])) |
|
187 | - echo ' |
|
193 | + if (!empty($context['from_ajax'])) { |
|
194 | + echo ' |
|
188 | 195 | form.submit(function(e) { |
189 | 196 | // If we are submitting backup code, let normal workflow follow since it redirects a couple times into a different page |
190 | 197 | if (form.find("input[name=tfa_backup]:first").val().length > 0) |
@@ -203,6 +210,7 @@ discard block |
||
203 | 210 | |
204 | 211 | return false; |
205 | 212 | });'; |
213 | + } |
|
206 | 214 | |
207 | 215 | echo ' |
208 | 216 | form.find("input[name=backup]").click(function(e) { |
@@ -234,10 +242,11 @@ discard block |
||
234 | 242 | <p class="information centertext"> |
235 | 243 | ', empty($context['kick_message']) ? $txt['only_members_can_access'] : $context['kick_message'], '<br>'; |
236 | 244 | |
237 | - if ($context['can_register']) |
|
238 | - echo sprintf($txt['login_below_or_register'], $scripturl . '?action=signup', $context['forum_name_html_safe']); |
|
239 | - else |
|
240 | - echo $txt['login_below']; |
|
245 | + if ($context['can_register']) { |
|
246 | + echo sprintf($txt['login_below_or_register'], $scripturl . '?action=signup', $context['forum_name_html_safe']); |
|
247 | + } else { |
|
248 | + echo $txt['login_below']; |
|
249 | + } |
|
241 | 250 | |
242 | 251 | // And now the login information. |
243 | 252 | echo ' |
@@ -256,9 +265,10 @@ discard block |
||
256 | 265 | <dd> |
257 | 266 | <select name="cookielength" id="cookielength">'; |
258 | 267 | |
259 | - foreach ($context['login_cookie_times'] as $cookie_time => $cookie_txt) |
|
260 | - echo ' |
|
268 | + foreach ($context['login_cookie_times'] as $cookie_time => $cookie_txt) { |
|
269 | + echo ' |
|
261 | 270 | <option value="', $cookie_time, '"', $modSettings['cookieTime'] == $cookie_time ? ' selected' : '', '>', $txt[$cookie_txt], '</option>'; |
271 | + } |
|
262 | 272 | |
263 | 273 | echo ' |
264 | 274 | </select> |
@@ -315,9 +325,10 @@ discard block |
||
315 | 325 | <dd> |
316 | 326 | <select name="cookielength" id="cookielength">'; |
317 | 327 | |
318 | - foreach ($context['login_cookie_times'] as $cookie_time => $cookie_txt) |
|
319 | - echo ' |
|
328 | + foreach ($context['login_cookie_times'] as $cookie_time => $cookie_txt) { |
|
329 | + echo ' |
|
320 | 330 | <option value="', $cookie_time, '"', $modSettings['cookieTime'] == $cookie_time ? ' selected' : '', '>', $txt[$cookie_txt], '</option>'; |
331 | + } |
|
321 | 332 | |
322 | 333 | echo ' |
323 | 334 | </select> |
@@ -351,9 +362,10 @@ discard block |
||
351 | 362 | </div> |
352 | 363 | <div class="roundframe centertext">'; |
353 | 364 | |
354 | - if (!empty($context['incorrect_password'])) |
|
355 | - echo ' |
|
365 | + if (!empty($context['incorrect_password'])) { |
|
366 | + echo ' |
|
356 | 367 | <div class="error">', $txt['admin_incorrect_password'], '</div>'; |
368 | + } |
|
357 | 369 | |
358 | 370 | echo ' |
359 | 371 | <strong>', $txt['password'], ':</strong> |
@@ -394,10 +406,11 @@ discard block |
||
394 | 406 | <dl>'; |
395 | 407 | |
396 | 408 | // You didn't even have an ID? |
397 | - if (empty($context['member_id'])) |
|
398 | - echo ' |
|
409 | + if (empty($context['member_id'])) { |
|
410 | + echo ' |
|
399 | 411 | <dt>', $txt['invalid_activation_username'], ':</dt> |
400 | 412 | <dd><input type="text" name="user" size="30"></dd>'; |
413 | + } |
|
401 | 414 | |
402 | 415 | echo ' |
403 | 416 | <dt>', $txt['invalid_activation_retry'], ':</dt> |
@@ -434,13 +447,14 @@ discard block |
||
434 | 447 | <dd><input type="password" name="passwd" size="30"></dd> |
435 | 448 | </dl>'; |
436 | 449 | |
437 | - if ($context['can_activate']) |
|
438 | - echo ' |
|
450 | + if ($context['can_activate']) { |
|
451 | + echo ' |
|
439 | 452 | <p>', $txt['invalid_activation_known'], '</p> |
440 | 453 | <dl> |
441 | 454 | <dt>', $txt['invalid_activation_retry'], ':</dt> |
442 | 455 | <dd><input type="text" name="code" size="30"></dd> |
443 | 456 | </dl>'; |
457 | + } |
|
444 | 458 | |
445 | 459 | echo ' |
446 | 460 | <p><input type="submit" value="', $txt['invalid_activation_resend'], '" class="button"></p> |
@@ -14,8 +14,9 @@ discard block |
||
14 | 14 | * @version 2.1 Beta 4 |
15 | 15 | */ |
16 | 16 | |
17 | -if (!defined('SMF')) |
|
17 | +if (!defined('SMF')) { |
|
18 | 18 | die('No direct access...'); |
19 | +} |
|
19 | 20 | |
20 | 21 | /** |
21 | 22 | * This function shows the board index. |
@@ -34,8 +35,9 @@ discard block |
||
34 | 35 | $context['canonical_url'] = $scripturl; |
35 | 36 | |
36 | 37 | // Do not let search engines index anything if there is a random thing in $_GET. |
37 | - if (!empty($_GET)) |
|
38 | - $context['robot_no_index'] = true; |
|
38 | + if (!empty($_GET)) { |
|
39 | + $context['robot_no_index'] = true; |
|
40 | + } |
|
39 | 41 | |
40 | 42 | // Retrieve the categories and boards. |
41 | 43 | require_once($sourcedir . '/Subs-BoardIndex.php'); |
@@ -62,11 +64,12 @@ discard block |
||
62 | 64 | $context['latest_posts'] = cache_quick_get('boardindex-latest_posts:' . md5($user_info['query_wanna_see_board'] . $user_info['language']), 'Subs-Recent.php', 'cache_getLastPosts', array($latestPostOptions)); |
63 | 65 | } |
64 | 66 | |
65 | - if (!empty($context['latest_posts']) || !empty($context['latest_post'])) |
|
66 | - $context['info_center'][] = array( |
|
67 | + if (!empty($context['latest_posts']) || !empty($context['latest_post'])) { |
|
68 | + $context['info_center'][] = array( |
|
67 | 69 | 'tpl' => 'recent', |
68 | 70 | 'txt' => 'recent_posts', |
69 | 71 | ); |
72 | + } |
|
70 | 73 | } |
71 | 74 | |
72 | 75 | // Load the calendar? |
@@ -87,20 +90,22 @@ discard block |
||
87 | 90 | // This is used to show the "how-do-I-edit" help. |
88 | 91 | $context['calendar_can_edit'] = allowedTo('calendar_edit_any'); |
89 | 92 | |
90 | - if (!empty($context['show_calendar'])) |
|
91 | - $context['info_center'][] = array( |
|
93 | + if (!empty($context['show_calendar'])) { |
|
94 | + $context['info_center'][] = array( |
|
92 | 95 | 'tpl' => 'calendar', |
93 | 96 | 'txt' => $context['calendar_only_today'] ? 'calendar_today' : 'calendar_upcoming', |
94 | 97 | ); |
98 | + } |
|
95 | 99 | } |
96 | 100 | |
97 | 101 | // And stats. |
98 | 102 | $context['show_stats'] = allowedTo('view_stats') && !empty($modSettings['trackStats']); |
99 | - if ($settings['show_stats_index']) |
|
100 | - $context['info_center'][] = array( |
|
103 | + if ($settings['show_stats_index']) { |
|
104 | + $context['info_center'][] = array( |
|
101 | 105 | 'tpl' => 'stats', |
102 | 106 | 'txt' => 'forum_stats', |
103 | 107 | ); |
108 | + } |
|
104 | 109 | |
105 | 110 | // Now the online stuff |
106 | 111 | require_once($sourcedir . '/Subs-MembersOnline.php'); |
@@ -118,12 +123,14 @@ discard block |
||
118 | 123 | ); |
119 | 124 | |
120 | 125 | // Track most online statistics? (Subs-MembersOnline.php) |
121 | - if (!empty($modSettings['trackStats'])) |
|
122 | - trackStatsUsersOnline($context['num_guests'] + $context['num_spiders'] + $context['num_users_online']); |
|
126 | + if (!empty($modSettings['trackStats'])) { |
|
127 | + trackStatsUsersOnline($context['num_guests'] + $context['num_spiders'] + $context['num_users_online']); |
|
128 | + } |
|
123 | 129 | |
124 | 130 | // Are we showing all membergroups on the board index? |
125 | - if (!empty($settings['show_group_key'])) |
|
126 | - $context['membergroups'] = cache_quick_get('membergroup_list', 'Subs-Membergroups.php', 'cache_getMembergroupList', array()); |
|
131 | + if (!empty($settings['show_group_key'])) { |
|
132 | + $context['membergroups'] = cache_quick_get('membergroup_list', 'Subs-Membergroups.php', 'cache_getMembergroupList', array()); |
|
133 | + } |
|
127 | 134 | |
128 | 135 | // And back to normality. |
129 | 136 | $context['page_title'] = sprintf($txt['forum_index'], $context['forum_name']); |
@@ -328,7 +328,7 @@ |
||
328 | 328 | foreach ($context['error_info']['backtrace'] as $key => $value) |
329 | 329 | { |
330 | 330 | //Check for existing |
331 | - if (!property_exists($value,'file') || empty($value->file)) |
|
331 | + if (!property_exists($value, 'file') || empty($value->file)) |
|
332 | 332 | $value->file = $txt['unknown']; |
333 | 333 | if (!property_exists($value, 'line') || empty($value->line)) |
334 | 334 | $value->line = -1; |
@@ -23,15 +23,15 @@ discard block |
||
23 | 23 | { |
24 | 24 | global $context, $txt; |
25 | 25 | |
26 | - if (!empty($context['simple_action'])) |
|
27 | - echo ' |
|
26 | + if (!empty($context['simple_action'])) { |
|
27 | + echo ' |
|
28 | 28 | <strong> |
29 | 29 | ', $context['error_title'], ' |
30 | 30 | </strong><br> |
31 | 31 | <div ', $context['error_code'], 'class="padding"> |
32 | 32 | ', $context['error_message'], ' |
33 | 33 | </div>'; |
34 | - else |
|
34 | + } else |
|
35 | 35 | { |
36 | 36 | echo ' |
37 | 37 | <div id="fatal_error"> |
@@ -85,21 +85,23 @@ discard block |
||
85 | 85 | |
86 | 86 | $error_types = array(); |
87 | 87 | |
88 | - foreach ($context['error_types'] as $type => $details) |
|
89 | - $error_types[] = ($details['is_selected'] ? '<img src="' . $settings['images_url'] . '/selected.png" alt=""> ' : '') . '<a href="' . $details['url'] . '" ' . ($details['is_selected'] ? 'style="font-weight: bold;"' : '') . ' title="' . $details['description'] . '">' . $details['label'] . '</a>'; |
|
88 | + foreach ($context['error_types'] as $type => $details) { |
|
89 | + $error_types[] = ($details['is_selected'] ? '<img src="' . $settings['images_url'] . '/selected.png" alt=""> ' : '') . '<a href="' . $details['url'] . '" ' . ($details['is_selected'] ? 'style="font-weight: bold;"' : '') . ' title="' . $details['description'] . '">' . $details['label'] . '</a>'; |
|
90 | + } |
|
90 | 91 | |
91 | 92 | echo ' |
92 | 93 | ', implode(' | ', $error_types), ' |
93 | 94 | </td> |
94 | 95 | </tr>'; |
95 | 96 | |
96 | - if ($context['has_filter']) |
|
97 | - echo ' |
|
97 | + if ($context['has_filter']) { |
|
98 | + echo ' |
|
98 | 99 | <tr> |
99 | 100 | <td colspan="3" class="windowbg"> |
100 | 101 | <strong>', $txt['applying_filter'], ':</strong> ', $context['filter']['entity'], ' ', $context['filter']['value']['html'], ' [<a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', '">', $txt['clear_filter'], '</a>] |
101 | 102 | </td> |
102 | 103 | </tr>'; |
104 | + } |
|
103 | 105 | |
104 | 106 | echo ' |
105 | 107 | <tr> |
@@ -110,11 +112,12 @@ discard block |
||
110 | 112 | </tr>'; |
111 | 113 | |
112 | 114 | // No errors, then show a message |
113 | - if (count($context['errors']) == 0) |
|
114 | - echo ' |
|
115 | + if (count($context['errors']) == 0) { |
|
116 | + echo ' |
|
115 | 117 | <tr class="windowbg"> |
116 | 118 | <td class="centertext" colspan="2">', $txt['errlog_no_entries'], '</td> |
117 | 119 | </tr>'; |
120 | + } |
|
118 | 121 | |
119 | 122 | // We have some errors, must be some mods installed :P |
120 | 123 | foreach ($context['errors'] as $error) |
@@ -128,16 +131,18 @@ discard block |
||
128 | 131 | <a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? '' : ';desc', $context['has_filter'] ? $context['filter']['href'] : '', '" title="', $txt['reverse_direction'], '"><span class="generic_icons sort_' . $context['sort_direction'] . '"></span></a> |
129 | 132 | ', $error['time'], '<br>'; |
130 | 133 | |
131 | - if (!empty($error['member']['ip'])) |
|
132 | - echo ' |
|
134 | + if (!empty($error['member']['ip'])) { |
|
135 | + echo ' |
|
133 | 136 | <a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=ip;value=', $error['member']['ip'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_ip'], '"><span class="generic_icons filter centericon"></span></a> |
134 | 137 | <strong><a href="', $scripturl, '?action=trackip;searchip=', $error['member']['ip'], '">', $error['member']['ip'], '</a></strong>'; |
138 | + } |
|
135 | 139 | |
136 | - if ($error['member']['session'] != '') |
|
137 | - echo ' |
|
140 | + if ($error['member']['session'] != '') { |
|
141 | + echo ' |
|
138 | 142 | <br> |
139 | 143 | <a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=session;value=', $error['member']['session'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_session'], '"><span class="generic_icons filter centericon"></span></a> |
140 | 144 | ', $error['member']['session'], '<br>'; |
145 | + } |
|
141 | 146 | |
142 | 147 | echo ' |
143 | 148 | </div> |
@@ -152,12 +157,13 @@ discard block |
||
152 | 157 | <a href="', $error['url']['html'], '">', $error['url']['html'], '</a> |
153 | 158 | '; |
154 | 159 | |
155 | - if (!empty($error['file'])) |
|
156 | - echo ' |
|
160 | + if (!empty($error['file'])) { |
|
161 | + echo ' |
|
157 | 162 | <div> |
158 | 163 | <a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=file;value=', $error['file']['search'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_file'], '">' |
159 | 164 | . ' <span class="generic_icons filter"></span></a> ', $error['file']['link'], ' (', $txt['line'], ' ', $error['file']['line'], ') |
160 | 165 | </div>'; |
166 | + } |
|
161 | 167 | |
162 | 168 | echo ' |
163 | 169 | </div> |
@@ -186,9 +192,10 @@ discard block |
||
186 | 192 | </div> |
187 | 193 | </div>'; |
188 | 194 | |
189 | - if ($context['sort_direction'] == 'down') |
|
190 | - echo ' |
|
195 | + if ($context['sort_direction'] == 'down') { |
|
196 | + echo ' |
|
191 | 197 | <input type="hidden" name="desc" value="1">'; |
198 | + } |
|
192 | 199 | |
193 | 200 | echo ' |
194 | 201 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -249,9 +256,10 @@ discard block |
||
249 | 256 | $context['error_message'], ' |
250 | 257 | </div>'; |
251 | 258 | |
252 | - if (!empty($context['back_link'])) |
|
253 | - echo ' |
|
259 | + if (!empty($context['back_link'])) { |
|
260 | + echo ' |
|
254 | 261 | <a class="button" href="', $scripturl, $context['back_link'], '">', $txt['back'], '</a>'; |
262 | + } |
|
255 | 263 | |
256 | 264 | echo ' |
257 | 265 | <span style="float: right; margin:.5em;"></span> |
@@ -288,25 +296,30 @@ discard block |
||
288 | 296 | <div class="windowbg"> |
289 | 297 | <ul class="padding">'; |
290 | 298 | |
291 | - if (!empty($context['error_info']['error_type'])) |
|
292 | - echo ' |
|
299 | + if (!empty($context['error_info']['error_type'])) { |
|
300 | + echo ' |
|
293 | 301 | <li>', $txt['error_type'], ': ', ucfirst($context['error_info']['error_type']), '</li>'; |
302 | + } |
|
294 | 303 | |
295 | - if (!empty($context['error_info']['message'])) |
|
296 | - echo ' |
|
304 | + if (!empty($context['error_info']['message'])) { |
|
305 | + echo ' |
|
297 | 306 | <li>', $txt['error_message'], ': ', $context['error_info']['message'], '</li>'; |
307 | + } |
|
298 | 308 | |
299 | - if (!empty($context['error_info']['file'])) |
|
300 | - echo ' |
|
309 | + if (!empty($context['error_info']['file'])) { |
|
310 | + echo ' |
|
301 | 311 | <li>', $txt['error_file'], ': ', $context['error_info']['file'], '</li>'; |
312 | + } |
|
302 | 313 | |
303 | - if (!empty($context['error_info']['line'])) |
|
304 | - echo ' |
|
314 | + if (!empty($context['error_info']['line'])) { |
|
315 | + echo ' |
|
305 | 316 | <li>', $txt['error_line'], ': ', $context['error_info']['line'], '</li>'; |
317 | + } |
|
306 | 318 | |
307 | - if (!empty($context['error_info']['url'])) |
|
308 | - echo ' |
|
319 | + if (!empty($context['error_info']['url'])) { |
|
320 | + echo ' |
|
309 | 321 | <li>', $txt['error_url'], ': ', $context['error_info']['url'], '</li>'; |
322 | + } |
|
310 | 323 | |
311 | 324 | |
312 | 325 | echo ' |
@@ -328,10 +341,12 @@ discard block |
||
328 | 341 | foreach ($context['error_info']['backtrace'] as $key => $value) |
329 | 342 | { |
330 | 343 | //Check for existing |
331 | - if (!property_exists($value,'file') || empty($value->file)) |
|
332 | - $value->file = $txt['unknown']; |
|
333 | - if (!property_exists($value, 'line') || empty($value->line)) |
|
334 | - $value->line = -1; |
|
344 | + if (!property_exists($value,'file') || empty($value->file)) { |
|
345 | + $value->file = $txt['unknown']; |
|
346 | + } |
|
347 | + if (!property_exists($value, 'line') || empty($value->line)) { |
|
348 | + $value->line = -1; |
|
349 | + } |
|
335 | 350 | |
336 | 351 | echo ' |
337 | 352 | <li class="backtrace">', sprintf($txt['backtrace_info'], $key, $value->function, $value->file, $value->line, base64_encode($value->file)), '</li>'; |
@@ -26,9 +26,10 @@ discard block |
||
26 | 26 | </div> |
27 | 27 | <div class="pagesection">', $context['page_index'], '</div>'; |
28 | 28 | |
29 | - if (empty($context['posts'])) |
|
30 | - echo ' |
|
29 | + if (empty($context['posts'])) { |
|
30 | + echo ' |
|
31 | 31 | <div class="windowbg">', $txt['no_messages'], '</div>'; |
32 | + } |
|
32 | 33 | |
33 | 34 | foreach ($context['posts'] as $post) |
34 | 35 | { |
@@ -41,28 +42,33 @@ discard block |
||
41 | 42 | </div> |
42 | 43 | <div class="list_posts">', $post['message'], '</div>'; |
43 | 44 | |
44 | - if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) |
|
45 | - echo ' |
|
45 | + if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) { |
|
46 | + echo ' |
|
46 | 47 | <ul class="quickbuttons">'; |
48 | + } |
|
47 | 49 | |
48 | 50 | // If they *can* reply? |
49 | - if ($post['can_reply']) |
|
50 | - echo ' |
|
51 | + if ($post['can_reply']) { |
|
52 | + echo ' |
|
51 | 53 | <li><a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>'; |
54 | + } |
|
52 | 55 | |
53 | 56 | // If they *can* quote? |
54 | - if ($post['can_quote']) |
|
55 | - echo ' |
|
57 | + if ($post['can_quote']) { |
|
58 | + echo ' |
|
56 | 59 | <li><a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], ';quote=', $post['id'], '"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>'; |
60 | + } |
|
57 | 61 | |
58 | 62 | // How about... even... remove it entirely?! |
59 | - if ($post['can_delete']) |
|
60 | - echo ' |
|
63 | + if ($post['can_delete']) { |
|
64 | + echo ' |
|
61 | 65 | <li><a href="', $scripturl, '?action=deletemsg;msg=', $post['id'], ';topic=', $post['topic'], ';recent;', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['remove_message'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove'], '</a></li>'; |
66 | + } |
|
62 | 67 | |
63 | - if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) |
|
64 | - echo ' |
|
68 | + if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) { |
|
69 | + echo ' |
|
65 | 70 | </ul>'; |
71 | + } |
|
66 | 72 | |
67 | 73 | echo ' |
68 | 74 | </div><!-- $post[css_class] -->'; |
@@ -83,12 +89,13 @@ discard block |
||
83 | 89 | echo ' |
84 | 90 | <div id="recent" class="main_content">'; |
85 | 91 | |
86 | - if ($context['showCheckboxes']) |
|
87 | - echo ' |
|
92 | + if ($context['showCheckboxes']) { |
|
93 | + echo ' |
|
88 | 94 | <form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm"> |
89 | 95 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
90 | 96 | <input type="hidden" name="qaction" value="markread"> |
91 | 97 | <input type="hidden" name="redirect_url" value="action=unread', (!empty($context['showing_all_topics']) ? ';all' : ''), $context['querystring_board_limits'], '">'; |
98 | + } |
|
92 | 99 | |
93 | 100 | if (!empty($context['topics'])) |
94 | 101 | { |
@@ -117,11 +124,12 @@ discard block |
||
117 | 124 | </div>'; |
118 | 125 | |
119 | 126 | // Show a "select all" box for quick moderation? |
120 | - if ($context['showCheckboxes']) |
|
121 | - echo ' |
|
127 | + if ($context['showCheckboxes']) { |
|
128 | + echo ' |
|
122 | 129 | <div class="moderation"> |
123 | 130 | <input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');"> |
124 | 131 | </div>'; |
132 | + } |
|
125 | 133 | |
126 | 134 | echo ' |
127 | 135 | </div><!-- #topic_header --> |
@@ -141,17 +149,20 @@ discard block |
||
141 | 149 | echo ' |
142 | 150 | <div class="icons floatright">'; |
143 | 151 | |
144 | - if ($topic['is_locked']) |
|
145 | - echo ' |
|
152 | + if ($topic['is_locked']) { |
|
153 | + echo ' |
|
146 | 154 | <span class="generic_icons lock"></span>'; |
155 | + } |
|
147 | 156 | |
148 | - if ($topic['is_sticky']) |
|
149 | - echo ' |
|
157 | + if ($topic['is_sticky']) { |
|
158 | + echo ' |
|
150 | 159 | <span class="generic_icons sticky"></span>'; |
160 | + } |
|
151 | 161 | |
152 | - if ($topic['is_poll']) |
|
153 | - echo ' |
|
162 | + if ($topic['is_poll']) { |
|
163 | + echo ' |
|
154 | 164 | <span class="generic_icons poll"></span>'; |
165 | + } |
|
155 | 166 | |
156 | 167 | echo ' |
157 | 168 | </div>'; |
@@ -177,19 +188,21 @@ discard block |
||
177 | 188 | ', sprintf($txt['last_post_topic'], '<a href="' . $topic['last_post']['href'] . '">' . $topic['last_post']['time'] . '</a>', $topic['last_post']['member']['link']), ' |
178 | 189 | </div>'; |
179 | 190 | |
180 | - if ($context['showCheckboxes']) |
|
181 | - echo ' |
|
191 | + if ($context['showCheckboxes']) { |
|
192 | + echo ' |
|
182 | 193 | <div class="moderation"> |
183 | 194 | <input type="checkbox" name="topics[]" value="', $topic['id'], '"> |
184 | 195 | </div>'; |
196 | + } |
|
185 | 197 | |
186 | 198 | echo ' |
187 | 199 | </div><!-- $topic[css_class] -->'; |
188 | 200 | } |
189 | 201 | |
190 | - if (empty($context['topics'])) |
|
191 | - echo ' |
|
202 | + if (empty($context['topics'])) { |
|
203 | + echo ' |
|
192 | 204 | <div style="display: none;"></div>'; |
205 | + } |
|
193 | 206 | |
194 | 207 | echo ' |
195 | 208 | </div><!-- #topic_container --> |
@@ -204,25 +217,27 @@ discard block |
||
204 | 217 | ', $context['page_index'], ' |
205 | 218 | </div> |
206 | 219 | </div>'; |
207 | - } |
|
208 | - else |
|
209 | - echo ' |
|
220 | + } else { |
|
221 | + echo ' |
|
210 | 222 | <div class="cat_bar"> |
211 | 223 | <h3 class="catbg centertext"> |
212 | 224 | ', $context['showing_all_topics'] ? $txt['topic_alert_none'] : $txt['unread_topics_visit_none'], ' |
213 | 225 | </h3> |
214 | 226 | </div>'; |
227 | + } |
|
215 | 228 | |
216 | - if ($context['showCheckboxes']) |
|
217 | - echo ' |
|
229 | + if ($context['showCheckboxes']) { |
|
230 | + echo ' |
|
218 | 231 | </form>'; |
232 | + } |
|
219 | 233 | |
220 | 234 | echo ' |
221 | 235 | </div><!-- #recent -->'; |
222 | 236 | |
223 | - if (empty($context['no_topic_listing'])) |
|
224 | - template_topic_legend(); |
|
225 | -} |
|
237 | + if (empty($context['no_topic_listing'])) { |
|
238 | + template_topic_legend(); |
|
239 | + } |
|
240 | + } |
|
226 | 241 | |
227 | 242 | /** |
228 | 243 | * Template for showing unread replies (eg new replies to topics you've posted in) |
@@ -234,12 +249,13 @@ discard block |
||
234 | 249 | echo ' |
235 | 250 | <div id="recent">'; |
236 | 251 | |
237 | - if ($context['showCheckboxes']) |
|
238 | - echo ' |
|
252 | + if ($context['showCheckboxes']) { |
|
253 | + echo ' |
|
239 | 254 | <form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm"> |
240 | 255 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
241 | 256 | <input type="hidden" name="qaction" value="markread"> |
242 | 257 | <input type="hidden" name="redirect_url" value="action=unreadreplies', (!empty($context['showing_all_topics']) ? ';all' : ''), $context['querystring_board_limits'], '">'; |
258 | + } |
|
243 | 259 | |
244 | 260 | if (!empty($context['topics'])) |
245 | 261 | { |
@@ -268,11 +284,12 @@ discard block |
||
268 | 284 | </div>'; |
269 | 285 | |
270 | 286 | // Show a "select all" box for quick moderation? |
271 | - if ($context['showCheckboxes']) |
|
272 | - echo ' |
|
287 | + if ($context['showCheckboxes']) { |
|
288 | + echo ' |
|
273 | 289 | <div class="moderation"> |
274 | 290 | <input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');"> |
275 | 291 | </div>'; |
292 | + } |
|
276 | 293 | |
277 | 294 | echo ' |
278 | 295 | </div><!-- #topic_header --> |
@@ -292,17 +309,20 @@ discard block |
||
292 | 309 | echo ' |
293 | 310 | <div class="icons floatright">'; |
294 | 311 | |
295 | - if ($topic['is_locked']) |
|
296 | - echo ' |
|
312 | + if ($topic['is_locked']) { |
|
313 | + echo ' |
|
297 | 314 | <span class="generic_icons lock"></span>'; |
315 | + } |
|
298 | 316 | |
299 | - if ($topic['is_sticky']) |
|
300 | - echo ' |
|
317 | + if ($topic['is_sticky']) { |
|
318 | + echo ' |
|
301 | 319 | <span class="generic_icons sticky"></span>'; |
320 | + } |
|
302 | 321 | |
303 | - if ($topic['is_poll']) |
|
304 | - echo ' |
|
322 | + if ($topic['is_poll']) { |
|
323 | + echo ' |
|
305 | 324 | <span class="generic_icons poll"></span>'; |
325 | + } |
|
306 | 326 | |
307 | 327 | echo ' |
308 | 328 | </div>'; |
@@ -328,11 +348,12 @@ discard block |
||
328 | 348 | ', sprintf($txt['last_post_topic'], '<a href="' . $topic['last_post']['href'] . '">' . $topic['last_post']['time'] . '</a>', $topic['last_post']['member']['link']), ' |
329 | 349 | </div>'; |
330 | 350 | |
331 | - if ($context['showCheckboxes']) |
|
332 | - echo ' |
|
351 | + if ($context['showCheckboxes']) { |
|
352 | + echo ' |
|
333 | 353 | <div class="moderation"> |
334 | 354 | <input type="checkbox" name="topics[]" value="', $topic['id'], '"> |
335 | 355 | </div>'; |
356 | + } |
|
336 | 357 | |
337 | 358 | echo ' |
338 | 359 | </div><!-- $topic[css_class] -->'; |
@@ -349,24 +370,26 @@ discard block |
||
349 | 370 | ', $context['page_index'], ' |
350 | 371 | </div> |
351 | 372 | </div>'; |
352 | - } |
|
353 | - else |
|
354 | - echo ' |
|
373 | + } else { |
|
374 | + echo ' |
|
355 | 375 | <div class="cat_bar"> |
356 | 376 | <h3 class="catbg centertext"> |
357 | 377 | ', $context['showing_all_topics'] ? $txt['topic_alert_none'] : $txt['updated_topics_visit_none'], ' |
358 | 378 | </h3> |
359 | 379 | </div>'; |
380 | + } |
|
360 | 381 | |
361 | - if ($context['showCheckboxes']) |
|
362 | - echo ' |
|
382 | + if ($context['showCheckboxes']) { |
|
383 | + echo ' |
|
363 | 384 | </form>'; |
385 | + } |
|
364 | 386 | |
365 | 387 | echo ' |
366 | 388 | </div><!-- #recent -->'; |
367 | 389 | |
368 | - if (empty($context['no_topic_listing'])) |
|
369 | - template_topic_legend(); |
|
370 | -} |
|
390 | + if (empty($context['no_topic_listing'])) { |
|
391 | + template_topic_legend(); |
|
392 | + } |
|
393 | + } |
|
371 | 394 | |
372 | 395 | ?> |
373 | 396 | \ No newline at end of file |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | <div id="recent" class="main_section"> |
22 | 22 | <div class="cat_bar"> |
23 | 23 | <h3 class="catbg"> |
24 | - <span class="xx"></span>',$txt['recent_posts'],' |
|
24 | + <span class="xx"></span>',$txt['recent_posts'], ' |
|
25 | 25 | </h3> |
26 | 26 | </div> |
27 | 27 | <div class="pagesection">', $context['page_index'], '</div>'; |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | <p class="floatleft"> |
165 | 165 | ', $topic['first_post']['started_by'], ' |
166 | 166 | </p> |
167 | - ', !empty($topic['pages']) ? '<span id="pages'.$topic['first_post']['id'].'" class="topic_pages">'.$topic['pages'].'</span>' : '', ' |
|
167 | + ', !empty($topic['pages']) ? '<span id="pages' . $topic['first_post']['id'] . '" class="topic_pages">' . $topic['pages'] . '</span>' : '', ' |
|
168 | 168 | </div><!-- .info --> |
169 | 169 | <div class="board_stats centertext"> |
170 | 170 | <p> |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | <p class="floatleft"> |
316 | 316 | ', $topic['first_post']['started_by'], ' |
317 | 317 | </p> |
318 | - ', !empty($topic['pages']) ? '<span id="pages'.$topic['first_post']['id'].'" class="topic_pages">'.$topic['pages'].'</span>' : '', ' |
|
318 | + ', !empty($topic['pages']) ? '<span id="pages' . $topic['first_post']['id'] . '" class="topic_pages">' . $topic['pages'] . '</span>' : '', ' |
|
319 | 319 | </div><!-- .info --> |
320 | 320 | <div class="board_stats centertext"> |
321 | 321 | <p> |
@@ -20,17 +20,19 @@ discard block |
||
20 | 20 | echo ' |
21 | 21 | <form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" name="searchform" id="searchform">'; |
22 | 22 | |
23 | - if (!empty($context['search_errors'])) |
|
24 | - echo ' |
|
23 | + if (!empty($context['search_errors'])) { |
|
24 | + echo ' |
|
25 | 25 | <div class="errorbox"> |
26 | 26 | ', implode('<br>', $context['search_errors']['messages']), ' |
27 | 27 | </div>'; |
28 | + } |
|
28 | 29 | |
29 | - if (!empty($context['search_ignored'])) |
|
30 | - echo ' |
|
30 | + if (!empty($context['search_ignored'])) { |
|
31 | + echo ' |
|
31 | 32 | <div class="noticebox"> |
32 | 33 | ', $txt['search_warning_ignored_word' . (count($context['search_ignored']) == 1 ? '' : 's')], ': ', implode(', ', $context['search_ignored']), ' |
33 | 34 | </div>'; |
35 | + } |
|
34 | 36 | |
35 | 37 | echo ' |
36 | 38 | <div class="cat_bar"> |
@@ -48,9 +50,10 @@ discard block |
||
48 | 50 | <dd> |
49 | 51 | <input type="search" name="search" id="searchfor" ', !empty($context['search_params']['search']) ? ' value="' . $context['search_params']['search'] . '"' : '', ' maxlength="', $context['search_string_limit'], '" size="40">'; |
50 | 52 | |
51 | - if (empty($modSettings['search_simple_fulltext'])) |
|
52 | - echo ' |
|
53 | + if (empty($modSettings['search_simple_fulltext'])) { |
|
54 | + echo ' |
|
53 | 55 | <br><em class="smalltext">', $txt['search_example'], '</em>'; |
56 | + } |
|
54 | 57 | |
55 | 58 | echo ' |
56 | 59 | </dd> |
@@ -114,21 +117,23 @@ discard block |
||
114 | 117 | <input type="hidden" name="advanced" value="1">'; |
115 | 118 | |
116 | 119 | // Require an image to be typed to save spamming? |
117 | - if ($context['require_verification']) |
|
118 | - echo ' |
|
120 | + if ($context['require_verification']) { |
|
121 | + echo ' |
|
119 | 122 | <p> |
120 | 123 | <strong>', $txt['verification'], ':</strong> |
121 | 124 | ', template_control_verification($context['visual_verification_id'], 'all'), ' |
122 | 125 | </p>'; |
126 | + } |
|
123 | 127 | |
124 | 128 | // If $context['search_params']['topic'] is set, that means we're searching just one topic. |
125 | - if (!empty($context['search_params']['topic'])) |
|
126 | - echo ' |
|
129 | + if (!empty($context['search_params']['topic'])) { |
|
130 | + echo ' |
|
127 | 131 | <p> |
128 | 132 | ', $txt['search_specific_topic'], ' "', $context['search_topic']['link'], '". |
129 | 133 | </p> |
130 | 134 | <input type="hidden" name="topic" value="', $context['search_topic']['id'], '"> |
131 | 135 | <input type="submit" name="b_search" value="', $txt['search'], '" class="button">'; |
136 | + } |
|
132 | 137 | |
133 | 138 | echo ' |
134 | 139 | </div>'; |
@@ -238,17 +243,19 @@ discard block |
||
238 | 243 | <div class="roundframe">'; |
239 | 244 | |
240 | 245 | // Did they make any typos or mistakes, perhaps? |
241 | - if (isset($context['did_you_mean'])) |
|
242 | - echo ' |
|
246 | + if (isset($context['did_you_mean'])) { |
|
247 | + echo ' |
|
243 | 248 | <p> |
244 | 249 | ', $txt['search_did_you_mean'], ' <a href="', $scripturl, '?action=search2;params=', $context['did_you_mean_params'], '">', $context['did_you_mean'], '</a>. |
245 | 250 | </p>'; |
251 | + } |
|
246 | 252 | |
247 | - if (!empty($context['search_ignored'])) |
|
248 | - echo ' |
|
253 | + if (!empty($context['search_ignored'])) { |
|
254 | + echo ' |
|
249 | 255 | <p> |
250 | 256 | ', $txt['search_warning_ignored_word' . (count($context['search_ignored']) == 1 ? '' : 's')], ': ', implode(', ', $context['search_ignored']), ' |
251 | 257 | </p>'; |
258 | + } |
|
252 | 259 | |
253 | 260 | echo ' |
254 | 261 | <form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '"> |
@@ -271,10 +278,11 @@ discard block |
||
271 | 278 | <input type="hidden" name="sort" value="', !empty($context['search_params']['sort']) ? $context['search_params']['sort'] : 'relevance', '"> |
272 | 279 | </div>'; |
273 | 280 | |
274 | - if (!empty($context['search_params']['brd'])) |
|
275 | - foreach ($context['search_params']['brd'] as $board_id) |
|
281 | + if (!empty($context['search_params']['brd'])) { |
|
282 | + foreach ($context['search_params']['brd'] as $board_id) |
|
276 | 283 | echo ' |
277 | 284 | <input type="hidden" name="brd[', $board_id, ']" value="', $board_id, '">'; |
285 | + } |
|
278 | 286 | |
279 | 287 | echo ' |
280 | 288 | </form> |
@@ -285,18 +293,20 @@ discard block |
||
285 | 293 | if ($context['compact']) |
286 | 294 | { |
287 | 295 | // Quick moderation set to checkboxes? Oh, how fun :/ |
288 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) |
|
289 | - echo ' |
|
296 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) { |
|
297 | + echo ' |
|
290 | 298 | <form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="topicForm">'; |
299 | + } |
|
291 | 300 | |
292 | 301 | echo ' |
293 | 302 | <div class="cat_bar"> |
294 | 303 | <h3 class="catbg"> |
295 | 304 | <span class="floatright">'; |
296 | 305 | |
297 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) |
|
298 | - echo ' |
|
306 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) { |
|
307 | + echo ' |
|
299 | 308 | <input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');">'; |
309 | + } |
|
300 | 310 | echo ' |
301 | 311 | </span> |
302 | 312 | <span class="generic_icons filter"></span> ', $txt['mlist_search_results'], ': ', $context['search_params']['search'], ' |
@@ -304,15 +314,15 @@ discard block |
||
304 | 314 | </div>'; |
305 | 315 | |
306 | 316 | // Was anything even found? |
307 | - if (!empty($context['topics'])) |
|
308 | - echo ' |
|
317 | + if (!empty($context['topics'])) { |
|
318 | + echo ' |
|
309 | 319 | <div class="pagesection"> |
310 | 320 | <span>', $context['page_index'], '</span> |
311 | 321 | </div>'; |
312 | - |
|
313 | - else |
|
314 | - echo ' |
|
322 | + } else { |
|
323 | + echo ' |
|
315 | 324 | <div class="roundframe noup">', $txt['find_no_results'], '</div>'; |
325 | + } |
|
316 | 326 | |
317 | 327 | // While we have results to show ... |
318 | 328 | while ($topic = $context['get_topics']()) |
@@ -335,31 +345,35 @@ discard block |
||
335 | 345 | echo ' |
336 | 346 | <span class="floatright">'; |
337 | 347 | |
338 | - if ($options['display_quick_mod'] == 1) |
|
339 | - echo ' |
|
348 | + if ($options['display_quick_mod'] == 1) { |
|
349 | + echo ' |
|
340 | 350 | <input type="checkbox" name="topics[]" value="', $topic['id'], '">'; |
341 | - |
|
342 | - else |
|
351 | + } else |
|
343 | 352 | { |
344 | - if ($topic['quick_mod']['remove']) |
|
345 | - echo ' |
|
353 | + if ($topic['quick_mod']['remove']) { |
|
354 | + echo ' |
|
346 | 355 | <a href="', $scripturl, '?action=quickmod;board=' . $topic['board']['id'] . '.0;actions%5B', $topic['id'], '%5D=remove;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons delete" title="', $txt['remove_topic'], '"></span></a>'; |
356 | + } |
|
347 | 357 | |
348 | - if ($topic['quick_mod']['lock']) |
|
349 | - echo ' |
|
358 | + if ($topic['quick_mod']['lock']) { |
|
359 | + echo ' |
|
350 | 360 | <a href="', $scripturl, '?action=quickmod;board=' . $topic['board']['id'] . '.0;actions%5B', $topic['id'], '%5D=lock;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons lock" title="', $topic['is_locked'] ? $txt['set_unlock'] : $txt['set_lock'], '"></span></a>'; |
361 | + } |
|
351 | 362 | |
352 | - if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) |
|
353 | - echo ' |
|
363 | + if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) { |
|
364 | + echo ' |
|
354 | 365 | <br>'; |
366 | + } |
|
355 | 367 | |
356 | - if ($topic['quick_mod']['sticky']) |
|
357 | - echo ' |
|
368 | + if ($topic['quick_mod']['sticky']) { |
|
369 | + echo ' |
|
358 | 370 | <a href="', $scripturl, '?action=quickmod;board=' . $topic['board']['id'] . '.0;actions%5B', $topic['id'], '%5D=sticky;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons sticky" title="', $topic['is_sticky'] ? $txt['set_nonsticky'] : $txt['set_sticky'], '"></span></a>'; |
371 | + } |
|
359 | 372 | |
360 | - if ($topic['quick_mod']['move']) |
|
361 | - echo ' |
|
373 | + if ($topic['quick_mod']['move']) { |
|
374 | + echo ' |
|
362 | 375 | <a href="', $scripturl, '?action=movetopic;topic=', $topic['id'], '.0"><span class="generic_icons move" title="', $txt['move_topic'], '"></span></a>'; |
376 | + } |
|
363 | 377 | } |
364 | 378 | |
365 | 379 | echo ' |
@@ -369,20 +383,22 @@ discard block |
||
369 | 383 | echo ' |
370 | 384 | </div><!-- .block -->'; |
371 | 385 | |
372 | - if ($message['body_highlighted'] != '') |
|
373 | - echo ' |
|
386 | + if ($message['body_highlighted'] != '') { |
|
387 | + echo ' |
|
374 | 388 | <div class="list_posts double_height">', $message['body_highlighted'], '</div>'; |
389 | + } |
|
375 | 390 | } |
376 | 391 | |
377 | 392 | echo ' |
378 | 393 | </div><!-- $topic[css_class] -->'; |
379 | 394 | } |
380 | 395 | |
381 | - if (!empty($context['topics'])) |
|
382 | - echo ' |
|
396 | + if (!empty($context['topics'])) { |
|
397 | + echo ' |
|
383 | 398 | <div class="pagesection"> |
384 | 399 | <span>', $context['page_index'], '</span> |
385 | 400 | </div>'; |
401 | + } |
|
386 | 402 | |
387 | 403 | if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics'])) |
388 | 404 | { |
@@ -391,17 +407,19 @@ discard block |
||
391 | 407 | <select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.move_to.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '> |
392 | 408 | <option value="">--------</option>'; |
393 | 409 | |
394 | - foreach ($context['qmod_actions'] as $qmod_action) |
|
395 | - if ($context['can_' . $qmod_action]) |
|
410 | + foreach ($context['qmod_actions'] as $qmod_action) { |
|
411 | + if ($context['can_' . $qmod_action]) |
|
396 | 412 | echo ' |
397 | 413 | <option value="' . $qmod_action . '">' . $txt['quick_mod_' . $qmod_action] . '</option>'; |
414 | + } |
|
398 | 415 | |
399 | 416 | echo ' |
400 | 417 | </select>'; |
401 | 418 | |
402 | - if ($context['can_move']) |
|
403 | - echo ' |
|
419 | + if ($context['can_move']) { |
|
420 | + echo ' |
|
404 | 421 | <span id="quick_mod_jump_to"></span>'; |
422 | + } |
|
405 | 423 | |
406 | 424 | echo ' |
407 | 425 | <input type="hidden" name="redirect_url" value="', $scripturl . '?action=search2;params=' . $context['params'], '"> |
@@ -410,12 +428,12 @@ discard block |
||
410 | 428 | } |
411 | 429 | |
412 | 430 | |
413 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics'])) |
|
414 | - echo ' |
|
431 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics'])) { |
|
432 | + echo ' |
|
415 | 433 | <input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '"> |
416 | 434 | </form>'; |
417 | - } |
|
418 | - else |
|
435 | + } |
|
436 | + } else |
|
419 | 437 | { |
420 | 438 | echo ' |
421 | 439 | <div class="cat_bar"> |
@@ -427,9 +445,10 @@ discard block |
||
427 | 445 | <span>', $context['page_index'], '</span> |
428 | 446 | </div>'; |
429 | 447 | |
430 | - if (empty($context['topics'])) |
|
431 | - echo ' |
|
448 | + if (empty($context['topics'])) { |
|
449 | + echo ' |
|
432 | 450 | <div class="information">(', $txt['search_no_results'], ')</div>'; |
451 | + } |
|
433 | 452 | |
434 | 453 | while ($topic = $context['get_topics']()) |
435 | 454 | { |
@@ -464,8 +483,8 @@ discard block |
||
464 | 483 | <div class="smalltext righttext" id="search_jump_to"></div> |
465 | 484 | <script>'; |
466 | 485 | |
467 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) |
|
468 | - echo ' |
|
486 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) { |
|
487 | + echo ' |
|
469 | 488 | if (typeof(window.XMLHttpRequest) != "undefined") |
470 | 489 | aJumpTo[aJumpTo.length] = new JumpTo({ |
471 | 490 | sContainerId: "quick_mod_jump_to", |
@@ -480,6 +499,7 @@ discard block |
||
480 | 499 | bDisabled: true, |
481 | 500 | sCustomName: "move_to" |
482 | 501 | });'; |
502 | + } |
|
483 | 503 | |
484 | 504 | echo ' |
485 | 505 | if (typeof(window.XMLHttpRequest) != "undefined") |
@@ -38,8 +38,8 @@ discard block |
||
38 | 38 | } |
39 | 39 | </script>'; |
40 | 40 | |
41 | - if (!empty($context['poll_error']['messages'])) |
|
42 | - echo ' |
|
41 | + if (!empty($context['poll_error']['messages'])) { |
|
42 | + echo ' |
|
43 | 43 | <div class="errorbox"> |
44 | 44 | <dl class="poll_error"> |
45 | 45 | <dt> |
@@ -50,6 +50,7 @@ discard block |
||
50 | 50 | </dt> |
51 | 51 | </dl> |
52 | 52 | </div>'; |
53 | + } |
|
53 | 54 | |
54 | 55 | // Start the main poll form. |
55 | 56 | echo ' |
@@ -79,8 +80,9 @@ discard block |
||
79 | 80 | <input type="text" name="options[', $choice['id'], ']" id="options-', $choice['id'], '" value="', $choice['label'], '" size="80" maxlength="255">'; |
80 | 81 | |
81 | 82 | // Does this option have a vote count yet, or is it new? |
82 | - if ($choice['votes'] != -1) |
|
83 | - echo ' (', $choice['votes'], ' ', $txt['votes'], ')'; |
|
83 | + if ($choice['votes'] != -1) { |
|
84 | + echo ' (', $choice['votes'], ' ', $txt['votes'], ')'; |
|
85 | + } |
|
84 | 86 | |
85 | 87 | echo ' |
86 | 88 | </dd>'; |
@@ -118,14 +120,15 @@ discard block |
||
118 | 120 | <input type="checkbox" id="poll_change_vote" name="poll_change_vote"', !empty($context['poll']['change_vote']) ? ' checked' : '', '> |
119 | 121 | </dd>'; |
120 | 122 | |
121 | - if ($context['poll']['guest_vote_allowed']) |
|
122 | - echo ' |
|
123 | + if ($context['poll']['guest_vote_allowed']) { |
|
124 | + echo ' |
|
123 | 125 | <dt> |
124 | 126 | <label for="poll_guest_vote">', $txt['poll_guest_vote'], ':</label> |
125 | 127 | </dt> |
126 | 128 | <dd> |
127 | 129 | <input type="checkbox" id="poll_guest_vote" name="poll_guest_vote"', !empty($context['poll']['guest_vote']) ? ' checked' : '', '> |
128 | 130 | </dd>'; |
131 | + } |
|
129 | 132 | } |
130 | 133 | |
131 | 134 | echo ' |
@@ -141,12 +144,13 @@ discard block |
||
141 | 144 | </fieldset>'; |
142 | 145 | |
143 | 146 | // If this is an edit, we can allow them to reset the vote counts. |
144 | - if ($context['is_edit']) |
|
145 | - echo ' |
|
147 | + if ($context['is_edit']) { |
|
148 | + echo ' |
|
146 | 149 | <fieldset id="poll_reset"> |
147 | 150 | <legend>', $txt['reset_votes'], '</legend> |
148 | 151 | <input type="checkbox" name="resetVoteCount" value="on"> ' . $txt['reset_votes_check'] . ' |
149 | 152 | </fieldset>'; |
153 | + } |
|
150 | 154 | echo ' |
151 | 155 | <input type="submit" name="post" value="', $txt['save'], '" onclick="return submitThisOnce(this);" accesskey="s" class="button"> |
152 | 156 | </div><!-- .roundframe --> |
@@ -20,9 +20,10 @@ discard block |
||
20 | 20 | echo ' |
21 | 21 | <form action="', $scripturl, '?action=admin;area=paidsubscribe;sa=modify;sid=', $context['sub_id'], '" method="post">'; |
22 | 22 | |
23 | - if (!empty($context['disable_groups'])) |
|
24 | - echo ' |
|
23 | + if (!empty($context['disable_groups'])) { |
|
24 | + echo ' |
|
25 | 25 | <div class="noticebox">', $txt['paid_mod_edit_note'], '</div>'; |
26 | + } |
|
26 | 27 | |
27 | 28 | echo ' |
28 | 29 | <div class="cat_bar"> |
@@ -66,9 +67,10 @@ discard block |
||
66 | 67 | <option value="0"', $context['sub']['prim_group'] == 0 ? ' selected' : '', '>', $txt['paid_mod_no_group'], '</option>'; |
67 | 68 | |
68 | 69 | // Put each group into the box. |
69 | - foreach ($context['groups'] as $id => $name) |
|
70 | - echo ' |
|
70 | + foreach ($context['groups'] as $id => $name) { |
|
71 | + echo ' |
|
71 | 72 | <option value="', $id, '"', $context['sub']['prim_group'] == $id ? ' selected' : '', '>', $name, '</option>'; |
73 | + } |
|
72 | 74 | |
73 | 75 | echo ' |
74 | 76 | </select> |
@@ -80,12 +82,13 @@ discard block |
||
80 | 82 | <dd>'; |
81 | 83 | |
82 | 84 | // Put a checkbox in for each group |
83 | - foreach ($context['groups'] as $id => $name) |
|
84 | - echo ' |
|
85 | + foreach ($context['groups'] as $id => $name) { |
|
86 | + echo ' |
|
85 | 87 | <label for="addgroup_', $id, '"> |
86 | 88 | <input type="checkbox" id="addgroup_', $id, '" name="addgroup[', $id, ']"', in_array($id, $context['sub']['add_groups']) ? ' checked' : '', !empty($context['disable_groups']) ? ' disabled' : '', '> |
87 | 89 | <span class="smalltext">', $name, '</span> |
88 | 90 | </label><br>'; |
91 | + } |
|
89 | 92 | |
90 | 93 | echo ' |
91 | 94 | </dd> |
@@ -230,8 +233,8 @@ discard block |
||
230 | 233 | <dl class="settings">'; |
231 | 234 | |
232 | 235 | // Do we need a username? |
233 | - if ($context['action_type'] == 'add') |
|
234 | - echo ' |
|
236 | + if ($context['action_type'] == 'add') { |
|
237 | + echo ' |
|
235 | 238 | <dt> |
236 | 239 | <strong>', $txt['paid_username'], ':</strong><br> |
237 | 240 | <span class="smalltext">', $txt['one_username'], '</span> |
@@ -239,6 +242,7 @@ discard block |
||
239 | 242 | <dd> |
240 | 243 | <input type="text" name="name" id="name_control" value="', $context['sub']['username'], '" size="30"> |
241 | 244 | </dd>'; |
245 | + } |
|
242 | 246 | |
243 | 247 | echo ' |
244 | 248 | <dt> |
@@ -256,9 +260,10 @@ discard block |
||
256 | 260 | <select name="year" id="year" onchange="generateDays();">'; |
257 | 261 | |
258 | 262 | // Show a list of all the years we allow... |
259 | - for ($year = 2005; $year <= 2030; $year++) |
|
260 | - echo ' |
|
263 | + for ($year = 2005; $year <= 2030; $year++) { |
|
264 | + echo ' |
|
261 | 265 | <option value="', $year, '"', $year == $context['sub']['start']['year'] ? ' selected' : '', '>', $year, '</option>'; |
266 | + } |
|
262 | 267 | |
263 | 268 | echo ' |
264 | 269 | </select> |
@@ -266,9 +271,10 @@ discard block |
||
266 | 271 | <select name="month" id="month" onchange="generateDays();">'; |
267 | 272 | |
268 | 273 | // There are 12 months per year - ensure that they all get listed. |
269 | - for ($month = 1; $month <= 12; $month++) |
|
270 | - echo ' |
|
274 | + for ($month = 1; $month <= 12; $month++) { |
|
275 | + echo ' |
|
271 | 276 | <option value="', $month, '"', $month == $context['sub']['start']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>'; |
277 | + } |
|
272 | 278 | |
273 | 279 | echo ' |
274 | 280 | </select> |
@@ -276,9 +282,10 @@ discard block |
||
276 | 282 | <select name="day" id="day">'; |
277 | 283 | |
278 | 284 | // This prints out all the days in the current month - this changes dynamically as we switch months. |
279 | - for ($day = 1; $day <= $context['sub']['start']['last_day']; $day++) |
|
280 | - echo ' |
|
285 | + for ($day = 1; $day <= $context['sub']['start']['last_day']; $day++) { |
|
286 | + echo ' |
|
281 | 287 | <option value="', $day, '"', $day == $context['sub']['start']['day'] ? ' selected' : '', '>', $day, '</option>'; |
288 | + } |
|
282 | 289 | |
283 | 290 | echo ' |
284 | 291 | </select> |
@@ -290,9 +297,10 @@ discard block |
||
290 | 297 | <select name="yearend" id="yearend" onchange="generateDays(\'end\');">'; |
291 | 298 | |
292 | 299 | // Show a list of all the years we allow... |
293 | - for ($year = 2005; $year <= 2030; $year++) |
|
294 | - echo ' |
|
300 | + for ($year = 2005; $year <= 2030; $year++) { |
|
301 | + echo ' |
|
295 | 302 | <option value="', $year, '"', $year == $context['sub']['end']['year'] ? ' selected' : '', '>', $year, '</option>'; |
303 | + } |
|
296 | 304 | |
297 | 305 | echo ' |
298 | 306 | </select> |
@@ -300,9 +308,10 @@ discard block |
||
300 | 308 | <select name="monthend" id="monthend" onchange="generateDays(\'end\');">'; |
301 | 309 | |
302 | 310 | // There are 12 months per year - ensure that they all get listed. |
303 | - for ($month = 1; $month <= 12; $month++) |
|
304 | - echo ' |
|
311 | + for ($month = 1; $month <= 12; $month++) { |
|
312 | + echo ' |
|
305 | 313 | <option value="', $month, '"', $month == $context['sub']['end']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>'; |
314 | + } |
|
306 | 315 | |
307 | 316 | echo ' |
308 | 317 | </select> |
@@ -310,9 +319,10 @@ discard block |
||
310 | 319 | <select name="dayend" id="dayend">'; |
311 | 320 | |
312 | 321 | // This prints out all the days in the current month - this changes dynamically as we switch months. |
313 | - for ($day = 1; $day <= $context['sub']['end']['last_day']; $day++) |
|
314 | - echo ' |
|
322 | + for ($day = 1; $day <= $context['sub']['end']['last_day']; $day++) { |
|
323 | + echo ' |
|
315 | 324 | <option value="', $day, '"', $day == $context['sub']['end']['day'] ? ' selected' : '', '>', $day, '</option>'; |
325 | + } |
|
316 | 326 | |
317 | 327 | echo ' |
318 | 328 | </select> |
@@ -351,8 +361,8 @@ discard block |
||
351 | 361 | <div class="windowbg"> |
352 | 362 | <ul>'; |
353 | 363 | |
354 | - foreach ($context['pending_payments'] as $id => $payment) |
|
355 | - echo ' |
|
364 | + foreach ($context['pending_payments'] as $id => $payment) { |
|
365 | + echo ' |
|
356 | 366 | <li> |
357 | 367 | ', $payment['desc'], ' |
358 | 368 | <span class="floatleft"> |
@@ -362,6 +372,7 @@ discard block |
||
362 | 372 | <a href="', $scripturl, '?action=admin;area=paidsubscribe;sa=modifyuser;lid=', $context['log_id'], ';pending=', $id, ';remove">', $txt['pending_payments_remove'], '</a> |
363 | 373 | </span> |
364 | 374 | </li>'; |
375 | + } |
|
365 | 376 | |
366 | 377 | echo ' |
367 | 378 | </ul>'; |
@@ -385,12 +396,12 @@ discard block |
||
385 | 396 | <h3 class="catbg">', $txt['subscriptions'], '</h3> |
386 | 397 | </div>'; |
387 | 398 | |
388 | - if (empty($context['subscriptions'])) |
|
389 | - echo ' |
|
399 | + if (empty($context['subscriptions'])) { |
|
400 | + echo ' |
|
390 | 401 | <div class="information"> |
391 | 402 | ', $txt['paid_subs_none'], ' |
392 | 403 | </div>'; |
393 | - else |
|
404 | + } else |
|
394 | 405 | { |
395 | 406 | echo ' |
396 | 407 | <div class="information"> |
@@ -401,8 +412,9 @@ discard block |
||
401 | 412 | foreach ($context['subscriptions'] as $id => $subscription) |
402 | 413 | { |
403 | 414 | // Ignore the inactive ones... |
404 | - if (empty($subscription['active'])) |
|
405 | - continue; |
|
415 | + if (empty($subscription['active'])) { |
|
416 | + continue; |
|
417 | + } |
|
406 | 418 | |
407 | 419 | echo ' |
408 | 420 | <div class="cat_bar"> |
@@ -412,9 +424,10 @@ discard block |
||
412 | 424 | <p><strong>', $subscription['name'], '</strong></p> |
413 | 425 | <p class="smalltext">', $subscription['desc'], '</p>'; |
414 | 426 | |
415 | - if (!$subscription['flexible']) |
|
416 | - echo ' |
|
427 | + if (!$subscription['flexible']) { |
|
428 | + echo ' |
|
417 | 429 | <div><strong>', $txt['paid_duration'], ':</strong> ', $subscription['length'], '</div>'; |
430 | + } |
|
418 | 431 | |
419 | 432 | if ($context['user']['is_owner']) |
420 | 433 | { |
@@ -427,24 +440,25 @@ discard block |
||
427 | 440 | <select name="cur[', $subscription['id'], ']">'; |
428 | 441 | |
429 | 442 | // Print out the costs for this one. |
430 | - foreach ($subscription['costs'] as $duration => $value) |
|
431 | - echo ' |
|
443 | + foreach ($subscription['costs'] as $duration => $value) { |
|
444 | + echo ' |
|
432 | 445 | <option value="', $duration, '">', sprintf($modSettings['paid_currency_symbol'], $value), '/', $txt[$duration], '</option>'; |
446 | + } |
|
433 | 447 | |
434 | 448 | echo ' |
435 | 449 | </select>'; |
436 | - } |
|
437 | - else |
|
438 | - echo ' |
|
450 | + } else { |
|
451 | + echo ' |
|
439 | 452 | ', sprintf($modSettings['paid_currency_symbol'], $subscription['costs']['fixed']); |
453 | + } |
|
440 | 454 | |
441 | 455 | echo ' |
442 | 456 | <hr> |
443 | 457 | <input type="submit" name="sub_id[', $subscription['id'], ']" value="', $txt['paid_order'], '" class="button">'; |
444 | - } |
|
445 | - else |
|
446 | - echo ' |
|
458 | + } else { |
|
459 | + echo ' |
|
447 | 460 | <a href="', $scripturl, '?action=admin;area=paidsubscribe;sa=modifyuser;sid=', $subscription['id'], ';uid=', $context['member']['id'], (empty($context['current'][$subscription['id']]) ? '' : ';lid=' . $context['current'][$subscription['id']]['id']), '">', empty($context['current'][$subscription['id']]) ? $txt['paid_admin_add'] : $txt['paid_edit_subscription'], '</a>'; |
461 | + } |
|
448 | 462 | |
449 | 463 | echo ' |
450 | 464 | </div><!-- .windowbg -->'; |
@@ -471,18 +485,19 @@ discard block |
||
471 | 485 | </thead> |
472 | 486 | <tbody>'; |
473 | 487 | |
474 | - if (empty($context['current'])) |
|
475 | - echo ' |
|
488 | + if (empty($context['current'])) { |
|
489 | + echo ' |
|
476 | 490 | <tr class="windowbg"> |
477 | 491 | <td colspan="4"> |
478 | 492 | ', $txt['paid_none_yet'], ' |
479 | 493 | </td> |
480 | 494 | </tr>'; |
495 | + } |
|
481 | 496 | |
482 | 497 | foreach ($context['current'] as $sub) |
483 | 498 | { |
484 | - if (!$sub['hide']) |
|
485 | - echo ' |
|
499 | + if (!$sub['hide']) { |
|
500 | + echo ' |
|
486 | 501 | <tr class="windowbg"> |
487 | 502 | <td> |
488 | 503 | ', ($context['user']['is_admin'] ? '<a href="' . $scripturl . '?action=admin;area=paidsubscribe;sa=modifyuser;lid=' . $sub['id'] . '">' . $sub['name'] . '</a>' : $sub['name']), ' |
@@ -493,6 +508,7 @@ discard block |
||
493 | 508 | <td>', $sub['start'], '</td> |
494 | 509 | <td>', $sub['end'], '</td> |
495 | 510 | </tr>'; |
511 | + } |
|
496 | 512 | } |
497 | 513 | |
498 | 514 | echo ' |
@@ -544,15 +560,17 @@ discard block |
||
544 | 560 | ', $gateway['desc'], '<br> |
545 | 561 | <form action="', $gateway['form'], '" method="post">'; |
546 | 562 | |
547 | - if (!empty($gateway['javascript'])) |
|
548 | - echo ' |
|
563 | + if (!empty($gateway['javascript'])) { |
|
564 | + echo ' |
|
549 | 565 | <script> |
550 | 566 | ', $gateway['javascript'], ' |
551 | 567 | </script>'; |
568 | + } |
|
552 | 569 | |
553 | - foreach ($gateway['hidden'] as $name => $value) |
|
554 | - echo ' |
|
570 | + foreach ($gateway['hidden'] as $name => $value) { |
|
571 | + echo ' |
|
555 | 572 | <input type="hidden" id="', $gateway['id'], '_', $name, '" name="', $name, '" value="', $value, '">'; |
573 | + } |
|
556 | 574 | |
557 | 575 | echo ' |
558 | 576 | <br> |
@@ -19,26 +19,28 @@ discard block |
||
19 | 19 | global $context, $settings, $scripturl, $txt, $modSettings; |
20 | 20 | |
21 | 21 | // Not allowed to edit? |
22 | - if (!$context['can_modify']) |
|
23 | - echo ' |
|
22 | + if (!$context['can_modify']) { |
|
23 | + echo ' |
|
24 | 24 | <div class="errorbox"> |
25 | 25 | ', sprintf($txt['permission_cannot_edit'], $scripturl . '?action=admin;area=permissions;sa=profiles'), ' |
26 | 26 | </div>'; |
27 | + } |
|
27 | 28 | |
28 | 29 | echo ' |
29 | 30 | <div id="admin_form_wrapper"> |
30 | 31 | <form action="', $scripturl, '?action=admin;area=permissions;sa=quick" method="post" accept-charset="', $context['character_set'], '" name="permissionForm" id="permissionForm">'; |
31 | 32 | |
32 | - if (!empty($context['profile'])) |
|
33 | - echo ' |
|
33 | + if (!empty($context['profile'])) { |
|
34 | + echo ' |
|
34 | 35 | <div class="cat_bar"> |
35 | 36 | <h3 class="catbg">', $txt['permissions_for_profile'], ': "', $context['profile']['name'], '"</h3> |
36 | 37 | </div>'; |
37 | - else |
|
38 | - echo ' |
|
38 | + } else { |
|
39 | + echo ' |
|
39 | 40 | <div class="cat_bar"> |
40 | 41 | <h3 class="catbg">', $txt['permissions_title'], '</h3> |
41 | 42 | </div>'; |
43 | + } |
|
42 | 44 | |
43 | 45 | echo ' |
44 | 46 | <table class="table_grid"> |
@@ -47,13 +49,14 @@ discard block |
||
47 | 49 | <th>', $txt['membergroups_name'], '</th> |
48 | 50 | <th class="small_table">', $txt['membergroups_members_top'], '</th>'; |
49 | 51 | |
50 | - if (empty($modSettings['permission_enable_deny'])) |
|
51 | - echo ' |
|
52 | + if (empty($modSettings['permission_enable_deny'])) { |
|
53 | + echo ' |
|
52 | 54 | <th class="small_table">', $txt['membergroups_permissions'], '</th>'; |
53 | - else |
|
54 | - echo ' |
|
55 | + } else { |
|
56 | + echo ' |
|
55 | 57 | <th class="small_table">', $txt['permissions_allowed'], '</th> |
56 | 58 | <th class="small_table">', $txt['permissions_denied'], '</th>'; |
59 | + } |
|
57 | 60 | |
58 | 61 | echo ' |
59 | 62 | <th class="small_table">', $context['can_modify'] ? $txt['permissions_modify'] : $txt['permissions_view'], '</th> |
@@ -71,26 +74,28 @@ discard block |
||
71 | 74 | <td> |
72 | 75 | ', !empty($group['help']) ? ' <a class="help" href="' . $scripturl . '?action=helpadmin;help=' . $group['help'] . '" onclick="return reqOverlayDiv(this.href);"><span class="generic_icons help" title="' . $txt['help'] . '"></span></a> ' : '<img class="icon" src="' . $settings['images_url'] . '/blank.png" alt="' . $txt['help'] . '">', '<span>', $group['name'], '</span>'; |
73 | 76 | |
74 | - if (!empty($group['children'])) |
|
75 | - echo ' |
|
77 | + if (!empty($group['children'])) { |
|
78 | + echo ' |
|
76 | 79 | <br> |
77 | 80 | <span class="smalltext">', $txt['permissions_includes_inherited'], ': "', implode('", "', $group['children']), '"</span>'; |
81 | + } |
|
78 | 82 | |
79 | 83 | echo ' |
80 | 84 | </td> |
81 | 85 | <td>', $group['can_search'] ? $group['link'] : $group['num_members'], '</td>'; |
82 | 86 | |
83 | - if (empty($modSettings['permission_enable_deny'])) |
|
84 | - echo ' |
|
87 | + if (empty($modSettings['permission_enable_deny'])) { |
|
88 | + echo ' |
|
85 | 89 | <td>', $group['num_permissions']['allowed'], '</td>'; |
86 | - else |
|
87 | - echo ' |
|
90 | + } else { |
|
91 | + echo ' |
|
88 | 92 | <td ', $group['id'] == 1 ? ' style="font-style: italic;"' : '', '> |
89 | 93 | ', $group['num_permissions']['allowed'], ' |
90 | 94 | </td> |
91 | 95 | <td ', $group['id'] == 1 || $group['id'] == -1 ? ' style="font-style: italic;"' : (!empty($group['num_permissions']['denied']) ? ' class="red"' : ''), '> |
92 | 96 | ', $group['num_permissions']['denied'], ' |
93 | 97 | </td>'; |
98 | + } |
|
94 | 99 | |
95 | 100 | echo ' |
96 | 101 | <td> |
@@ -141,10 +146,11 @@ discard block |
||
141 | 146 | <select name="copy_from"> |
142 | 147 | <option value="empty">(', $txt['permissions_select_membergroup'], ')</option>'; |
143 | 148 | |
144 | - foreach ($context['groups'] as $group) |
|
145 | - if ($group['id'] != 1) |
|
149 | + foreach ($context['groups'] as $group) { |
|
150 | + if ($group['id'] != 1) |
|
146 | 151 | echo ' |
147 | 152 | <option value="', $group['id'], '">', $group['name'], '</option>'; |
153 | + } |
|
148 | 154 | |
149 | 155 | echo ' |
150 | 156 | </select> |
@@ -154,9 +160,10 @@ discard block |
||
154 | 160 | <option value="add">', $txt['permissions_add'], '...</option> |
155 | 161 | <option value="clear">', $txt['permissions_remove'], '...</option>'; |
156 | 162 | |
157 | - if (!empty($modSettings['permission_enable_deny'])) |
|
158 | - echo ' |
|
163 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
164 | + echo ' |
|
159 | 165 | <option value="deny">', $txt['permissions_deny'], '...</option>'; |
166 | + } |
|
160 | 167 | |
161 | 168 | echo ' |
162 | 169 | </select> |
@@ -167,31 +174,35 @@ discard block |
||
167 | 174 | |
168 | 175 | foreach ($context['permissions'] as $permissionType) |
169 | 176 | { |
170 | - if ($permissionType['id'] == 'membergroup' && !empty($context['profile'])) |
|
171 | - continue; |
|
177 | + if ($permissionType['id'] == 'membergroup' && !empty($context['profile'])) { |
|
178 | + continue; |
|
179 | + } |
|
172 | 180 | |
173 | 181 | foreach ($permissionType['columns'] as $column) |
174 | 182 | { |
175 | 183 | foreach ($column as $permissionGroup) |
176 | 184 | { |
177 | - if ($permissionGroup['hidden']) |
|
178 | - continue; |
|
185 | + if ($permissionGroup['hidden']) { |
|
186 | + continue; |
|
187 | + } |
|
179 | 188 | |
180 | 189 | echo ' |
181 | 190 | <option value="" disabled>[', $permissionGroup['name'], ']</option>'; |
182 | 191 | |
183 | 192 | foreach ($permissionGroup['permissions'] as $perm) |
184 | 193 | { |
185 | - if ($perm['hidden']) |
|
186 | - continue; |
|
194 | + if ($perm['hidden']) { |
|
195 | + continue; |
|
196 | + } |
|
187 | 197 | |
188 | - if ($perm['has_own_any']) |
|
189 | - echo ' |
|
198 | + if ($perm['has_own_any']) { |
|
199 | + echo ' |
|
190 | 200 | <option value="', $permissionType['id'], '/', $perm['own']['id'], '"> ', $perm['name'], ' (', $perm['own']['name'], ')</option> |
191 | 201 | <option value="', $permissionType['id'], '/', $perm['any']['id'], '"> ', $perm['name'], ' (', $perm['any']['name'], ')</option>'; |
192 | - else |
|
193 | - echo ' |
|
202 | + } else { |
|
203 | + echo ' |
|
194 | 204 | <option value="', $permissionType['id'], '/', $perm['id'], '"> ', $perm['name'], '</option>'; |
205 | + } |
|
195 | 206 | } |
196 | 207 | } |
197 | 208 | } |
@@ -256,9 +267,10 @@ discard block |
||
256 | 267 | } |
257 | 268 | </script>'; |
258 | 269 | |
259 | - if (!empty($context['profile'])) |
|
260 | - echo ' |
|
270 | + if (!empty($context['profile'])) { |
|
271 | + echo ' |
|
261 | 272 | <input type="hidden" name="pid" value="', $context['profile']['id'], '">'; |
273 | + } |
|
262 | 274 | |
263 | 275 | echo ' |
264 | 276 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -302,9 +314,10 @@ discard block |
||
302 | 314 | <h3 class="subbg">', $category['name'], '</h3> |
303 | 315 | </div>'; |
304 | 316 | |
305 | - if (!empty($category['boards'])) |
|
306 | - echo ' |
|
317 | + if (!empty($category['boards'])) { |
|
318 | + echo ' |
|
307 | 319 | <ul class="perm_boards flow_hidden">'; |
320 | + } |
|
308 | 321 | |
309 | 322 | foreach ($category['boards'] as $board) |
310 | 323 | { |
@@ -320,33 +333,36 @@ discard block |
||
320 | 333 | echo ' |
321 | 334 | <select name="boardprofile[', $board['id'], ']">'; |
322 | 335 | |
323 | - foreach ($context['profiles'] as $id => $profile) |
|
324 | - echo ' |
|
336 | + foreach ($context['profiles'] as $id => $profile) { |
|
337 | + echo ' |
|
325 | 338 | <option value="', $id, '"', $id == $board['profile'] ? ' selected' : '', '>', $profile['name'], '</option>'; |
339 | + } |
|
326 | 340 | |
327 | 341 | echo ' |
328 | 342 | </select>'; |
329 | - } |
|
330 | - else |
|
331 | - echo ' |
|
343 | + } else { |
|
344 | + echo ' |
|
332 | 345 | <a href="', $scripturl, '?action=admin;area=permissions;sa=index;pid=', $board['profile'], ';', $context['session_var'], '=', $context['session_id'], '">', $board['profile_name'], '</a>'; |
346 | + } |
|
333 | 347 | |
334 | 348 | echo ' |
335 | 349 | </span> |
336 | 350 | </li>'; |
337 | 351 | } |
338 | 352 | |
339 | - if (!empty($category['boards'])) |
|
340 | - echo ' |
|
353 | + if (!empty($category['boards'])) { |
|
354 | + echo ' |
|
341 | 355 | </ul>'; |
356 | + } |
|
342 | 357 | } |
343 | 358 | |
344 | - if ($context['edit_all']) |
|
345 | - echo ' |
|
359 | + if ($context['edit_all']) { |
|
360 | + echo ' |
|
346 | 361 | <input type="submit" name="save_changes" value="', $txt['save'], '" class="button">'; |
347 | - else |
|
348 | - echo ' |
|
362 | + } else { |
|
363 | + echo ' |
|
349 | 364 | <a class="button" href="', $scripturl, '?action=admin;area=permissions;sa=board;edit;', $context['session_var'], '=', $context['session_id'], '">', $txt['permissions_board_all'], '</a>'; |
365 | + } |
|
350 | 366 | |
351 | 367 | echo ' |
352 | 368 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -385,12 +401,13 @@ discard block |
||
385 | 401 | <tr class="windowbg"> |
386 | 402 | <td>'; |
387 | 403 | |
388 | - if (!empty($context['show_rename_boxes']) && $profile['can_edit']) |
|
389 | - echo ' |
|
404 | + if (!empty($context['show_rename_boxes']) && $profile['can_edit']) { |
|
405 | + echo ' |
|
390 | 406 | <input type="text" name="rename_profile[', $profile['id'], ']" value="', $profile['name'], '">'; |
391 | - else |
|
392 | - echo ' |
|
407 | + } else { |
|
408 | + echo ' |
|
393 | 409 | <a href="', $scripturl, '?action=admin;area=permissions;sa=index;pid=', $profile['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $profile['name'], '</a>'; |
410 | + } |
|
394 | 411 | |
395 | 412 | echo ' |
396 | 413 | </td> |
@@ -410,9 +427,10 @@ discard block |
||
410 | 427 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
411 | 428 | <input type="hidden" name="', $context['admin-mpp_token_var'], '" value="', $context['admin-mpp_token'], '">'; |
412 | 429 | |
413 | - if ($context['can_edit_something']) |
|
414 | - echo ' |
|
430 | + if ($context['can_edit_something']) { |
|
431 | + echo ' |
|
415 | 432 | <input type="submit" name="rename" value="', empty($context['show_rename_boxes']) ? $txt['permissions_profile_rename'] : $txt['permissions_commit'], '" class="button">'; |
433 | + } |
|
416 | 434 | |
417 | 435 | echo ' |
418 | 436 | <input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" class="button" ', !empty($context['show_rename_boxes']) ? ' style="display:none"' : '', '> |
@@ -437,9 +455,10 @@ discard block |
||
437 | 455 | <dd> |
438 | 456 | <select name="copy_from">'; |
439 | 457 | |
440 | - foreach ($context['profiles'] as $id => $profile) |
|
441 | - echo ' |
|
458 | + foreach ($context['profiles'] as $id => $profile) { |
|
459 | + echo ' |
|
442 | 460 | <option value="', $id, '">', $profile['name'], '</option>'; |
461 | + } |
|
443 | 462 | |
444 | 463 | echo ' |
445 | 464 | </select> |
@@ -461,13 +480,13 @@ discard block |
||
461 | 480 | global $context, $scripturl, $txt, $modSettings; |
462 | 481 | |
463 | 482 | // Cannot be edited? |
464 | - if (!$context['profile']['can_modify']) |
|
465 | - echo ' |
|
483 | + if (!$context['profile']['can_modify']) { |
|
484 | + echo ' |
|
466 | 485 | <div class="errorbox"> |
467 | 486 | ', sprintf($txt['permission_cannot_edit'], $scripturl . '?action=admin;area=permissions;sa=profiles'), ' |
468 | 487 | </div>'; |
469 | - else |
|
470 | - echo ' |
|
488 | + } else { |
|
489 | + echo ' |
|
471 | 490 | <script> |
472 | 491 | window.smf_usedDeny = false; |
473 | 492 | |
@@ -479,26 +498,29 @@ discard block |
||
479 | 498 | return true; |
480 | 499 | } |
481 | 500 | </script>'; |
501 | + } |
|
482 | 502 | |
483 | 503 | echo ' |
484 | 504 | <form id="permissions" action="', $scripturl, '?action=admin;area=permissions;sa=modify2;group=', $context['group']['id'], ';pid=', $context['profile']['id'], '" method="post" accept-charset="', $context['character_set'], '" name="permissionForm" onsubmit="return warnAboutDeny();">'; |
485 | 505 | |
486 | - if (!empty($modSettings['permission_enable_deny']) && $context['group']['id'] != -1) |
|
487 | - echo ' |
|
506 | + if (!empty($modSettings['permission_enable_deny']) && $context['group']['id'] != -1) { |
|
507 | + echo ' |
|
488 | 508 | <div class="information"> |
489 | 509 | ', $txt['permissions_option_desc'], ' |
490 | 510 | </div>'; |
511 | + } |
|
491 | 512 | |
492 | 513 | echo ' |
493 | 514 | <div class="cat_bar"> |
494 | 515 | <h3 class="catbg">'; |
495 | 516 | |
496 | - if ($context['permission_type'] == 'board') |
|
497 | - echo ' |
|
517 | + if ($context['permission_type'] == 'board') { |
|
518 | + echo ' |
|
498 | 519 | ', $txt['permissions_local_for'], ' "', $context['group']['name'], '" ', $txt['permissions_on'], ' "', $context['profile']['name'], '"'; |
499 | - else |
|
500 | - echo ' |
|
520 | + } else { |
|
521 | + echo ' |
|
501 | 522 | ', $context['permission_type'] == 'membergroup' ? $txt['permissions_general'] : $txt['permissions_board'], ' - "', $context['group']['name'], '"'; |
523 | + } |
|
502 | 524 | echo ' |
503 | 525 | </h3> |
504 | 526 | </div>'; |
@@ -521,15 +543,17 @@ discard block |
||
521 | 543 | template_modify_group_display('board'); |
522 | 544 | } |
523 | 545 | |
524 | - if ($context['profile']['can_modify']) |
|
525 | - echo ' |
|
546 | + if ($context['profile']['can_modify']) { |
|
547 | + echo ' |
|
526 | 548 | <div class="padding"> |
527 | 549 | <input type="submit" value="', $txt['permissions_commit'], '" class="button"> |
528 | 550 | </div>'; |
551 | + } |
|
529 | 552 | |
530 | - foreach ($context['hidden_perms'] as $hidden_perm) |
|
531 | - echo ' |
|
553 | + foreach ($context['hidden_perms'] as $hidden_perm) { |
|
554 | + echo ' |
|
532 | 555 | <input type="hidden" name="perm[', $hidden_perm[0], '][', $hidden_perm[1], ']" value="', $hidden_perm[2], '">'; |
556 | + } |
|
533 | 557 | |
534 | 558 | echo ' |
535 | 559 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -556,17 +580,19 @@ discard block |
||
556 | 580 | |
557 | 581 | foreach ($column as $permissionGroup) |
558 | 582 | { |
559 | - if (empty($permissionGroup['permissions'])) |
|
560 | - continue; |
|
583 | + if (empty($permissionGroup['permissions'])) { |
|
584 | + continue; |
|
585 | + } |
|
561 | 586 | |
562 | 587 | // Are we likely to have something in this group to display or is it all hidden? |
563 | 588 | $has_display_content = false; |
564 | 589 | if (!$permissionGroup['hidden']) |
565 | 590 | { |
566 | 591 | // Before we go any further check we are going to have some data to print otherwise we just have a silly heading. |
567 | - foreach ($permissionGroup['permissions'] as $permission) |
|
568 | - if (!$permission['hidden']) |
|
592 | + foreach ($permissionGroup['permissions'] as $permission) { |
|
593 | + if (!$permission['hidden']) |
|
569 | 594 | $has_display_content = true; |
595 | + } |
|
570 | 596 | |
571 | 597 | if ($has_display_content) |
572 | 598 | { |
@@ -575,10 +601,11 @@ discard block |
||
575 | 601 | <th></th> |
576 | 602 | <th', $context['group']['id'] == -1 ? ' colspan="2"' : '', ' class="smalltext">', $permissionGroup['name'], '</th>'; |
577 | 603 | |
578 | - if ($context['group']['id'] != -1) |
|
579 | - echo ' |
|
604 | + if ($context['group']['id'] != -1) { |
|
605 | + echo ' |
|
580 | 606 | <th>', $txt['permissions_option_own'], '</th> |
581 | 607 | <th>', $txt['permissions_option_any'], '</th>'; |
608 | + } |
|
582 | 609 | |
583 | 610 | echo ' |
584 | 611 | </tr>'; |
@@ -601,17 +628,18 @@ discard block |
||
601 | 628 | // Guests can't do their own thing. |
602 | 629 | if ($context['group']['id'] != -1) |
603 | 630 | { |
604 | - if (empty($modSettings['permission_enable_deny'])) |
|
605 | - echo ' |
|
631 | + if (empty($modSettings['permission_enable_deny'])) { |
|
632 | + echo ' |
|
606 | 633 | <input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['own']['id'], ']"', $permission['own']['select'] == 'on' ? ' checked="checked"' : '', ' value="on" id="', $permission['own']['id'], '_on" ', $disable_field, '>'; |
607 | - else |
|
634 | + } else |
|
608 | 635 | { |
609 | 636 | echo ' |
610 | 637 | <select name="perm[', $permission_type['id'], '][', $permission['own']['id'], ']" ', $disable_field, '>'; |
611 | 638 | |
612 | - foreach (array('on', 'off', 'deny') as $c) |
|
613 | - echo ' |
|
639 | + foreach (array('on', 'off', 'deny') as $c) { |
|
640 | + echo ' |
|
614 | 641 | <option ', $permission['own']['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>'; |
642 | + } |
|
615 | 643 | echo ' |
616 | 644 | </select>'; |
617 | 645 | } |
@@ -621,39 +649,41 @@ discard block |
||
621 | 649 | <td>'; |
622 | 650 | } |
623 | 651 | |
624 | - if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) |
|
625 | - echo ' |
|
652 | + if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) { |
|
653 | + echo ' |
|
626 | 654 | <input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['any']['id'], ']"', $permission['any']['select'] == 'on' ? ' checked="checked"' : '', ' value="on" ', $disable_field, '>'; |
627 | - else |
|
655 | + } else |
|
628 | 656 | { |
629 | 657 | echo ' |
630 | 658 | <select name="perm[', $permission_type['id'], '][', $permission['any']['id'], ']" ', $disable_field, '>'; |
631 | 659 | |
632 | - foreach (array('on', 'off', 'deny') as $c) |
|
633 | - echo ' |
|
660 | + foreach (array('on', 'off', 'deny') as $c) { |
|
661 | + echo ' |
|
634 | 662 | <option ', $permission['any']['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>'; |
663 | + } |
|
635 | 664 | echo ' |
636 | 665 | </select>'; |
637 | 666 | } |
638 | - } |
|
639 | - else |
|
667 | + } else |
|
640 | 668 | { |
641 | - if ($context['group']['id'] != -1) |
|
642 | - echo ' |
|
669 | + if ($context['group']['id'] != -1) { |
|
670 | + echo ' |
|
643 | 671 | </td> |
644 | 672 | <td>'; |
673 | + } |
|
645 | 674 | |
646 | - if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) |
|
647 | - echo ' |
|
675 | + if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) { |
|
676 | + echo ' |
|
648 | 677 | <input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['id'], ']"', $permission['select'] == 'on' ? ' checked="checked"' : '', ' value="on" ', $disable_field, '>'; |
649 | - else |
|
678 | + } else |
|
650 | 679 | { |
651 | 680 | echo ' |
652 | 681 | <select name="perm[', $permission_type['id'], '][', $permission['id'], ']" ', $disable_field, '>'; |
653 | 682 | |
654 | - foreach (array('on', 'off', 'deny') as $c) |
|
655 | - echo ' |
|
683 | + foreach (array('on', 'off', 'deny') as $c) { |
|
684 | + echo ' |
|
656 | 685 | <option ', $permission['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>'; |
686 | + } |
|
657 | 687 | echo ' |
658 | 688 | </select>'; |
659 | 689 | } |
@@ -685,11 +715,11 @@ discard block |
||
685 | 715 | <fieldset id="', $context['current_permission'], '"> |
686 | 716 | <legend><a href="javascript:void(0);" onclick="document.getElementById(\'', $context['current_permission'], '\').style.display = \'none\';document.getElementById(\'', $context['current_permission'], '_groups_link\').style.display = \'block\'; return false;" class="toggle_up"> ', $txt['avatar_select_permission'], '</a></legend>'; |
687 | 717 | |
688 | - if (empty($modSettings['permission_enable_deny'])) |
|
689 | - echo ' |
|
718 | + if (empty($modSettings['permission_enable_deny'])) { |
|
719 | + echo ' |
|
690 | 720 | <ul>'; |
691 | - else |
|
692 | - echo ' |
|
721 | + } else { |
|
722 | + echo ' |
|
693 | 723 | <div class="information">', $txt['permissions_option_desc'], '</div> |
694 | 724 | <dl class="settings"> |
695 | 725 | <dt> |
@@ -699,47 +729,52 @@ discard block |
||
699 | 729 | </dt> |
700 | 730 | <dd> |
701 | 731 | </dd>'; |
732 | + } |
|
702 | 733 | |
703 | 734 | foreach ($context['member_groups'] as $group) |
704 | 735 | { |
705 | - if (!empty($modSettings['permission_enable_deny'])) |
|
706 | - echo ' |
|
736 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
737 | + echo ' |
|
707 | 738 | <dt>'; |
708 | - else |
|
709 | - echo ' |
|
739 | + } else { |
|
740 | + echo ' |
|
710 | 741 | <li>'; |
742 | + } |
|
711 | 743 | |
712 | - if (empty($modSettings['permission_enable_deny'])) |
|
713 | - echo ' |
|
744 | + if (empty($modSettings['permission_enable_deny'])) { |
|
745 | + echo ' |
|
714 | 746 | <input type="checkbox" name="', $context['current_permission'], '[', $group['id'], ']" value="on"', $group['status'] == 'on' ? ' checked' : '', '>'; |
715 | - else |
|
716 | - echo ' |
|
747 | + } else { |
|
748 | + echo ' |
|
717 | 749 | <span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="on"', $group['status'] == 'on' ? ' checked' : '', '></span> |
718 | 750 | <span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="off"', $group['status'] == 'off' ? ' checked' : '', '></span> |
719 | 751 | <span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="deny"', $group['status'] == 'deny' ? ' checked' : '', '></span>'; |
752 | + } |
|
720 | 753 | |
721 | - if (!empty($modSettings['permission_enable_deny'])) |
|
722 | - echo ' |
|
754 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
755 | + echo ' |
|
723 | 756 | </dt> |
724 | 757 | <dd> |
725 | 758 | <span', $group['is_postgroup'] ? ' style="font-style: italic;"' : '', '>', $group['name'], '</span> |
726 | 759 | </dd>'; |
727 | - else |
|
728 | - echo ' |
|
760 | + } else { |
|
761 | + echo ' |
|
729 | 762 | <span', $group['is_postgroup'] ? ' style="font-style: italic;"' : '', '>', $group['name'], '</span> |
730 | 763 | </li>'; |
764 | + } |
|
731 | 765 | } |
732 | 766 | |
733 | - if (empty($modSettings['permission_enable_deny'])) |
|
734 | - echo ' |
|
767 | + if (empty($modSettings['permission_enable_deny'])) { |
|
768 | + echo ' |
|
735 | 769 | <li> |
736 | 770 | <input type="checkbox" onclick="invertAll(this, this.form, \''. $context['current_permission'] . '[\');"> |
737 | 771 | <span>', $txt['check_all'], '</span> |
738 | 772 | </li> |
739 | 773 | </ul>'; |
740 | - else |
|
741 | - echo ' |
|
774 | + } else { |
|
775 | + echo ' |
|
742 | 776 | </dl>'; |
777 | + } |
|
743 | 778 | |
744 | 779 | echo ' |
745 | 780 | </fieldset> |
@@ -779,9 +814,10 @@ discard block |
||
779 | 814 | if (!empty($modSettings['postmod_active'])) |
780 | 815 | { |
781 | 816 | // Got advanced permissions - if so warn! |
782 | - if (!empty($modSettings['permission_enable_deny'])) |
|
783 | - echo ' |
|
817 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
818 | + echo ' |
|
784 | 819 | <div class="information">', $txt['permissions_post_moderation_deny_note'], '</div>'; |
820 | + } |
|
785 | 821 | |
786 | 822 | echo ' |
787 | 823 | <div class="padding"> |
@@ -796,10 +832,11 @@ discard block |
||
796 | 832 | ', $txt['permissions_post_moderation_select'], ': |
797 | 833 | <select name="pid" onchange="document.forms.postmodForm.submit();">'; |
798 | 834 | |
799 | - foreach ($context['profiles'] as $profile) |
|
800 | - if ($profile['can_modify']) |
|
835 | + foreach ($context['profiles'] as $profile) { |
|
836 | + if ($profile['can_modify']) |
|
801 | 837 | echo ' |
802 | 838 | <option value="', $profile['id'], '"', $profile['id'] == $context['current_profile'] ? ' selected' : '', '>', $profile['name'], '</option>'; |
839 | + } |
|
803 | 840 | |
804 | 841 | echo ' |
805 | 842 | </select> |
@@ -820,11 +857,12 @@ discard block |
||
820 | 857 | ', $txt['permissions_post_moderation_replies_any'], ' |
821 | 858 | </th>'; |
822 | 859 | |
823 | - if ($modSettings['attachmentEnable'] == 1) |
|
824 | - echo ' |
|
860 | + if ($modSettings['attachmentEnable'] == 1) { |
|
861 | + echo ' |
|
825 | 862 | <th class="centercol" colspan="3"> |
826 | 863 | ', $txt['permissions_post_moderation_attachments'], ' |
827 | 864 | </th>'; |
865 | + } |
|
828 | 866 | |
829 | 867 | echo ' |
830 | 868 | </tr> |
@@ -842,11 +880,12 @@ discard block |
||
842 | 880 | <th><span class="generic_icons post_moderation_moderate"></span></th> |
843 | 881 | <th><span class="generic_icons post_moderation_deny"></span></th>'; |
844 | 882 | |
845 | - if ($modSettings['attachmentEnable'] == 1) |
|
846 | - echo ' |
|
883 | + if ($modSettings['attachmentEnable'] == 1) { |
|
884 | + echo ' |
|
847 | 885 | <th><span class="generic_icons post_moderation_allow"></span></th> |
848 | 886 | <th><span class="generic_icons post_moderation_moderate"></span></th> |
849 | 887 | <th><span class="generic_icons post_moderation_deny"></span></th>'; |
888 | + } |
|
850 | 889 | |
851 | 890 | echo ' |
852 | 891 | </tr> |
@@ -860,10 +899,11 @@ discard block |
||
860 | 899 | <td class="half_table"> |
861 | 900 | <span ', ($group['color'] ? 'style="color: ' . $group['color'] . '"' : ''), '>', $group['name'], '</span>'; |
862 | 901 | |
863 | - if (!empty($group['children'])) |
|
864 | - echo ' |
|
902 | + if (!empty($group['children'])) { |
|
903 | + echo ' |
|
865 | 904 | <br> |
866 | 905 | <span class="smalltext">', $txt['permissions_includes_inherited'], ': "', implode('", "', $group['children']), '"</span>'; |
906 | + } |
|
867 | 907 | |
868 | 908 | echo ' |
869 | 909 | </td> |
@@ -878,11 +918,11 @@ discard block |
||
878 | 918 | </td>'; |
879 | 919 | |
880 | 920 | // Guests can't have "own" permissions |
881 | - if ($group['id'] == '-1') |
|
882 | - echo ' |
|
921 | + if ($group['id'] == '-1') { |
|
922 | + echo ' |
|
883 | 923 | <td colspan="3"></td>'; |
884 | - else |
|
885 | - echo ' |
|
924 | + } else { |
|
925 | + echo ' |
|
886 | 926 | <td class="centercol"> |
887 | 927 | <input type="radio" name="replies_own[', $group['id'], ']" value="allow"', $group['replies_own'] == 'allow' ? ' checked' : '', '> |
888 | 928 | </td> |
@@ -892,6 +932,7 @@ discard block |
||
892 | 932 | <td class="centercol"> |
893 | 933 | <input type="radio" name="replies_own[', $group['id'], ']" value="disallow"', $group['replies_own'] == 'disallow' ? ' checked' : '', '> |
894 | 934 | </td>'; |
935 | + } |
|
895 | 936 | |
896 | 937 | echo ' |
897 | 938 | <td class="centercol"> |
@@ -904,8 +945,8 @@ discard block |
||
904 | 945 | <input type="radio" name="replies_any[', $group['id'], ']" value="disallow"', $group['replies_any'] == 'disallow' ? ' checked' : '', '> |
905 | 946 | </td>'; |
906 | 947 | |
907 | - if ($modSettings['attachmentEnable'] == 1) |
|
908 | - echo ' |
|
948 | + if ($modSettings['attachmentEnable'] == 1) { |
|
949 | + echo ' |
|
909 | 950 | <td class="centercol"> |
910 | 951 | <input type="radio" name="attachment[', $group['id'], ']" value="allow"', $group['attachment'] == 'allow' ? ' checked' : '', '> |
911 | 952 | </td> |
@@ -915,6 +956,7 @@ discard block |
||
915 | 956 | <td class="centercol"> |
916 | 957 | <input type="radio" name="attachment[', $group['id'], ']" value="disallow"', $group['attachment'] == 'disallow' ? ' checked' : '', '> |
917 | 958 | </td>'; |
959 | + } |
|
918 | 960 | |
919 | 961 | echo ' |
920 | 962 | </tr>'; |