@@ -26,9 +26,10 @@ discard block |
||
26 | 26 | </h3> |
27 | 27 | </div>'; |
28 | 28 | |
29 | - if ($context['ban']['is_new']) |
|
30 | - echo ' |
|
29 | + if ($context['ban']['is_new']) { |
|
30 | + echo ' |
|
31 | 31 | <div class="information noup">', $txt['ban_add_notes'], '</div>'; |
32 | + } |
|
32 | 33 | |
33 | 34 | // If there were errors creating the ban, show them. |
34 | 35 | if (!empty($context['error_messages'])) |
@@ -38,9 +39,10 @@ discard block |
||
38 | 39 | <strong>', $txt['ban_errors_detected'], '</strong> |
39 | 40 | <ul>'; |
40 | 41 | |
41 | - foreach ($context['error_messages'] as $error) |
|
42 | - echo ' |
|
42 | + foreach ($context['error_messages'] as $error) { |
|
43 | + echo ' |
|
43 | 44 | <li class="error">', $error, '</li>'; |
45 | + } |
|
44 | 46 | |
45 | 47 | echo ' |
46 | 48 | </ul> |
@@ -57,8 +59,8 @@ discard block |
||
57 | 59 | <input type="text" id="ban_name" name="ban_name" value="', $context['ban']['name'], '" size="45" maxlength="60" class="input_text"> |
58 | 60 | </dd>'; |
59 | 61 | |
60 | - if (isset($context['ban']['reason'])) |
|
61 | - echo ' |
|
62 | + if (isset($context['ban']['reason'])) { |
|
63 | + echo ' |
|
62 | 64 | <dt> |
63 | 65 | <strong><label for="reason">', $txt['ban_reason'], ':</label></strong><br> |
64 | 66 | <span class="smalltext">', $txt['ban_reason_desc'], '</span> |
@@ -66,9 +68,10 @@ discard block |
||
66 | 68 | <dd> |
67 | 69 | <textarea name="reason" id="reason" cols="40" rows="3" style="min-height: 64px; max-height: 64px; min-width: 50%; max-width: 99%;">', $context['ban']['reason'], '</textarea> |
68 | 70 | </dd>'; |
71 | + } |
|
69 | 72 | |
70 | - if (isset($context['ban']['notes'])) |
|
71 | - echo ' |
|
73 | + if (isset($context['ban']['notes'])) { |
|
74 | + echo ' |
|
72 | 75 | <dt> |
73 | 76 | <strong><label for="ban_notes">', $txt['ban_notes'], ':</label></strong><br> |
74 | 77 | <span class="smalltext">', $txt['ban_notes_desc'], '</span> |
@@ -76,6 +79,7 @@ discard block |
||
76 | 79 | <dd> |
77 | 80 | <textarea name="notes" id="ban_notes" cols="40" rows="3" style="min-height: 64px; max-height: 64px; min-width: 50%; max-width: 99%;">', $context['ban']['notes'], '</textarea> |
78 | 81 | </dd>'; |
82 | + } |
|
79 | 83 | |
80 | 84 | echo ' |
81 | 85 | </dl> |
@@ -115,8 +119,8 @@ discard block |
||
115 | 119 | <input type="text" name="main_ip" value="', $context['ban_suggestions']['main_ip'], '" size="44" onfocus="document.getElementById(\'main_ip_check\').checked = true;" class="input_text"> |
116 | 120 | </dd>'; |
117 | 121 | |
118 | - if (empty($modSettings['disableHostnameLookup'])) |
|
119 | - echo ' |
|
122 | + if (empty($modSettings['disableHostnameLookup'])) { |
|
123 | + echo ' |
|
120 | 124 | <dt> |
121 | 125 | <input type="checkbox" name="ban_suggestions[]" id="hostname_check" value="hostname" class="input_check"', !empty($context['ban_suggestions']['hostname']) ? ' checked' : '', '> |
122 | 126 | <label for="hostname_check">', $txt['ban_on_hostname'], '</label> |
@@ -124,6 +128,7 @@ discard block |
||
124 | 128 | <dd> |
125 | 129 | <input type="text" name="hostname" value="', $context['ban_suggestions']['hostname'], '" size="44" onfocus="document.getElementById(\'hostname_check\').checked = true;" class="input_text"> |
126 | 130 | </dd>'; |
131 | + } |
|
127 | 132 | |
128 | 133 | echo ' |
129 | 134 | <dt> |
@@ -153,14 +158,15 @@ discard block |
||
153 | 158 | <dl class="settings">'; |
154 | 159 | |
155 | 160 | $count = 0; |
156 | - foreach ($ban_ips as $ip) |
|
157 | - echo ' |
|
161 | + foreach ($ban_ips as $ip) { |
|
162 | + echo ' |
|
158 | 163 | <dt> |
159 | 164 | <input type="checkbox" id="suggestions_', $key, '_', $count, '" name="ban_suggestions[', $key, '][]"', !empty($context['ban_suggestions']['saved_triggers'][$key]) && in_array($ip, $context['ban_suggestions']['saved_triggers'][$key]) ? ' checked' : '', ' value="', $ip, '" class="input_check"> |
160 | 165 | </dt> |
161 | 166 | <dd> |
162 | 167 | <label for="suggestions_', $key, '_', $count++, '">', $ip, '</label> |
163 | 168 | </dd>'; |
169 | + } |
|
164 | 170 | |
165 | 171 | echo ' |
166 | 172 | </dl>'; |
@@ -202,8 +208,8 @@ discard block |
||
202 | 208 | addLoadEvent(fUpdateStatus);'; |
203 | 209 | |
204 | 210 | // Auto suggest only needed for adding new bans, not editing |
205 | - if ($context['ban']['is_new'] && empty($_REQUEST['u'])) |
|
206 | - echo ' |
|
211 | + if ($context['ban']['is_new'] && empty($_REQUEST['u'])) { |
|
212 | + echo ' |
|
207 | 213 | var oAddMemberSuggest = new smc_AutoSuggest({ |
208 | 214 | sSelf: \'oAddMemberSuggest\', |
209 | 215 | sSessionId: smf_session_id, |
@@ -221,6 +227,7 @@ discard block |
||
221 | 227 | return true; |
222 | 228 | } |
223 | 229 | oAddMemberSuggest.registerCallback(\'onBeforeUpdate\', \'onUpdateName\');'; |
230 | + } |
|
224 | 231 | |
225 | 232 | echo ' |
226 | 233 | function confirmBan(aForm) |
@@ -268,8 +275,8 @@ discard block |
||
268 | 275 | <input type="text" name="main_ip" value="', $context['ban_trigger']['ip']['value'], '" size="44" onfocus="document.getElementById(\'main_ip_check\').checked = true;" class="input_text"> |
269 | 276 | </dd>'; |
270 | 277 | |
271 | - if (empty($modSettings['disableHostnameLookup'])) |
|
272 | - echo ' |
|
278 | + if (empty($modSettings['disableHostnameLookup'])) { |
|
279 | + echo ' |
|
273 | 280 | <dt> |
274 | 281 | <input type="checkbox" name="ban_suggestions[]" id="hostname_check" value="hostname" class="input_check"', $context['ban_trigger']['hostname']['selected'] ? ' checked' : '', '> |
275 | 282 | <label for="hostname_check">', $txt['ban_on_hostname'], '</label> |
@@ -277,6 +284,7 @@ discard block |
||
277 | 284 | <dd> |
278 | 285 | <input type="text" name="hostname" value="', $context['ban_trigger']['hostname']['value'], '" size="44" onfocus="document.getElementById(\'hostname_check\').checked = true;" class="input_text"> |
279 | 286 | </dd>'; |
287 | + } |
|
280 | 288 | |
281 | 289 | echo ' |
282 | 290 | <dt> |
@@ -48,17 +48,19 @@ discard block |
||
48 | 48 | </a>'; |
49 | 49 | |
50 | 50 | // Has it outstanding posts for approval? |
51 | - if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) |
|
52 | - echo ' |
|
51 | + if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) { |
|
52 | + echo ' |
|
53 | 53 | <a href="', $scripturl, '?action=moderate;area=postmod;sa=', ($board['unapproved_topics'] > 0 ? 'topics' : 'posts'), ';brd=', $board['id'], ';', $context['session_var'], '=', $context['session_id'], '" title="', sprintf($txt['unapproved_posts'], $board['unapproved_topics'], $board['unapproved_posts']), '" class="moderation_link">(!)</a>'; |
54 | + } |
|
54 | 55 | |
55 | 56 | echo ' |
56 | 57 | <p class="board_description">', $board['description'], '</p>'; |
57 | 58 | |
58 | 59 | // Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.) |
59 | - if (!empty($board['moderators']) || !empty($board['moderator_groups'])) |
|
60 | - echo ' |
|
60 | + if (!empty($board['moderators']) || !empty($board['moderator_groups'])) { |
|
61 | + echo ' |
|
61 | 62 | <p class="moderators">', count($board['link_moderators']) === 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>'; |
63 | + } |
|
62 | 64 | |
63 | 65 | // Show some basic information about the number of posts, etc. |
64 | 66 | echo ' |
@@ -70,9 +72,10 @@ discard block |
||
70 | 72 | </div> |
71 | 73 | <div class="lastpost lpr_border">'; |
72 | 74 | |
73 | - if (!empty($board['last_post']['id'])) |
|
74 | - echo ' |
|
75 | + if (!empty($board['last_post']['id'])) { |
|
76 | + echo ' |
|
75 | 77 | <p>', $board['last_post']['last_post_message'], '</p>'; |
78 | + } |
|
76 | 79 | echo ' |
77 | 80 | </div>'; |
78 | 81 | |
@@ -85,14 +88,16 @@ discard block |
||
85 | 88 | id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */ |
86 | 89 | foreach ($board['children'] as $child) |
87 | 90 | { |
88 | - if (!$child['is_redirect']) |
|
89 | - $child['link'] = '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . ($child['new'] ? '</a> <a ' . ($child['new'] ? 'class="new_posts" ' : '') . 'href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span>' : '') . '</a>'; |
|
90 | - else |
|
91 | - $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>'; |
|
91 | + if (!$child['is_redirect']) { |
|
92 | + $child['link'] = '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . ($child['new'] ? '</a> <a ' . ($child['new'] ? 'class="new_posts" ' : '') . 'href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span>' : '') . '</a>'; |
|
93 | + } else { |
|
94 | + $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>'; |
|
95 | + } |
|
92 | 96 | |
93 | 97 | // Has it posts awaiting approval? |
94 | - if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics'])) |
|
95 | - $child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>'; |
|
98 | + if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics'])) { |
|
99 | + $child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>'; |
|
100 | + } |
|
96 | 101 | |
97 | 102 | $children[] = $child['new'] ? '<strong>' . $child['link'] . '</strong>' : $child['link']; |
98 | 103 | } |
@@ -111,8 +116,9 @@ discard block |
||
111 | 116 | } |
112 | 117 | |
113 | 118 | // They can only mark read if they are logged in and it's enabled! |
114 | - if (!$context['user']['is_logged']) |
|
115 | - unset($context['normal_buttons']['markread']); |
|
119 | + if (!$context['user']['is_logged']) { |
|
120 | + unset($context['normal_buttons']['markread']); |
|
121 | + } |
|
116 | 122 | |
117 | 123 | if (!$context['no_topic_listing']) |
118 | 124 | { |
@@ -135,13 +141,15 @@ discard block |
||
135 | 141 | <div id="description_board" class="generic_list_wrapper"> |
136 | 142 | <h3>', $context['name'], '</h3> |
137 | 143 | <p>'; |
138 | - if ($context['description'] != '') |
|
139 | - echo ' |
|
144 | + if ($context['description'] != '') { |
|
145 | + echo ' |
|
140 | 146 | ', $context['description'], ' '; |
147 | + } |
|
141 | 148 | |
142 | - if (!empty($context['moderators'])) |
|
143 | - echo ' |
|
149 | + if (!empty($context['moderators'])) { |
|
150 | + echo ' |
|
144 | 151 | ', count($context['moderators']) === 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $context['link_moderators']), '.'; |
152 | + } |
|
145 | 153 | |
146 | 154 | echo ' |
147 | 155 | </p> |
@@ -149,9 +157,10 @@ discard block |
||
149 | 157 | } |
150 | 158 | |
151 | 159 | // If Quick Moderation is enabled start the form. |
152 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) |
|
153 | - echo ' |
|
160 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) { |
|
161 | + echo ' |
|
154 | 162 | <form action="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" class="clear" name="quickModForm" id="quickModForm">'; |
163 | + } |
|
155 | 164 | |
156 | 165 | echo ' |
157 | 166 | <div id="messageindex">'; |
@@ -159,10 +168,11 @@ discard block |
||
159 | 168 | { |
160 | 169 | echo ' |
161 | 170 | <div class="information">'; |
162 | - if ($settings['display_who_viewing'] == 1) |
|
163 | - echo count($context['view_members']), ' ', count($context['view_members']) === 1 ? $txt['who_member'] : $txt['members']; |
|
164 | - else |
|
165 | - echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . (empty($context['view_num_hidden']) || $context['can_moderate_forum'] ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')'); |
|
171 | + if ($settings['display_who_viewing'] == 1) { |
|
172 | + echo count($context['view_members']), ' ', count($context['view_members']) === 1 ? $txt['who_member'] : $txt['members']; |
|
173 | + } else { |
|
174 | + echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . (empty($context['view_num_hidden']) || $context['can_moderate_forum'] ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')'); |
|
175 | + } |
|
166 | 176 | echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_board']; |
167 | 177 | |
168 | 178 | echo ' |
@@ -181,19 +191,22 @@ discard block |
||
181 | 191 | <div class="lastpost">', $context['topics_headers']['last_post'], '</div>'; |
182 | 192 | |
183 | 193 | // Show a "select all" box for quick moderation? |
184 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1) |
|
185 | - echo ' |
|
194 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1) { |
|
195 | + echo ' |
|
186 | 196 | <div class="moderation"><input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="input_check"></div>'; |
197 | + } |
|
187 | 198 | |
188 | 199 | // If it's on in "image" mode, don't show anything but the column. |
189 | - elseif (!empty($context['can_quick_mod'])) |
|
190 | - echo ' |
|
200 | + elseif (!empty($context['can_quick_mod'])) { |
|
201 | + echo ' |
|
191 | 202 | <div class="moderation"> </div>'; |
203 | + } |
|
192 | 204 | } |
193 | 205 | // No topics.... just say, "sorry bub". |
194 | - else |
|
195 | - echo ' |
|
206 | + else { |
|
207 | + echo ' |
|
196 | 208 | <h3 class="titlebg">', $txt['topic_alert_none'], '</h3>'; |
209 | + } |
|
197 | 210 | |
198 | 211 | echo ' |
199 | 212 | </div>'; |
@@ -225,21 +238,26 @@ discard block |
||
225 | 238 | // Now we handle the icons |
226 | 239 | echo ' |
227 | 240 | <div class="icons floatright">'; |
228 | - if ($topic['is_watched']) |
|
229 | - echo ' |
|
241 | + if ($topic['is_watched']) { |
|
242 | + echo ' |
|
230 | 243 | <span class="generic_icons watch" title="', $txt['watching_this_topic'], '"></span>'; |
231 | - if ($topic['is_locked']) |
|
232 | - echo ' |
|
244 | + } |
|
245 | + if ($topic['is_locked']) { |
|
246 | + echo ' |
|
233 | 247 | <span class="generic_icons lock"></span>'; |
234 | - if ($topic['is_sticky']) |
|
235 | - echo ' |
|
248 | + } |
|
249 | + if ($topic['is_sticky']) { |
|
250 | + echo ' |
|
236 | 251 | <span class="generic_icons sticky"></span>'; |
237 | - if ($topic['is_redirect']) |
|
238 | - echo ' |
|
252 | + } |
|
253 | + if ($topic['is_redirect']) { |
|
254 | + echo ' |
|
239 | 255 | <span class="generic_icons move"></span>'; |
240 | - if ($topic['is_poll']) |
|
241 | - echo ' |
|
256 | + } |
|
257 | + if ($topic['is_poll']) { |
|
258 | + echo ' |
|
242 | 259 | <span class="generic_icons poll"></span>'; |
260 | + } |
|
243 | 261 | echo ' |
244 | 262 | </div>'; |
245 | 263 | |
@@ -265,26 +283,31 @@ discard block |
||
265 | 283 | { |
266 | 284 | echo ' |
267 | 285 | <div class="moderation">'; |
268 | - if ($options['display_quick_mod'] == 1) |
|
269 | - echo ' |
|
286 | + if ($options['display_quick_mod'] == 1) { |
|
287 | + echo ' |
|
270 | 288 | <input type="checkbox" name="topics[]" value="', $topic['id'], '" class="input_check">'; |
271 | - else |
|
289 | + } else |
|
272 | 290 | { |
273 | 291 | // Check permissions on each and show only the ones they are allowed to use. |
274 | - if ($topic['quick_mod']['remove']) |
|
275 | - echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';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>'; |
|
292 | + if ($topic['quick_mod']['remove']) { |
|
293 | + echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';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>'; |
|
294 | + } |
|
276 | 295 | |
277 | - if ($topic['quick_mod']['lock']) |
|
278 | - echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';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>'; |
|
296 | + if ($topic['quick_mod']['lock']) { |
|
297 | + echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';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>'; |
|
298 | + } |
|
279 | 299 | |
280 | - if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) |
|
281 | - echo '<br>'; |
|
300 | + if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) { |
|
301 | + echo '<br>'; |
|
302 | + } |
|
282 | 303 | |
283 | - if ($topic['quick_mod']['sticky']) |
|
284 | - echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';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>'; |
|
304 | + if ($topic['quick_mod']['sticky']) { |
|
305 | + echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';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>'; |
|
306 | + } |
|
285 | 307 | |
286 | - if ($topic['quick_mod']['move']) |
|
287 | - echo '<a href="', $scripturl, '?action=movetopic;current_board=', $context['current_board'], ';board=', $context['current_board'], '.', $context['start'], ';topic=', $topic['id'], '.0"><span class="generic_icons move" title="', $txt['move_topic'], '"></span></a>'; |
|
308 | + if ($topic['quick_mod']['move']) { |
|
309 | + echo '<a href="', $scripturl, '?action=movetopic;current_board=', $context['current_board'], ';board=', $context['current_board'], '.', $context['start'], ';topic=', $topic['id'], '.0"><span class="generic_icons move" title="', $txt['move_topic'], '"></span></a>'; |
|
310 | + } |
|
288 | 311 | } |
289 | 312 | echo ' |
290 | 313 | </div>'; |
@@ -302,18 +325,20 @@ discard block |
||
302 | 325 | <select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.move_to.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '> |
303 | 326 | <option value="">--------</option>'; |
304 | 327 | |
305 | - foreach ($context['qmod_actions'] as $qmod_action) |
|
306 | - if ($context['can_' . $qmod_action]) |
|
328 | + foreach ($context['qmod_actions'] as $qmod_action) { |
|
329 | + if ($context['can_' . $qmod_action]) |
|
307 | 330 | echo ' |
308 | 331 | <option value="' . $qmod_action . '">' . $txt['quick_mod_' . $qmod_action] . '</option>'; |
332 | + } |
|
309 | 333 | |
310 | 334 | echo ' |
311 | 335 | </select>'; |
312 | 336 | |
313 | 337 | // Show a list of boards they can move the topic to. |
314 | - if ($context['can_move']) |
|
315 | - echo ' |
|
338 | + if ($context['can_move']) { |
|
339 | + echo ' |
|
316 | 340 | <span id="quick_mod_jump_to"> </span>'; |
341 | + } |
|
317 | 342 | |
318 | 343 | echo ' |
319 | 344 | <input type="submit" value="', $txt['quick_mod_go'], '" onclick="return document.forms.quickModForm.qaction.value != \'\' && confirm(\'', $txt['quickmod_confirm'], '\');" class="button_submit qaction"> |
@@ -324,10 +349,11 @@ discard block |
||
324 | 349 | </div>'; |
325 | 350 | |
326 | 351 | // Finish off the form - again. |
327 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) |
|
328 | - echo ' |
|
352 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) { |
|
353 | + echo ' |
|
329 | 354 | <input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '"> |
330 | 355 | </form>'; |
356 | + } |
|
331 | 357 | |
332 | 358 | // Mobile action buttons (bottom) |
333 | 359 | echo ' |
@@ -346,8 +372,8 @@ discard block |
||
346 | 372 | // Show breadcrumbs at the bottom too. |
347 | 373 | theme_linktree(); |
348 | 374 | |
349 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) |
|
350 | - echo ' |
|
375 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) { |
|
376 | + echo ' |
|
351 | 377 | <script> |
352 | 378 | if (typeof(window.XMLHttpRequest) != "undefined") |
353 | 379 | aJumpTo[aJumpTo.length] = new JumpTo({ |
@@ -366,6 +392,7 @@ discard block |
||
366 | 392 | sCustomName: "move_to" |
367 | 393 | }); |
368 | 394 | </script>'; |
395 | + } |
|
369 | 396 | |
370 | 397 | // Javascript for inline editing. |
371 | 398 | echo ' |
@@ -401,8 +428,8 @@ discard block |
||
401 | 428 | <div class="information"> |
402 | 429 | <p class="floatright" id="message_index_jump_to"> </p>'; |
403 | 430 | |
404 | - if (empty($context['no_topic_listing'])) |
|
405 | - echo ' |
|
431 | + if (empty($context['no_topic_listing'])) { |
|
432 | + echo ' |
|
406 | 433 | <p class="floatleft">', !empty($modSettings['enableParticipation']) && $context['user']['is_logged'] ? ' |
407 | 434 | <img src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="" class="centericon"> ' . $txt['participation_caption'] . '<br>' : '', ' |
408 | 435 | '. ($modSettings['pollMode'] == '1' ? '<span class="generic_icons poll centericon"></span> ' . $txt['poll'] : '') . '<br> |
@@ -412,9 +439,10 @@ discard block |
||
412 | 439 | <span class="generic_icons lock centericon"></span> ' . $txt['locked_topic'] . '<br> |
413 | 440 | <span class="generic_icons sticky centericon"></span> ' . $txt['sticky_topic'] . '<br> |
414 | 441 | </p>'; |
442 | + } |
|
415 | 443 | |
416 | - if (!empty($context['jump_to'])) |
|
417 | - echo ' |
|
444 | + if (!empty($context['jump_to'])) { |
|
445 | + echo ' |
|
418 | 446 | <script> |
419 | 447 | if (typeof(window.XMLHttpRequest) != "undefined") |
420 | 448 | aJumpTo[aJumpTo.length] = new JumpTo({ |
@@ -430,6 +458,7 @@ discard block |
||
430 | 458 | sGoButtonLabel: "', $txt['quick_mod_go'], '" |
431 | 459 | }); |
432 | 460 | </script>'; |
461 | + } |
|
433 | 462 | |
434 | 463 | echo ' |
435 | 464 | <br class="clear"> |
@@ -1,9 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // Try to handle it with the upper level index.php. (it should know what to do.) |
4 | -if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) |
|
4 | +if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) { |
|
5 | 5 | include (dirname(dirname(__FILE__)) . '/index.php'); |
6 | -else |
|
6 | +} else { |
|
7 | 7 | exit; |
8 | +} |
|
8 | 9 | |
9 | 10 | ?> |
10 | 11 | \ No newline at end of file |
@@ -1,9 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // Try to handle it with the upper level index.php. (it should know what to do.) |
4 | -if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) |
|
4 | +if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) { |
|
5 | 5 | include (dirname(dirname(__FILE__)) . '/index.php'); |
6 | -else |
|
6 | +} else { |
|
7 | 7 | exit; |
8 | +} |
|
8 | 9 | |
9 | 10 | ?> |
10 | 11 | \ No newline at end of file |
@@ -1,9 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // Try to handle it with the upper level index.php. (it should know what to do.) |
4 | -if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) |
|
4 | +if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) { |
|
5 | 5 | include (dirname(dirname(__FILE__)) . '/index.php'); |
6 | -else |
|
6 | +} else { |
|
7 | 7 | exit; |
8 | +} |
|
8 | 9 | |
9 | 10 | ?> |
10 | 11 | \ No newline at end of file |
@@ -1,9 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // Try to handle it with the upper level index.php. (it should know what to do.) |
4 | -if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) |
|
4 | +if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) { |
|
5 | 5 | include (dirname(dirname(__FILE__)) . '/index.php'); |
6 | -else |
|
6 | +} else { |
|
7 | 7 | exit; |
8 | +} |
|
8 | 9 | |
9 | 10 | ?> |
10 | 11 | \ No newline at end of file |
@@ -1,9 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // Try to handle it with the upper level index.php. (it should know what to do.) |
4 | -if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) |
|
4 | +if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) { |
|
5 | 5 | include (dirname(dirname(__FILE__)) . '/index.php'); |
6 | -else |
|
6 | +} else { |
|
7 | 7 | exit; |
8 | +} |
|
8 | 9 | |
9 | 10 | ?> |
10 | 11 | \ No newline at end of file |
@@ -1,9 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // Try to handle it with the upper level index.php. (it should know what to do.) |
4 | -if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) |
|
4 | +if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) { |
|
5 | 5 | include (dirname(dirname(__FILE__)) . '/index.php'); |
6 | -else |
|
6 | +} else { |
|
7 | 7 | exit; |
8 | +} |
|
8 | 9 | |
9 | 10 | ?> |
10 | 11 | \ No newline at end of file |
@@ -51,11 +51,13 @@ discard block |
||
51 | 51 | <p>'; |
52 | 52 | |
53 | 53 | // Show just numbers...? |
54 | - if ($settings['display_who_viewing'] == 1) |
|
55 | - echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members']; |
|
54 | + if ($settings['display_who_viewing'] == 1) { |
|
55 | + echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members']; |
|
56 | + } |
|
56 | 57 | // Or show the actual people viewing the topic? |
57 | - else |
|
58 | - echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) || $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')'); |
|
58 | + else { |
|
59 | + echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) || $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')'); |
|
60 | + } |
|
59 | 61 | |
60 | 62 | // Now show how many guests are here too. |
61 | 63 | echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], ' |
@@ -93,10 +95,11 @@ discard block |
||
93 | 95 | <dt class="', $option['voted_this'] ? ' voted' : '', '">', $option['option'], '</dt> |
94 | 96 | <dd class="statsbar', $option['voted_this'] ? ' voted' : '', '">'; |
95 | 97 | |
96 | - if ($context['allow_results_view']) |
|
97 | - echo ' |
|
98 | + if ($context['allow_results_view']) { |
|
99 | + echo ' |
|
98 | 100 | ', $option['bar_ndt'], ' |
99 | 101 | <span class="percentage">', $option['votes'], ' (', $option['percent'], '%)</span>'; |
102 | + } |
|
100 | 103 | |
101 | 104 | echo ' |
102 | 105 | </dd>'; |
@@ -105,9 +108,10 @@ discard block |
||
105 | 108 | echo ' |
106 | 109 | </dl>'; |
107 | 110 | |
108 | - if ($context['allow_results_view']) |
|
109 | - echo ' |
|
111 | + if ($context['allow_results_view']) { |
|
112 | + echo ' |
|
110 | 113 | <p><strong>', $txt['poll_total_voters'], ':</strong> ', $context['poll']['total_votes'], '</p>'; |
114 | + } |
|
111 | 115 | } |
112 | 116 | // They are allowed to vote! Go to it! |
113 | 117 | else |
@@ -116,17 +120,19 @@ discard block |
||
116 | 120 | <form action="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], '" method="post" accept-charset="', $context['character_set'], '">'; |
117 | 121 | |
118 | 122 | // Show a warning if they are allowed more than one option. |
119 | - if ($context['poll']['allowed_warning']) |
|
120 | - echo ' |
|
123 | + if ($context['poll']['allowed_warning']) { |
|
124 | + echo ' |
|
121 | 125 | <p class="smallpadding">', $context['poll']['allowed_warning'], '</p>'; |
126 | + } |
|
122 | 127 | |
123 | 128 | echo ' |
124 | 129 | <ul class="options">'; |
125 | 130 | |
126 | 131 | // Show each option with its button - a radio likely. |
127 | - foreach ($context['poll']['options'] as $option) |
|
128 | - echo ' |
|
132 | + foreach ($context['poll']['options'] as $option) { |
|
133 | + echo ' |
|
129 | 134 | <li>', $option['vote_button'], ' <label for="', $option['id'], '">', $option['option'], '</label></li>'; |
135 | + } |
|
130 | 136 | |
131 | 137 | echo ' |
132 | 138 | </ul> |
@@ -138,9 +144,10 @@ discard block |
||
138 | 144 | } |
139 | 145 | |
140 | 146 | // Is the clock ticking? |
141 | - if (!empty($context['poll']['expire_time'])) |
|
142 | - echo ' |
|
147 | + if (!empty($context['poll']['expire_time'])) { |
|
148 | + echo ' |
|
143 | 149 | <p><strong>', ($context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on']), ':</strong> ', $context['poll']['expire_time'], '</p>'; |
150 | + } |
|
144 | 151 | |
145 | 152 | echo ' |
146 | 153 | </div> |
@@ -170,11 +177,13 @@ discard block |
||
170 | 177 | <li> |
171 | 178 | <b class="event_title"><a href="', $scripturl, '?action=calendar;event=', $event['id'], '">', $event['title'], '</a></b>'; |
172 | 179 | |
173 | - if ($event['can_edit']) |
|
174 | - echo ' <a href="' . $event['modify_href'] . '"><span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span></a>'; |
|
180 | + if ($event['can_edit']) { |
|
181 | + echo ' <a href="' . $event['modify_href'] . '"><span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span></a>'; |
|
182 | + } |
|
175 | 183 | |
176 | - if ($event['can_export']) |
|
177 | - echo ' <a href="' . $event['export_href'] . '"><span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span></a>'; |
|
184 | + if ($event['can_export']) { |
|
185 | + echo ' <a href="' . $event['export_href'] . '"><span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span></a>'; |
|
186 | + } |
|
178 | 187 | |
179 | 188 | echo ' |
180 | 189 | <br>'; |
@@ -182,14 +191,14 @@ discard block |
||
182 | 191 | if (!empty($event['allday'])) |
183 | 192 | { |
184 | 193 | echo '<time datetime="' . $event['start_iso_gmdate'] . '">', trim($event['start_date_local']), '</time>', ($event['start_date'] != $event['end_date']) ? ' – <time datetime="' . $event['end_iso_gmdate'] . '">' . trim($event['end_date_local']) . '</time>' : ''; |
185 | - } |
|
186 | - else |
|
194 | + } else |
|
187 | 195 | { |
188 | 196 | // Display event info relative to user's local timezone |
189 | 197 | echo '<time datetime="' . $event['start_iso_gmdate'] . '">', trim($event['start_date_local']), ', ', trim($event['start_time_local']), '</time> – <time datetime="' . $event['end_iso_gmdate'] . '">'; |
190 | 198 | |
191 | - if ($event['start_date_local'] != $event['end_date_local']) |
|
192 | - echo trim($event['end_date_local']) . ', '; |
|
199 | + if ($event['start_date_local'] != $event['end_date_local']) { |
|
200 | + echo trim($event['end_date_local']) . ', '; |
|
201 | + } |
|
193 | 202 | |
194 | 203 | echo trim($event['end_time_local']); |
195 | 204 | |
@@ -198,23 +207,27 @@ discard block |
||
198 | 207 | { |
199 | 208 | echo '</time> (<time datetime="' . $event['start_iso_gmdate'] . '">'; |
200 | 209 | |
201 | - if ($event['start_date_orig'] != $event['start_date_local'] || $event['end_date_orig'] != $event['end_date_local'] || $event['start_date_orig'] != $event['end_date_orig']) |
|
202 | - echo trim($event['start_date_orig']), ', '; |
|
210 | + if ($event['start_date_orig'] != $event['start_date_local'] || $event['end_date_orig'] != $event['end_date_local'] || $event['start_date_orig'] != $event['end_date_orig']) { |
|
211 | + echo trim($event['start_date_orig']), ', '; |
|
212 | + } |
|
203 | 213 | |
204 | 214 | echo trim($event['start_time_orig']), '</time> – <time datetime="' . $event['end_iso_gmdate'] . '">'; |
205 | 215 | |
206 | - if ($event['start_date_orig'] != $event['end_date_orig']) |
|
207 | - echo trim($event['end_date_orig']) . ', '; |
|
216 | + if ($event['start_date_orig'] != $event['end_date_orig']) { |
|
217 | + echo trim($event['end_date_orig']) . ', '; |
|
218 | + } |
|
208 | 219 | |
209 | 220 | echo trim($event['end_time_orig']), ' ', $event['tz_abbrev'], '</time>)'; |
210 | 221 | } |
211 | 222 | // Event is scheduled in the user's own timezone? Let 'em know, just to avoid confusion |
212 | - else |
|
213 | - echo ' ', $event['tz_abbrev'], '</time>'; |
|
223 | + else { |
|
224 | + echo ' ', $event['tz_abbrev'], '</time>'; |
|
225 | + } |
|
214 | 226 | } |
215 | 227 | |
216 | - if (!empty($event['location'])) |
|
217 | - echo '<br>', $event['location']; |
|
228 | + if (!empty($event['location'])) { |
|
229 | + echo '<br>', $event['location']; |
|
230 | + } |
|
218 | 231 | |
219 | 232 | echo ' |
220 | 233 | </li>'; |
@@ -252,8 +265,9 @@ discard block |
||
252 | 265 | $context['removableMessageIDs'] = array(); |
253 | 266 | |
254 | 267 | // Get all the messages... |
255 | - while ($message = $context['get_message']()) |
|
256 | - template_single_post($message); |
|
268 | + while ($message = $context['get_message']()) { |
|
269 | + template_single_post($message); |
|
270 | + } |
|
257 | 271 | |
258 | 272 | echo ' |
259 | 273 | </form> |
@@ -290,8 +304,9 @@ discard block |
||
290 | 304 | <div id="display_jump_to"> </div>'; |
291 | 305 | |
292 | 306 | // Show quickreply |
293 | - if ($context['can_reply']) |
|
294 | - template_quickreply(); |
|
307 | + if ($context['can_reply']) { |
|
308 | + template_quickreply(); |
|
309 | + } |
|
295 | 310 | |
296 | 311 | // User action pop on mobile screen (or actually small screen), this uses responsive css does not check mobile device. |
297 | 312 | echo ' |
@@ -304,8 +319,8 @@ discard block |
||
304 | 319 | </div>'; |
305 | 320 | |
306 | 321 | // Show the moderation button & pop only if user can moderate |
307 | - if ($context['can_moderate_forum'] || $context['user']['is_mod']) |
|
308 | - echo ' |
|
322 | + if ($context['can_moderate_forum'] || $context['user']['is_mod']) { |
|
323 | + echo ' |
|
309 | 324 | <div id="mobile_moderation" class="popup_container"> |
310 | 325 | <div class="popup_window description"> |
311 | 326 | <div class="popup_heading">', $txt['mobile_moderation'], ' |
@@ -315,6 +330,7 @@ discard block |
||
315 | 330 | </div> |
316 | 331 | </div> |
317 | 332 | </div>'; |
333 | + } |
|
318 | 334 | |
319 | 335 | echo ' |
320 | 336 | <script>'; |
@@ -438,9 +454,10 @@ discard block |
||
438 | 454 | }); |
439 | 455 | }'; |
440 | 456 | |
441 | - if (!empty($context['ignoredMsgs'])) |
|
442 | - echo ' |
|
457 | + if (!empty($context['ignoredMsgs'])) { |
|
458 | + echo ' |
|
443 | 459 | ignore_toggles([', implode(', ', $context['ignoredMsgs']), '], ', JavaScriptEscape($txt['show_ignore_user_post']), ');'; |
460 | + } |
|
444 | 461 | |
445 | 462 | echo ' |
446 | 463 | </script>'; |
@@ -457,8 +474,9 @@ discard block |
||
457 | 474 | |
458 | 475 | $ignoring = false; |
459 | 476 | |
460 | - if ($message['can_remove']) |
|
461 | - $context['removableMessageIDs'][] = $message['id']; |
|
477 | + if ($message['can_remove']) { |
|
478 | + $context['removableMessageIDs'][] = $message['id']; |
|
479 | + } |
|
462 | 480 | |
463 | 481 | // Are we ignoring this message? |
464 | 482 | if (!empty($message['is_ignored'])) |
@@ -484,9 +502,10 @@ discard block |
||
484 | 502 | <div class="custom_fields_above_member"> |
485 | 503 | <ul class="nolist">'; |
486 | 504 | |
487 | - foreach ($message['custom_fields']['above_member'] as $custom) |
|
488 | - echo ' |
|
505 | + foreach ($message['custom_fields']['above_member'] as $custom) { |
|
506 | + echo ' |
|
489 | 507 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
508 | + } |
|
490 | 509 | |
491 | 510 | echo ' |
492 | 511 | </ul> |
@@ -497,9 +516,10 @@ discard block |
||
497 | 516 | <h4>'; |
498 | 517 | |
499 | 518 | // Show online and offline buttons? |
500 | - if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) |
|
501 | - echo ' |
|
519 | + if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) { |
|
520 | + echo ' |
|
502 | 521 | ', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', '<span class="' . ($message['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $message['member']['online']['text'] . '"></span>', $context['can_send_pm'] ? '</a>' : ''; |
522 | + } |
|
503 | 523 | |
504 | 524 | |
505 | 525 | // Show a link to the member's profile. |
@@ -512,51 +532,59 @@ discard block |
||
512 | 532 | |
513 | 533 | |
514 | 534 | // Show the user's avatar. |
515 | - if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) |
|
516 | - echo ' |
|
535 | + if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) { |
|
536 | + echo ' |
|
517 | 537 | <li class="avatar"> |
518 | 538 | <a href="', $message['member']['href'], '">', $message['member']['avatar']['image'], '</a> |
519 | 539 | </li>'; |
540 | + } |
|
520 | 541 | |
521 | 542 | // Are there any custom fields below the avatar? |
522 | - if (!empty($message['custom_fields']['below_avatar'])) |
|
523 | - foreach ($message['custom_fields']['below_avatar'] as $custom) |
|
543 | + if (!empty($message['custom_fields']['below_avatar'])) { |
|
544 | + foreach ($message['custom_fields']['below_avatar'] as $custom) |
|
524 | 545 | echo ' |
525 | 546 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
547 | + } |
|
526 | 548 | |
527 | 549 | // Show the post group icons, but not for guests. |
528 | - if (!$message['member']['is_guest']) |
|
529 | - echo ' |
|
550 | + if (!$message['member']['is_guest']) { |
|
551 | + echo ' |
|
530 | 552 | <li class="icons">', $message['member']['group_icons'], '</li>'; |
553 | + } |
|
531 | 554 | |
532 | 555 | // Show the member's primary group (like 'Administrator') if they have one. |
533 | - if (!empty($message['member']['group'])) |
|
534 | - echo ' |
|
556 | + if (!empty($message['member']['group'])) { |
|
557 | + echo ' |
|
535 | 558 | <li class="membergroup">', $message['member']['group'], '</li>'; |
559 | + } |
|
536 | 560 | |
537 | 561 | // Show the member's custom title, if they have one. |
538 | - if (!empty($message['member']['title'])) |
|
539 | - echo ' |
|
562 | + if (!empty($message['member']['title'])) { |
|
563 | + echo ' |
|
540 | 564 | <li class="title">', $message['member']['title'], '</li>'; |
565 | + } |
|
541 | 566 | |
542 | 567 | // Don't show these things for guests. |
543 | 568 | if (!$message['member']['is_guest']) |
544 | 569 | { |
545 | 570 | |
546 | 571 | // Show the post group if and only if they have no other group or the option is on, and they are in a post group. |
547 | - if ((empty($modSettings['hide_post_group']) || empty($message['member']['group'])) && !empty($message['member']['post_group'])) |
|
548 | - echo ' |
|
572 | + if ((empty($modSettings['hide_post_group']) || empty($message['member']['group'])) && !empty($message['member']['post_group'])) { |
|
573 | + echo ' |
|
549 | 574 | <li class="postgroup">', $message['member']['post_group'], '</li>'; |
575 | + } |
|
550 | 576 | |
551 | 577 | // Show how many posts they have made. |
552 | - if (!isset($context['disabled_fields']['posts'])) |
|
553 | - echo ' |
|
578 | + if (!isset($context['disabled_fields']['posts'])) { |
|
579 | + echo ' |
|
554 | 580 | <li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>'; |
581 | + } |
|
555 | 582 | |
556 | 583 | // Show their personal text? |
557 | - if (!empty($modSettings['show_blurb']) && !empty($message['member']['blurb'])) |
|
558 | - echo ' |
|
584 | + if (!empty($modSettings['show_blurb']) && !empty($message['member']['blurb'])) { |
|
585 | + echo ' |
|
559 | 586 | <li class="blurb">', $message['member']['blurb'], '</li>'; |
587 | + } |
|
560 | 588 | |
561 | 589 | // Any custom fields to show as icons? |
562 | 590 | if (!empty($message['custom_fields']['icons'])) |
@@ -565,9 +593,10 @@ discard block |
||
565 | 593 | <li class="im_icons"> |
566 | 594 | <ol>'; |
567 | 595 | |
568 | - foreach ($message['custom_fields']['icons'] as $custom) |
|
569 | - echo ' |
|
596 | + foreach ($message['custom_fields']['icons'] as $custom) { |
|
597 | + echo ' |
|
570 | 598 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
599 | + } |
|
571 | 600 | |
572 | 601 | echo ' |
573 | 602 | </ol> |
@@ -582,19 +611,22 @@ discard block |
||
582 | 611 | <ol class="profile_icons">'; |
583 | 612 | |
584 | 613 | // Don't show an icon if they haven't specified a website. |
585 | - if (!empty($message['member']['website']['url']) && !isset($context['disabled_fields']['website'])) |
|
586 | - echo ' |
|
614 | + if (!empty($message['member']['website']['url']) && !isset($context['disabled_fields']['website'])) { |
|
615 | + echo ' |
|
587 | 616 | <li><a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank" class="new_win">', ($settings['use_image_buttons'] ? '<span class="generic_icons www centericon" title="' . $message['member']['website']['title'] . '"></span>' : $txt['www']), '</a></li>'; |
617 | + } |
|
588 | 618 | |
589 | 619 | // Since we know this person isn't a guest, you *can* message them. |
590 | - if ($context['can_send_pm']) |
|
591 | - echo ' |
|
620 | + if ($context['can_send_pm']) { |
|
621 | + echo ' |
|
592 | 622 | <li><a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline'], '">', $settings['use_image_buttons'] ? '<span class="generic_icons im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . ' centericon" title="' . ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']) . '"></span> ' : ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']), '</a></li>'; |
623 | + } |
|
593 | 624 | |
594 | 625 | // Show the email if necessary |
595 | - if (!empty($message['member']['email']) && $message['member']['show_email']) |
|
596 | - echo ' |
|
626 | + if (!empty($message['member']['email']) && $message['member']['show_email']) { |
|
627 | + echo ' |
|
597 | 628 | <li class="email"><a href="mailto:' . $message['member']['email'] . '" rel="nofollow">', ($settings['use_image_buttons'] ? '<span class="generic_icons mail centericon" title="' . $txt['email'] . '"></span>' : $txt['email']), '</a></li>'; |
629 | + } |
|
598 | 630 | |
599 | 631 | echo ' |
600 | 632 | </ol> |
@@ -602,48 +634,56 @@ discard block |
||
602 | 634 | } |
603 | 635 | |
604 | 636 | // Any custom fields for standard placement? |
605 | - if (!empty($message['custom_fields']['standard'])) |
|
606 | - foreach ($message['custom_fields']['standard'] as $custom) |
|
637 | + if (!empty($message['custom_fields']['standard'])) { |
|
638 | + foreach ($message['custom_fields']['standard'] as $custom) |
|
607 | 639 | echo ' |
608 | 640 | <li class="custom ', $custom['col_name'], '">', $custom['title'], ': ', $custom['value'], '</li>'; |
641 | + } |
|
609 | 642 | |
610 | 643 | } |
611 | 644 | // Otherwise, show the guest's email. |
612 | - elseif (!empty($message['member']['email']) && $message['member']['show_email']) |
|
613 | - echo ' |
|
645 | + elseif (!empty($message['member']['email']) && $message['member']['show_email']) { |
|
646 | + echo ' |
|
614 | 647 | <li class="email"><a href="mailto:' . $message['member']['email'] . '" rel="nofollow">', ($settings['use_image_buttons'] ? '<span class="generic_icons mail centericon" title="' . $txt['email'] . '"></span>' : $txt['email']), '</a></li>'; |
648 | + } |
|
615 | 649 | |
616 | 650 | // Show the IP to this user for this post - because you can moderate? |
617 | - if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) |
|
618 | - echo ' |
|
651 | + if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) { |
|
652 | + echo ' |
|
619 | 653 | <li class="poster_ip"><a href="', $scripturl, '?action=', !empty($message['member']['is_guest']) ? 'trackip' : 'profile;area=tracking;sa=ip;u=' . $message['member']['id'], ';searchip=', $message['member']['ip'], '">', $message['member']['ip'], '</a> <a href="', $scripturl, '?action=helpadmin;help=see_admin_ip" onclick="return reqOverlayDiv(this.href);" class="help">(?)</a></li>'; |
654 | + } |
|
620 | 655 | |
621 | 656 | // Or, should we show it because this is you? |
622 | - elseif ($message['can_see_ip']) |
|
623 | - echo ' |
|
657 | + elseif ($message['can_see_ip']) { |
|
658 | + echo ' |
|
624 | 659 | <li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $message['member']['ip'], '</a></li>'; |
660 | + } |
|
625 | 661 | |
626 | 662 | // Okay, are you at least logged in? Then we can show something about why IPs are logged... |
627 | - elseif (!$context['user']['is_guest']) |
|
628 | - echo ' |
|
663 | + elseif (!$context['user']['is_guest']) { |
|
664 | + echo ' |
|
629 | 665 | <li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $txt['logged'], '</a></li>'; |
666 | + } |
|
630 | 667 | |
631 | 668 | // Otherwise, you see NOTHING! |
632 | - else |
|
633 | - echo ' |
|
669 | + else { |
|
670 | + echo ' |
|
634 | 671 | <li class="poster_ip">', $txt['logged'], '</li>'; |
672 | + } |
|
635 | 673 | |
636 | 674 | // Are we showing the warning status? |
637 | 675 | // Don't show these things for guests. |
638 | - if (!$message['member']['is_guest'] && $message['member']['can_see_warning']) |
|
639 | - echo ' |
|
676 | + if (!$message['member']['is_guest'] && $message['member']['can_see_warning']) { |
|
677 | + echo ' |
|
640 | 678 | <li class="warning">', $context['can_issue_warning'] ? '<a href="' . $scripturl . '?action=profile;area=issuewarning;u=' . $message['member']['id'] . '">' : '', '<span class="generic_icons warning_', $message['member']['warning_status'], '"></span> ', $context['can_issue_warning'] ? '</a>' : '', '<span class="warn_', $message['member']['warning_status'], '">', $txt['warn_' . $message['member']['warning_status']], '</span></li>'; |
679 | + } |
|
641 | 680 | |
642 | 681 | // Are there any custom fields to show at the bottom of the poster info? |
643 | - if (!empty($message['custom_fields']['bottom_poster'])) |
|
644 | - foreach ($message['custom_fields']['bottom_poster'] as $custom) |
|
682 | + if (!empty($message['custom_fields']['bottom_poster'])) { |
|
683 | + foreach ($message['custom_fields']['bottom_poster'] as $custom) |
|
645 | 684 | echo ' |
646 | 685 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
686 | + } |
|
647 | 687 | |
648 | 688 | // Poster info ends. |
649 | 689 | echo ' |
@@ -672,9 +712,10 @@ discard block |
||
672 | 712 | echo ' |
673 | 713 | <span class="smalltext modified" id="modified_', $message['id'], '">'; |
674 | 714 | |
675 | - if (!empty($modSettings['show_modify']) && !empty($message['modified']['name'])) |
|
676 | - echo |
|
715 | + if (!empty($modSettings['show_modify']) && !empty($message['modified']['name'])) { |
|
716 | + echo |
|
677 | 717 | $message['modified']['last_edit_text']; |
718 | + } |
|
678 | 719 | |
679 | 720 | echo ' |
680 | 721 | </span>'; |
@@ -685,22 +726,24 @@ discard block |
||
685 | 726 | </div>'; |
686 | 727 | |
687 | 728 | // Ignoring this user? Hide the post. |
688 | - if ($ignoring) |
|
689 | - echo ' |
|
729 | + if ($ignoring) { |
|
730 | + echo ' |
|
690 | 731 | <div id="msg_', $message['id'], '_ignored_prompt"> |
691 | 732 | ', $txt['ignoring_user'], ' |
692 | 733 | <a href="#" id="msg_', $message['id'], '_ignored_link" style="display: none;">', $txt['show_ignore_user_post'], '</a> |
693 | 734 | </div>'; |
735 | + } |
|
694 | 736 | |
695 | 737 | // Show the post itself, finally! |
696 | 738 | echo ' |
697 | 739 | <div class="post">'; |
698 | 740 | |
699 | - if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id']) |
|
700 | - echo ' |
|
741 | + if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id']) { |
|
742 | + echo ' |
|
701 | 743 | <div class="approve_post"> |
702 | 744 | ', $txt['post_awaiting_approval'], ' |
703 | 745 | </div>'; |
746 | + } |
|
704 | 747 | echo ' |
705 | 748 | <div class="inner" data-msgid="', $message['id'], '" id="msg_', $message['id'], '"', $ignoring ? ' style="display:none;"' : '', '>', $message['body'], '</div> |
706 | 749 | </div>'; |
@@ -717,9 +760,9 @@ discard block |
||
717 | 760 | foreach ($message['attachment'] as $attachment) |
718 | 761 | { |
719 | 762 | // Do we want this attachment to not be showed here? |
720 | - if (!empty($modSettings['dont_show_attach_under_post']) && !empty($context['show_attach_under_post'][$attachment['id']])) |
|
721 | - continue; |
|
722 | - elseif (!$div_output) |
|
763 | + if (!empty($modSettings['dont_show_attach_under_post']) && !empty($context['show_attach_under_post'][$attachment['id']])) { |
|
764 | + continue; |
|
765 | + } elseif (!$div_output) |
|
723 | 766 | { |
724 | 767 | $div_output = true; |
725 | 768 | |
@@ -735,9 +778,10 @@ discard block |
||
735 | 778 | <fieldset> |
736 | 779 | <legend>', $txt['attach_awaiting_approve']; |
737 | 780 | |
738 | - if ($context['can_approve']) |
|
739 | - echo ' |
|
781 | + if ($context['can_approve']) { |
|
782 | + echo ' |
|
740 | 783 | [<a href="', $scripturl, '?action=attachapprove;sa=all;mid=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve_all'], '</a>]'; |
784 | + } |
|
741 | 785 | |
742 | 786 | echo ' |
743 | 787 | </legend>'; |
@@ -751,12 +795,13 @@ discard block |
||
751 | 795 | echo ' |
752 | 796 | <div class="attachments_top">'; |
753 | 797 | |
754 | - if ($attachment['thumbnail']['has_thumb']) |
|
755 | - echo ' |
|
798 | + if ($attachment['thumbnail']['has_thumb']) { |
|
799 | + echo ' |
|
756 | 800 | <a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" class="atc_img"></a>'; |
757 | - else |
|
758 | - echo ' |
|
801 | + } else { |
|
802 | + echo ' |
|
759 | 803 | <img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" class="atc_img">'; |
804 | + } |
|
760 | 805 | |
761 | 806 | echo ' |
762 | 807 | </div>'; |
@@ -766,9 +811,10 @@ discard block |
||
766 | 811 | <div class="attachments_bot"> |
767 | 812 | <a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.png" class="centericon" alt="*"> ' . $attachment['name'] . '</a> '; |
768 | 813 | |
769 | - if (!$attachment['is_approved'] && $context['can_approve']) |
|
770 | - echo ' |
|
814 | + if (!$attachment['is_approved'] && $context['can_approve']) { |
|
815 | + echo ' |
|
771 | 816 | [<a href="', $scripturl, '?action=attachapprove;sa=approve;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve'], '</a>] | [<a href="', $scripturl, '?action=attachapprove;sa=reject;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['delete'], '</a>] '; |
817 | + } |
|
772 | 818 | echo ' |
773 | 819 | <br>', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . '<br>' . sprintf($txt['attach_viewed'], $attachment['downloads']) : '<br>' . sprintf($txt['attach_downloaded'], $attachment['downloads'])), ' |
774 | 820 | </div>'; |
@@ -777,33 +823,38 @@ discard block |
||
777 | 823 | </div>'; |
778 | 824 | |
779 | 825 | // Next attachment line ? |
780 | - if (++$i % $attachments_per_line === 0) |
|
781 | - echo ' |
|
826 | + if (++$i % $attachments_per_line === 0) { |
|
827 | + echo ' |
|
782 | 828 | <br>'; |
829 | + } |
|
783 | 830 | } |
784 | 831 | |
785 | 832 | // If we had unapproved attachments clean up. |
786 | - if ($last_approved_state == 0) |
|
787 | - echo ' |
|
833 | + if ($last_approved_state == 0) { |
|
834 | + echo ' |
|
788 | 835 | </fieldset>'; |
836 | + } |
|
789 | 837 | |
790 | 838 | // Only do this if we output a div above - otherwise it'll break things |
791 | - if ($div_output) |
|
792 | - echo ' |
|
839 | + if ($div_output) { |
|
840 | + echo ' |
|
793 | 841 | </div>'; |
842 | + } |
|
794 | 843 | } |
795 | 844 | |
796 | 845 | // And stuff below the attachments. |
797 | - if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) |
|
798 | - echo ' |
|
846 | + if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) { |
|
847 | + echo ' |
|
799 | 848 | <div class="under_message">'; |
849 | + } |
|
800 | 850 | |
801 | 851 | // Maybe they want to report this post to the moderator(s)? |
802 | - if ($context['can_report_moderator']) |
|
803 | - echo ' |
|
852 | + if ($context['can_report_moderator']) { |
|
853 | + echo ' |
|
804 | 854 | <ul class="floatright smalltext"> |
805 | 855 | <li class="report_link"><a href="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '">', $txt['report_to_mod'], '</a></li> |
806 | 856 | </ul>'; |
857 | + } |
|
807 | 858 | |
808 | 859 | // What about likes? |
809 | 860 | if (!empty($modSettings['enable_likes'])) |
@@ -844,78 +895,91 @@ discard block |
||
844 | 895 | <ul class="quickbuttons">'; |
845 | 896 | |
846 | 897 | // Can they quote? if so they can select and quote as well! |
847 | - if ($context['can_quote']) |
|
848 | - echo ' |
|
898 | + if ($context['can_quote']) { |
|
899 | + echo ' |
|
849 | 900 | <li><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '" onclick="return oQuickReply.quote(', $message['id'], ');"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li> |
850 | 901 | <li style="display:none;" id="quoteSelected_', $message['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'], '</a></li>'; |
902 | + } |
|
851 | 903 | |
852 | 904 | // Can the user modify the contents of this post? Show the modify inline image. |
853 | - if ($message['can_modify']) |
|
854 | - echo ' |
|
905 | + if ($message['can_modify']) { |
|
906 | + echo ' |
|
855 | 907 | <li class="quick_edit"><a title="', $txt['modify_msg'], '" class="modifybutton" id="modify_button_', $message['id'], '" onclick="oQuickModify.modifyMsg(\'', $message['id'], '\', \'', !empty($modSettings['toggle_subject']), '\')"><span class="generic_icons quick_edit_button"></span>', $txt['quick_edit'], '</a></li>'; |
908 | + } |
|
856 | 909 | |
857 | - if ($message['can_approve'] || $message['can_unapprove'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) |
|
858 | - echo ' |
|
910 | + if ($message['can_approve'] || $message['can_unapprove'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) { |
|
911 | + echo ' |
|
859 | 912 | <li class="post_options">', $txt['post_options']; |
913 | + } |
|
860 | 914 | |
861 | 915 | echo ' |
862 | 916 | <ul>'; |
863 | 917 | |
864 | 918 | // Can the user modify the contents of this post? |
865 | - if ($message['can_modify']) |
|
866 | - echo ' |
|
919 | + if ($message['can_modify']) { |
|
920 | + echo ' |
|
867 | 921 | <li><a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], '"><span class="generic_icons modify_button"></span>', $txt['modify'], '</a></li>'; |
922 | + } |
|
868 | 923 | |
869 | 924 | // How about... even... remove it entirely?! |
870 | - if ($context['can_delete'] && ($context['topic_first_message'] == $message['id'])) |
|
871 | - echo ' |
|
925 | + if ($context['can_delete'] && ($context['topic_first_message'] == $message['id'])) { |
|
926 | + echo ' |
|
872 | 927 | <li><a href="', $scripturl, '?action=removetopic2;topic=', $context['current_topic'], '.', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['are_sure_remove_topic'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove_topic'], '</a></li>'; |
873 | - elseif ($message['can_remove'] && ($context['topic_first_message'] != $message['id'])) |
|
874 | - echo ' |
|
928 | + } elseif ($message['can_remove'] && ($context['topic_first_message'] != $message['id'])) { |
|
929 | + echo ' |
|
875 | 930 | <li><a href="', $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['remove_message_question'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove'], '</a></li>'; |
931 | + } |
|
876 | 932 | |
877 | 933 | // What about splitting it off the rest of the topic? |
878 | - if ($context['can_split'] && !empty($context['real_num_replies'])) |
|
879 | - echo ' |
|
934 | + if ($context['can_split'] && !empty($context['real_num_replies'])) { |
|
935 | + echo ' |
|
880 | 936 | <li><a href="', $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '"><span class="generic_icons split_button"></span>', $txt['split'], '</a></li>'; |
937 | + } |
|
881 | 938 | |
882 | 939 | // Can we issue a warning because of this post? Remember, we can't give guests warnings. |
883 | - if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest']) |
|
884 | - echo ' |
|
940 | + if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest']) { |
|
941 | + echo ' |
|
885 | 942 | <li><a href="', $scripturl, '?action=profile;area=issuewarning;u=', $message['member']['id'], ';msg=', $message['id'], '"><span class="generic_icons warn_button"></span>', $txt['issue_warning'], '</a></li>'; |
943 | + } |
|
886 | 944 | |
887 | 945 | // Can we restore topics? |
888 | - if ($context['can_restore_msg']) |
|
889 | - echo ' |
|
946 | + if ($context['can_restore_msg']) { |
|
947 | + echo ' |
|
890 | 948 | <li><a href="', $scripturl, '?action=restoretopic;msgs=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons restore_button"></span>', $txt['restore_message'], '</a></li>'; |
949 | + } |
|
891 | 950 | |
892 | 951 | // Maybe we can approve it, maybe we should? |
893 | - if ($message['can_approve']) |
|
894 | - echo ' |
|
952 | + if ($message['can_approve']) { |
|
953 | + echo ' |
|
895 | 954 | <li><a href="', $scripturl, '?action=moderate;area=postmod;sa=approve;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons approve_button"></span>', $txt['approve'], '</a></li>'; |
955 | + } |
|
896 | 956 | |
897 | 957 | // Maybe we can unapprove it? |
898 | - if ($message['can_unapprove']) |
|
899 | - echo ' |
|
958 | + if ($message['can_unapprove']) { |
|
959 | + echo ' |
|
900 | 960 | <li><a href="', $scripturl, '?action=moderate;area=postmod;sa=approve;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons unapprove_button"></span>', $txt['unapprove'], '</a></li>'; |
961 | + } |
|
901 | 962 | |
902 | 963 | echo ' |
903 | 964 | </ul> |
904 | 965 | </li>'; |
905 | 966 | |
906 | 967 | // Show a checkbox for quick moderation? |
907 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove']) |
|
908 | - echo ' |
|
968 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove']) { |
|
969 | + echo ' |
|
909 | 970 | <li style="display: none;" id="in_topic_mod_check_', $message['id'], '"></li>'; |
971 | + } |
|
910 | 972 | |
911 | - if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) |
|
912 | - echo ' |
|
973 | + if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) { |
|
974 | + echo ' |
|
913 | 975 | </ul>'; |
976 | + } |
|
914 | 977 | } |
915 | 978 | |
916 | - if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) |
|
917 | - echo ' |
|
979 | + if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) { |
|
980 | + echo ' |
|
918 | 981 | </div>'; |
982 | + } |
|
919 | 983 | |
920 | 984 | echo ' |
921 | 985 | </div> |
@@ -928,9 +992,10 @@ discard block |
||
928 | 992 | <div class="custom_fields_above_signature"> |
929 | 993 | <ul class="nolist">'; |
930 | 994 | |
931 | - foreach ($message['custom_fields']['above_signature'] as $custom) |
|
932 | - echo ' |
|
995 | + foreach ($message['custom_fields']['above_signature'] as $custom) { |
|
996 | + echo ' |
|
933 | 997 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
998 | + } |
|
934 | 999 | |
935 | 1000 | echo ' |
936 | 1001 | </ul> |
@@ -938,9 +1003,10 @@ discard block |
||
938 | 1003 | } |
939 | 1004 | |
940 | 1005 | // Show the member's signature? |
941 | - if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) |
|
942 | - echo ' |
|
1006 | + if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) { |
|
1007 | + echo ' |
|
943 | 1008 | <div class="signature" id="msg_', $message['id'], '_signature"', $ignoring ? ' style="display:none;"' : '', '>', $message['member']['signature'], '</div>'; |
1009 | + } |
|
944 | 1010 | |
945 | 1011 | |
946 | 1012 | // Are there any custom profile fields for below the signature? |
@@ -950,9 +1016,10 @@ discard block |
||
950 | 1016 | <div class="custom_fields_below_signature"> |
951 | 1017 | <ul class="nolist">'; |
952 | 1018 | |
953 | - foreach ($message['custom_fields']['below_signature'] as $custom) |
|
954 | - echo ' |
|
1019 | + foreach ($message['custom_fields']['below_signature'] as $custom) { |
|
1020 | + echo ' |
|
955 | 1021 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
1022 | + } |
|
956 | 1023 | |
957 | 1024 | echo ' |
958 | 1025 | </ul> |
@@ -1000,8 +1067,8 @@ discard block |
||
1000 | 1067 | <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '">'; |
1001 | 1068 | |
1002 | 1069 | // Guests just need more. |
1003 | - if ($context['user']['is_guest']) |
|
1004 | - echo ' |
|
1070 | + if ($context['user']['is_guest']) { |
|
1071 | + echo ' |
|
1005 | 1072 | <dl id="post_header"> |
1006 | 1073 | <dt> |
1007 | 1074 | ', $txt['name'], ': |
@@ -1016,6 +1083,7 @@ discard block |
||
1016 | 1083 | <input type="email" name="email" size="25" value="', $context['email'], '" tabindex="', $context['tabindex']++, '" class="input_text" required> |
1017 | 1084 | </dd> |
1018 | 1085 | </dl>'; |
1086 | + } |
|
1019 | 1087 | |
1020 | 1088 | echo ' |
1021 | 1089 | ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'), ' |
@@ -1063,8 +1131,8 @@ discard block |
||
1063 | 1131 | <br class="clear">'; |
1064 | 1132 | |
1065 | 1133 | // draft autosave available and the user has it enabled? |
1066 | - if (!empty($context['drafts_autosave'])) |
|
1067 | - echo ' |
|
1134 | + if (!empty($context['drafts_autosave'])) { |
|
1135 | + echo ' |
|
1068 | 1136 | <script> |
1069 | 1137 | var oDraftAutoSave = new smf_DraftAutoSave({ |
1070 | 1138 | sSelf: \'oDraftAutoSave\', |
@@ -1076,10 +1144,12 @@ discard block |
||
1076 | 1144 | iFreq: ', (empty($modSettings['masterAutoSaveDraftsDelay']) ? 60000 : $modSettings['masterAutoSaveDraftsDelay'] * 1000), ' |
1077 | 1145 | }); |
1078 | 1146 | </script>'; |
1147 | + } |
|
1079 | 1148 | |
1080 | - if ($context['show_spellchecking']) |
|
1081 | - echo ' |
|
1149 | + if ($context['show_spellchecking']) { |
|
1150 | + echo ' |
|
1082 | 1151 | <form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"><input type="hidden" name="spellstring" value=""></form>'; |
1152 | + } |
|
1083 | 1153 | |
1084 | 1154 | echo ' |
1085 | 1155 | <script> |