@@ -43,28 +43,33 @@ discard block |
||
| 43 | 43 | </div> |
| 44 | 44 | <div class="list_posts">', $post['message'], '</div>'; |
| 45 | 45 | |
| 46 | - if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) |
|
| 47 | - echo ' |
|
| 46 | + if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) { |
|
| 47 | + echo ' |
|
| 48 | 48 | <ul class="quickbuttons">'; |
| 49 | + } |
|
| 49 | 50 | |
| 50 | 51 | // If they *can* reply? |
| 51 | - if ($post['can_reply']) |
|
| 52 | - echo ' |
|
| 52 | + if ($post['can_reply']) { |
|
| 53 | + echo ' |
|
| 53 | 54 | <li><a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>'; |
| 55 | + } |
|
| 54 | 56 | |
| 55 | 57 | // If they *can* quote? |
| 56 | - if ($post['can_quote']) |
|
| 57 | - echo ' |
|
| 58 | + if ($post['can_quote']) { |
|
| 59 | + echo ' |
|
| 58 | 60 | <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>'; |
| 61 | + } |
|
| 59 | 62 | |
| 60 | 63 | // How about... even... remove it entirely?! |
| 61 | - if ($post['can_delete']) |
|
| 62 | - echo ' |
|
| 64 | + if ($post['can_delete']) { |
|
| 65 | + echo ' |
|
| 63 | 66 | <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>'; |
| 67 | + } |
|
| 64 | 68 | |
| 65 | - if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) |
|
| 66 | - echo ' |
|
| 69 | + if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) { |
|
| 70 | + echo ' |
|
| 67 | 71 | </ul>'; |
| 72 | + } |
|
| 68 | 73 | |
| 69 | 74 | echo ' |
| 70 | 75 | </div><!-- $post[css_class] -->'; |
@@ -86,12 +91,13 @@ discard block |
||
| 86 | 91 | echo ' |
| 87 | 92 | <div id="recent" class="main_content">'; |
| 88 | 93 | |
| 89 | - if ($context['showCheckboxes']) |
|
| 90 | - echo ' |
|
| 94 | + if ($context['showCheckboxes']) { |
|
| 95 | + echo ' |
|
| 91 | 96 | <form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm"> |
| 92 | 97 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 93 | 98 | <input type="hidden" name="qaction" value="markread"> |
| 94 | 99 | <input type="hidden" name="redirect_url" value="action=unread', (!empty($context['showing_all_topics']) ? ';all' : ''), $context['querystring_board_limits'], '">'; |
| 100 | + } |
|
| 95 | 101 | |
| 96 | 102 | if (!empty($context['topics'])) |
| 97 | 103 | { |
@@ -120,11 +126,12 @@ discard block |
||
| 120 | 126 | </div>'; |
| 121 | 127 | |
| 122 | 128 | // Show a "select all" box for quick moderation? |
| 123 | - if ($context['showCheckboxes']) |
|
| 124 | - echo ' |
|
| 129 | + if ($context['showCheckboxes']) { |
|
| 130 | + echo ' |
|
| 125 | 131 | <div class="moderation"> |
| 126 | 132 | <input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');"> |
| 127 | 133 | </div>'; |
| 134 | + } |
|
| 128 | 135 | |
| 129 | 136 | echo ' |
| 130 | 137 | </div><!-- #topic_header --> |
@@ -143,15 +150,18 @@ discard block |
||
| 143 | 150 | // Now we handle the icons |
| 144 | 151 | echo ' |
| 145 | 152 | <div class="icons floatright">'; |
| 146 | - if ($topic['is_locked']) |
|
| 147 | - echo ' |
|
| 153 | + if ($topic['is_locked']) { |
|
| 154 | + echo ' |
|
| 148 | 155 | <span class="generic_icons lock"></span>'; |
| 149 | - if ($topic['is_sticky']) |
|
| 150 | - echo ' |
|
| 156 | + } |
|
| 157 | + if ($topic['is_sticky']) { |
|
| 158 | + echo ' |
|
| 151 | 159 | <span class="generic_icons sticky"></span>'; |
| 152 | - if ($topic['is_poll']) |
|
| 153 | - echo ' |
|
| 160 | + } |
|
| 161 | + if ($topic['is_poll']) { |
|
| 162 | + echo ' |
|
| 154 | 163 | <span class="generic_icons poll"></span>'; |
| 164 | + } |
|
| 155 | 165 | echo ' |
| 156 | 166 | </div>'; |
| 157 | 167 | |
@@ -176,19 +186,21 @@ discard block |
||
| 176 | 186 | ', sprintf($txt['last_post_topic'], '<a href="' . $topic['last_post']['href'] . '">' . $topic['last_post']['time'] . '</a>', $topic['last_post']['member']['link']), ' |
| 177 | 187 | </div>'; |
| 178 | 188 | |
| 179 | - if ($context['showCheckboxes']) |
|
| 180 | - echo ' |
|
| 189 | + if ($context['showCheckboxes']) { |
|
| 190 | + echo ' |
|
| 181 | 191 | <div class="moderation"> |
| 182 | 192 | <input type="checkbox" name="topics[]" value="', $topic['id'], '"> |
| 183 | 193 | </div>'; |
| 194 | + } |
|
| 184 | 195 | |
| 185 | 196 | echo ' |
| 186 | 197 | </div><!-- $topic[css_class] -->'; |
| 187 | 198 | } |
| 188 | 199 | |
| 189 | - if (empty($context['topics'])) |
|
| 190 | - echo ' |
|
| 200 | + if (empty($context['topics'])) { |
|
| 201 | + echo ' |
|
| 191 | 202 | <div style="display: none;"></div>'; |
| 203 | + } |
|
| 192 | 204 | |
| 193 | 205 | echo ' |
| 194 | 206 | </div><!-- #topic_container --> |
@@ -203,25 +215,27 @@ discard block |
||
| 203 | 215 | ', $context['page_index'], ' |
| 204 | 216 | </div> |
| 205 | 217 | </div>'; |
| 206 | - } |
|
| 207 | - else |
|
| 208 | - echo ' |
|
| 218 | + } else { |
|
| 219 | + echo ' |
|
| 209 | 220 | <div class="cat_bar"> |
| 210 | 221 | <h3 class="catbg centertext"> |
| 211 | 222 | ', $context['showing_all_topics'] ? $txt['topic_alert_none'] : $txt['unread_topics_visit_none'], ' |
| 212 | 223 | </h3> |
| 213 | 224 | </div>'; |
| 225 | + } |
|
| 214 | 226 | |
| 215 | - if ($context['showCheckboxes']) |
|
| 216 | - echo ' |
|
| 227 | + if ($context['showCheckboxes']) { |
|
| 228 | + echo ' |
|
| 217 | 229 | </form>'; |
| 230 | + } |
|
| 218 | 231 | |
| 219 | 232 | echo ' |
| 220 | 233 | </div><!-- #recent -->'; |
| 221 | 234 | |
| 222 | - if (empty($context['no_topic_listing'])) |
|
| 223 | - template_topic_legend(); |
|
| 224 | -} |
|
| 235 | + if (empty($context['no_topic_listing'])) { |
|
| 236 | + template_topic_legend(); |
|
| 237 | + } |
|
| 238 | + } |
|
| 225 | 239 | |
| 226 | 240 | /** |
| 227 | 241 | * Template for showing unread replies (eg new replies to topics you've posted in) |
@@ -233,12 +247,13 @@ discard block |
||
| 233 | 247 | echo ' |
| 234 | 248 | <div id="recent">'; |
| 235 | 249 | |
| 236 | - if ($context['showCheckboxes']) |
|
| 237 | - echo ' |
|
| 250 | + if ($context['showCheckboxes']) { |
|
| 251 | + echo ' |
|
| 238 | 252 | <form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm"> |
| 239 | 253 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 240 | 254 | <input type="hidden" name="qaction" value="markread"> |
| 241 | 255 | <input type="hidden" name="redirect_url" value="action=unreadreplies', (!empty($context['showing_all_topics']) ? ';all' : ''), $context['querystring_board_limits'], '">'; |
| 256 | + } |
|
| 242 | 257 | |
| 243 | 258 | if (!empty($context['topics'])) |
| 244 | 259 | { |
@@ -267,11 +282,12 @@ discard block |
||
| 267 | 282 | </div>'; |
| 268 | 283 | |
| 269 | 284 | // Show a "select all" box for quick moderation? |
| 270 | - if ($context['showCheckboxes']) |
|
| 271 | - echo ' |
|
| 285 | + if ($context['showCheckboxes']) { |
|
| 286 | + echo ' |
|
| 272 | 287 | <div class="moderation"> |
| 273 | 288 | <input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');"> |
| 274 | 289 | </div>'; |
| 290 | + } |
|
| 275 | 291 | |
| 276 | 292 | echo ' |
| 277 | 293 | </div><!-- #topic_header --> |
@@ -290,15 +306,18 @@ discard block |
||
| 290 | 306 | // Now we handle the icons |
| 291 | 307 | echo ' |
| 292 | 308 | <div class="icons floatright">'; |
| 293 | - if ($topic['is_locked']) |
|
| 294 | - echo ' |
|
| 309 | + if ($topic['is_locked']) { |
|
| 310 | + echo ' |
|
| 295 | 311 | <span class="generic_icons lock"></span>'; |
| 296 | - if ($topic['is_sticky']) |
|
| 297 | - echo ' |
|
| 312 | + } |
|
| 313 | + if ($topic['is_sticky']) { |
|
| 314 | + echo ' |
|
| 298 | 315 | <span class="generic_icons sticky"></span>'; |
| 299 | - if ($topic['is_poll']) |
|
| 300 | - echo ' |
|
| 316 | + } |
|
| 317 | + if ($topic['is_poll']) { |
|
| 318 | + echo ' |
|
| 301 | 319 | <span class="generic_icons poll"></span>'; |
| 320 | + } |
|
| 302 | 321 | echo ' |
| 303 | 322 | </div>'; |
| 304 | 323 | |
@@ -323,11 +342,12 @@ discard block |
||
| 323 | 342 | ', sprintf($txt['last_post_topic'], '<a href="' . $topic['last_post']['href'] . '">' . $topic['last_post']['time'] . '</a>', $topic['last_post']['member']['link']), ' |
| 324 | 343 | </div>'; |
| 325 | 344 | |
| 326 | - if ($context['showCheckboxes']) |
|
| 327 | - echo ' |
|
| 345 | + if ($context['showCheckboxes']) { |
|
| 346 | + echo ' |
|
| 328 | 347 | <div class="moderation"> |
| 329 | 348 | <input type="checkbox" name="topics[]" value="', $topic['id'], '"> |
| 330 | 349 | </div>'; |
| 350 | + } |
|
| 331 | 351 | echo ' |
| 332 | 352 | </div><!-- $topic[css_class] -->'; |
| 333 | 353 | } |
@@ -343,24 +363,26 @@ discard block |
||
| 343 | 363 | ', $context['page_index'], ' |
| 344 | 364 | </div> |
| 345 | 365 | </div>'; |
| 346 | - } |
|
| 347 | - else |
|
| 348 | - echo ' |
|
| 366 | + } else { |
|
| 367 | + echo ' |
|
| 349 | 368 | <div class="cat_bar"> |
| 350 | 369 | <h3 class="catbg centertext"> |
| 351 | 370 | ', $context['showing_all_topics'] ? $txt['topic_alert_none'] : $txt['unread_topics_visit_none'], ' |
| 352 | 371 | </h3> |
| 353 | 372 | </div>'; |
| 373 | + } |
|
| 354 | 374 | |
| 355 | - if ($context['showCheckboxes']) |
|
| 356 | - echo ' |
|
| 375 | + if ($context['showCheckboxes']) { |
|
| 376 | + echo ' |
|
| 357 | 377 | </form>'; |
| 378 | + } |
|
| 358 | 379 | |
| 359 | 380 | echo ' |
| 360 | 381 | </div><!-- #recent -->'; |
| 361 | 382 | |
| 362 | - if (empty($context['no_topic_listing'])) |
|
| 363 | - template_topic_legend(); |
|
| 364 | -} |
|
| 383 | + if (empty($context['no_topic_listing'])) { |
|
| 384 | + template_topic_legend(); |
|
| 385 | + } |
|
| 386 | + } |
|
| 365 | 387 | |
| 366 | 388 | ?> |
| 367 | 389 | \ No newline at end of file |
@@ -22,27 +22,31 @@ discard block |
||
| 22 | 22 | // Get a shortcut to the current list. |
| 23 | 23 | $list_id = $list_id === null ? (!empty($context['default_list']) ? $context['default_list'] : '') : $list_id; |
| 24 | 24 | |
| 25 | - if (empty($list_id) || empty($context[$list_id])) |
|
| 26 | - return; |
|
| 25 | + if (empty($list_id) || empty($context[$list_id])) { |
|
| 26 | + return; |
|
| 27 | + } |
|
| 27 | 28 | |
| 28 | 29 | $cur_list = &$context[$list_id]; |
| 29 | 30 | |
| 30 | 31 | // These are the main tabs that is used all around the template. |
| 31 | - if (isset($cur_list['list_menu'], $cur_list['list_menu']['show_on']) && ($cur_list['list_menu']['show_on'] == 'both' || $cur_list['list_menu']['show_on'] == 'top')) |
|
| 32 | - template_create_list_menu($cur_list['list_menu'], 'top'); |
|
| 32 | + if (isset($cur_list['list_menu'], $cur_list['list_menu']['show_on']) && ($cur_list['list_menu']['show_on'] == 'both' || $cur_list['list_menu']['show_on'] == 'top')) { |
|
| 33 | + template_create_list_menu($cur_list['list_menu'], 'top'); |
|
| 34 | + } |
|
| 33 | 35 | |
| 34 | - if (isset($cur_list['form'])) |
|
| 35 | - echo ' |
|
| 36 | + if (isset($cur_list['form'])) { |
|
| 37 | + echo ' |
|
| 36 | 38 | <form action="', $cur_list['form']['href'], '" method="post"', empty($cur_list['form']['name']) ? '' : ' name="' . $cur_list['form']['name'] . '" id="' . $cur_list['form']['name'] . '"', ' accept-charset="', $context['character_set'], '">'; |
| 39 | + } |
|
| 37 | 40 | |
| 38 | 41 | // Show the title of the table (if any). |
| 39 | - if (!empty($cur_list['title'])) |
|
| 40 | - echo ' |
|
| 42 | + if (!empty($cur_list['title'])) { |
|
| 43 | + echo ' |
|
| 41 | 44 | <div class="cat_bar"> |
| 42 | 45 | <h3 class="catbg"> |
| 43 | 46 | ', $cur_list['title'], ' |
| 44 | 47 | </h3> |
| 45 | 48 | </div>'; |
| 49 | + } |
|
| 46 | 50 | |
| 47 | 51 | if (isset($cur_list['additional_rows']['after_title'])) |
| 48 | 52 | { |
@@ -55,20 +59,23 @@ discard block |
||
| 55 | 59 | </div>'; |
| 56 | 60 | } |
| 57 | 61 | |
| 58 | - if (isset($cur_list['additional_rows']['top_of_list'])) |
|
| 59 | - template_additional_rows('top_of_list', $cur_list); |
|
| 62 | + if (isset($cur_list['additional_rows']['top_of_list'])) { |
|
| 63 | + template_additional_rows('top_of_list', $cur_list); |
|
| 64 | + } |
|
| 60 | 65 | |
| 61 | 66 | if ((!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) || isset($cur_list['additional_rows']['above_column_headers'])) |
| 62 | 67 | { |
| 63 | 68 | // Show the page index (if this list doesn't intend to show all items). |
| 64 | - if (!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) |
|
| 65 | - echo ' |
|
| 69 | + if (!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) { |
|
| 70 | + echo ' |
|
| 66 | 71 | <div class="floatleft"> |
| 67 | 72 | <div class="pagesection">', $cur_list['page_index'], '</div> |
| 68 | 73 | </div>'; |
| 74 | + } |
|
| 69 | 75 | |
| 70 | - if (isset($cur_list['additional_rows']['above_column_headers'])) |
|
| 71 | - template_additional_rows('above_column_headers', $cur_list); |
|
| 76 | + if (isset($cur_list['additional_rows']['above_column_headers'])) { |
|
| 77 | + template_additional_rows('above_column_headers', $cur_list); |
|
| 78 | + } |
|
| 72 | 79 | } |
| 73 | 80 | |
| 74 | 81 | echo ' |
@@ -100,13 +107,14 @@ discard block |
||
| 100 | 107 | <tbody>'; |
| 101 | 108 | |
| 102 | 109 | // Show a nice message informing there are no items in this list. |
| 103 | - if (empty($cur_list['rows']) && !empty($cur_list['no_items_label'])) |
|
| 104 | - echo ' |
|
| 110 | + if (empty($cur_list['rows']) && !empty($cur_list['no_items_label'])) { |
|
| 111 | + echo ' |
|
| 105 | 112 | <tr class="windowbg"> |
| 106 | 113 | <td colspan="', $cur_list['num_columns'], '" class="', !empty($cur_list['no_items_align']) ? $cur_list['no_items_align'] : 'centertext', '"> |
| 107 | 114 | ', $cur_list['no_items_label'], ' |
| 108 | 115 | </td> |
| 109 | 116 | </tr>'; |
| 117 | + } |
|
| 110 | 118 | |
| 111 | 119 | // Show the list rows. |
| 112 | 120 | elseif (!empty($cur_list['rows'])) |
@@ -116,12 +124,13 @@ discard block |
||
| 116 | 124 | echo ' |
| 117 | 125 | <tr class="windowbg', empty($row['class']) ? '' : ' ' . $row['class'], '"', empty($row['style']) ? '' : ' style="' . $row['style'] . '"', ' id="list_', $list_id, '_', $id, '">'; |
| 118 | 126 | |
| 119 | - if (!empty($row['data'])) |
|
| 120 | - foreach ($row['data'] as $row_data) |
|
| 127 | + if (!empty($row['data'])) { |
|
| 128 | + foreach ($row['data'] as $row_data) |
|
| 121 | 129 | echo ' |
| 122 | 130 | <td', empty($row_data['class']) ? '' : ' class="' . $row_data['class'] . '"', empty($row_data['style']) ? '' : ' style="' . $row_data['style'] . '"', '> |
| 123 | 131 | ', $row_data['value'], ' |
| 124 | 132 | </td>'; |
| 133 | + } |
|
| 125 | 134 | |
| 126 | 135 | echo ' |
| 127 | 136 | </tr>'; |
@@ -138,46 +147,53 @@ discard block |
||
| 138 | 147 | <div class="flow_auto">'; |
| 139 | 148 | |
| 140 | 149 | // Show the page index (if this list doesn't intend to show all items). |
| 141 | - if (!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) |
|
| 142 | - echo ' |
|
| 150 | + if (!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) { |
|
| 151 | + echo ' |
|
| 143 | 152 | <div class="floatleft"> |
| 144 | 153 | <div class="pagesection">', $cur_list['page_index'], '</div> |
| 145 | 154 | </div>'; |
| 155 | + } |
|
| 146 | 156 | |
| 147 | - if (isset($cur_list['additional_rows']['below_table_data'])) |
|
| 148 | - template_additional_rows('below_table_data', $cur_list); |
|
| 157 | + if (isset($cur_list['additional_rows']['below_table_data'])) { |
|
| 158 | + template_additional_rows('below_table_data', $cur_list); |
|
| 159 | + } |
|
| 149 | 160 | |
| 150 | 161 | echo ' |
| 151 | 162 | </div>'; |
| 152 | 163 | } |
| 153 | 164 | |
| 154 | - if (isset($cur_list['additional_rows']['bottom_of_list'])) |
|
| 155 | - template_additional_rows('bottom_of_list', $cur_list); |
|
| 165 | + if (isset($cur_list['additional_rows']['bottom_of_list'])) { |
|
| 166 | + template_additional_rows('bottom_of_list', $cur_list); |
|
| 167 | + } |
|
| 156 | 168 | |
| 157 | 169 | if (isset($cur_list['form'])) |
| 158 | 170 | { |
| 159 | - foreach ($cur_list['form']['hidden_fields'] as $name => $value) |
|
| 160 | - echo ' |
|
| 171 | + foreach ($cur_list['form']['hidden_fields'] as $name => $value) { |
|
| 172 | + echo ' |
|
| 161 | 173 | <input type="hidden" name="', $name, '" value="', $value, '">'; |
| 174 | + } |
|
| 162 | 175 | |
| 163 | - if (isset($cur_list['form']['token'])) |
|
| 164 | - echo ' |
|
| 176 | + if (isset($cur_list['form']['token'])) { |
|
| 177 | + echo ' |
|
| 165 | 178 | <input type="hidden" name="', $context[$cur_list['form']['token'] . '_token_var'], '" value="', $context[$cur_list['form']['token'] . '_token'], '">'; |
| 179 | + } |
|
| 166 | 180 | |
| 167 | 181 | echo ' |
| 168 | 182 | </form>'; |
| 169 | 183 | } |
| 170 | 184 | |
| 171 | 185 | // Tabs at the bottom. Usually bottom aligned. |
| 172 | - if (isset($cur_list['list_menu'], $cur_list['list_menu']['show_on']) && ($cur_list['list_menu']['show_on'] == 'both' || $cur_list['list_menu']['show_on'] == 'bottom')) |
|
| 173 | - template_create_list_menu($cur_list['list_menu'], 'bottom'); |
|
| 186 | + if (isset($cur_list['list_menu'], $cur_list['list_menu']['show_on']) && ($cur_list['list_menu']['show_on'] == 'both' || $cur_list['list_menu']['show_on'] == 'bottom')) { |
|
| 187 | + template_create_list_menu($cur_list['list_menu'], 'bottom'); |
|
| 188 | + } |
|
| 174 | 189 | |
| 175 | - if (isset($cur_list['javascript'])) |
|
| 176 | - echo ' |
|
| 190 | + if (isset($cur_list['javascript'])) { |
|
| 191 | + echo ' |
|
| 177 | 192 | <script> |
| 178 | 193 | ', $cur_list['javascript'], ' |
| 179 | 194 | </script>'; |
| 180 | -} |
|
| 195 | + } |
|
| 196 | + } |
|
| 181 | 197 | |
| 182 | 198 | /** |
| 183 | 199 | * This template displays additional rows above or below the list. |
@@ -187,12 +203,13 @@ discard block |
||
| 187 | 203 | */ |
| 188 | 204 | function template_additional_rows($row_position, $cur_list) |
| 189 | 205 | { |
| 190 | - foreach ($cur_list['additional_rows'][$row_position] as $row) |
|
| 191 | - echo ' |
|
| 206 | + foreach ($cur_list['additional_rows'][$row_position] as $row) { |
|
| 207 | + echo ' |
|
| 192 | 208 | <div class="additional_row', empty($row['class']) ? '' : ' ' . $row['class'], '"', empty($row['style']) ? '' : ' style="' . $row['style'] . '"', '> |
| 193 | 209 | ', $row['value'], ' |
| 194 | 210 | </div>'; |
| 195 | -} |
|
| 211 | + } |
|
| 212 | + } |
|
| 196 | 213 | |
| 197 | 214 | /** |
| 198 | 215 | * This function creates a menu |
@@ -251,18 +268,19 @@ discard block |
||
| 251 | 268 | |
| 252 | 269 | foreach ($list_menu['links'] as $link) |
| 253 | 270 | { |
| 254 | - if ($link['is_selected']) |
|
| 255 | - echo ' |
|
| 271 | + if ($link['is_selected']) { |
|
| 272 | + echo ' |
|
| 256 | 273 | <td class="', $direction == 'top' ? 'mirror' : 'main', 'tab_active_', $first, '"> </td> |
| 257 | 274 | <td class="', $direction == 'top' ? 'mirrortab' : 'maintab', '_active_back"> |
| 258 | 275 | <a href="', $link['href'], '">', $link['label'], '</a> |
| 259 | 276 | </td> |
| 260 | 277 | <td class="', $direction == 'top' ? 'mirror' : 'main', 'tab_active_', $last, '"> </td>'; |
| 261 | - else |
|
| 262 | - echo ' |
|
| 278 | + } else { |
|
| 279 | + echo ' |
|
| 263 | 280 | <td class="', $direction == 'top' ? 'mirror' : 'main', 'tab_back"> |
| 264 | 281 | <a href="', $link['href'], '">', $link['label'], '</a> |
| 265 | 282 | </td>'; |
| 283 | + } |
|
| 266 | 284 | } |
| 267 | 285 | |
| 268 | 286 | echo ' |
@@ -273,12 +291,12 @@ discard block |
||
| 273 | 291 | <td> </td>' : '', ' |
| 274 | 292 | </tr> |
| 275 | 293 | </table>'; |
| 276 | - } |
|
| 277 | - elseif (isset($list_menu['style']) && $list_menu['style'] == 'buttons') |
|
| 294 | + } elseif (isset($list_menu['style']) && $list_menu['style'] == 'buttons') |
|
| 278 | 295 | { |
| 279 | 296 | $links = array(); |
| 280 | - foreach ($list_menu['links'] as $link) |
|
| 281 | - $links[] = '<a href="' . $link['href'] . '">' . $link['label'] . '</a>'; |
|
| 297 | + foreach ($list_menu['links'] as $link) { |
|
| 298 | + $links[] = '<a href="' . $link['href'] . '">' . $link['label'] . '</a>'; |
|
| 299 | + } |
|
| 282 | 300 | |
| 283 | 301 | echo ' |
| 284 | 302 | <table style="margin-', $list_menu['position'], ': 10px; width: 100%;"> |
@@ -28,14 +28,15 @@ discard block |
||
| 28 | 28 | <div id="confirm_buttons">'; |
| 29 | 29 | |
| 30 | 30 | // Age restriction in effect? |
| 31 | - if ($context['show_coppa']) |
|
| 32 | - echo ' |
|
| 31 | + if ($context['show_coppa']) { |
|
| 32 | + echo ' |
|
| 33 | 33 | <input type="submit" name="accept_agreement" value="', $context['coppa_agree_above'], '" class="button"><br> |
| 34 | 34 | <br> |
| 35 | 35 | <input type="submit" name="accept_agreement_coppa" value="', $context['coppa_agree_below'], '" class="button">'; |
| 36 | - else |
|
| 37 | - echo ' |
|
| 36 | + } else { |
|
| 37 | + echo ' |
|
| 38 | 38 | <input type="submit" name="accept_agreement" value="', $txt['agreement_agree'], '" class="button">'; |
| 39 | + } |
|
| 39 | 40 | |
| 40 | 41 | echo ' |
| 41 | 42 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -78,9 +79,10 @@ discard block |
||
| 78 | 79 | <ul>'; |
| 79 | 80 | |
| 80 | 81 | // Cycle through each error and display an error message. |
| 81 | - foreach ($context['registration_errors'] as $error) |
|
| 82 | - echo ' |
|
| 82 | + foreach ($context['registration_errors'] as $error) { |
|
| 83 | + echo ' |
|
| 83 | 84 | <li>', $error, '</li>'; |
| 85 | + } |
|
| 84 | 86 | |
| 85 | 87 | echo ' |
| 86 | 88 | </ul> |
@@ -150,14 +152,15 @@ discard block |
||
| 150 | 152 | |
| 151 | 153 | <dl class="register_form">'; |
| 152 | 154 | |
| 153 | - foreach ($context['custom_fields'] as $field) |
|
| 154 | - if ($field['show_reg'] > 1) |
|
| 155 | + foreach ($context['custom_fields'] as $field) { |
|
| 156 | + if ($field['show_reg'] > 1) |
|
| 155 | 157 | echo ' |
| 156 | 158 | <dt> |
| 157 | 159 | <strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['name'], ':</strong> |
| 158 | 160 | <span class="smalltext">', $field['desc'], '</span> |
| 159 | 161 | </dt> |
| 160 | 162 | <dd>', str_replace('name="', 'tabindex="' . $context['tabindex']++ . '" name="', $field['input_html']), '</dd>'; |
| 163 | + } |
|
| 161 | 164 | |
| 162 | 165 | echo ' |
| 163 | 166 | </dl>'; |
@@ -191,41 +194,45 @@ discard block |
||
| 191 | 194 | $callback_func = 'template_profile_' . $field['callback_func']; |
| 192 | 195 | $callback_func(); |
| 193 | 196 | } |
| 194 | - } |
|
| 195 | - else |
|
| 197 | + } else |
|
| 196 | 198 | { |
| 197 | 199 | echo ' |
| 198 | 200 | <dt> |
| 199 | 201 | <strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['label'], ':</strong>'; |
| 200 | 202 | |
| 201 | 203 | // Does it have any subtext to show? |
| 202 | - if (!empty($field['subtext'])) |
|
| 203 | - echo ' |
|
| 204 | + if (!empty($field['subtext'])) { |
|
| 205 | + echo ' |
|
| 204 | 206 | <span class="smalltext">', $field['subtext'], '</span>'; |
| 207 | + } |
|
| 205 | 208 | |
| 206 | 209 | echo ' |
| 207 | 210 | </dt> |
| 208 | 211 | <dd>'; |
| 209 | 212 | |
| 210 | 213 | // Want to put something infront of the box? |
| 211 | - if (!empty($field['preinput'])) |
|
| 212 | - echo ' |
|
| 214 | + if (!empty($field['preinput'])) { |
|
| 215 | + echo ' |
|
| 213 | 216 | ', $field['preinput']; |
| 217 | + } |
|
| 214 | 218 | |
| 215 | 219 | // What type of data are we showing? |
| 216 | - if ($field['type'] == 'label') |
|
| 217 | - echo ' |
|
| 220 | + if ($field['type'] == 'label') { |
|
| 221 | + echo ' |
|
| 218 | 222 | ', $field['value']; |
| 223 | + } |
|
| 219 | 224 | |
| 220 | 225 | // Maybe it's a text box - very likely! |
| 221 | - elseif (in_array($field['type'], array('int', 'float', 'text', 'password'))) |
|
| 222 | - echo ' |
|
| 226 | + elseif (in_array($field['type'], array('int', 'float', 'text', 'password'))) { |
|
| 227 | + echo ' |
|
| 223 | 228 | <input type="', $field['type'] == 'password' ? 'password' : 'text', '" name="', $key, '" id="', $key, '" size="', empty($field['size']) ? 30 : $field['size'], '" value="', $field['value'], '" tabindex="', $context['tabindex']++, '" ', $field['input_attr'], '>'; |
| 229 | + } |
|
| 224 | 230 | |
| 225 | 231 | // You "checking" me out? ;) |
| 226 | - elseif ($field['type'] == 'check') |
|
| 227 | - echo ' |
|
| 232 | + elseif ($field['type'] == 'check') { |
|
| 233 | + echo ' |
|
| 228 | 234 | <input type="hidden" name="', $key, '" value="0"><input type="checkbox" name="', $key, '" id="', $key, '"', !empty($field['value']) ? ' checked' : '', ' value="1" tabindex="', $context['tabindex']++, '" ', $field['input_attr'], '>'; |
| 235 | + } |
|
| 229 | 236 | |
| 230 | 237 | // Always fun - select boxes! |
| 231 | 238 | elseif ($field['type'] == 'select') |
@@ -236,14 +243,16 @@ discard block |
||
| 236 | 243 | if (isset($field['options'])) |
| 237 | 244 | { |
| 238 | 245 | // Is this some code to generate the options? |
| 239 | - if (!is_array($field['options'])) |
|
| 240 | - $field['options'] = eval($field['options']); |
|
| 246 | + if (!is_array($field['options'])) { |
|
| 247 | + $field['options'] = eval($field['options']); |
|
| 248 | + } |
|
| 241 | 249 | |
| 242 | 250 | // Assuming we now have some! |
| 243 | - if (is_array($field['options'])) |
|
| 244 | - foreach ($field['options'] as $value => $name) |
|
| 251 | + if (is_array($field['options'])) { |
|
| 252 | + foreach ($field['options'] as $value => $name) |
|
| 245 | 253 | echo ' |
| 246 | 254 | <option value="', $value, '"', $value == $field['value'] ? ' selected' : '', '>', $name, '</option>'; |
| 255 | + } |
|
| 247 | 256 | } |
| 248 | 257 | |
| 249 | 258 | echo ' |
@@ -251,9 +260,10 @@ discard block |
||
| 251 | 260 | } |
| 252 | 261 | |
| 253 | 262 | // Something to end with? |
| 254 | - if (!empty($field['postinput'])) |
|
| 255 | - echo ' |
|
| 263 | + if (!empty($field['postinput'])) { |
|
| 264 | + echo ' |
|
| 256 | 265 | ', $field['postinput']; |
| 266 | + } |
|
| 257 | 267 | |
| 258 | 268 | echo ' |
| 259 | 269 | </dd>'; |
@@ -266,13 +276,14 @@ discard block |
||
| 266 | 276 | { |
| 267 | 277 | foreach ($context['custom_fields'] as $field) |
| 268 | 278 | { |
| 269 | - if ($field['show_reg'] < 2) |
|
| 270 | - echo ' |
|
| 279 | + if ($field['show_reg'] < 2) { |
|
| 280 | + echo ' |
|
| 271 | 281 | <dt> |
| 272 | 282 | <strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['name'], ':</strong> |
| 273 | 283 | <span class="smalltext">', $field['desc'], '</span> |
| 274 | 284 | </dt> |
| 275 | 285 | <dd>', $field['input_html'], '</dd>'; |
| 286 | + } |
|
| 276 | 287 | } |
| 277 | 288 | } |
| 278 | 289 | |
@@ -302,14 +313,15 @@ discard block |
||
| 302 | 313 | <div id="confirm_buttons" class="flow_auto">'; |
| 303 | 314 | |
| 304 | 315 | // Age restriction in effect? |
| 305 | - if (!$context['require_agreement'] && $context['show_coppa']) |
|
| 306 | - echo ' |
|
| 316 | + if (!$context['require_agreement'] && $context['show_coppa']) { |
|
| 317 | + echo ' |
|
| 307 | 318 | <input type="submit" name="accept_agreement" value="', $context['coppa_agree_above'], '" class="button"><br> |
| 308 | 319 | <br> |
| 309 | 320 | <input type="submit" name="accept_agreement_coppa" value="', $context['coppa_agree_below'], '" class="button">'; |
| 310 | - else |
|
| 311 | - echo ' |
|
| 321 | + } else { |
|
| 322 | + echo ' |
|
| 312 | 323 | <input type="submit" name="regSubmit" value="', $txt['register'], '" tabindex="', $context['tabindex']++, '" class="button">'; |
| 324 | + } |
|
| 313 | 325 | echo ' |
| 314 | 326 | </div> |
| 315 | 327 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -457,19 +469,20 @@ discard block |
||
| 457 | 469 | </head> |
| 458 | 470 | <body style="margin: 1ex;"> |
| 459 | 471 | <div class="windowbg description" style="text-align: center;">'; |
| 460 | - if (isBrowser('is_ie') || isBrowser('is_ie11')) |
|
| 461 | - echo ' |
|
| 472 | + if (isBrowser('is_ie') || isBrowser('is_ie11')) { |
|
| 473 | + echo ' |
|
| 462 | 474 | <object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" type="audio/x-wav"> |
| 463 | 475 | <param name="AutoStart" value="1"> |
| 464 | 476 | <param name="FileName" value="', $context['verification_sound_href'], '"> |
| 465 | 477 | </object>'; |
| 466 | - else |
|
| 467 | - echo ' |
|
| 478 | + } else { |
|
| 479 | + echo ' |
|
| 468 | 480 | <audio src="', $context['verification_sound_href'], '" controls> |
| 469 | 481 | <object type="audio/x-wav" data="', $context['verification_sound_href'], '"> |
| 470 | 482 | <a href="', $context['verification_sound_href'], '" rel="nofollow">', $context['verification_sound_href'], '</a> |
| 471 | 483 | </object> |
| 472 | 484 | </audio>'; |
| 485 | + } |
|
| 473 | 486 | echo ' |
| 474 | 487 | <br> |
| 475 | 488 | <a href="', $context['verification_sound_href'], ';sound" rel="nofollow">', $txt['visual_verification_sound_again'], '</a><br> |
@@ -496,11 +509,12 @@ discard block |
||
| 496 | 509 | </div> |
| 497 | 510 | <div id="register_screen" class="windowbg2 noup">'; |
| 498 | 511 | |
| 499 | - if (!empty($context['registration_done'])) |
|
| 500 | - echo ' |
|
| 512 | + if (!empty($context['registration_done'])) { |
|
| 513 | + echo ' |
|
| 501 | 514 | <div class="infobox"> |
| 502 | 515 | ', $context['registration_done'], ' |
| 503 | 516 | </div>'; |
| 517 | + } |
|
| 504 | 518 | |
| 505 | 519 | echo ' |
| 506 | 520 | <dl class="register_form" id="admin_register_form"> |
@@ -536,9 +550,10 @@ discard block |
||
| 536 | 550 | <dd> |
| 537 | 551 | <select name="group" id="group_select" tabindex="', $context['tabindex']++, '">'; |
| 538 | 552 | |
| 539 | - foreach ($context['member_groups'] as $id => $name) |
|
| 540 | - echo ' |
|
| 553 | + foreach ($context['member_groups'] as $id => $name) { |
|
| 554 | + echo ' |
|
| 541 | 555 | <option value="', $id, '">', $name, '</option>'; |
| 556 | + } |
|
| 542 | 557 | |
| 543 | 558 | echo ' |
| 544 | 559 | </select> |
@@ -546,8 +561,8 @@ discard block |
||
| 546 | 561 | } |
| 547 | 562 | |
| 548 | 563 | // If there is any field marked as required, show it here! |
| 549 | - if (!empty($context['custom_fields_required']) && !empty($context['custom_fields'])) |
|
| 550 | - foreach ($context['custom_fields'] as $field) |
|
| 564 | + if (!empty($context['custom_fields_required']) && !empty($context['custom_fields'])) { |
|
| 565 | + foreach ($context['custom_fields'] as $field) |
|
| 551 | 566 | if ($field['show_reg'] > 1) |
| 552 | 567 | echo ' |
| 553 | 568 | <dt> |
@@ -557,6 +572,7 @@ discard block |
||
| 557 | 572 | <dd> |
| 558 | 573 | ', str_replace('name="', 'tabindex="' . $context['tabindex']++ . '" name="', $field['input_html']), ' |
| 559 | 574 | </dd>'; |
| 575 | + } |
|
| 560 | 576 | |
| 561 | 577 | echo ' |
| 562 | 578 | <dt> |
@@ -593,12 +609,13 @@ discard block |
||
| 593 | 609 | { |
| 594 | 610 | global $context, $scripturl, $txt; |
| 595 | 611 | |
| 596 | - if (!empty($context['saved_successful'])) |
|
| 597 | - echo ' |
|
| 612 | + if (!empty($context['saved_successful'])) { |
|
| 613 | + echo ' |
|
| 598 | 614 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
| 599 | - elseif (!empty($context['could_not_save'])) |
|
| 600 | - echo ' |
|
| 615 | + } elseif (!empty($context['could_not_save'])) { |
|
| 616 | + echo ' |
|
| 601 | 617 | <div class="errorbox">', $txt['admin_agreement_not_saved'], '</div>'; |
| 618 | + } |
|
| 602 | 619 | |
| 603 | 620 | // Just a big box to edit the text file ;) |
| 604 | 621 | echo ' |
@@ -608,9 +625,10 @@ discard block |
||
| 608 | 625 | </div>'; |
| 609 | 626 | |
| 610 | 627 | // Warning for if the file isn't writable. |
| 611 | - if (!empty($context['warning'])) |
|
| 612 | - echo ' |
|
| 628 | + if (!empty($context['warning'])) { |
|
| 629 | + echo ' |
|
| 613 | 630 | <p class="error">', $context['warning'], '</p>'; |
| 631 | + } |
|
| 614 | 632 | |
| 615 | 633 | echo ' |
| 616 | 634 | <div class="windowbg2 noup" id="registration_agreement">'; |
@@ -627,9 +645,10 @@ discard block |
||
| 627 | 645 | <strong>', $txt['admin_agreement_select_language'], ':</strong> |
| 628 | 646 | <select name="agree_lang" onchange="document.getElementById(\'change_reg\').submit();" tabindex="', $context['tabindex']++, '">'; |
| 629 | 647 | |
| 630 | - foreach ($context['editable_agreements'] as $file => $name) |
|
| 631 | - echo ' |
|
| 648 | + foreach ($context['editable_agreements'] as $file => $name) { |
|
| 649 | + echo ' |
|
| 632 | 650 | <option value="', $file, '"', $context['current_agreement'] == $file ? ' selected' : '', '>', $name, '</option>'; |
| 651 | + } |
|
| 633 | 652 | |
| 634 | 653 | echo ' |
| 635 | 654 | </select> |
@@ -669,9 +688,10 @@ discard block |
||
| 669 | 688 | { |
| 670 | 689 | global $context, $scripturl, $txt; |
| 671 | 690 | |
| 672 | - if (!empty($context['saved_successful'])) |
|
| 673 | - echo ' |
|
| 691 | + if (!empty($context['saved_successful'])) { |
|
| 692 | + echo ' |
|
| 674 | 693 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
| 694 | + } |
|
| 675 | 695 | |
| 676 | 696 | echo ' |
| 677 | 697 | <form id="admin_form_wrapper" action="', $scripturl, '?action=admin;area=regcenter" method="post" accept-charset="', $context['character_set'], '"> |
@@ -144,11 +144,12 @@ discard block |
||
| 144 | 144 | <div class="question">', $txt['poll_question'], ': <strong>', $context['poll']['question'], '</strong>'; |
| 145 | 145 | |
| 146 | 146 | $options = 1; |
| 147 | - foreach ($context['poll']['options'] as $option) |
|
| 148 | - echo ' |
|
| 147 | + foreach ($context['poll']['options'] as $option) { |
|
| 148 | + echo ' |
|
| 149 | 149 | <div class="', $option['voted_this'] ? 'voted' : '', '">', $txt['option'], ' ', $options++, ': <strong>', $option['option'], '</strong> |
| 150 | 150 | ', $context['allow_poll_view'] ? $txt['votes'] . ': ' . $option['votes'] . '' : '', ' |
| 151 | 151 | </div>'; |
| 152 | + } |
|
| 152 | 153 | |
| 153 | 154 | echo ' |
| 154 | 155 | </div>'; |
@@ -170,9 +171,10 @@ discard block |
||
| 170 | 171 | echo ' |
| 171 | 172 | <hr>'; |
| 172 | 173 | |
| 173 | - foreach ($context['printattach'][$post['id_msg']] as $attach) |
|
| 174 | - echo ' |
|
| 174 | + foreach ($context['printattach'][$post['id_msg']] as $attach) { |
|
| 175 | + echo ' |
|
| 175 | 176 | <img width="' . $attach['width'] . '" height="' . $attach['height'] . '" src="', $scripturl . '?action=dlattach;topic=' . $topic . '.0;attach=' . $attach['id_attach'] . '" alt="">'; |
| 177 | + } |
|
| 176 | 178 | } |
| 177 | 179 | |
| 178 | 180 | echo ' |
@@ -207,12 +209,13 @@ discard block |
||
| 207 | 209 | <div class="print_options">'; |
| 208 | 210 | |
| 209 | 211 | // Which option is set, text or text&images |
| 210 | - if (isset($_REQUEST['images'])) |
|
| 211 | - echo ' |
|
| 212 | + if (isset($_REQUEST['images'])) { |
|
| 213 | + echo ' |
|
| 212 | 214 | <a href="', $url_text, '">', $txt['print_page_text'], '</a> | <strong><a href="', $url_images, '">', $txt['print_page_images'], '</a></strong>'; |
| 213 | - else |
|
| 214 | - echo ' |
|
| 215 | + } else { |
|
| 216 | + echo ' |
|
| 215 | 217 | <strong><a href="', $url_text, '">', $txt['print_page_text'], '</a></strong> | <a href="', $url_images, '">', $txt['print_page_images'], '</a>'; |
| 218 | + } |
|
| 216 | 219 | |
| 217 | 220 | echo ' |
| 218 | 221 | </div><!-- .print_options -->'; |
@@ -25,15 +25,17 @@ discard block |
||
| 25 | 25 | </h3> |
| 26 | 26 | </div>'; |
| 27 | 27 | |
| 28 | - if (!empty($context['search_errors'])) |
|
| 29 | - echo ' |
|
| 28 | + if (!empty($context['search_errors'])) { |
|
| 29 | + echo ' |
|
| 30 | 30 | <div class="errorbox">', implode('<br>', $context['search_errors']['messages']), '</div>'; |
| 31 | + } |
|
| 31 | 32 | |
| 32 | - if (!empty($context['search_ignored'])) |
|
| 33 | - echo ' |
|
| 33 | + if (!empty($context['search_ignored'])) { |
|
| 34 | + echo ' |
|
| 34 | 35 | <p class="noticebox"> |
| 35 | 36 | ', $txt['search_warning_ignored_word' . (count($context['search_ignored']) == 1 ? '' : 's')], ': ', implode(', ', $context['search_ignored']), ' |
| 36 | 37 | </p>'; |
| 38 | + } |
|
| 37 | 39 | |
| 38 | 40 | echo ' |
| 39 | 41 | <div id="advanced_search" class="roundframe"> |
@@ -44,9 +46,10 @@ discard block |
||
| 44 | 46 | <dd> |
| 45 | 47 | <input type="search" name="search" id="searchfor" ', !empty($context['search_params']['search']) ? ' value="' . $context['search_params']['search'] . '"' : '', ' maxlength="', $context['search_string_limit'], '" size="40">'; |
| 46 | 48 | |
| 47 | - if (empty($modSettings['search_simple_fulltext'])) |
|
| 48 | - echo ' |
|
| 49 | + if (empty($modSettings['search_simple_fulltext'])) { |
|
| 50 | + echo ' |
|
| 49 | 51 | <br><em class="smalltext">', $txt['search_example'], '</em>'; |
| 52 | + } |
|
| 50 | 53 | |
| 51 | 54 | echo ' |
| 52 | 55 | </dd> |
@@ -120,13 +123,14 @@ discard block |
||
| 120 | 123 | } |
| 121 | 124 | |
| 122 | 125 | // If $context['search_params']['topic'] is set, that means we're searching just one topic. |
| 123 | - if (!empty($context['search_params']['topic'])) |
|
| 124 | - echo ' |
|
| 126 | + if (!empty($context['search_params']['topic'])) { |
|
| 127 | + echo ' |
|
| 125 | 128 | <p> |
| 126 | 129 | ', $txt['search_specific_topic'], ' "', $context['search_topic']['link'], '". |
| 127 | 130 | </p> |
| 128 | 131 | <input type="hidden" name="topic" value="', $context['search_topic']['id'], '"> |
| 129 | 132 | <input type="submit" name="b_search" value="', $txt['search'], '" class="button">'; |
| 133 | + } |
|
| 130 | 134 | |
| 131 | 135 | echo ' |
| 132 | 136 | </div>'; |
@@ -156,14 +160,15 @@ discard block |
||
| 156 | 160 | |
| 157 | 161 | foreach ($category['boards'] as $board) |
| 158 | 162 | { |
| 159 | - if ($i == $limit) |
|
| 160 | - echo ' |
|
| 163 | + if ($i == $limit) { |
|
| 164 | + echo ' |
|
| 161 | 165 | </ul> |
| 162 | 166 | </li> |
| 163 | 167 | </ul> |
| 164 | 168 | <ul class="ignoreboards floatright"> |
| 165 | 169 | <li class="category"> |
| 166 | 170 | <ul>'; |
| 171 | + } |
|
| 167 | 172 | |
| 168 | 173 | echo ' |
| 169 | 174 | <li class="board"> |
@@ -251,17 +256,19 @@ discard block |
||
| 251 | 256 | <div class="roundframe">'; |
| 252 | 257 | |
| 253 | 258 | // Did they make any typos or mistakes, perhaps? |
| 254 | - if (isset($context['did_you_mean'])) |
|
| 255 | - echo ' |
|
| 259 | + if (isset($context['did_you_mean'])) { |
|
| 260 | + echo ' |
|
| 256 | 261 | <p> |
| 257 | 262 | ', $txt['search_did_you_mean'], ' <a href="', $scripturl, '?action=search2;params=', $context['did_you_mean_params'], '">', $context['did_you_mean'], '</a>. |
| 258 | 263 | </p>'; |
| 264 | + } |
|
| 259 | 265 | |
| 260 | - if (!empty($context['search_ignored'])) |
|
| 261 | - echo ' |
|
| 266 | + if (!empty($context['search_ignored'])) { |
|
| 267 | + echo ' |
|
| 262 | 268 | <p> |
| 263 | 269 | ', $txt['search_warning_ignored_word' . (count($context['search_ignored']) == 1 ? '' : 's')], ': ', implode(', ', $context['search_ignored']), ' |
| 264 | 270 | </p>'; |
| 271 | + } |
|
| 265 | 272 | |
| 266 | 273 | echo ' |
| 267 | 274 | <form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '"> |
@@ -284,10 +291,11 @@ discard block |
||
| 284 | 291 | <input type="hidden" name="sort" value="', !empty($context['search_params']['sort']) ? $context['search_params']['sort'] : 'relevance', '"> |
| 285 | 292 | </div>'; |
| 286 | 293 | |
| 287 | - if (!empty($context['search_params']['brd'])) |
|
| 288 | - foreach ($context['search_params']['brd'] as $board_id) |
|
| 294 | + if (!empty($context['search_params']['brd'])) { |
|
| 295 | + foreach ($context['search_params']['brd'] as $board_id) |
|
| 289 | 296 | echo ' |
| 290 | 297 | <input type="hidden" name="brd[', $board_id, ']" value="', $board_id, '">'; |
| 298 | + } |
|
| 291 | 299 | |
| 292 | 300 | echo ' |
| 293 | 301 | </form> |
@@ -299,18 +307,20 @@ discard block |
||
| 299 | 307 | if ($context['compact']) |
| 300 | 308 | { |
| 301 | 309 | // Quick moderation set to checkboxes? Oh, how fun :/ |
| 302 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) |
|
| 303 | - echo ' |
|
| 310 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) { |
|
| 311 | + echo ' |
|
| 304 | 312 | <form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="topicForm">'; |
| 313 | + } |
|
| 305 | 314 | |
| 306 | 315 | echo ' |
| 307 | 316 | <div class="cat_bar"> |
| 308 | 317 | <h3 class="catbg"> |
| 309 | 318 | <span class="floatright">'; |
| 310 | 319 | |
| 311 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) |
|
| 312 | - echo ' |
|
| 320 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) { |
|
| 321 | + echo ' |
|
| 313 | 322 | <input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');">'; |
| 323 | + } |
|
| 314 | 324 | echo ' |
| 315 | 325 | </span> |
| 316 | 326 | <span class="generic_icons filter"></span> ', $txt['mlist_search_results'], ': ', $context['search_params']['search'], ' |
@@ -318,15 +328,15 @@ discard block |
||
| 318 | 328 | </div>'; |
| 319 | 329 | |
| 320 | 330 | // Was anything even found? |
| 321 | - if (!empty($context['topics'])) |
|
| 322 | - echo ' |
|
| 331 | + if (!empty($context['topics'])) { |
|
| 332 | + echo ' |
|
| 323 | 333 | <div class="pagesection"> |
| 324 | 334 | <span>', $context['page_index'], '</span> |
| 325 | 335 | </div>'; |
| 326 | - |
|
| 327 | - else |
|
| 328 | - echo ' |
|
| 336 | + } else { |
|
| 337 | + echo ' |
|
| 329 | 338 | <div class="roundframe">', $txt['find_no_results'], '</div>'; |
| 339 | + } |
|
| 330 | 340 | |
| 331 | 341 | // While we have results to show ... |
| 332 | 342 | while ($topic = $context['get_topics']()) |
@@ -354,38 +364,43 @@ discard block |
||
| 354 | 364 | { |
| 355 | 365 | echo ' |
| 356 | 366 | <input type="checkbox" name="topics[]" value="', $topic['id'], '">'; |
| 357 | - } |
|
| 358 | - else |
|
| 367 | + } else |
|
| 359 | 368 | { |
| 360 | - if ($topic['quick_mod']['remove']) |
|
| 361 | - echo ' |
|
| 369 | + if ($topic['quick_mod']['remove']) { |
|
| 370 | + echo ' |
|
| 362 | 371 | <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>'; |
| 372 | + } |
|
| 363 | 373 | |
| 364 | - if ($topic['quick_mod']['lock']) |
|
| 365 | - echo ' |
|
| 374 | + if ($topic['quick_mod']['lock']) { |
|
| 375 | + echo ' |
|
| 366 | 376 | <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>'; |
| 377 | + } |
|
| 367 | 378 | |
| 368 | - if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) |
|
| 369 | - echo ' |
|
| 379 | + if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) { |
|
| 380 | + echo ' |
|
| 370 | 381 | <br>'; |
| 382 | + } |
|
| 371 | 383 | |
| 372 | - if ($topic['quick_mod']['sticky']) |
|
| 373 | - echo ' |
|
| 384 | + if ($topic['quick_mod']['sticky']) { |
|
| 385 | + echo ' |
|
| 374 | 386 | <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>'; |
| 387 | + } |
|
| 375 | 388 | |
| 376 | - if ($topic['quick_mod']['move']) |
|
| 377 | - echo ' |
|
| 389 | + if ($topic['quick_mod']['move']) { |
|
| 390 | + echo ' |
|
| 378 | 391 | <a href="', $scripturl, '?action=movetopic;topic=', $topic['id'], '.0"><span class="generic_icons move" title="', $txt['move_topic'], '"></span></a>'; |
| 392 | + } |
|
| 379 | 393 | } |
| 380 | 394 | |
| 381 | 395 | echo ' |
| 382 | 396 | </div><!-- .floatright -->'; |
| 383 | 397 | } |
| 384 | 398 | |
| 385 | - if ($message['body_highlighted'] != '') |
|
| 386 | - echo ' |
|
| 399 | + if ($message['body_highlighted'] != '') { |
|
| 400 | + echo ' |
|
| 387 | 401 | <br class="clear"> |
| 388 | 402 | <div class="list_posts double_height">', $message['body_highlighted'], '</div>'; |
| 403 | + } |
|
| 389 | 404 | } |
| 390 | 405 | |
| 391 | 406 | echo ' |
@@ -393,11 +408,12 @@ discard block |
||
| 393 | 408 | </div><!-- $topic[css_class] -->'; |
| 394 | 409 | |
| 395 | 410 | } |
| 396 | - if (!empty($context['topics'])) |
|
| 397 | - echo ' |
|
| 411 | + if (!empty($context['topics'])) { |
|
| 412 | + echo ' |
|
| 398 | 413 | <div class="pagesection"> |
| 399 | 414 | <span>', $context['page_index'], '</span> |
| 400 | 415 | </div>'; |
| 416 | + } |
|
| 401 | 417 | |
| 402 | 418 | if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics'])) |
| 403 | 419 | { |
@@ -407,17 +423,19 @@ discard block |
||
| 407 | 423 | <select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.move_to.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '> |
| 408 | 424 | <option value="">--------</option>'; |
| 409 | 425 | |
| 410 | - foreach ($context['qmod_actions'] as $qmod_action) |
|
| 411 | - if ($context['can_' . $qmod_action]) |
|
| 426 | + foreach ($context['qmod_actions'] as $qmod_action) { |
|
| 427 | + if ($context['can_' . $qmod_action]) |
|
| 412 | 428 | echo ' |
| 413 | 429 | <option value="' . $qmod_action . '">' . $txt['quick_mod_' . $qmod_action] . '</option>'; |
| 430 | + } |
|
| 414 | 431 | |
| 415 | 432 | echo ' |
| 416 | 433 | </select>'; |
| 417 | 434 | |
| 418 | - if ($context['can_move']) |
|
| 419 | - echo ' |
|
| 435 | + if ($context['can_move']) { |
|
| 436 | + echo ' |
|
| 420 | 437 | <span id="quick_mod_jump_to"> </span>'; |
| 438 | + } |
|
| 421 | 439 | |
| 422 | 440 | echo ' |
| 423 | 441 | <input type="hidden" name="redirect_url" value="', $scripturl . '?action=search2;params=' . $context['params'], '"> |
@@ -427,13 +445,13 @@ discard block |
||
| 427 | 445 | } |
| 428 | 446 | |
| 429 | 447 | |
| 430 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics'])) |
|
| 431 | - echo ' |
|
| 448 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics'])) { |
|
| 449 | + echo ' |
|
| 432 | 450 | <input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '"> |
| 433 | 451 | </form>'; |
| 452 | + } |
|
| 434 | 453 | |
| 435 | - } |
|
| 436 | - else |
|
| 454 | + } else |
|
| 437 | 455 | { |
| 438 | 456 | echo ' |
| 439 | 457 | <div class="cat_bar"> |
@@ -445,9 +463,10 @@ discard block |
||
| 445 | 463 | <span>', $context['page_index'], '</span> |
| 446 | 464 | </div>'; |
| 447 | 465 | |
| 448 | - if (empty($context['topics'])) |
|
| 449 | - echo ' |
|
| 466 | + if (empty($context['topics'])) { |
|
| 467 | + echo ' |
|
| 450 | 468 | <div class="information">(', $txt['search_no_results'], ')</div>'; |
| 469 | + } |
|
| 451 | 470 | |
| 452 | 471 | while ($topic = $context['get_topics']()) |
| 453 | 472 | { |
@@ -464,23 +483,27 @@ discard block |
||
| 464 | 483 | </div> |
| 465 | 484 | <div class="list_posts">', $message['body_highlighted'], '</div>'; |
| 466 | 485 | |
| 467 | - if ($topic['can_reply']) |
|
| 468 | - echo ' |
|
| 486 | + if ($topic['can_reply']) { |
|
| 487 | + echo ' |
|
| 469 | 488 | <ul class="quickbuttons">'; |
| 489 | + } |
|
| 470 | 490 | |
| 471 | 491 | // If they *can* reply? |
| 472 | - if ($topic['can_reply']) |
|
| 473 | - echo ' |
|
| 492 | + if ($topic['can_reply']) { |
|
| 493 | + echo ' |
|
| 474 | 494 | <li><a href="', $scripturl . '?action=post;topic=' . $topic['id'] . '.' . $message['start'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>'; |
| 495 | + } |
|
| 475 | 496 | |
| 476 | 497 | // If they *can* quote? |
| 477 | - if ($topic['can_quote']) |
|
| 478 | - echo ' |
|
| 498 | + if ($topic['can_quote']) { |
|
| 499 | + echo ' |
|
| 479 | 500 | <li><a href="', $scripturl . '?action=post;topic=' . $topic['id'] . '.' . $message['start'] . ';quote=' . $message['id'] . '"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>'; |
| 501 | + } |
|
| 480 | 502 | |
| 481 | - if ($topic['can_reply']) |
|
| 482 | - echo ' |
|
| 503 | + if ($topic['can_reply']) { |
|
| 504 | + echo ' |
|
| 483 | 505 | </ul>'; |
| 506 | + } |
|
| 484 | 507 | echo ' |
| 485 | 508 | <br class="clear"> |
| 486 | 509 | </div><!-- $topic[css_class] -->'; |
@@ -499,8 +522,8 @@ discard block |
||
| 499 | 522 | <div class="smalltext righttext" id="search_jump_to"> </div> |
| 500 | 523 | <script>'; |
| 501 | 524 | |
| 502 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) |
|
| 503 | - echo ' |
|
| 525 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) { |
|
| 526 | + echo ' |
|
| 504 | 527 | if (typeof(window.XMLHttpRequest) != "undefined") |
| 505 | 528 | aJumpTo[aJumpTo.length] = new JumpTo({ |
| 506 | 529 | sContainerId: "quick_mod_jump_to", |
@@ -515,6 +538,7 @@ discard block |
||
| 515 | 538 | bDisabled: true, |
| 516 | 539 | sCustomName: "move_to" |
| 517 | 540 | });'; |
| 541 | + } |
|
| 518 | 542 | |
| 519 | 543 | echo ' |
| 520 | 544 | if (typeof(window.XMLHttpRequest) != "undefined") |
@@ -54,9 +54,10 @@ discard block |
||
| 54 | 54 | <dd> |
| 55 | 55 | <div id="known_themes_list">'; |
| 56 | 56 | |
| 57 | - foreach ($context['themes'] as $theme) |
|
| 58 | - echo ' |
|
| 57 | + foreach ($context['themes'] as $theme) { |
|
| 58 | + echo ' |
|
| 59 | 59 | <label for="options-known_themes_', $theme['id'], '"><input type="checkbox" name="options[known_themes][]" id="options-known_themes_', $theme['id'], '" value="', $theme['id'], '"', $theme['known'] ? ' checked' : '', '> ', $theme['name'], '</label><br>'; |
| 60 | + } |
|
| 60 | 61 | |
| 61 | 62 | echo ' |
| 62 | 63 | </div> |
@@ -73,9 +74,10 @@ discard block |
||
| 73 | 74 | <select name="options[theme_guests]" id="theme_guests">'; |
| 74 | 75 | |
| 75 | 76 | // Put an option for each theme in the select box. |
| 76 | - foreach ($context['themes'] as $theme) |
|
| 77 | - echo ' |
|
| 77 | + foreach ($context['themes'] as $theme) { |
|
| 78 | + echo ' |
|
| 78 | 79 | <option value="', $theme['id'], '"', $modSettings['theme_guests'] == $theme['id'] ? ' selected' : '', '>', $theme['name'], '</option>'; |
| 80 | + } |
|
| 79 | 81 | |
| 80 | 82 | echo ' |
| 81 | 83 | </select> |
@@ -90,9 +92,10 @@ discard block |
||
| 90 | 92 | <option value="0">', $txt['theme_forum_default'], '</option>'; |
| 91 | 93 | |
| 92 | 94 | // Same thing, this time for changing the theme of everyone. |
| 93 | - foreach ($context['themes'] as $theme) |
|
| 94 | - echo ' |
|
| 95 | + foreach ($context['themes'] as $theme) { |
|
| 96 | + echo ' |
|
| 95 | 97 | <option value="', $theme['id'], '">', $theme['name'], '</option>'; |
| 98 | + } |
|
| 96 | 99 | |
| 97 | 100 | echo ' |
| 98 | 101 | </select> |
@@ -189,11 +192,12 @@ discard block |
||
| 189 | 192 | global $context, $scripturl, $txt; |
| 190 | 193 | |
| 191 | 194 | // Show a nice confirmation message. |
| 192 | - if (isset($_GET['done'])) |
|
| 193 | - echo ' |
|
| 195 | + if (isset($_GET['done'])) { |
|
| 196 | + echo ' |
|
| 194 | 197 | <div class="infobox"> |
| 195 | 198 | ', $txt['theme_confirmed_' . $_GET['done']], ' |
| 196 | 199 | </div>'; |
| 200 | + } |
|
| 197 | 201 | |
| 198 | 202 | echo ' |
| 199 | 203 | <div id="admincenter">'; |
@@ -358,11 +362,12 @@ discard block |
||
| 358 | 362 | if (empty($setting) || !is_array($setting)) |
| 359 | 363 | { |
| 360 | 364 | // Insert a separator (unless this is the first item in the list) |
| 361 | - if ($i !== $first_option_key) |
|
| 362 | - echo ' |
|
| 365 | + if ($i !== $first_option_key) { |
|
| 366 | + echo ' |
|
| 363 | 367 | </dl> |
| 364 | 368 | <hr> |
| 365 | 369 | <dl class="settings">'; |
| 370 | + } |
|
| 366 | 371 | |
| 367 | 372 | // Should we give a name to this section? |
| 368 | 373 | if (is_string($setting) && !empty($setting)) |
@@ -371,9 +376,9 @@ discard block |
||
| 371 | 376 | echo ' |
| 372 | 377 | <dt><strong>' . $setting . '</strong></dt> |
| 373 | 378 | <dd></dd>'; |
| 379 | + } else { |
|
| 380 | + $titled_section = false; |
|
| 374 | 381 | } |
| 375 | - else |
|
| 376 | - $titled_section = false; |
|
| 377 | 382 | |
| 378 | 383 | continue; |
| 379 | 384 | } |
@@ -382,8 +387,8 @@ discard block |
||
| 382 | 387 | <dt>'; |
| 383 | 388 | |
| 384 | 389 | // Show the change option box? |
| 385 | - if ($context['theme_options_reset']) |
|
| 386 | - echo ' |
|
| 390 | + if ($context['theme_options_reset']) { |
|
| 391 | + echo ' |
|
| 387 | 392 | <span class="floatleft"> |
| 388 | 393 | <select name="', !empty($setting['default']) ? 'default_' : '', 'options_master[', $setting['id'], ']" onchange="this.form.options_', $setting['id'], '.disabled = this.selectedIndex != 1;"> |
| 389 | 394 | <option value="0" selected>', $txt['themeadmin_reset_options_none'], '</option> |
@@ -391,14 +396,16 @@ discard block |
||
| 391 | 396 | <option value="2">', $txt['themeadmin_reset_options_default'], '</option> |
| 392 | 397 | </select> |
| 393 | 398 | </span>'; |
| 399 | + } |
|
| 394 | 400 | |
| 395 | 401 | echo ' |
| 396 | 402 | <label for="options_', $setting['id'], '">', !$titled_section ? '<strong>' : '', $setting['label'], !$titled_section ? '</strong>' : '', '</label>'; |
| 397 | 403 | |
| 398 | - if (isset($setting['description'])) |
|
| 399 | - echo ' |
|
| 404 | + if (isset($setting['description'])) { |
|
| 405 | + echo ' |
|
| 400 | 406 | <br> |
| 401 | 407 | <span class="smalltext">', $setting['description'], '</span>'; |
| 408 | + } |
|
| 402 | 409 | echo ' |
| 403 | 410 | </dt>'; |
| 404 | 411 | |
@@ -440,13 +447,11 @@ discard block |
||
| 440 | 447 | |
| 441 | 448 | echo ' |
| 442 | 449 | <input type="number"', $min . $max . $step; |
| 443 | - } |
|
| 444 | - else if (isset($setting['type']) && $setting['type'] == 'url') |
|
| 450 | + } else if (isset($setting['type']) && $setting['type'] == 'url') |
|
| 445 | 451 | { |
| 446 | 452 | echo' |
| 447 | 453 | <input type="url"'; |
| 448 | - } |
|
| 449 | - else |
|
| 454 | + } else |
|
| 450 | 455 | { |
| 451 | 456 | echo ' |
| 452 | 457 | <input type="text"'; |
@@ -490,8 +495,8 @@ discard block |
||
| 490 | 495 | <br>'; |
| 491 | 496 | |
| 492 | 497 | // @todo Why can't I edit the default theme popup. |
| 493 | - if ($context['theme_settings']['theme_id'] != 1) |
|
| 494 | - echo ' |
|
| 498 | + if ($context['theme_settings']['theme_id'] != 1) { |
|
| 499 | + echo ' |
|
| 495 | 500 | <div class="cat_bar"> |
| 496 | 501 | <h3 class="catbg config_hd"> |
| 497 | 502 | ', $txt['theme_edit'], ' |
@@ -507,6 +512,7 @@ discard block |
||
| 507 | 512 | </li> |
| 508 | 513 | </ul> |
| 509 | 514 | </div>'; |
| 515 | + } |
|
| 510 | 516 | |
| 511 | 517 | echo ' |
| 512 | 518 | <div class="cat_bar"> |
@@ -560,9 +566,10 @@ discard block |
||
| 560 | 566 | <dd> |
| 561 | 567 | <select id="variant" name="options[default_variant]" onchange="changeVariant(this.value)">'; |
| 562 | 568 | |
| 563 | - foreach ($context['theme_variants'] as $key => $variant) |
|
| 564 | - echo ' |
|
| 569 | + foreach ($context['theme_variants'] as $key => $variant) { |
|
| 570 | + echo ' |
|
| 565 | 571 | <option value="', $key, '"', $context['default_variant'] == $key ? ' selected' : '', '>', $variant['label'], '</option>'; |
| 572 | + } |
|
| 566 | 573 | |
| 567 | 574 | echo ' |
| 568 | 575 | </select> |
@@ -598,11 +605,12 @@ discard block |
||
| 598 | 605 | if (empty($setting) || !is_array($setting)) |
| 599 | 606 | { |
| 600 | 607 | // We don't need a separator before the first list element |
| 601 | - if ($i !== $first_setting_key) |
|
| 602 | - echo ' |
|
| 608 | + if ($i !== $first_setting_key) { |
|
| 609 | + echo ' |
|
| 603 | 610 | </dl> |
| 604 | 611 | <hr> |
| 605 | 612 | <dl class="settings">'; |
| 613 | + } |
|
| 606 | 614 | |
| 607 | 615 | // Add a fake heading? |
| 608 | 616 | if (is_string($setting) && !empty($setting)) |
@@ -611,9 +619,9 @@ discard block |
||
| 611 | 619 | echo ' |
| 612 | 620 | <dt><strong>' . $setting . '</strong></dt> |
| 613 | 621 | <dd></dd>'; |
| 622 | + } else { |
|
| 623 | + $titled_section = false; |
|
| 614 | 624 | } |
| 615 | - else |
|
| 616 | - $titled_section = false; |
|
| 617 | 625 | |
| 618 | 626 | continue; |
| 619 | 627 | } |
@@ -622,9 +630,10 @@ discard block |
||
| 622 | 630 | <dt> |
| 623 | 631 | <label for="', $setting['id'], '">', !$titled_section ? '<strong>' : '', $setting['label'], !$titled_section ? '</strong>' : '', '</label>:'; |
| 624 | 632 | |
| 625 | - if (isset($setting['description'])) |
|
| 626 | - echo '<br> |
|
| 633 | + if (isset($setting['description'])) { |
|
| 634 | + echo '<br> |
|
| 627 | 635 | <span class="smalltext">', $setting['description'], '</span>'; |
| 636 | + } |
|
| 628 | 637 | |
| 629 | 638 | echo ' |
| 630 | 639 | </dt>'; |
@@ -645,9 +654,10 @@ discard block |
||
| 645 | 654 | <dd> |
| 646 | 655 | <select name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="', $setting['id'], '">'; |
| 647 | 656 | |
| 648 | - foreach ($setting['options'] as $value => $label) |
|
| 649 | - echo ' |
|
| 657 | + foreach ($setting['options'] as $value => $label) { |
|
| 658 | + echo ' |
|
| 650 | 659 | <option value="', $value, '"', $value == $setting['value'] ? ' selected' : '', '>', $label, '</option>'; |
| 660 | + } |
|
| 651 | 661 | |
| 652 | 662 | echo ' |
| 653 | 663 | </select> |
@@ -676,13 +686,11 @@ discard block |
||
| 676 | 686 | |
| 677 | 687 | echo ' |
| 678 | 688 | <input type="number"', $min . $max . $step; |
| 679 | - } |
|
| 680 | - else if (isset($setting['type']) && $setting['type'] == 'url') |
|
| 689 | + } else if (isset($setting['type']) && $setting['type'] == 'url') |
|
| 681 | 690 | { |
| 682 | 691 | echo' |
| 683 | 692 | <input type="url"'; |
| 684 | - } |
|
| 685 | - else |
|
| 693 | + } else |
|
| 686 | 694 | { |
| 687 | 695 | echo ' |
| 688 | 696 | <input type="text"'; |
@@ -839,21 +847,23 @@ discard block |
||
| 839 | 847 | <div class="windowbg">'; |
| 840 | 848 | |
| 841 | 849 | // Oops! there was an error :( |
| 842 | - if (!empty($context['error_message'])) |
|
| 843 | - echo ' |
|
| 850 | + if (!empty($context['error_message'])) { |
|
| 851 | + echo ' |
|
| 844 | 852 | <p> |
| 845 | 853 | ', $context['error_message'], ' |
| 846 | 854 | </p>'; |
| 855 | + } |
|
| 847 | 856 | |
| 848 | 857 | // Not much to show except a link back... |
| 849 | - else |
|
| 850 | - echo ' |
|
| 858 | + else { |
|
| 859 | + echo ' |
|
| 851 | 860 | <p> |
| 852 | 861 | <a href="', $scripturl, '?action=admin;area=theme;sa=list;th=', $context['installed_theme']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $context['installed_theme']['name'], '</a> ', $txt['theme_' . (isset($context['installed_theme']['updated']) ? 'updated' : 'installed') . '_message'], ' |
| 853 | 862 | </p> |
| 854 | 863 | <p> |
| 855 | 864 | <a href="', $scripturl, '?action=admin;area=theme;sa=admin;', $context['session_var'], '=', $context['session_id'], '">', $txt['back'], '</a> |
| 856 | 865 | </p>'; |
| 866 | + } |
|
| 857 | 867 | |
| 858 | 868 | echo ' |
| 859 | 869 | </div><!-- .windowbg --> |
@@ -920,11 +930,12 @@ discard block |
||
| 920 | 930 | <span class="floatleft">', $template['filename'], $template['already_exists'] ? ' <span class="error">(' . $txt['themeadmin_edit_exists'] . ')</span>' : '', '</span> |
| 921 | 931 | <span class="floatright">'; |
| 922 | 932 | |
| 923 | - if ($template['can_copy']) |
|
| 924 | - echo ' |
|
| 933 | + if ($template['can_copy']) { |
|
| 934 | + echo ' |
|
| 925 | 935 | <a href="', $scripturl, '?action=admin;area=theme;th=', $context['theme_id'], ';', $context['session_var'], '=', $context['session_id'], ';sa=copy;template=', $template['value'], '" data-confirm="', $template['already_exists'] ? $txt['themeadmin_edit_overwrite_confirm'] : $txt['themeadmin_edit_copy_confirm'], '" class="you_sure">', $txt['themeadmin_edit_do_copy'], '</a>'; |
| 926 | - else |
|
| 927 | - echo $txt['themeadmin_edit_no_copy']; |
|
| 936 | + } else { |
|
| 937 | + echo $txt['themeadmin_edit_no_copy']; |
|
| 938 | + } |
|
| 928 | 939 | |
| 929 | 940 | echo ' |
| 930 | 941 | </span> |
@@ -947,11 +958,12 @@ discard block |
||
| 947 | 958 | echo ' |
| 948 | 959 | <div id="admincenter">'; |
| 949 | 960 | |
| 950 | - if (!empty($context['browse_title'])) |
|
| 951 | - echo ' |
|
| 961 | + if (!empty($context['browse_title'])) { |
|
| 962 | + echo ' |
|
| 952 | 963 | <div class="cat_bar"> |
| 953 | 964 | <h3 class="catbg">', $context['browse_title'], '</h3> |
| 954 | 965 | </div>'; |
| 966 | + } |
|
| 955 | 967 | |
| 956 | 968 | echo ' |
| 957 | 969 | <table class="table_grid tborder"> |
@@ -971,16 +983,15 @@ discard block |
||
| 971 | 983 | <tr class="windowbg"> |
| 972 | 984 | <td>'; |
| 973 | 985 | |
| 974 | - if ($file['is_editable']) |
|
| 975 | - echo ' |
|
| 986 | + if ($file['is_editable']) { |
|
| 987 | + echo ' |
|
| 976 | 988 | <a href="', $file['href'], '"', $file['is_template'] ? ' style="font-weight: bold;"' : '', '>', $file['filename'], '</a>'; |
| 977 | - |
|
| 978 | - elseif ($file['is_directory']) |
|
| 979 | - echo ' |
|
| 989 | + } elseif ($file['is_directory']) { |
|
| 990 | + echo ' |
|
| 980 | 991 | <a href="', $file['href'], '" class="is_directory"><span class="generic_icons folder"></span>', $file['filename'], '</a>'; |
| 981 | - |
|
| 982 | - else |
|
| 983 | - echo $file['filename']; |
|
| 992 | + } else { |
|
| 993 | + echo $file['filename']; |
|
| 994 | + } |
|
| 984 | 995 | |
| 985 | 996 | echo ' |
| 986 | 997 | </td> |
@@ -1002,11 +1013,12 @@ discard block |
||
| 1002 | 1013 | { |
| 1003 | 1014 | global $context, $settings, $scripturl, $txt; |
| 1004 | 1015 | |
| 1005 | - if ($context['session_error']) |
|
| 1006 | - echo ' |
|
| 1016 | + if ($context['session_error']) { |
|
| 1017 | + echo ' |
|
| 1007 | 1018 | <div class="errorbox"> |
| 1008 | 1019 | ', $txt['error_session_timeout'], ' |
| 1009 | 1020 | </div>'; |
| 1021 | + } |
|
| 1010 | 1022 | |
| 1011 | 1023 | // From now on no one can complain that editing css is difficult. If you disagree, go to www.w3schools.com. |
| 1012 | 1024 | echo ' |
@@ -1069,17 +1081,18 @@ discard block |
||
| 1069 | 1081 | try |
| 1070 | 1082 | { |
| 1071 | 1083 | '; |
| 1072 | - if (isBrowser('is_ie')) |
|
| 1073 | - echo ' |
|
| 1084 | + if (isBrowser('is_ie')) { |
|
| 1085 | + echo ' |
|
| 1074 | 1086 | var sheets = frames["css_preview_box"].document.styleSheets; |
| 1075 | 1087 | for (var j = 0; j < sheets.length; j++) |
| 1076 | 1088 | { |
| 1077 | 1089 | if (sheets[j].id == "css_preview_box") |
| 1078 | 1090 | sheets[j].cssText = document.forms.stylesheetForm.entire_file.value; |
| 1079 | 1091 | }'; |
| 1080 | - else |
|
| 1081 | - echo ' |
|
| 1092 | + } else { |
|
| 1093 | + echo ' |
|
| 1082 | 1094 | setInnerHTML(frames["css_preview_box"].document.getElementById("css_preview_sheet"), document.forms.stylesheetForm.entire_file.value);'; |
| 1095 | + } |
|
| 1083 | 1096 | echo ' |
| 1084 | 1097 | } |
| 1085 | 1098 | catch (e) |
@@ -1131,9 +1144,10 @@ discard block |
||
| 1131 | 1144 | </div> |
| 1132 | 1145 | <div class="windowbg">'; |
| 1133 | 1146 | |
| 1134 | - if (!$context['allow_save']) |
|
| 1135 | - echo ' |
|
| 1147 | + if (!$context['allow_save']) { |
|
| 1148 | + echo ' |
|
| 1136 | 1149 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>'; |
| 1150 | + } |
|
| 1137 | 1151 | |
| 1138 | 1152 | echo ' |
| 1139 | 1153 | <textarea class="edit_file" name="entire_file" cols="80" rows="20" onkeyup="setPreviewTimeout();" onchange="refreshPreview(true);">', $context['entire_file'], '</textarea> |
@@ -1147,9 +1161,10 @@ discard block |
||
| 1147 | 1161 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
| 1148 | 1162 | |
| 1149 | 1163 | // Hopefully it exists. |
| 1150 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
| 1151 | - echo ' |
|
| 1164 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
| 1165 | + echo ' |
|
| 1152 | 1166 | <input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">'; |
| 1167 | + } |
|
| 1153 | 1168 | |
| 1154 | 1169 | echo ' |
| 1155 | 1170 | </form> |
@@ -1163,18 +1178,20 @@ discard block |
||
| 1163 | 1178 | { |
| 1164 | 1179 | global $context, $scripturl, $txt; |
| 1165 | 1180 | |
| 1166 | - if ($context['session_error']) |
|
| 1167 | - echo ' |
|
| 1181 | + if ($context['session_error']) { |
|
| 1182 | + echo ' |
|
| 1168 | 1183 | <div class="errorbox"> |
| 1169 | 1184 | ', $txt['error_session_timeout'], ' |
| 1170 | 1185 | </div>'; |
| 1186 | + } |
|
| 1171 | 1187 | |
| 1172 | - if (isset($context['parse_error'])) |
|
| 1173 | - echo ' |
|
| 1188 | + if (isset($context['parse_error'])) { |
|
| 1189 | + echo ' |
|
| 1174 | 1190 | <div class="errorbox"> |
| 1175 | 1191 | ', $txt['themeadmin_edit_error'], ' |
| 1176 | 1192 | <div><pre>', $context['parse_error'], '</pre></div> |
| 1177 | 1193 | </div>'; |
| 1194 | + } |
|
| 1178 | 1195 | |
| 1179 | 1196 | // Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.) |
| 1180 | 1197 | echo ' |
@@ -1185,16 +1202,18 @@ discard block |
||
| 1185 | 1202 | </div> |
| 1186 | 1203 | <div class="windowbg">'; |
| 1187 | 1204 | |
| 1188 | - if (!$context['allow_save']) |
|
| 1189 | - echo ' |
|
| 1205 | + if (!$context['allow_save']) { |
|
| 1206 | + echo ' |
|
| 1190 | 1207 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>'; |
| 1208 | + } |
|
| 1191 | 1209 | |
| 1192 | - foreach ($context['file_parts'] as $part) |
|
| 1193 | - echo ' |
|
| 1210 | + foreach ($context['file_parts'] as $part) { |
|
| 1211 | + echo ' |
|
| 1194 | 1212 | <label for="on_line', $part['line'], '">', $txt['themeadmin_edit_on_line'], ' ', $part['line'], '</label>:<br> |
| 1195 | 1213 | <div class="centertext"> |
| 1196 | 1214 | <textarea id="on_line', $part['line'], '" name="entire_file[]" cols="80" rows="', $part['lines'] > 14 ? '14' : $part['lines'], '" class="edit_file">', $part['data'], '</textarea> |
| 1197 | 1215 | </div>'; |
| 1216 | + } |
|
| 1198 | 1217 | |
| 1199 | 1218 | echo ' |
| 1200 | 1219 | <div class="padding righttext"> |
@@ -1203,9 +1222,10 @@ discard block |
||
| 1203 | 1222 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
| 1204 | 1223 | |
| 1205 | 1224 | // Hopefully it exists. |
| 1206 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
| 1207 | - echo ' |
|
| 1225 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
| 1226 | + echo ' |
|
| 1208 | 1227 | <input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">'; |
| 1228 | + } |
|
| 1209 | 1229 | |
| 1210 | 1230 | echo ' |
| 1211 | 1231 | </div><!-- .righttext --> |
@@ -1221,18 +1241,20 @@ discard block |
||
| 1221 | 1241 | { |
| 1222 | 1242 | global $context, $scripturl, $txt; |
| 1223 | 1243 | |
| 1224 | - if ($context['session_error']) |
|
| 1225 | - echo ' |
|
| 1244 | + if ($context['session_error']) { |
|
| 1245 | + echo ' |
|
| 1226 | 1246 | <div class="errorbox"> |
| 1227 | 1247 | ', $txt['error_session_timeout'], ' |
| 1228 | 1248 | </div>'; |
| 1249 | + } |
|
| 1229 | 1250 | |
| 1230 | 1251 | // Is this file writeable? |
| 1231 | - if (!$context['allow_save']) |
|
| 1232 | - echo ' |
|
| 1252 | + if (!$context['allow_save']) { |
|
| 1253 | + echo ' |
|
| 1233 | 1254 | <div class="errorbox"> |
| 1234 | 1255 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], ' |
| 1235 | 1256 | </div>'; |
| 1257 | + } |
|
| 1236 | 1258 | |
| 1237 | 1259 | // Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.) |
| 1238 | 1260 | echo ' |
@@ -1248,9 +1270,10 @@ discard block |
||
| 1248 | 1270 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
| 1249 | 1271 | |
| 1250 | 1272 | // Hopefully it exists. |
| 1251 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
| 1252 | - echo ' |
|
| 1273 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
| 1274 | + echo ' |
|
| 1253 | 1275 | <input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">'; |
| 1276 | + } |
|
| 1254 | 1277 | |
| 1255 | 1278 | echo ' |
| 1256 | 1279 | </div><!-- .windowbg --> |
@@ -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 | |
| 77 | 80 | echo ' |
| 78 | 81 | </div>'; |
@@ -87,14 +90,16 @@ discard block |
||
| 87 | 90 | |
| 88 | 91 | foreach ($board['children'] as $child) |
| 89 | 92 | { |
| 90 | - if (!$child['is_redirect']) |
|
| 91 | - $child['link'] = ''. ($child['new'] ? '<a 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>' : '') . '<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'] . '</a>'; |
|
| 92 | - else |
|
| 93 | - $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>'; |
|
| 93 | + if (!$child['is_redirect']) { |
|
| 94 | + $child['link'] = ''. ($child['new'] ? '<a 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>' : '') . '<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'] . '</a>'; |
|
| 95 | + } else { |
|
| 96 | + $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>'; |
|
| 97 | + } |
|
| 94 | 98 | |
| 95 | 99 | // Has it posts awaiting approval? |
| 96 | - if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics'])) |
|
| 97 | - $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 | + if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics'])) { |
|
| 101 | + $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>'; |
|
| 102 | + } |
|
| 98 | 103 | |
| 99 | 104 | $children[] = $child['new'] ? '<span class="strong">' . $child['link'] . '</span>' : '<span>' . $child['link'] . '</span>'; |
| 100 | 105 | } |
@@ -114,8 +119,9 @@ discard block |
||
| 114 | 119 | } |
| 115 | 120 | |
| 116 | 121 | // They can only mark read if they are logged in and it's enabled! |
| 117 | - if (!$context['user']['is_logged']) |
|
| 118 | - unset($context['normal_buttons']['markread']); |
|
| 122 | + if (!$context['user']['is_logged']) { |
|
| 123 | + unset($context['normal_buttons']['markread']); |
|
| 124 | + } |
|
| 119 | 125 | |
| 120 | 126 | if (!$context['no_topic_listing']) |
| 121 | 127 | { |
@@ -142,13 +148,15 @@ discard block |
||
| 142 | 148 | <h3>', $context['name'], '</h3> |
| 143 | 149 | <p>'; |
| 144 | 150 | |
| 145 | - if ($context['description'] != '') |
|
| 146 | - echo ' |
|
| 151 | + if ($context['description'] != '') { |
|
| 152 | + echo ' |
|
| 147 | 153 | ', $context['description'], ' '; |
| 154 | + } |
|
| 148 | 155 | |
| 149 | - if (!empty($context['moderators'])) |
|
| 150 | - echo ' |
|
| 156 | + if (!empty($context['moderators'])) { |
|
| 157 | + echo ' |
|
| 151 | 158 | ', count($context['moderators']) === 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $context['link_moderators']), '.'; |
| 159 | + } |
|
| 152 | 160 | |
| 153 | 161 | echo ' |
| 154 | 162 | </p> |
@@ -156,9 +164,10 @@ discard block |
||
| 156 | 164 | } |
| 157 | 165 | |
| 158 | 166 | // If Quick Moderation is enabled start the form. |
| 159 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) |
|
| 160 | - echo ' |
|
| 167 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) { |
|
| 168 | + echo ' |
|
| 161 | 169 | <form action="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" class="clear" name="quickModForm" id="quickModForm">'; |
| 170 | + } |
|
| 162 | 171 | |
| 163 | 172 | echo ' |
| 164 | 173 | <div id="messageindex">'; |
@@ -168,11 +177,11 @@ discard block |
||
| 168 | 177 | echo ' |
| 169 | 178 | <div class="information">'; |
| 170 | 179 | |
| 171 | - if ($settings['display_who_viewing'] == 1) |
|
| 172 | - echo count($context['view_members']), ' ', count($context['view_members']) === 1 ? $txt['who_member'] : $txt['members']; |
|
| 173 | - |
|
| 174 | - else |
|
| 175 | - 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'] . ')'); |
|
| 180 | + if ($settings['display_who_viewing'] == 1) { |
|
| 181 | + echo count($context['view_members']), ' ', count($context['view_members']) === 1 ? $txt['who_member'] : $txt['members']; |
|
| 182 | + } else { |
|
| 183 | + 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'] . ')'); |
|
| 184 | + } |
|
| 176 | 185 | echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_board']; |
| 177 | 186 | |
| 178 | 187 | echo ' |
@@ -192,22 +201,25 @@ discard block |
||
| 192 | 201 | <div class="lastpost">', $context['topics_headers']['last_post'], '</div>'; |
| 193 | 202 | |
| 194 | 203 | // Show a "select all" box for quick moderation? |
| 195 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1) |
|
| 196 | - echo ' |
|
| 204 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1) { |
|
| 205 | + echo ' |
|
| 197 | 206 | <div class="moderation"> |
| 198 | 207 | <input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');"> |
| 199 | 208 | </div>'; |
| 209 | + } |
|
| 200 | 210 | |
| 201 | 211 | // If it's on in "image" mode, don't show anything but the column. |
| 202 | - elseif (!empty($context['can_quick_mod'])) |
|
| 203 | - echo ' |
|
| 212 | + elseif (!empty($context['can_quick_mod'])) { |
|
| 213 | + echo ' |
|
| 204 | 214 | <div class="moderation"> </div>'; |
| 215 | + } |
|
| 205 | 216 | } |
| 206 | 217 | |
| 207 | 218 | // No topics.... just say, "sorry bub". |
| 208 | - else |
|
| 209 | - echo ' |
|
| 219 | + else { |
|
| 220 | + echo ' |
|
| 210 | 221 | <h3 class="titlebg">', $txt['topic_alert_none'], '</h3>'; |
| 222 | + } |
|
| 211 | 223 | |
| 212 | 224 | echo ' |
| 213 | 225 | </div><!-- #topic_header -->'; |
@@ -240,21 +252,26 @@ discard block |
||
| 240 | 252 | echo ' |
| 241 | 253 | <div class="icons floatright">'; |
| 242 | 254 | |
| 243 | - if ($topic['is_watched']) |
|
| 244 | - echo ' |
|
| 255 | + if ($topic['is_watched']) { |
|
| 256 | + echo ' |
|
| 245 | 257 | <span class="generic_icons watch" title="', $txt['watching_this_topic'], '"></span>'; |
| 246 | - if ($topic['is_locked']) |
|
| 247 | - echo ' |
|
| 258 | + } |
|
| 259 | + if ($topic['is_locked']) { |
|
| 260 | + echo ' |
|
| 248 | 261 | <span class="generic_icons lock"></span>'; |
| 249 | - if ($topic['is_sticky']) |
|
| 250 | - echo ' |
|
| 262 | + } |
|
| 263 | + if ($topic['is_sticky']) { |
|
| 264 | + echo ' |
|
| 251 | 265 | <span class="generic_icons sticky"></span>'; |
| 252 | - if ($topic['is_redirect']) |
|
| 253 | - echo ' |
|
| 266 | + } |
|
| 267 | + if ($topic['is_redirect']) { |
|
| 268 | + echo ' |
|
| 254 | 269 | <span class="generic_icons move"></span>'; |
| 255 | - if ($topic['is_poll']) |
|
| 256 | - echo ' |
|
| 270 | + } |
|
| 271 | + if ($topic['is_poll']) { |
|
| 272 | + echo ' |
|
| 257 | 273 | <span class="generic_icons poll"></span>'; |
| 274 | + } |
|
| 258 | 275 | |
| 259 | 276 | echo ' |
| 260 | 277 | </div>'; |
@@ -284,26 +301,31 @@ discard block |
||
| 284 | 301 | echo ' |
| 285 | 302 | <div class="moderation">'; |
| 286 | 303 | |
| 287 | - if ($options['display_quick_mod'] == 1) |
|
| 288 | - echo ' |
|
| 304 | + if ($options['display_quick_mod'] == 1) { |
|
| 305 | + echo ' |
|
| 289 | 306 | <input type="checkbox" name="topics[]" value="', $topic['id'], '">'; |
| 290 | - else |
|
| 307 | + } else |
|
| 291 | 308 | { |
| 292 | 309 | // Check permissions on each and show only the ones they are allowed to use. |
| 293 | - if ($topic['quick_mod']['remove']) |
|
| 294 | - 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>'; |
|
| 310 | + if ($topic['quick_mod']['remove']) { |
|
| 311 | + 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>'; |
|
| 312 | + } |
|
| 295 | 313 | |
| 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>'; |
|
| 314 | + if ($topic['quick_mod']['lock']) { |
|
| 315 | + 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>'; |
|
| 316 | + } |
|
| 298 | 317 | |
| 299 | - if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) |
|
| 300 | - echo '<br>'; |
|
| 318 | + if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) { |
|
| 319 | + echo '<br>'; |
|
| 320 | + } |
|
| 301 | 321 | |
| 302 | - if ($topic['quick_mod']['sticky']) |
|
| 303 | - 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>'; |
|
| 322 | + if ($topic['quick_mod']['sticky']) { |
|
| 323 | + 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>'; |
|
| 324 | + } |
|
| 304 | 325 | |
| 305 | - if ($topic['quick_mod']['move']) |
|
| 306 | - 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>'; |
|
| 326 | + if ($topic['quick_mod']['move']) { |
|
| 327 | + 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>'; |
|
| 328 | + } |
|
| 307 | 329 | } |
| 308 | 330 | echo ' |
| 309 | 331 | </div><!-- .moderation -->'; |
@@ -321,18 +343,20 @@ discard block |
||
| 321 | 343 | <select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.move_to.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '> |
| 322 | 344 | <option value="">--------</option>'; |
| 323 | 345 | |
| 324 | - foreach ($context['qmod_actions'] as $qmod_action) |
|
| 325 | - if ($context['can_' . $qmod_action]) |
|
| 346 | + foreach ($context['qmod_actions'] as $qmod_action) { |
|
| 347 | + if ($context['can_' . $qmod_action]) |
|
| 326 | 348 | echo ' |
| 327 | 349 | <option value="' . $qmod_action . '">' . $txt['quick_mod_' . $qmod_action] . '</option>'; |
| 350 | + } |
|
| 328 | 351 | |
| 329 | 352 | echo ' |
| 330 | 353 | </select>'; |
| 331 | 354 | |
| 332 | 355 | // Show a list of boards they can move the topic to. |
| 333 | - if ($context['can_move']) |
|
| 334 | - echo ' |
|
| 356 | + if ($context['can_move']) { |
|
| 357 | + echo ' |
|
| 335 | 358 | <span id="quick_mod_jump_to"> </span>'; |
| 359 | + } |
|
| 336 | 360 | |
| 337 | 361 | echo ' |
| 338 | 362 | <input type="submit" value="', $txt['quick_mod_go'], '" onclick="return document.forms.quickModForm.qaction.value != \'\' && confirm(\'', $txt['quickmod_confirm'], '\');" class="button qaction"> |
@@ -343,10 +367,11 @@ discard block |
||
| 343 | 367 | </div><!-- #messageindex -->'; |
| 344 | 368 | |
| 345 | 369 | // Finish off the form - again. |
| 346 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) |
|
| 347 | - echo ' |
|
| 370 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) { |
|
| 371 | + echo ' |
|
| 348 | 372 | <input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '"> |
| 349 | 373 | </form>'; |
| 374 | + } |
|
| 350 | 375 | |
| 351 | 376 | // Mobile action buttons (bottom) |
| 352 | 377 | echo ' |
@@ -368,8 +393,8 @@ discard block |
||
| 368 | 393 | // Show breadcrumbs at the bottom too. |
| 369 | 394 | theme_linktree(); |
| 370 | 395 | |
| 371 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) |
|
| 372 | - echo ' |
|
| 396 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) { |
|
| 397 | + echo ' |
|
| 373 | 398 | <script> |
| 374 | 399 | if (typeof(window.XMLHttpRequest) != "undefined") |
| 375 | 400 | aJumpTo[aJumpTo.length] = new JumpTo({ |
@@ -388,6 +413,7 @@ discard block |
||
| 388 | 413 | sCustomName: "move_to" |
| 389 | 414 | }); |
| 390 | 415 | </script>'; |
| 416 | + } |
|
| 391 | 417 | |
| 392 | 418 | // Javascript for inline editing. |
| 393 | 419 | echo ' |
@@ -424,8 +450,8 @@ discard block |
||
| 424 | 450 | <div class="information"> |
| 425 | 451 | <p class="floatright" id="message_index_jump_to"> </p>'; |
| 426 | 452 | |
| 427 | - if (empty($context['no_topic_listing'])) |
|
| 428 | - echo ' |
|
| 453 | + if (empty($context['no_topic_listing'])) { |
|
| 454 | + echo ' |
|
| 429 | 455 | <p class="floatleft">', !empty($modSettings['enableParticipation']) && $context['user']['is_logged'] ? ' |
| 430 | 456 | <img src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="" class="centericon"> ' . $txt['participation_caption'] . '<br>' : '', ' |
| 431 | 457 | '. ($modSettings['pollMode'] == '1' ? '<span class="generic_icons poll centericon"></span> ' . $txt['poll'] : '') . '<br> |
@@ -435,9 +461,10 @@ discard block |
||
| 435 | 461 | <span class="generic_icons lock centericon"></span> ' . $txt['locked_topic'] . '<br> |
| 436 | 462 | <span class="generic_icons sticky centericon"></span> ' . $txt['sticky_topic'] . '<br> |
| 437 | 463 | </p>'; |
| 464 | + } |
|
| 438 | 465 | |
| 439 | - if (!empty($context['jump_to'])) |
|
| 440 | - echo ' |
|
| 466 | + if (!empty($context['jump_to'])) { |
|
| 467 | + echo ' |
|
| 441 | 468 | <script> |
| 442 | 469 | if (typeof(window.XMLHttpRequest) != "undefined") |
| 443 | 470 | aJumpTo[aJumpTo.length] = new JumpTo({ |
@@ -453,6 +480,7 @@ discard block |
||
| 453 | 480 | sGoButtonLabel: "', $txt['quick_mod_go'], '" |
| 454 | 481 | }); |
| 455 | 482 | </script>'; |
| 483 | + } |
|
| 456 | 484 | |
| 457 | 485 | echo ' |
| 458 | 486 | <br class="clear"> |
@@ -3078,8 +3078,7 @@ |
||
| 3078 | 3078 | <div class="roundframe"> |
| 3079 | 3079 | <div> |
| 3080 | 3080 | ', !empty($context['tfa_backup']) ? ' |
| 3081 | - <div class="smalltext error">' . $txt['tfa_backup_used_desc'] . '</div>' : |
|
| 3082 | - ($modSettings['tfa_mode'] == 2 ? ' |
|
| 3081 | + <div class="smalltext error">' . $txt['tfa_backup_used_desc'] . '</div>' : ($modSettings['tfa_mode'] == 2 ? ' |
|
| 3083 | 3082 | <div class="smalltext"><strong>' . $txt['tfa_forced_desc'] . '</strong></div>' : ''), ' |
| 3084 | 3083 | <div class="smalltext">', $txt['tfa_desc'], '</div> |
| 3085 | 3084 | <div class="floatleft"> |
@@ -18,23 +18,25 @@ discard block |
||
| 18 | 18 | global $context; |
| 19 | 19 | |
| 20 | 20 | // Prevent Chrome from auto completing fields when viewing/editing other members profiles |
| 21 | - if (isBrowser('is_chrome') && !$context['user']['is_owner']) |
|
| 22 | - echo ' |
|
| 21 | + if (isBrowser('is_chrome') && !$context['user']['is_owner']) { |
|
| 22 | + echo ' |
|
| 23 | 23 | <script> |
| 24 | 24 | disableAutoComplete(); |
| 25 | 25 | </script>'; |
| 26 | + } |
|
| 26 | 27 | |
| 27 | 28 | // If an error occurred while trying to save previously, give the user a clue! |
| 28 | 29 | echo ' |
| 29 | 30 | ', template_error_message(); |
| 30 | 31 | |
| 31 | 32 | // If the profile was update successfully, let the user know this. |
| 32 | - if (!empty($context['profile_updated'])) |
|
| 33 | - echo ' |
|
| 33 | + if (!empty($context['profile_updated'])) { |
|
| 34 | + echo ' |
|
| 34 | 35 | <div class="infobox"> |
| 35 | 36 | ', $context['profile_updated'], ' |
| 36 | 37 | </div>'; |
| 37 | -} |
|
| 38 | + } |
|
| 39 | + } |
|
| 38 | 40 | |
| 39 | 41 | /** |
| 40 | 42 | * Template for any HTML needed below the profile (closing off divs/tables, etc.) |
@@ -102,8 +104,7 @@ discard block |
||
| 102 | 104 | if (empty($context['unread_alerts'])) |
| 103 | 105 | { |
| 104 | 106 | template_alerts_all_read(); |
| 105 | - } |
|
| 106 | - else |
|
| 107 | + } else |
|
| 107 | 108 | { |
| 108 | 109 | foreach ($context['unread_alerts'] as $id_alert => $details) |
| 109 | 110 | { |
@@ -164,10 +165,11 @@ discard block |
||
| 164 | 165 | <div class="custom_fields_above_name"> |
| 165 | 166 | <ul>'; |
| 166 | 167 | |
| 167 | - foreach ($context['print_custom_fields']['above_member'] as $field) |
|
| 168 | - if (!empty($field['output_html'])) |
|
| 168 | + foreach ($context['print_custom_fields']['above_member'] as $field) { |
|
| 169 | + if (!empty($field['output_html'])) |
|
| 169 | 170 | echo ' |
| 170 | 171 | <li>', $field['output_html'], '</li>'; |
| 172 | + } |
|
| 171 | 173 | |
| 172 | 174 | echo ' |
| 173 | 175 | </ul> |
@@ -190,10 +192,11 @@ discard block |
||
| 190 | 192 | <div class="custom_fields_below_avatar"> |
| 191 | 193 | <ul>'; |
| 192 | 194 | |
| 193 | - foreach ($context['print_custom_fields']['below_avatar'] as $field) |
|
| 194 | - if (!empty($field['output_html'])) |
|
| 195 | + foreach ($context['print_custom_fields']['below_avatar'] as $field) { |
|
| 196 | + if (!empty($field['output_html'])) |
|
| 195 | 197 | echo ' |
| 196 | 198 | <li>', $field['output_html'], '</li>'; |
| 199 | + } |
|
| 197 | 200 | |
| 198 | 201 | echo ' |
| 199 | 202 | </ul> |
@@ -205,22 +208,25 @@ discard block |
||
| 205 | 208 | <ul class="clear">'; |
| 206 | 209 | |
| 207 | 210 | // Email is only visible if it's your profile or you have the moderate_forum permission |
| 208 | - if ($context['member']['show_email']) |
|
| 209 | - echo ' |
|
| 211 | + if ($context['member']['show_email']) { |
|
| 212 | + echo ' |
|
| 210 | 213 | <li><a href="mailto:', $context['member']['email'], '" title="', $context['member']['email'], '" rel="nofollow"><span class="generic_icons mail" title="' . $txt['email'] . '"></span></a></li>'; |
| 214 | + } |
|
| 211 | 215 | |
| 212 | 216 | // Don't show an icon if they haven't specified a website. |
| 213 | - if ($context['member']['website']['url'] !== '' && !isset($context['disabled_fields']['website'])) |
|
| 214 | - echo ' |
|
| 217 | + if ($context['member']['website']['url'] !== '' && !isset($context['disabled_fields']['website'])) { |
|
| 218 | + echo ' |
|
| 215 | 219 | <li><a href="', $context['member']['website']['url'], '" title="' . $context['member']['website']['title'] . '" target="_blank">', ($settings['use_image_buttons'] ? '<span class="generic_icons www" title="' . $context['member']['website']['title'] . '"></span>' : $txt['www']), '</a></li>'; |
| 220 | + } |
|
| 216 | 221 | |
| 217 | 222 | // Are there any custom profile fields as icons? |
| 218 | 223 | if (!empty($context['print_custom_fields']['icons'])) |
| 219 | 224 | { |
| 220 | - foreach ($context['print_custom_fields']['icons'] as $field) |
|
| 221 | - if (!empty($field['output_html'])) |
|
| 225 | + foreach ($context['print_custom_fields']['icons'] as $field) { |
|
| 226 | + if (!empty($field['output_html'])) |
|
| 222 | 227 | echo ' |
| 223 | 228 | <li class="custom_field">', $field['output_html'], '</li>'; |
| 229 | + } |
|
| 224 | 230 | } |
| 225 | 231 | |
| 226 | 232 | echo ' |
@@ -229,24 +235,27 @@ discard block |
||
| 229 | 235 | ', $context['can_send_pm'] ? '<a href="' . $context['member']['online']['href'] . '" title="' . $context['member']['online']['text'] . '" rel="nofollow">' : '', $settings['use_image_buttons'] ? '<span class="' . ($context['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $context['member']['online']['text'] . '"></span>' : $context['member']['online']['label'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $context['member']['online']['label'] . '</span>' : ''; |
| 230 | 236 | |
| 231 | 237 | // Can they add this member as a buddy? |
| 232 | - if (!empty($context['can_have_buddy']) && !$context['user']['is_owner']) |
|
| 233 | - echo ' |
|
| 238 | + if (!empty($context['can_have_buddy']) && !$context['user']['is_owner']) { |
|
| 239 | + echo ' |
|
| 234 | 240 | <br> |
| 235 | 241 | <a href="', $scripturl, '?action=buddy;u=', $context['id_member'], ';', $context['session_var'], '=', $context['session_id'], '">[', $txt['buddy_' . ($context['member']['is_buddy'] ? 'remove' : 'add')], ']</a>'; |
| 242 | + } |
|
| 236 | 243 | |
| 237 | 244 | echo ' |
| 238 | 245 | </span>'; |
| 239 | 246 | |
| 240 | - if (!$context['user']['is_owner'] && $context['can_send_pm']) |
|
| 241 | - echo ' |
|
| 247 | + if (!$context['user']['is_owner'] && $context['can_send_pm']) { |
|
| 248 | + echo ' |
|
| 242 | 249 | <a href="', $scripturl, '?action=pm;sa=send;u=', $context['id_member'], '" class="infolinks">', $txt['profile_sendpm_short'], '</a>'; |
| 250 | + } |
|
| 243 | 251 | |
| 244 | 252 | echo ' |
| 245 | 253 | <a href="', $scripturl, '?action=profile;area=showposts;u=', $context['id_member'], '" class="infolinks">', $txt['showPosts'], '</a>'; |
| 246 | 254 | |
| 247 | - if ($context['user']['is_owner'] && !empty($modSettings['drafts_post_enabled'])) |
|
| 248 | - echo ' |
|
| 255 | + if ($context['user']['is_owner'] && !empty($modSettings['drafts_post_enabled'])) { |
|
| 256 | + echo ' |
|
| 249 | 257 | <a href="', $scripturl, '?action=profile;area=showdrafts;u=', $context['id_member'], '" class="infolinks">', $txt['drafts_show'], '</a>'; |
| 258 | + } |
|
| 250 | 259 | |
| 251 | 260 | echo ' |
| 252 | 261 | <a href="', $scripturl, '?action=profile;area=statistics;u=', $context['id_member'], '" class="infolinks">', $txt['statPanel'], '</a>'; |
@@ -258,10 +267,11 @@ discard block |
||
| 258 | 267 | <div class="custom_fields_bottom"> |
| 259 | 268 | <ul class="nolist">'; |
| 260 | 269 | |
| 261 | - foreach ($context['print_custom_fields']['bottom_poster'] as $field) |
|
| 262 | - if (!empty($field['output_html'])) |
|
| 270 | + foreach ($context['print_custom_fields']['bottom_poster'] as $field) { |
|
| 271 | + if (!empty($field['output_html'])) |
|
| 263 | 272 | echo ' |
| 264 | 273 | <li>', $field['output_html'], '</li>'; |
| 274 | + } |
|
| 265 | 275 | |
| 266 | 276 | echo ' |
| 267 | 277 | </ul> |
@@ -274,15 +284,17 @@ discard block |
||
| 274 | 284 | <div id="detailedinfo"> |
| 275 | 285 | <dl class="settings">'; |
| 276 | 286 | |
| 277 | - if ($context['user']['is_owner'] || $context['user']['is_admin']) |
|
| 278 | - echo ' |
|
| 287 | + if ($context['user']['is_owner'] || $context['user']['is_admin']) { |
|
| 288 | + echo ' |
|
| 279 | 289 | <dt>', $txt['username'], ': </dt> |
| 280 | 290 | <dd>', $context['member']['username'], '</dd>'; |
| 291 | + } |
|
| 281 | 292 | |
| 282 | - if (!isset($context['disabled_fields']['posts'])) |
|
| 283 | - echo ' |
|
| 293 | + if (!isset($context['disabled_fields']['posts'])) { |
|
| 294 | + echo ' |
|
| 284 | 295 | <dt>', $txt['profile_posts'], ': </dt> |
| 285 | 296 | <dd>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</dd>'; |
| 297 | + } |
|
| 286 | 298 | |
| 287 | 299 | if ($context['member']['show_email']) |
| 288 | 300 | { |
@@ -291,15 +303,17 @@ discard block |
||
| 291 | 303 | <dd><a href="mailto:', $context['member']['email'], '">', $context['member']['email'], '</a></dd>'; |
| 292 | 304 | } |
| 293 | 305 | |
| 294 | - if (!empty($modSettings['titlesEnable']) && !empty($context['member']['title'])) |
|
| 295 | - echo ' |
|
| 306 | + if (!empty($modSettings['titlesEnable']) && !empty($context['member']['title'])) { |
|
| 307 | + echo ' |
|
| 296 | 308 | <dt>', $txt['custom_title'], ': </dt> |
| 297 | 309 | <dd>', $context['member']['title'], '</dd>'; |
| 310 | + } |
|
| 298 | 311 | |
| 299 | - if (!empty($context['member']['blurb'])) |
|
| 300 | - echo ' |
|
| 312 | + if (!empty($context['member']['blurb'])) { |
|
| 313 | + echo ' |
|
| 301 | 314 | <dt>', $txt['personal_text'], ': </dt> |
| 302 | 315 | <dd>', $context['member']['blurb'], '</dd>'; |
| 316 | + } |
|
| 303 | 317 | |
| 304 | 318 | echo ' |
| 305 | 319 | <dt>', $txt['age'], ':</dt> |
@@ -313,19 +327,21 @@ discard block |
||
| 313 | 327 | { |
| 314 | 328 | $fields = array(); |
| 315 | 329 | |
| 316 | - foreach ($context['print_custom_fields']['standard'] as $field) |
|
| 317 | - if (!empty($field['output_html'])) |
|
| 330 | + foreach ($context['print_custom_fields']['standard'] as $field) { |
|
| 331 | + if (!empty($field['output_html'])) |
|
| 318 | 332 | $fields[] = $field; |
| 333 | + } |
|
| 319 | 334 | |
| 320 | 335 | if (count($fields) > 0) |
| 321 | 336 | { |
| 322 | 337 | echo ' |
| 323 | 338 | <dl class="settings">'; |
| 324 | 339 | |
| 325 | - foreach ($fields as $field) |
|
| 326 | - echo ' |
|
| 340 | + foreach ($fields as $field) { |
|
| 341 | + echo ' |
|
| 327 | 342 | <dt>', $field['name'], ':</dt> |
| 328 | 343 | <dd>', $field['output_html'], '</dd>'; |
| 344 | + } |
|
| 329 | 345 | |
| 330 | 346 | echo ' |
| 331 | 347 | </dl>'; |
@@ -345,9 +361,10 @@ discard block |
||
| 345 | 361 | <a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=', ($context['can_issue_warning'] && !$context['user']['is_owner'] ? 'issuewarning' : 'viewwarning'), '">', $context['member']['warning'], '%</a>'; |
| 346 | 362 | |
| 347 | 363 | // Can we provide information on what this means? |
| 348 | - if (!empty($context['warning_status'])) |
|
| 349 | - echo ' |
|
| 364 | + if (!empty($context['warning_status'])) { |
|
| 365 | + echo ' |
|
| 350 | 366 | <span class="smalltext">(', $context['warning_status'], ')</span>'; |
| 367 | + } |
|
| 351 | 368 | |
| 352 | 369 | echo ' |
| 353 | 370 | </dd>'; |
@@ -358,9 +375,10 @@ discard block |
||
| 358 | 375 | { |
| 359 | 376 | |
| 360 | 377 | // If the person looking at the summary has permission, and the account isn't activated, give the viewer the ability to do it themselves. |
| 361 | - if (!empty($context['activate_message'])) |
|
| 362 | - echo ' |
|
| 378 | + if (!empty($context['activate_message'])) { |
|
| 379 | + echo ' |
|
| 363 | 380 | <dt class="clear"><span class="alert">', $context['activate_message'], '</span> (<a href="', $context['activate_link'], '"', ($context['activate_type'] == 4 ? ' class="you_sure" data-confirm="' . $txt['profileConfirm'] . '"' : ''), '>', $context['activate_link_text'], '</a>)</dt>'; |
| 381 | + } |
|
| 364 | 382 | |
| 365 | 383 | // If the current member is banned, show a message and possibly a link to the ban. |
| 366 | 384 | if (!empty($context['member']['bans'])) |
@@ -372,10 +390,11 @@ discard block |
||
| 372 | 390 | <dt class="clear" id="ban_info" style="display: none;"> |
| 373 | 391 | <strong>', $txt['user_banned_by_following'], ':</strong>'; |
| 374 | 392 | |
| 375 | - foreach ($context['member']['bans'] as $ban) |
|
| 376 | - echo ' |
|
| 393 | + foreach ($context['member']['bans'] as $ban) { |
|
| 394 | + echo ' |
|
| 377 | 395 | <br> |
| 378 | 396 | <span class="smalltext">', $ban['explanation'], '</span>'; |
| 397 | + } |
|
| 379 | 398 | |
| 380 | 399 | echo ' |
| 381 | 400 | </dt>'; |
@@ -389,30 +408,34 @@ discard block |
||
| 389 | 408 | // If the person looking is allowed, they can check the members IP address and hostname. |
| 390 | 409 | if ($context['can_see_ip']) |
| 391 | 410 | { |
| 392 | - if (!empty($context['member']['ip'])) |
|
| 393 | - echo ' |
|
| 411 | + if (!empty($context['member']['ip'])) { |
|
| 412 | + echo ' |
|
| 394 | 413 | <dt>', $txt['ip'], ': </dt> |
| 395 | 414 | <dd><a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['member']['ip'], ';u=', $context['member']['id'], '">', $context['member']['ip'], '</a></dd>'; |
| 415 | + } |
|
| 396 | 416 | |
| 397 | - if (empty($modSettings['disableHostnameLookup']) && !empty($context['member']['ip'])) |
|
| 398 | - echo ' |
|
| 417 | + if (empty($modSettings['disableHostnameLookup']) && !empty($context['member']['ip'])) { |
|
| 418 | + echo ' |
|
| 399 | 419 | <dt>', $txt['hostname'], ': </dt> |
| 400 | 420 | <dd>', $context['member']['hostname'], '</dd>'; |
| 421 | + } |
|
| 401 | 422 | } |
| 402 | 423 | |
| 403 | 424 | echo ' |
| 404 | 425 | <dt>', $txt['local_time'], ':</dt> |
| 405 | 426 | <dd>', $context['member']['local_time'], '</dd>'; |
| 406 | 427 | |
| 407 | - if (!empty($modSettings['userLanguage']) && !empty($context['member']['language'])) |
|
| 408 | - echo ' |
|
| 428 | + if (!empty($modSettings['userLanguage']) && !empty($context['member']['language'])) { |
|
| 429 | + echo ' |
|
| 409 | 430 | <dt>', $txt['language'], ':</dt> |
| 410 | 431 | <dd>', $context['member']['language'], '</dd>'; |
| 432 | + } |
|
| 411 | 433 | |
| 412 | - if ($context['member']['show_last_login']) |
|
| 413 | - echo ' |
|
| 434 | + if ($context['member']['show_last_login']) { |
|
| 435 | + echo ' |
|
| 414 | 436 | <dt>', $txt['lastLoggedIn'], ': </dt> |
| 415 | 437 | <dd>', $context['member']['last_login'], (!empty($context['member']['is_hidden']) ? ' (' . $txt['hidden'] . ')' : ''), '</dd>'; |
| 438 | + } |
|
| 416 | 439 | |
| 417 | 440 | echo ' |
| 418 | 441 | </dl>'; |
@@ -424,10 +447,11 @@ discard block |
||
| 424 | 447 | <div class="custom_fields_above_signature"> |
| 425 | 448 | <ul class="nolist">'; |
| 426 | 449 | |
| 427 | - foreach ($context['print_custom_fields']['above_signature'] as $field) |
|
| 428 | - if (!empty($field['output_html'])) |
|
| 450 | + foreach ($context['print_custom_fields']['above_signature'] as $field) { |
|
| 451 | + if (!empty($field['output_html'])) |
|
| 429 | 452 | echo ' |
| 430 | 453 | <li>', $field['output_html'], '</li>'; |
| 454 | + } |
|
| 431 | 455 | |
| 432 | 456 | echo ' |
| 433 | 457 | </ul> |
@@ -435,12 +459,13 @@ discard block |
||
| 435 | 459 | } |
| 436 | 460 | |
| 437 | 461 | // Show the users signature. |
| 438 | - if ($context['signature_enabled'] && !empty($context['member']['signature'])) |
|
| 439 | - echo ' |
|
| 462 | + if ($context['signature_enabled'] && !empty($context['member']['signature'])) { |
|
| 463 | + echo ' |
|
| 440 | 464 | <div class="signature"> |
| 441 | 465 | <h5>', $txt['signature'], ':</h5> |
| 442 | 466 | ', $context['member']['signature'], ' |
| 443 | 467 | </div>'; |
| 468 | + } |
|
| 444 | 469 | |
| 445 | 470 | // Are there any custom profile fields for below the signature? |
| 446 | 471 | if (!empty($context['print_custom_fields']['below_signature'])) |
@@ -449,10 +474,11 @@ discard block |
||
| 449 | 474 | <div class="custom_fields_below_signature"> |
| 450 | 475 | <ul class="nolist">'; |
| 451 | 476 | |
| 452 | - foreach ($context['print_custom_fields']['below_signature'] as $field) |
|
| 453 | - if (!empty($field['output_html'])) |
|
| 477 | + foreach ($context['print_custom_fields']['below_signature'] as $field) { |
|
| 478 | + if (!empty($field['output_html'])) |
|
| 454 | 479 | echo ' |
| 455 | 480 | <li>', $field['output_html'], '</li>'; |
| 481 | + } |
|
| 456 | 482 | |
| 457 | 483 | echo ' |
| 458 | 484 | </ul> |
@@ -498,62 +524,70 @@ discard block |
||
| 498 | 524 | </div> |
| 499 | 525 | <div class="list_posts">'; |
| 500 | 526 | |
| 501 | - if (!$post['approved']) |
|
| 502 | - echo ' |
|
| 527 | + if (!$post['approved']) { |
|
| 528 | + echo ' |
|
| 503 | 529 | <div class="approve_post"> |
| 504 | 530 | <em>', $txt['post_awaiting_approval'], '</em> |
| 505 | 531 | </div>'; |
| 532 | + } |
|
| 506 | 533 | |
| 507 | 534 | echo ' |
| 508 | 535 | ', $post['body'], ' |
| 509 | 536 | </div>'; |
| 510 | 537 | |
| 511 | - if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) |
|
| 512 | - echo ' |
|
| 538 | + if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) { |
|
| 539 | + echo ' |
|
| 513 | 540 | <div class="floatright"> |
| 514 | 541 | <ul class="quickbuttons">'; |
| 542 | + } |
|
| 515 | 543 | |
| 516 | 544 | // If they *can* reply? |
| 517 | - if ($post['can_reply']) |
|
| 518 | - echo ' |
|
| 545 | + if ($post['can_reply']) { |
|
| 546 | + echo ' |
|
| 519 | 547 | <li><a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>'; |
| 548 | + } |
|
| 520 | 549 | |
| 521 | 550 | // If they *can* quote? |
| 522 | - if ($post['can_quote']) |
|
| 523 | - echo ' |
|
| 551 | + if ($post['can_quote']) { |
|
| 552 | + echo ' |
|
| 524 | 553 | <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>'; |
| 554 | + } |
|
| 525 | 555 | |
| 526 | 556 | // How about... even... remove it entirely?! |
| 527 | - if ($post['can_delete']) |
|
| 528 | - echo ' |
|
| 557 | + if ($post['can_delete']) { |
|
| 558 | + echo ' |
|
| 529 | 559 | <li><a href="', $scripturl, '?action=deletemsg;msg=', $post['id'], ';topic=', $post['topic'], ';profile;u=', $context['member']['id'], ';start=', $context['start'], ';', $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>'; |
| 560 | + } |
|
| 530 | 561 | |
| 531 | - if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) |
|
| 532 | - echo ' |
|
| 562 | + if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) { |
|
| 563 | + echo ' |
|
| 533 | 564 | </ul> |
| 534 | 565 | </div><!-- .floatright -->'; |
| 566 | + } |
|
| 535 | 567 | |
| 536 | 568 | echo ' |
| 537 | 569 | </div><!-- $post[css_class] -->'; |
| 538 | 570 | } |
| 571 | + } else { |
|
| 572 | + template_show_list('attachments'); |
|
| 539 | 573 | } |
| 540 | - else |
|
| 541 | - template_show_list('attachments'); |
|
| 542 | 574 | |
| 543 | 575 | // No posts? Just end with a informative message. |
| 544 | - if ((isset($context['attachments']) && empty($context['attachments'])) || (!isset($context['attachments']) && empty($context['posts']))) |
|
| 545 | - echo ' |
|
| 576 | + if ((isset($context['attachments']) && empty($context['attachments'])) || (!isset($context['attachments']) && empty($context['posts']))) { |
|
| 577 | + echo ' |
|
| 546 | 578 | <div class="windowbg2"> |
| 547 | 579 | ', isset($context['attachments']) ? $txt['show_attachments_none'] : ($context['is_topics'] ? $txt['show_topics_none'] : $txt['show_posts_none']), ' |
| 548 | 580 | </div>'; |
| 581 | + } |
|
| 549 | 582 | |
| 550 | 583 | // Show more page numbers. |
| 551 | - if (!empty($context['page_index'])) |
|
| 552 | - echo ' |
|
| 584 | + if (!empty($context['page_index'])) { |
|
| 585 | + echo ' |
|
| 553 | 586 | <div class="pagesection"> |
| 554 | 587 | <div class="pagelinks">', $context['page_index'], '</div> |
| 555 | 588 | </div>'; |
| 556 | -} |
|
| 589 | + } |
|
| 590 | + } |
|
| 557 | 591 | |
| 558 | 592 | /** |
| 559 | 593 | * Template for showing alerts within the alerts popup |
@@ -563,11 +597,12 @@ discard block |
||
| 563 | 597 | global $context, $txt, $scripturl; |
| 564 | 598 | |
| 565 | 599 | // Do we have an update message? |
| 566 | - if (!empty($context['update_message'])) |
|
| 567 | - echo ' |
|
| 600 | + if (!empty($context['update_message'])) { |
|
| 601 | + echo ' |
|
| 568 | 602 | <div class="infobox"> |
| 569 | 603 | ', $context['update_message'], '. |
| 570 | 604 | </div>'; |
| 605 | + } |
|
| 571 | 606 | |
| 572 | 607 | echo ' |
| 573 | 608 | <div class="cat_bar"> |
@@ -576,13 +611,12 @@ discard block |
||
| 576 | 611 | </h3> |
| 577 | 612 | </div>'; |
| 578 | 613 | |
| 579 | - if (empty($context['alerts'])) |
|
| 580 | - echo ' |
|
| 614 | + if (empty($context['alerts'])) { |
|
| 615 | + echo ' |
|
| 581 | 616 | <div class="information"> |
| 582 | 617 | ', $txt['alerts_none'], ' |
| 583 | 618 | </div>'; |
| 584 | - |
|
| 585 | - else |
|
| 619 | + } else |
|
| 586 | 620 | { |
| 587 | 621 | // Start the form. |
| 588 | 622 | echo ' |
@@ -644,12 +678,12 @@ discard block |
||
| 644 | 678 | </div>' : ''; |
| 645 | 679 | |
| 646 | 680 | // No drafts? Just show an informative message. |
| 647 | - if (empty($context['drafts'])) |
|
| 648 | - echo ' |
|
| 681 | + if (empty($context['drafts'])) { |
|
| 682 | + echo ' |
|
| 649 | 683 | <div class="windowbg2 centertext"> |
| 650 | 684 | ', $txt['draft_none'], ' |
| 651 | 685 | </div>'; |
| 652 | - else |
|
| 686 | + } else |
|
| 653 | 687 | { |
| 654 | 688 | // For every draft to be displayed, give it its own div, and show the important details of the draft. |
| 655 | 689 | foreach ($context['drafts'] as $draft) |
@@ -661,13 +695,15 @@ discard block |
||
| 661 | 695 | <h5> |
| 662 | 696 | <strong><a href="', $scripturl, '?board=', $draft['board']['id'], '.0">', $draft['board']['name'], '</a> / ', $draft['topic']['link'], '</strong> '; |
| 663 | 697 | |
| 664 | - if (!empty($draft['sticky'])) |
|
| 665 | - echo ' |
|
| 698 | + if (!empty($draft['sticky'])) { |
|
| 699 | + echo ' |
|
| 666 | 700 | <span class="generic_icons sticky" title="', $txt['sticky_topic'], '"></span>'; |
| 701 | + } |
|
| 667 | 702 | |
| 668 | - if (!empty($draft['locked'])) |
|
| 669 | - echo ' |
|
| 703 | + if (!empty($draft['locked'])) { |
|
| 704 | + echo ' |
|
| 670 | 705 | <span class="generic_icons lock" title="', $txt['locked_topic'], '"></span>'; |
| 706 | + } |
|
| 671 | 707 | |
| 672 | 708 | echo ' |
| 673 | 709 | </h5> |
@@ -700,13 +736,13 @@ discard block |
||
| 700 | 736 | { |
| 701 | 737 | global $context, $scripturl, $txt; |
| 702 | 738 | |
| 703 | - if (!empty($context['saved_successful'])) |
|
| 704 | - echo ' |
|
| 739 | + if (!empty($context['saved_successful'])) { |
|
| 740 | + echo ' |
|
| 705 | 741 | <div class="infobox">', $context['user']['is_owner'] ? $txt['profile_updated_own'] : sprintf($txt['profile_updated_else'], $context['member']['name']), '</div>'; |
| 706 | - |
|
| 707 | - elseif (!empty($context['saved_failed'])) |
|
| 708 | - echo ' |
|
| 742 | + } elseif (!empty($context['saved_failed'])) { |
|
| 743 | + echo ' |
|
| 709 | 744 | <div class="errorbox">', $context['saved_failed'], '</div>'; |
| 745 | + } |
|
| 710 | 746 | |
| 711 | 747 | echo ' |
| 712 | 748 | <div id="edit_buddies"> |
@@ -721,14 +757,16 @@ discard block |
||
| 721 | 757 | <th scope="col" class="quarter_table">', $txt['name'], '</th> |
| 722 | 758 | <th scope="col">', $txt['status'], '</th>'; |
| 723 | 759 | |
| 724 | - if (allowedTo('moderate_forum')) |
|
| 725 | - echo ' |
|
| 760 | + if (allowedTo('moderate_forum')) { |
|
| 761 | + echo ' |
|
| 726 | 762 | <th scope="col">', $txt['email'], '</th>'; |
| 763 | + } |
|
| 727 | 764 | |
| 728 | - if (!empty($context['custom_pf'])) |
|
| 729 | - foreach ($context['custom_pf'] as $column) |
|
| 765 | + if (!empty($context['custom_pf'])) { |
|
| 766 | + foreach ($context['custom_pf'] as $column) |
|
| 730 | 767 | echo ' |
| 731 | 768 | <th scope="col">', $column['label'], '</th>'; |
| 769 | + } |
|
| 732 | 770 | |
| 733 | 771 | echo ' |
| 734 | 772 | <th scope="col">', $txt['remove'], '</th> |
@@ -737,13 +775,14 @@ discard block |
||
| 737 | 775 | <tbody>'; |
| 738 | 776 | |
| 739 | 777 | // If they don't have any buddies don't list them! |
| 740 | - if (empty($context['buddies'])) |
|
| 741 | - echo ' |
|
| 778 | + if (empty($context['buddies'])) { |
|
| 779 | + echo ' |
|
| 742 | 780 | <tr class="windowbg"> |
| 743 | 781 | <td colspan="', allowedTo('moderate_forum') ? '10' : '9', '"> |
| 744 | 782 | <strong>', $txt['no_buddies'], '</strong> |
| 745 | 783 | </td> |
| 746 | 784 | </tr>'; |
| 785 | + } |
|
| 747 | 786 | |
| 748 | 787 | // Now loop through each buddy showing info on each. |
| 749 | 788 | else |
@@ -757,17 +796,19 @@ discard block |
||
| 757 | 796 | <a href="', $buddy['online']['href'], '"><span class="' . ($buddy['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $buddy['online']['text'] . '"></span></a> |
| 758 | 797 | </td>'; |
| 759 | 798 | |
| 760 | - if ($buddy['show_email']) |
|
| 761 | - echo ' |
|
| 799 | + if ($buddy['show_email']) { |
|
| 800 | + echo ' |
|
| 762 | 801 | <td> |
| 763 | 802 | <a href="mailto:' . $buddy['email'] . '" rel="nofollow"><span class="generic_icons mail icon" title="' . $txt['email'] . ' ' . $buddy['name'] . '"></span></a> |
| 764 | 803 | </td>'; |
| 804 | + } |
|
| 765 | 805 | |
| 766 | 806 | // Show the custom profile fields for this user. |
| 767 | - if (!empty($context['custom_pf'])) |
|
| 768 | - foreach ($context['custom_pf'] as $key => $column) |
|
| 807 | + if (!empty($context['custom_pf'])) { |
|
| 808 | + foreach ($context['custom_pf'] as $key => $column) |
|
| 769 | 809 | echo ' |
| 770 | 810 | <td class="lefttext">', $buddy['options'][$key], '</td>'; |
| 811 | + } |
|
| 771 | 812 | |
| 772 | 813 | echo ' |
| 773 | 814 | <td> |
@@ -800,9 +841,10 @@ discard block |
||
| 800 | 841 | </dl> |
| 801 | 842 | </div>'; |
| 802 | 843 | |
| 803 | - if (!empty($context['token_check'])) |
|
| 804 | - echo ' |
|
| 844 | + if (!empty($context['token_check'])) { |
|
| 845 | + echo ' |
|
| 805 | 846 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
| 847 | + } |
|
| 806 | 848 | |
| 807 | 849 | echo ' |
| 808 | 850 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -828,12 +870,13 @@ discard block |
||
| 828 | 870 | { |
| 829 | 871 | global $context, $scripturl, $txt; |
| 830 | 872 | |
| 831 | - if (!empty($context['saved_successful'])) |
|
| 832 | - echo ' |
|
| 873 | + if (!empty($context['saved_successful'])) { |
|
| 874 | + echo ' |
|
| 833 | 875 | <div class="infobox">', $context['user']['is_owner'] ? $txt['profile_updated_own'] : sprintf($txt['profile_updated_else'], $context['member']['name']), '</div>'; |
| 834 | - elseif (!empty($context['saved_failed'])) |
|
| 835 | - echo ' |
|
| 876 | + } elseif (!empty($context['saved_failed'])) { |
|
| 877 | + echo ' |
|
| 836 | 878 | <div class="errorbox">', $context['saved_failed'], '</div>'; |
| 879 | + } |
|
| 837 | 880 | |
| 838 | 881 | echo ' |
| 839 | 882 | <div id="edit_buddies"> |
@@ -848,9 +891,10 @@ discard block |
||
| 848 | 891 | <th scope="col" class="quarter_table">', $txt['name'], '</th> |
| 849 | 892 | <th scope="col">', $txt['status'], '</th>'; |
| 850 | 893 | |
| 851 | - if (allowedTo('moderate_forum')) |
|
| 852 | - echo ' |
|
| 894 | + if (allowedTo('moderate_forum')) { |
|
| 895 | + echo ' |
|
| 853 | 896 | <th scope="col">', $txt['email'], '</th>'; |
| 897 | + } |
|
| 854 | 898 | |
| 855 | 899 | echo ' |
| 856 | 900 | <th scope="col">', $txt['ignore_remove'], '</th> |
@@ -859,13 +903,14 @@ discard block |
||
| 859 | 903 | <tbody>'; |
| 860 | 904 | |
| 861 | 905 | // If they don't have anyone on their ignore list, don't list it! |
| 862 | - if (empty($context['ignore_list'])) |
|
| 863 | - echo ' |
|
| 906 | + if (empty($context['ignore_list'])) { |
|
| 907 | + echo ' |
|
| 864 | 908 | <tr class="windowbg"> |
| 865 | 909 | <td colspan="', allowedTo('moderate_forum') ? '4' : '3', '"> |
| 866 | 910 | <strong>', $txt['no_ignore'], '</strong> |
| 867 | 911 | </td> |
| 868 | 912 | </tr>'; |
| 913 | + } |
|
| 869 | 914 | |
| 870 | 915 | // Now loop through each buddy showing info on each. |
| 871 | 916 | foreach ($context['ignore_list'] as $member) |
@@ -877,11 +922,12 @@ discard block |
||
| 877 | 922 | <a href="', $member['online']['href'], '"><span class="' . ($member['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $member['online']['text'] . '"></span></a> |
| 878 | 923 | </td>'; |
| 879 | 924 | |
| 880 | - if ($member['show_email']) |
|
| 881 | - echo ' |
|
| 925 | + if ($member['show_email']) { |
|
| 926 | + echo ' |
|
| 882 | 927 | <td> |
| 883 | 928 | <a href="mailto:' . $member['email'] . '" rel="nofollow"><span class="generic_icons mail icon" title="' . $txt['email'] . ' ' . $member['name'] . '"></span></a> |
| 884 | 929 | </td>'; |
| 930 | + } |
|
| 885 | 931 | echo ' |
| 886 | 932 | <td> |
| 887 | 933 | <a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=lists;sa=ignore;remove=', $member['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons delete" title="', $txt['ignore_remove'], '"></span></a> |
@@ -911,9 +957,10 @@ discard block |
||
| 911 | 957 | </dl> |
| 912 | 958 | </div>'; |
| 913 | 959 | |
| 914 | - if (!empty($context['token_check'])) |
|
| 915 | - echo ' |
|
| 960 | + if (!empty($context['token_check'])) { |
|
| 961 | + echo ' |
|
| 916 | 962 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
| 963 | + } |
|
| 917 | 964 | |
| 918 | 965 | echo ' |
| 919 | 966 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -959,9 +1006,10 @@ discard block |
||
| 959 | 1006 | <a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['last_ip'], ';u=', $context['member']['id'], '">', $context['last_ip'], '</a>'; |
| 960 | 1007 | |
| 961 | 1008 | // Second address detected? |
| 962 | - if (!empty($context['last_ip2'])) |
|
| 963 | - echo ' |
|
| 1009 | + if (!empty($context['last_ip2'])) { |
|
| 1010 | + echo ' |
|
| 964 | 1011 | , <a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['last_ip2'], ';u=', $context['member']['id'], '">', $context['last_ip2'], '</a>'; |
| 1012 | + } |
|
| 965 | 1013 | |
| 966 | 1014 | echo ' |
| 967 | 1015 | </dd>'; |
@@ -1027,9 +1075,10 @@ discard block |
||
| 1027 | 1075 | </div> |
| 1028 | 1076 | <div class="windowbg2 noup">'; |
| 1029 | 1077 | |
| 1030 | - foreach ($context['whois_servers'] as $server) |
|
| 1031 | - echo ' |
|
| 1078 | + foreach ($context['whois_servers'] as $server) { |
|
| 1079 | + echo ' |
|
| 1032 | 1080 | <a href="', $server['url'], '" target="_blank"', isset($context['auto_whois_server']) && $context['auto_whois_server']['name'] == $server['name'] ? ' style="font-weight: bold;"' : '', '>', $server['name'], '</a><br>'; |
| 1081 | + } |
|
| 1033 | 1082 | echo ' |
| 1034 | 1083 | </div> |
| 1035 | 1084 | <br>'; |
@@ -1040,10 +1089,10 @@ discard block |
||
| 1040 | 1089 | <div class="cat_bar"> |
| 1041 | 1090 | <h3 class="catbg">', $txt['members_from_ip'], ' ', $context['ip'], '</h3> |
| 1042 | 1091 | </div>'; |
| 1043 | - if (empty($context['ips'])) |
|
| 1044 | - echo ' |
|
| 1092 | + if (empty($context['ips'])) { |
|
| 1093 | + echo ' |
|
| 1045 | 1094 | <p class="windowbg2 description"><em>', $txt['no_members_from_ip'], '</em></p>'; |
| 1046 | - else |
|
| 1095 | + } else |
|
| 1047 | 1096 | { |
| 1048 | 1097 | echo ' |
| 1049 | 1098 | <table class="table_grid"> |
@@ -1056,12 +1105,13 @@ discard block |
||
| 1056 | 1105 | <tbody>'; |
| 1057 | 1106 | |
| 1058 | 1107 | // Loop through each of the members and display them. |
| 1059 | - foreach ($context['ips'] as $ip => $memberlist) |
|
| 1060 | - echo ' |
|
| 1108 | + foreach ($context['ips'] as $ip => $memberlist) { |
|
| 1109 | + echo ' |
|
| 1061 | 1110 | <tr class="windowbg"> |
| 1062 | 1111 | <td><a href="', $context['base_url'], ';searchip=', $ip, '">', $ip, '</a></td> |
| 1063 | 1112 | <td>', implode(', ', $memberlist), '</td> |
| 1064 | 1113 | </tr>'; |
| 1114 | + } |
|
| 1065 | 1115 | |
| 1066 | 1116 | echo ' |
| 1067 | 1117 | </tbody> |
@@ -1107,8 +1157,7 @@ discard block |
||
| 1107 | 1157 | { |
| 1108 | 1158 | echo ' |
| 1109 | 1159 | <div class="information">', $txt['showPermissions_all'], '</div>'; |
| 1110 | - } |
|
| 1111 | - else |
|
| 1160 | + } else |
|
| 1112 | 1161 | { |
| 1113 | 1162 | echo ' |
| 1114 | 1163 | <div class="information">',$txt['showPermissions_help'], '</div> |
@@ -1123,9 +1172,10 @@ discard block |
||
| 1123 | 1172 | <div class="windowbg smalltext"> |
| 1124 | 1173 | ', $txt['showPermissions_restricted_boards_desc'], ':<br>'; |
| 1125 | 1174 | |
| 1126 | - foreach ($context['no_access_boards'] as $no_access_board) |
|
| 1127 | - echo ' |
|
| 1175 | + foreach ($context['no_access_boards'] as $no_access_board) { |
|
| 1176 | + echo ' |
|
| 1128 | 1177 | <a href="', $scripturl, '?board=', $no_access_board['id'], '.0">', $no_access_board['name'], '</a>', $no_access_board['is_last'] ? '' : ', '; |
| 1178 | + } |
|
| 1129 | 1179 | echo ' |
| 1130 | 1180 | </div>'; |
| 1131 | 1181 | } |
@@ -1157,12 +1207,13 @@ discard block |
||
| 1157 | 1207 | </td> |
| 1158 | 1208 | <td class="smalltext">'; |
| 1159 | 1209 | |
| 1160 | - if ($permission['is_denied']) |
|
| 1161 | - echo ' |
|
| 1210 | + if ($permission['is_denied']) { |
|
| 1211 | + echo ' |
|
| 1162 | 1212 | <span class="alert">', $txt['showPermissions_denied'], ': ', implode(', ', $permission['groups']['denied']), '</span>'; |
| 1163 | - else |
|
| 1164 | - echo ' |
|
| 1213 | + } else { |
|
| 1214 | + echo ' |
|
| 1165 | 1215 | ', $txt['showPermissions_given'], ': ', implode(', ', $permission['groups']['allowed']); |
| 1216 | + } |
|
| 1166 | 1217 | |
| 1167 | 1218 | echo ' |
| 1168 | 1219 | </td> |
@@ -1173,10 +1224,10 @@ discard block |
||
| 1173 | 1224 | </table> |
| 1174 | 1225 | </div><!-- .tborder --> |
| 1175 | 1226 | <br>'; |
| 1176 | - } |
|
| 1177 | - else |
|
| 1178 | - echo ' |
|
| 1227 | + } else { |
|
| 1228 | + echo ' |
|
| 1179 | 1229 | <p class="windowbg2">', $txt['showPermissions_none_general'], '</p>'; |
| 1230 | + } |
|
| 1180 | 1231 | |
| 1181 | 1232 | // Board permission section. |
| 1182 | 1233 | echo ' |
@@ -1186,14 +1237,16 @@ discard block |
||
| 1186 | 1237 | <a id="board_permissions"></a>', $txt['showPermissions_select'], ': |
| 1187 | 1238 | <select name="board" onchange="if (this.options[this.selectedIndex].value) this.form.submit();"> |
| 1188 | 1239 | <option value="0"', $context['board'] == 0 ? ' selected' : '', '>', $txt['showPermissions_global'], ' </option>'; |
| 1189 | - if (!empty($context['boards'])) |
|
| 1190 | - echo ' |
|
| 1240 | + if (!empty($context['boards'])) { |
|
| 1241 | + echo ' |
|
| 1191 | 1242 | <option value="" disabled>---------------------------</option>'; |
| 1243 | + } |
|
| 1192 | 1244 | |
| 1193 | 1245 | // Fill the box with any local permission boards. |
| 1194 | - foreach ($context['boards'] as $board) |
|
| 1195 | - echo ' |
|
| 1246 | + foreach ($context['boards'] as $board) { |
|
| 1247 | + echo ' |
|
| 1196 | 1248 | <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['name'], ' (', $board['profile_name'], ')</option>'; |
| 1249 | + } |
|
| 1197 | 1250 | |
| 1198 | 1251 | echo ' |
| 1199 | 1252 | </select> |
@@ -1224,8 +1277,7 @@ discard block |
||
| 1224 | 1277 | { |
| 1225 | 1278 | echo ' |
| 1226 | 1279 | <span class="alert">', $txt['showPermissions_denied'], ': ', implode(', ', $permission['groups']['denied']), '</span>'; |
| 1227 | - } |
|
| 1228 | - else |
|
| 1280 | + } else |
|
| 1229 | 1281 | { |
| 1230 | 1282 | echo ' |
| 1231 | 1283 | ', $txt['showPermissions_given'], ': ', implode(', ', $permission['groups']['allowed']); |
@@ -1237,10 +1289,10 @@ discard block |
||
| 1237 | 1289 | echo ' |
| 1238 | 1290 | </tbody> |
| 1239 | 1291 | </table>'; |
| 1240 | - } |
|
| 1241 | - else |
|
| 1242 | - echo ' |
|
| 1292 | + } else { |
|
| 1293 | + echo ' |
|
| 1243 | 1294 | <p class="windowbg2">', $txt['showPermissions_none_board'], '</p>'; |
| 1295 | + } |
|
| 1244 | 1296 | echo ' |
| 1245 | 1297 | </div><!-- #permissions -->'; |
| 1246 | 1298 | } |
@@ -1281,9 +1333,10 @@ discard block |
||
| 1281 | 1333 | </div>'; |
| 1282 | 1334 | |
| 1283 | 1335 | // If they haven't post at all, don't draw the graph. |
| 1284 | - if (empty($context['posts_by_time'])) |
|
| 1285 | - echo ' |
|
| 1336 | + if (empty($context['posts_by_time'])) { |
|
| 1337 | + echo ' |
|
| 1286 | 1338 | <p class="centertext padding">', $txt['statPanel_noPosts'], '</p>'; |
| 1339 | + } |
|
| 1287 | 1340 | // Otherwise do! |
| 1288 | 1341 | else |
| 1289 | 1342 | { |
@@ -1321,11 +1374,10 @@ discard block |
||
| 1321 | 1374 | </h3> |
| 1322 | 1375 | </div>'; |
| 1323 | 1376 | |
| 1324 | - if (empty($context['popular_boards'])) |
|
| 1325 | - echo ' |
|
| 1377 | + if (empty($context['popular_boards'])) { |
|
| 1378 | + echo ' |
|
| 1326 | 1379 | <p class="centertext padding">', $txt['statPanel_noPosts'], '</p>'; |
| 1327 | - |
|
| 1328 | - else |
|
| 1380 | + } else |
|
| 1329 | 1381 | { |
| 1330 | 1382 | echo ' |
| 1331 | 1383 | <dl class="stats">'; |
@@ -1355,10 +1407,10 @@ discard block |
||
| 1355 | 1407 | </h3> |
| 1356 | 1408 | </div>'; |
| 1357 | 1409 | |
| 1358 | - if (empty($context['board_activity'])) |
|
| 1359 | - echo ' |
|
| 1410 | + if (empty($context['board_activity'])) { |
|
| 1411 | + echo ' |
|
| 1360 | 1412 | <p class="centertext padding">', $txt['statPanel_noPosts'], '</p>'; |
| 1361 | - else |
|
| 1413 | + } else |
|
| 1362 | 1414 | { |
| 1363 | 1415 | echo ' |
| 1364 | 1416 | <dl class="stats">'; |
@@ -1409,41 +1461,46 @@ discard block |
||
| 1409 | 1461 | <h3 class="catbg profile_hd">'; |
| 1410 | 1462 | |
| 1411 | 1463 | // Don't say "Profile" if this isn't the profile... |
| 1412 | - if (!empty($context['profile_header_text'])) |
|
| 1413 | - echo ' |
|
| 1464 | + if (!empty($context['profile_header_text'])) { |
|
| 1465 | + echo ' |
|
| 1414 | 1466 | ', $context['profile_header_text']; |
| 1415 | - else |
|
| 1416 | - echo ' |
|
| 1467 | + } else { |
|
| 1468 | + echo ' |
|
| 1417 | 1469 | ', $txt['profile']; |
| 1470 | + } |
|
| 1418 | 1471 | |
| 1419 | 1472 | echo ' |
| 1420 | 1473 | </h3> |
| 1421 | 1474 | </div>'; |
| 1422 | 1475 | |
| 1423 | 1476 | // Have we some description? |
| 1424 | - if ($context['page_desc']) |
|
| 1425 | - echo ' |
|
| 1477 | + if ($context['page_desc']) { |
|
| 1478 | + echo ' |
|
| 1426 | 1479 | <p class="information">', $context['page_desc'], '</p>'; |
| 1480 | + } |
|
| 1427 | 1481 | |
| 1428 | 1482 | echo ' |
| 1429 | 1483 | <div class="roundframe">'; |
| 1430 | 1484 | |
| 1431 | 1485 | // Any bits at the start? |
| 1432 | - if (!empty($context['profile_prehtml'])) |
|
| 1433 | - echo ' |
|
| 1486 | + if (!empty($context['profile_prehtml'])) { |
|
| 1487 | + echo ' |
|
| 1434 | 1488 | <div>', $context['profile_prehtml'], '</div>'; |
| 1489 | + } |
|
| 1435 | 1490 | |
| 1436 | - if (!empty($context['profile_fields'])) |
|
| 1437 | - echo ' |
|
| 1491 | + if (!empty($context['profile_fields'])) { |
|
| 1492 | + echo ' |
|
| 1438 | 1493 | <dl class="settings">'; |
| 1494 | + } |
|
| 1439 | 1495 | |
| 1440 | 1496 | // Start the big old loop 'of love. |
| 1441 | 1497 | $lastItem = 'hr'; |
| 1442 | 1498 | foreach ($context['profile_fields'] as $key => $field) |
| 1443 | 1499 | { |
| 1444 | 1500 | // We add a little hack to be sure we never get more than one hr in a row! |
| 1445 | - if ($lastItem == 'hr' && $field['type'] == 'hr') |
|
| 1446 | - continue; |
|
| 1501 | + if ($lastItem == 'hr' && $field['type'] == 'hr') { |
|
| 1502 | + continue; |
|
| 1503 | + } |
|
| 1447 | 1504 | |
| 1448 | 1505 | $lastItem = $field['type']; |
| 1449 | 1506 | if ($field['type'] == 'hr') |
@@ -1452,48 +1509,50 @@ discard block |
||
| 1452 | 1509 | </dl> |
| 1453 | 1510 | <hr> |
| 1454 | 1511 | <dl class="settings">'; |
| 1455 | - } |
|
| 1456 | - elseif ($field['type'] == 'callback') |
|
| 1512 | + } elseif ($field['type'] == 'callback') |
|
| 1457 | 1513 | { |
| 1458 | 1514 | if (isset($field['callback_func']) && function_exists('template_profile_' . $field['callback_func'])) |
| 1459 | 1515 | { |
| 1460 | 1516 | $callback_func = 'template_profile_' . $field['callback_func']; |
| 1461 | 1517 | $callback_func(); |
| 1462 | 1518 | } |
| 1463 | - } |
|
| 1464 | - else |
|
| 1519 | + } else |
|
| 1465 | 1520 | { |
| 1466 | 1521 | echo ' |
| 1467 | 1522 | <dt> |
| 1468 | 1523 | <strong', !empty($field['is_error']) ? ' class="error"' : '', '>', $field['type'] !== 'label' ? '<label for="' . $key . '">' : '', $field['label'], $field['type'] !== 'label' ? '</label>' : '', '</strong>'; |
| 1469 | 1524 | |
| 1470 | 1525 | // Does it have any subtext to show? |
| 1471 | - if (!empty($field['subtext'])) |
|
| 1472 | - echo ' |
|
| 1526 | + if (!empty($field['subtext'])) { |
|
| 1527 | + echo ' |
|
| 1473 | 1528 | <br> |
| 1474 | 1529 | <span class="smalltext">', $field['subtext'], '</span>'; |
| 1530 | + } |
|
| 1475 | 1531 | |
| 1476 | 1532 | echo ' |
| 1477 | 1533 | </dt> |
| 1478 | 1534 | <dd>'; |
| 1479 | 1535 | |
| 1480 | 1536 | // Want to put something infront of the box? |
| 1481 | - if (!empty($field['preinput'])) |
|
| 1482 | - echo ' |
|
| 1537 | + if (!empty($field['preinput'])) { |
|
| 1538 | + echo ' |
|
| 1483 | 1539 | ', $field['preinput']; |
| 1540 | + } |
|
| 1484 | 1541 | |
| 1485 | 1542 | // What type of data are we showing? |
| 1486 | - if ($field['type'] == 'label') |
|
| 1487 | - echo ' |
|
| 1543 | + if ($field['type'] == 'label') { |
|
| 1544 | + echo ' |
|
| 1488 | 1545 | ', $field['value']; |
| 1546 | + } |
|
| 1489 | 1547 | |
| 1490 | 1548 | // Maybe it's a text box - very likely! |
| 1491 | 1549 | elseif (in_array($field['type'], array('int', 'float', 'text', 'password', 'color', 'date', 'datetime', 'datetime-local', 'email', 'month', 'number', 'time', 'url'))) |
| 1492 | 1550 | { |
| 1493 | - if ($field['type'] == 'int' || $field['type'] == 'float') |
|
| 1494 | - $type = 'number'; |
|
| 1495 | - else |
|
| 1496 | - $type = $field['type']; |
|
| 1551 | + if ($field['type'] == 'int' || $field['type'] == 'float') { |
|
| 1552 | + $type = 'number'; |
|
| 1553 | + } else { |
|
| 1554 | + $type = $field['type']; |
|
| 1555 | + } |
|
| 1497 | 1556 | $step = $field['type'] == 'float' ? ' step="0.1"' : ''; |
| 1498 | 1557 | |
| 1499 | 1558 | |
@@ -1501,10 +1560,11 @@ discard block |
||
| 1501 | 1560 | <input type="', $type, '" name="', $key, '" id="', $key, '" size="', empty($field['size']) ? 30 : $field['size'], '" value="', $field['value'], '" ', $field['input_attr'], ' ', $step, '>'; |
| 1502 | 1561 | } |
| 1503 | 1562 | // You "checking" me out? ;) |
| 1504 | - elseif ($field['type'] == 'check') |
|
| 1505 | - echo ' |
|
| 1563 | + elseif ($field['type'] == 'check') { |
|
| 1564 | + echo ' |
|
| 1506 | 1565 | <input type="hidden" name="', $key, '" value="0"> |
| 1507 | 1566 | <input type="checkbox" name="', $key, '" id="', $key, '"', !empty($field['value']) ? ' checked' : '', ' value="1" ', $field['input_attr'], '>'; |
| 1567 | + } |
|
| 1508 | 1568 | |
| 1509 | 1569 | // Always fun - select boxes! |
| 1510 | 1570 | elseif ($field['type'] == 'select') |
@@ -1515,14 +1575,16 @@ discard block |
||
| 1515 | 1575 | if (isset($field['options'])) |
| 1516 | 1576 | { |
| 1517 | 1577 | // Is this some code to generate the options? |
| 1518 | - if (!is_array($field['options'])) |
|
| 1519 | - $field['options'] = $field['options'](); |
|
| 1578 | + if (!is_array($field['options'])) { |
|
| 1579 | + $field['options'] = $field['options'](); |
|
| 1580 | + } |
|
| 1520 | 1581 | |
| 1521 | 1582 | // Assuming we now have some! |
| 1522 | - if (is_array($field['options'])) |
|
| 1523 | - foreach ($field['options'] as $value => $name) |
|
| 1583 | + if (is_array($field['options'])) { |
|
| 1584 | + foreach ($field['options'] as $value => $name) |
|
| 1524 | 1585 | echo ' |
| 1525 | 1586 | <option value="', $value, '"', $value == $field['value'] ? ' selected' : '', '>', $name, '</option>'; |
| 1587 | + } |
|
| 1526 | 1588 | } |
| 1527 | 1589 | |
| 1528 | 1590 | echo ' |
@@ -1530,25 +1592,28 @@ discard block |
||
| 1530 | 1592 | } |
| 1531 | 1593 | |
| 1532 | 1594 | // Something to end with? |
| 1533 | - if (!empty($field['postinput'])) |
|
| 1534 | - echo ' |
|
| 1595 | + if (!empty($field['postinput'])) { |
|
| 1596 | + echo ' |
|
| 1535 | 1597 | ', $field['postinput']; |
| 1598 | + } |
|
| 1536 | 1599 | |
| 1537 | 1600 | echo ' |
| 1538 | 1601 | </dd>'; |
| 1539 | 1602 | } |
| 1540 | 1603 | } |
| 1541 | 1604 | |
| 1542 | - if (!empty($context['profile_fields'])) |
|
| 1543 | - echo ' |
|
| 1605 | + if (!empty($context['profile_fields'])) { |
|
| 1606 | + echo ' |
|
| 1544 | 1607 | </dl>'; |
| 1608 | + } |
|
| 1545 | 1609 | |
| 1546 | 1610 | // Are there any custom profile fields - if so print them! |
| 1547 | 1611 | if (!empty($context['custom_fields'])) |
| 1548 | 1612 | { |
| 1549 | - if ($lastItem != 'hr') |
|
| 1550 | - echo ' |
|
| 1613 | + if ($lastItem != 'hr') { |
|
| 1614 | + echo ' |
|
| 1551 | 1615 | <hr>'; |
| 1616 | + } |
|
| 1552 | 1617 | |
| 1553 | 1618 | echo ' |
| 1554 | 1619 | <dl class="settings">'; |
@@ -1571,13 +1636,14 @@ discard block |
||
| 1571 | 1636 | } |
| 1572 | 1637 | |
| 1573 | 1638 | // Any closing HTML? |
| 1574 | - if (!empty($context['profile_posthtml'])) |
|
| 1575 | - echo ' |
|
| 1639 | + if (!empty($context['profile_posthtml'])) { |
|
| 1640 | + echo ' |
|
| 1576 | 1641 | <div>', $context['profile_posthtml'], '</div>'; |
| 1642 | + } |
|
| 1577 | 1643 | |
| 1578 | 1644 | // Only show the password box if it's actually needed. |
| 1579 | - if ($context['require_password']) |
|
| 1580 | - echo ' |
|
| 1645 | + if ($context['require_password']) { |
|
| 1646 | + echo ' |
|
| 1581 | 1647 | <dl class="settings"> |
| 1582 | 1648 | <dt> |
| 1583 | 1649 | <strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '><label for="oldpasswrd">', $txt['current_password'], ': </label></strong><br> |
@@ -1587,18 +1653,21 @@ discard block |
||
| 1587 | 1653 | <input type="password" name="oldpasswrd" id="oldpasswrd" size="20"> |
| 1588 | 1654 | </dd> |
| 1589 | 1655 | </dl>'; |
| 1656 | + } |
|
| 1590 | 1657 | |
| 1591 | 1658 | // The button shouldn't say "Change profile" unless we're changing the profile... |
| 1592 | - if (!empty($context['submit_button_text'])) |
|
| 1593 | - echo ' |
|
| 1659 | + if (!empty($context['submit_button_text'])) { |
|
| 1660 | + echo ' |
|
| 1594 | 1661 | <input type="submit" name="save" value="', $context['submit_button_text'], '" class="button">'; |
| 1595 | - else |
|
| 1596 | - echo ' |
|
| 1662 | + } else { |
|
| 1663 | + echo ' |
|
| 1597 | 1664 | <input type="submit" name="save" value="', $txt['change_profile'], '" class="button">'; |
| 1665 | + } |
|
| 1598 | 1666 | |
| 1599 | - if (!empty($context['token_check'])) |
|
| 1600 | - echo ' |
|
| 1667 | + if (!empty($context['token_check'])) { |
|
| 1668 | + echo ' |
|
| 1601 | 1669 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
| 1670 | + } |
|
| 1602 | 1671 | |
| 1603 | 1672 | echo ' |
| 1604 | 1673 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -1608,10 +1677,11 @@ discard block |
||
| 1608 | 1677 | </form>'; |
| 1609 | 1678 | |
| 1610 | 1679 | // Any final spellchecking stuff? |
| 1611 | - if (!empty($context['show_spellchecking'])) |
|
| 1612 | - echo ' |
|
| 1680 | + if (!empty($context['show_spellchecking'])) { |
|
| 1681 | + echo ' |
|
| 1613 | 1682 | <form name="spell_form" id="spell_form" method="post" accept-charset="', $context['character_set'], '" target="spellWindow" action="', $scripturl, '?action=spellcheck"><input type="hidden" name="spellstring" value=""></form>'; |
| 1614 | -} |
|
| 1683 | + } |
|
| 1684 | + } |
|
| 1615 | 1685 | |
| 1616 | 1686 | /** |
| 1617 | 1687 | * Personal Message settings. |
@@ -1648,10 +1718,11 @@ discard block |
||
| 1648 | 1718 | <select name="pm_receive_from" id="pm_receive_from"> |
| 1649 | 1719 | <option value="0"', empty($context['receive_from']) || (empty($modSettings['enable_buddylist']) && $context['receive_from'] < 3) ? ' selected' : '', '>', $txt['pm_receive_from_everyone'], '</option>'; |
| 1650 | 1720 | |
| 1651 | - if (!empty($modSettings['enable_buddylist'])) |
|
| 1652 | - echo ' |
|
| 1721 | + if (!empty($modSettings['enable_buddylist'])) { |
|
| 1722 | + echo ' |
|
| 1653 | 1723 | <option value="1"', !empty($context['receive_from']) && $context['receive_from'] == 1 ? ' selected' : '', '>', $txt['pm_receive_from_ignore'], '</option> |
| 1654 | 1724 | <option value="2"', !empty($context['receive_from']) && $context['receive_from'] == 2 ? ' selected' : '', '>', $txt['pm_receive_from_buddies'], '</option>'; |
| 1725 | + } |
|
| 1655 | 1726 | |
| 1656 | 1727 | echo ' |
| 1657 | 1728 | <option value="3"', !empty($context['receive_from']) && $context['receive_from'] > 2 ? ' selected' : '', '>', $txt['pm_receive_from_admins'], '</option> |
@@ -1694,11 +1765,12 @@ discard block |
||
| 1694 | 1765 | if (empty($setting) || !is_array($setting)) |
| 1695 | 1766 | { |
| 1696 | 1767 | // Insert a separator (unless this is the first item in the list) |
| 1697 | - if ($i !== $first_option_key) |
|
| 1698 | - echo ' |
|
| 1768 | + if ($i !== $first_option_key) { |
|
| 1769 | + echo ' |
|
| 1699 | 1770 | </dl> |
| 1700 | 1771 | <hr> |
| 1701 | 1772 | <dl class="settings">'; |
| 1773 | + } |
|
| 1702 | 1774 | |
| 1703 | 1775 | // Should we give a name to this section? |
| 1704 | 1776 | if (is_string($setting) && !empty($setting)) |
@@ -1707,52 +1779,57 @@ discard block |
||
| 1707 | 1779 | echo ' |
| 1708 | 1780 | <dt><strong>' . $setting . '</strong></dt> |
| 1709 | 1781 | <dd></dd>'; |
| 1782 | + } else { |
|
| 1783 | + $titled_section = false; |
|
| 1710 | 1784 | } |
| 1711 | - else |
|
| 1712 | - $titled_section = false; |
|
| 1713 | 1785 | |
| 1714 | 1786 | continue; |
| 1715 | 1787 | } |
| 1716 | 1788 | |
| 1717 | 1789 | // Is this disabled? |
| 1718 | - if ($setting['id'] == 'calendar_start_day' && empty($modSettings['cal_enabled'])) |
|
| 1719 | - continue; |
|
| 1720 | - elseif (($setting['id'] == 'topics_per_page' || $setting['id'] == 'messages_per_page') && !empty($modSettings['disableCustomPerPage'])) |
|
| 1721 | - continue; |
|
| 1722 | - elseif ($setting['id'] == 'show_no_censored' && empty($modSettings['allow_no_censored'])) |
|
| 1723 | - continue; |
|
| 1724 | - elseif ($setting['id'] == 'posts_apply_ignore_list' && empty($modSettings['enable_buddylist'])) |
|
| 1725 | - continue; |
|
| 1726 | - elseif ($setting['id'] == 'wysiwyg_default' && !empty($modSettings['disable_wysiwyg'])) |
|
| 1727 | - continue; |
|
| 1728 | - elseif ($setting['id'] == 'drafts_autosave_enabled' && (empty($modSettings['drafts_autosave_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled'])))) |
|
| 1729 | - continue; |
|
| 1730 | - elseif ($setting['id'] == 'drafts_show_saved_enabled' && (empty($modSettings['drafts_show_saved_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled'])))) |
|
| 1731 | - continue; |
|
| 1790 | + if ($setting['id'] == 'calendar_start_day' && empty($modSettings['cal_enabled'])) { |
|
| 1791 | + continue; |
|
| 1792 | + } elseif (($setting['id'] == 'topics_per_page' || $setting['id'] == 'messages_per_page') && !empty($modSettings['disableCustomPerPage'])) { |
|
| 1793 | + continue; |
|
| 1794 | + } elseif ($setting['id'] == 'show_no_censored' && empty($modSettings['allow_no_censored'])) { |
|
| 1795 | + continue; |
|
| 1796 | + } elseif ($setting['id'] == 'posts_apply_ignore_list' && empty($modSettings['enable_buddylist'])) { |
|
| 1797 | + continue; |
|
| 1798 | + } elseif ($setting['id'] == 'wysiwyg_default' && !empty($modSettings['disable_wysiwyg'])) { |
|
| 1799 | + continue; |
|
| 1800 | + } elseif ($setting['id'] == 'drafts_autosave_enabled' && (empty($modSettings['drafts_autosave_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled'])))) { |
|
| 1801 | + continue; |
|
| 1802 | + } elseif ($setting['id'] == 'drafts_show_saved_enabled' && (empty($modSettings['drafts_show_saved_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled'])))) { |
|
| 1803 | + continue; |
|
| 1804 | + } |
|
| 1732 | 1805 | |
| 1733 | 1806 | // Some of these may not be set... Set to defaults here |
| 1734 | 1807 | $opts = array('topics_per_page', 'messages_per_page', 'display_quick_mod'); |
| 1735 | - if (in_array($setting['id'], $opts) && !isset($context['member']['options'][$setting['id']])) |
|
| 1736 | - $context['member']['options'][$setting['id']] = 0; |
|
| 1808 | + if (in_array($setting['id'], $opts) && !isset($context['member']['options'][$setting['id']])) { |
|
| 1809 | + $context['member']['options'][$setting['id']] = 0; |
|
| 1810 | + } |
|
| 1737 | 1811 | |
| 1738 | - if (!isset($setting['type']) || $setting['type'] == 'bool') |
|
| 1739 | - $setting['type'] = 'checkbox'; |
|
| 1740 | - elseif ($setting['type'] == 'int' || $setting['type'] == 'integer') |
|
| 1741 | - $setting['type'] = 'number'; |
|
| 1742 | - elseif ($setting['type'] == 'string') |
|
| 1743 | - $setting['type'] = 'text'; |
|
| 1812 | + if (!isset($setting['type']) || $setting['type'] == 'bool') { |
|
| 1813 | + $setting['type'] = 'checkbox'; |
|
| 1814 | + } elseif ($setting['type'] == 'int' || $setting['type'] == 'integer') { |
|
| 1815 | + $setting['type'] = 'number'; |
|
| 1816 | + } elseif ($setting['type'] == 'string') { |
|
| 1817 | + $setting['type'] = 'text'; |
|
| 1818 | + } |
|
| 1744 | 1819 | |
| 1745 | - if (isset($setting['options'])) |
|
| 1746 | - $setting['type'] = 'list'; |
|
| 1820 | + if (isset($setting['options'])) { |
|
| 1821 | + $setting['type'] = 'list'; |
|
| 1822 | + } |
|
| 1747 | 1823 | |
| 1748 | 1824 | echo ' |
| 1749 | 1825 | <dt> |
| 1750 | 1826 | <label for="', $setting['id'], '">', !$titled_section ? '<strong>' : '', $setting['label'], !$titled_section ? '</strong>' : '', '</label>'; |
| 1751 | 1827 | |
| 1752 | - if (isset($setting['description'])) |
|
| 1753 | - echo ' |
|
| 1828 | + if (isset($setting['description'])) { |
|
| 1829 | + echo ' |
|
| 1754 | 1830 | <br> |
| 1755 | 1831 | <span class="smalltext">', $setting['description'], '</span>'; |
| 1832 | + } |
|
| 1756 | 1833 | echo ' |
| 1757 | 1834 | </dt> |
| 1758 | 1835 | <dd>'; |
@@ -1790,13 +1867,11 @@ discard block |
||
| 1790 | 1867 | |
| 1791 | 1868 | echo ' |
| 1792 | 1869 | <input type="number"', $min . $max . $step; |
| 1793 | - } |
|
| 1794 | - else if (isset($setting['type']) && $setting['type'] == 'url') |
|
| 1870 | + } else if (isset($setting['type']) && $setting['type'] == 'url') |
|
| 1795 | 1871 | { |
| 1796 | 1872 | echo' |
| 1797 | 1873 | <input type="url"'; |
| 1798 | - } |
|
| 1799 | - else |
|
| 1874 | + } else |
|
| 1800 | 1875 | { |
| 1801 | 1876 | echo ' |
| 1802 | 1877 | <input type="text"'; |
@@ -1837,8 +1912,8 @@ discard block |
||
| 1837 | 1912 | <dl class="settings">'; |
| 1838 | 1913 | |
| 1839 | 1914 | // Allow notification on announcements to be disabled? |
| 1840 | - if (!empty($modSettings['allow_disableAnnounce'])) |
|
| 1841 | - echo ' |
|
| 1915 | + if (!empty($modSettings['allow_disableAnnounce'])) { |
|
| 1916 | + echo ' |
|
| 1842 | 1917 | <dt> |
| 1843 | 1918 | <label for="notify_announcements">', $txt['notify_important_email'], '</label> |
| 1844 | 1919 | </dt> |
@@ -1846,15 +1921,17 @@ discard block |
||
| 1846 | 1921 | <input type="hidden" name="notify_announcements" value="0"> |
| 1847 | 1922 | <input type="checkbox" id="notify_announcements" name="notify_announcements" value="1"', !empty($context['member']['notify_announcements']) ? ' checked' : '', '> |
| 1848 | 1923 | </dd>'; |
| 1924 | + } |
|
| 1849 | 1925 | |
| 1850 | - if (!empty($modSettings['enable_ajax_alerts'])) |
|
| 1851 | - echo ' |
|
| 1926 | + if (!empty($modSettings['enable_ajax_alerts'])) { |
|
| 1927 | + echo ' |
|
| 1852 | 1928 | <dt> |
| 1853 | 1929 | <label for="notify_send_body">', $txt['notify_alert_timeout'], '</label> |
| 1854 | 1930 | </dt> |
| 1855 | 1931 | <dd> |
| 1856 | 1932 | <input type="number" size="4" id="notify_alert_timeout" name="opt_alert_timeout" min="0" value="', $context['member']['alert_timeout'], '"> |
| 1857 | 1933 | </dd>'; |
| 1934 | + } |
|
| 1858 | 1935 | |
| 1859 | 1936 | echo ' |
| 1860 | 1937 | </dl> |
@@ -1884,9 +1961,10 @@ discard block |
||
| 1884 | 1961 | <td colspan="3">'; |
| 1885 | 1962 | $label = $txt['alert_opt_' . $opts[1]]; |
| 1886 | 1963 | $label_pos = isset($opts['label']) ? $opts['label'] : ''; |
| 1887 | - if ($label_pos == 'before') |
|
| 1888 | - echo ' |
|
| 1964 | + if ($label_pos == 'before') { |
|
| 1965 | + echo ' |
|
| 1889 | 1966 | <label for="opt_', $opts[1], '">', $label, '</label>'; |
| 1967 | + } |
|
| 1890 | 1968 | |
| 1891 | 1969 | $this_value = isset($context['alert_prefs'][$opts[1]]) ? $context['alert_prefs'][$opts[1]] : 0; |
| 1892 | 1970 | switch ($opts[0]) |
@@ -1898,17 +1976,19 @@ discard block |
||
| 1898 | 1976 | case 'select': |
| 1899 | 1977 | echo ' |
| 1900 | 1978 | <select name="opt_', $opts[1], '" id="opt_', $opts[1], '">'; |
| 1901 | - foreach ($opts['opts'] as $k => $v) |
|
| 1902 | - echo ' |
|
| 1979 | + foreach ($opts['opts'] as $k => $v) { |
|
| 1980 | + echo ' |
|
| 1903 | 1981 | <option value="', $k, '"', $this_value == $k ? ' selected' : '', '>', $v, '</option>'; |
| 1982 | + } |
|
| 1904 | 1983 | echo ' |
| 1905 | 1984 | </select>'; |
| 1906 | 1985 | break; |
| 1907 | 1986 | } |
| 1908 | 1987 | |
| 1909 | - if ($label_pos == 'after') |
|
| 1910 | - echo ' |
|
| 1988 | + if ($label_pos == 'after') { |
|
| 1989 | + echo ' |
|
| 1911 | 1990 | <label for="opt_', $opts[1], '">', $label, '</label>'; |
| 1991 | + } |
|
| 1912 | 1992 | |
| 1913 | 1993 | echo ' |
| 1914 | 1994 | </td> |
@@ -2024,11 +2104,12 @@ discard block |
||
| 2024 | 2104 | <p class="information">', $txt['groupMembership_info'], '</p>'; |
| 2025 | 2105 | |
| 2026 | 2106 | // Do we have an update message? |
| 2027 | - if (!empty($context['update_message'])) |
|
| 2028 | - echo ' |
|
| 2107 | + if (!empty($context['update_message'])) { |
|
| 2108 | + echo ' |
|
| 2029 | 2109 | <div class="infobox"> |
| 2030 | 2110 | ', $context['update_message'], '. |
| 2031 | 2111 | </div>'; |
| 2112 | + } |
|
| 2032 | 2113 | |
| 2033 | 2114 | echo ' |
| 2034 | 2115 | <div id="groups">'; |
@@ -2050,8 +2131,7 @@ discard block |
||
| 2050 | 2131 | </div> |
| 2051 | 2132 | </div> |
| 2052 | 2133 | </div><!-- .groupmembership -->'; |
| 2053 | - } |
|
| 2054 | - else |
|
| 2134 | + } else |
|
| 2055 | 2135 | { |
| 2056 | 2136 | echo ' |
| 2057 | 2137 | <div class="title_bar"> |
@@ -2063,27 +2143,30 @@ discard block |
||
| 2063 | 2143 | echo ' |
| 2064 | 2144 | <div class="windowbg" id="primdiv_', $group['id'], '">'; |
| 2065 | 2145 | |
| 2066 | - if ($context['can_edit_primary']) |
|
| 2067 | - echo ' |
|
| 2146 | + if ($context['can_edit_primary']) { |
|
| 2147 | + echo ' |
|
| 2068 | 2148 | <input type="radio" name="primary" id="primary_', $group['id'], '" value="', $group['id'], '"', $group['is_primary'] ? ' checked' : '', ' onclick="highlightSelected(\'primdiv_' . $group['id'] . '\');"', $group['can_be_primary'] ? '' : ' disabled', '>'; |
| 2149 | + } |
|
| 2069 | 2150 | |
| 2070 | 2151 | echo ' |
| 2071 | 2152 | <label for="primary_', $group['id'], '"><strong>', (empty($group['color']) ? $group['name'] : '<span style="color: ' . $group['color'] . '">' . $group['name'] . '</span>'), '</strong>', (!empty($group['desc']) ? '<br><span class="smalltext">' . $group['desc'] . '</span>' : ''), '</label>'; |
| 2072 | 2153 | |
| 2073 | 2154 | // Can they leave their group? |
| 2074 | - if ($group['can_leave']) |
|
| 2075 | - echo ' |
|
| 2155 | + if ($group['can_leave']) { |
|
| 2156 | + echo ' |
|
| 2076 | 2157 | <a href="' . $scripturl . '?action=profile;save;u=' . $context['id_member'] . ';area=groupmembership;' . $context['session_var'] . '=' . $context['session_id'] . ';gid=' . $group['id'] . ';', $context[$context['token_check'] . '_token_var'], '=', $context[$context['token_check'] . '_token'], '">' . $txt['leave_group'] . '</a>'; |
| 2158 | + } |
|
| 2077 | 2159 | |
| 2078 | 2160 | echo ' |
| 2079 | 2161 | </div><!-- .windowbg -->'; |
| 2080 | 2162 | } |
| 2081 | 2163 | |
| 2082 | - if ($context['can_edit_primary']) |
|
| 2083 | - echo ' |
|
| 2164 | + if ($context['can_edit_primary']) { |
|
| 2165 | + echo ' |
|
| 2084 | 2166 | <div class="padding righttext"> |
| 2085 | 2167 | <input type="submit" value="', $txt['make_primary'], '" class="button"> |
| 2086 | 2168 | </div>'; |
| 2169 | + } |
|
| 2087 | 2170 | |
| 2088 | 2171 | // Any groups they can join? |
| 2089 | 2172 | if (!empty($context['groups']['available'])) |
@@ -2099,15 +2182,16 @@ discard block |
||
| 2099 | 2182 | <div class="windowbg"> |
| 2100 | 2183 | <strong>', (empty($group['color']) ? $group['name'] : '<span style="color: ' . $group['color'] . '">' . $group['name'] . '</span>'), '</strong>', (!empty($group['desc']) ? '<br><span class="smalltext">' . $group['desc'] . '</span>' : ''), ''; |
| 2101 | 2184 | |
| 2102 | - if ($group['type'] == 3) |
|
| 2103 | - echo ' |
|
| 2185 | + if ($group['type'] == 3) { |
|
| 2186 | + echo ' |
|
| 2104 | 2187 | <a href="', $scripturl, '?action=profile;save;u=', $context['id_member'], ';area=groupmembership;', $context['session_var'], '=', $context['session_id'], ';gid=', $group['id'], ';', $context[$context['token_check'] . '_token_var'], '=', $context[$context['token_check'] . '_token'], '" class="button floatright">', $txt['join_group'], '</a>'; |
| 2105 | - elseif ($group['type'] == 2 && $group['pending']) |
|
| 2106 | - echo ' |
|
| 2188 | + } elseif ($group['type'] == 2 && $group['pending']) { |
|
| 2189 | + echo ' |
|
| 2107 | 2190 | <span class="floatright">', $txt['approval_pending'], '</span>'; |
| 2108 | - elseif ($group['type'] == 2) |
|
| 2109 | - echo ' |
|
| 2191 | + } elseif ($group['type'] == 2) { |
|
| 2192 | + echo ' |
|
| 2110 | 2193 | <a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=groupmembership;request=', $group['id'], '" class="button floatright">', $txt['request_group'], '</a>'; |
| 2194 | + } |
|
| 2111 | 2195 | |
| 2112 | 2196 | echo ' |
| 2113 | 2197 | </div><!-- .windowbg -->'; |
@@ -2130,9 +2214,10 @@ discard block |
||
| 2130 | 2214 | |
| 2131 | 2215 | prevDiv.className = "windowbg"; |
| 2132 | 2216 | }'; |
| 2133 | - if (isset($context['groups']['member'][$context['primary_group']])) |
|
| 2134 | - echo ' |
|
| 2217 | + if (isset($context['groups']['member'][$context['primary_group']])) { |
|
| 2218 | + echo ' |
|
| 2135 | 2219 | highlightSelected("primdiv_' . $context['primary_group'] . '");'; |
| 2220 | + } |
|
| 2136 | 2221 | echo ' |
| 2137 | 2222 | </script>'; |
| 2138 | 2223 | } |
@@ -2140,9 +2225,10 @@ discard block |
||
| 2140 | 2225 | echo ' |
| 2141 | 2226 | </div><!-- #groups -->'; |
| 2142 | 2227 | |
| 2143 | - if (!empty($context['token_check'])) |
|
| 2144 | - echo ' |
|
| 2228 | + if (!empty($context['token_check'])) { |
|
| 2229 | + echo ' |
|
| 2145 | 2230 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
| 2231 | + } |
|
| 2146 | 2232 | |
| 2147 | 2233 | echo ' |
| 2148 | 2234 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -2190,14 +2276,15 @@ discard block |
||
| 2190 | 2276 | |
| 2191 | 2277 | foreach ($category['boards'] as $board) |
| 2192 | 2278 | { |
| 2193 | - if ($i == $limit) |
|
| 2194 | - echo ' |
|
| 2279 | + if ($i == $limit) { |
|
| 2280 | + echo ' |
|
| 2195 | 2281 | </ul> |
| 2196 | 2282 | </li> |
| 2197 | 2283 | </ul> |
| 2198 | 2284 | <ul class="ignoreboards floatright"> |
| 2199 | 2285 | <li class="category"> |
| 2200 | 2286 | <ul>'; |
| 2287 | + } |
|
| 2201 | 2288 | |
| 2202 | 2289 | echo ' |
| 2203 | 2290 | <li class="board" style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;"> |
@@ -2243,10 +2330,11 @@ discard block |
||
| 2243 | 2330 | |
| 2244 | 2331 | // Work out the starting color. |
| 2245 | 2332 | $context['current_color'] = $context['colors'][0]; |
| 2246 | - foreach ($context['colors'] as $limit => $color) |
|
| 2247 | - if ($context['member']['warning'] >= $limit) |
|
| 2333 | + foreach ($context['colors'] as $limit => $color) { |
|
| 2334 | + if ($context['member']['warning'] >= $limit) |
|
| 2248 | 2335 | $context['current_color'] = $color; |
| 2249 | -} |
|
| 2336 | + } |
|
| 2337 | + } |
|
| 2250 | 2338 | |
| 2251 | 2339 | // Show all warnings of a user? |
| 2252 | 2340 | function template_viewWarning() |
@@ -2285,14 +2373,15 @@ discard block |
||
| 2285 | 2373 | </dd>'; |
| 2286 | 2374 | |
| 2287 | 2375 | // There's some impact of this? |
| 2288 | - if (!empty($context['level_effects'][$context['current_level']])) |
|
| 2289 | - echo ' |
|
| 2376 | + if (!empty($context['level_effects'][$context['current_level']])) { |
|
| 2377 | + echo ' |
|
| 2290 | 2378 | <dt> |
| 2291 | 2379 | <strong>', $txt['profile_viewwarning_impact'], ':</strong> |
| 2292 | 2380 | </dt> |
| 2293 | 2381 | <dd> |
| 2294 | 2382 | ', $context['level_effects'][$context['current_level']], ' |
| 2295 | 2383 | </dd>'; |
| 2384 | + } |
|
| 2296 | 2385 | |
| 2297 | 2386 | echo ' |
| 2298 | 2387 | </dl> |
@@ -2330,10 +2419,11 @@ discard block |
||
| 2330 | 2419 | |
| 2331 | 2420 | // Otherwise see what we can do...'; |
| 2332 | 2421 | |
| 2333 | - foreach ($context['notification_templates'] as $k => $type) |
|
| 2334 | - echo ' |
|
| 2422 | + foreach ($context['notification_templates'] as $k => $type) { |
|
| 2423 | + echo ' |
|
| 2335 | 2424 | if (index == ', $k, ') |
| 2336 | 2425 | document.getElementById(\'warn_body\').value = "', strtr($type['body'], array('"' => "'", "\n" => '\\n', "\r" => '')), '";'; |
| 2426 | + } |
|
| 2337 | 2427 | |
| 2338 | 2428 | echo ' |
| 2339 | 2429 | } |
@@ -2343,10 +2433,11 @@ discard block |
||
| 2343 | 2433 | // Also set the right effect. |
| 2344 | 2434 | effectText = "";'; |
| 2345 | 2435 | |
| 2346 | - foreach ($context['level_effects'] as $limit => $text) |
|
| 2347 | - echo ' |
|
| 2436 | + foreach ($context['level_effects'] as $limit => $text) { |
|
| 2437 | + echo ' |
|
| 2348 | 2438 | if (slideAmount >= ', $limit, ') |
| 2349 | 2439 | effectText = "', $text, '";'; |
| 2440 | + } |
|
| 2350 | 2441 | |
| 2351 | 2442 | echo ' |
| 2352 | 2443 | setInnerHTML(document.getElementById(\'cur_level_div\'), slideAmount + \'% (\' + effectText + \')\'); |
@@ -2361,32 +2452,35 @@ discard block |
||
| 2361 | 2452 | </h3> |
| 2362 | 2453 | </div>'; |
| 2363 | 2454 | |
| 2364 | - if (!$context['user']['is_owner']) |
|
| 2365 | - echo ' |
|
| 2455 | + if (!$context['user']['is_owner']) { |
|
| 2456 | + echo ' |
|
| 2366 | 2457 | <p class="information">', $txt['profile_warning_desc'], '</p>'; |
| 2458 | + } |
|
| 2367 | 2459 | |
| 2368 | 2460 | echo ' |
| 2369 | 2461 | <div class="windowbg"> |
| 2370 | 2462 | <dl class="settings">'; |
| 2371 | 2463 | |
| 2372 | - if (!$context['user']['is_owner']) |
|
| 2373 | - echo ' |
|
| 2464 | + if (!$context['user']['is_owner']) { |
|
| 2465 | + echo ' |
|
| 2374 | 2466 | <dt> |
| 2375 | 2467 | <strong>', $txt['profile_warning_name'], ':</strong> |
| 2376 | 2468 | </dt> |
| 2377 | 2469 | <dd> |
| 2378 | 2470 | <strong>', $context['member']['name'], '</strong> |
| 2379 | 2471 | </dd>'; |
| 2472 | + } |
|
| 2380 | 2473 | |
| 2381 | 2474 | echo ' |
| 2382 | 2475 | <dt> |
| 2383 | 2476 | <strong>', $txt['profile_warning_level'], ':</strong>'; |
| 2384 | 2477 | |
| 2385 | 2478 | // Is there only so much they can apply? |
| 2386 | - if ($context['warning_limit']) |
|
| 2387 | - echo ' |
|
| 2479 | + if ($context['warning_limit']) { |
|
| 2480 | + echo ' |
|
| 2388 | 2481 | <br> |
| 2389 | 2482 | <span class="smalltext">', sprintf($txt['profile_warning_limit_attribute'], $context['warning_limit']), '</span>'; |
| 2483 | + } |
|
| 2390 | 2484 | |
| 2391 | 2485 | echo ' |
| 2392 | 2486 | </dt> |
@@ -2441,9 +2535,10 @@ discard block |
||
| 2441 | 2535 | <option value="-1">', $txt['profile_warning_notify_template'], '</option> |
| 2442 | 2536 | <option value="-1" disabled>------------------------------</option>'; |
| 2443 | 2537 | |
| 2444 | - foreach ($context['notification_templates'] as $id_template => $template) |
|
| 2445 | - echo ' |
|
| 2538 | + foreach ($context['notification_templates'] as $id_template => $template) { |
|
| 2539 | + echo ' |
|
| 2446 | 2540 | <option value="', $id_template, '">', $template['title'], '</option>'; |
| 2541 | + } |
|
| 2447 | 2542 | |
| 2448 | 2543 | echo ' |
| 2449 | 2544 | </select> |
@@ -2456,9 +2551,10 @@ discard block |
||
| 2456 | 2551 | </dl> |
| 2457 | 2552 | <div class="righttext">'; |
| 2458 | 2553 | |
| 2459 | - if (!empty($context['token_check'])) |
|
| 2460 | - echo ' |
|
| 2554 | + if (!empty($context['token_check'])) { |
|
| 2555 | + echo ' |
|
| 2461 | 2556 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
| 2557 | + } |
|
| 2462 | 2558 | |
| 2463 | 2559 | echo ' |
| 2464 | 2560 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -2474,8 +2570,8 @@ discard block |
||
| 2474 | 2570 | echo ' |
| 2475 | 2571 | <script>'; |
| 2476 | 2572 | |
| 2477 | - if (!$context['user']['is_owner']) |
|
| 2478 | - echo ' |
|
| 2573 | + if (!$context['user']['is_owner']) { |
|
| 2574 | + echo ' |
|
| 2479 | 2575 | modifyWarnNotify(); |
| 2480 | 2576 | $(document).ready(function() { |
| 2481 | 2577 | $("#preview_button").click(function() { |
@@ -2514,6 +2610,7 @@ discard block |
||
| 2514 | 2610 | }); |
| 2515 | 2611 | return false; |
| 2516 | 2612 | }'; |
| 2613 | + } |
|
| 2517 | 2614 | |
| 2518 | 2615 | echo ' |
| 2519 | 2616 | </script>'; |
@@ -2536,16 +2633,18 @@ discard block |
||
| 2536 | 2633 | </div>'; |
| 2537 | 2634 | |
| 2538 | 2635 | // If deleting another account give them a lovely info box. |
| 2539 | - if (!$context['user']['is_owner']) |
|
| 2540 | - echo ' |
|
| 2636 | + if (!$context['user']['is_owner']) { |
|
| 2637 | + echo ' |
|
| 2541 | 2638 | <p class="information">', $txt['deleteAccount_desc'], '</p>'; |
| 2639 | + } |
|
| 2542 | 2640 | echo ' |
| 2543 | 2641 | <div class="windowbg2">'; |
| 2544 | 2642 | |
| 2545 | 2643 | // If they are deleting their account AND the admin needs to approve it - give them another piece of info ;) |
| 2546 | - if ($context['needs_approval']) |
|
| 2547 | - echo ' |
|
| 2644 | + if ($context['needs_approval']) { |
|
| 2645 | + echo ' |
|
| 2548 | 2646 | <div class="errorbox">', $txt['deleteAccount_approval'], '</div>'; |
| 2647 | + } |
|
| 2549 | 2648 | |
| 2550 | 2649 | // If the user is deleting their own account warn them first - and require a password! |
| 2551 | 2650 | if ($context['user']['is_owner']) |
@@ -2557,9 +2656,10 @@ discard block |
||
| 2557 | 2656 | <input type="password" name="oldpasswrd" size="20"> |
| 2558 | 2657 | <input type="submit" value="', $txt['yes'], '" class="button">'; |
| 2559 | 2658 | |
| 2560 | - if (!empty($context['token_check'])) |
|
| 2561 | - echo ' |
|
| 2659 | + if (!empty($context['token_check'])) { |
|
| 2660 | + echo ' |
|
| 2562 | 2661 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
| 2662 | + } |
|
| 2563 | 2663 | |
| 2564 | 2664 | echo ' |
| 2565 | 2665 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -2589,10 +2689,11 @@ discard block |
||
| 2589 | 2689 | <option value="topics">', $txt['deleteAccount_topics'], '</option> |
| 2590 | 2690 | </select>'; |
| 2591 | 2691 | |
| 2592 | - if ($context['show_perma_delete']) |
|
| 2593 | - echo ' |
|
| 2692 | + if ($context['show_perma_delete']) { |
|
| 2693 | + echo ' |
|
| 2594 | 2694 | <br> |
| 2595 | 2695 | <label for="perma_delete"><input type="checkbox" name="perma_delete" id="perma_delete" value="1">', $txt['deleteAccount_permanent'], ':</label>'; |
| 2696 | + } |
|
| 2596 | 2697 | |
| 2597 | 2698 | echo ' |
| 2598 | 2699 | </div>'; |
@@ -2605,9 +2706,10 @@ discard block |
||
| 2605 | 2706 | <div> |
| 2606 | 2707 | <input type="submit" value="', $txt['delete'], '" class="button">'; |
| 2607 | 2708 | |
| 2608 | - if (!empty($context['token_check'])) |
|
| 2609 | - echo ' |
|
| 2709 | + if (!empty($context['token_check'])) { |
|
| 2710 | + echo ' |
|
| 2610 | 2711 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
| 2712 | + } |
|
| 2611 | 2713 | |
| 2612 | 2714 | echo ' |
| 2613 | 2715 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -2633,8 +2735,8 @@ discard block |
||
| 2633 | 2735 | <hr>'; |
| 2634 | 2736 | |
| 2635 | 2737 | // Only show the password box if it's actually needed. |
| 2636 | - if ($context['require_password']) |
|
| 2637 | - echo ' |
|
| 2738 | + if ($context['require_password']) { |
|
| 2739 | + echo ' |
|
| 2638 | 2740 | <dl class="settings"> |
| 2639 | 2741 | <dt> |
| 2640 | 2742 | <strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '>', $txt['current_password'], ': </strong><br> |
@@ -2644,13 +2746,15 @@ discard block |
||
| 2644 | 2746 | <input type="password" name="oldpasswrd" size="20"> |
| 2645 | 2747 | </dd> |
| 2646 | 2748 | </dl>'; |
| 2749 | + } |
|
| 2647 | 2750 | |
| 2648 | 2751 | echo ' |
| 2649 | 2752 | <div class="righttext">'; |
| 2650 | 2753 | |
| 2651 | - if (!empty($context['token_check'])) |
|
| 2652 | - echo ' |
|
| 2754 | + if (!empty($context['token_check'])) { |
|
| 2755 | + echo ' |
|
| 2653 | 2756 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
| 2757 | + } |
|
| 2654 | 2758 | |
| 2655 | 2759 | echo ' |
| 2656 | 2760 | <input type="submit" value="', $txt['change_profile'], '" class="button"> |
@@ -2677,9 +2781,10 @@ discard block |
||
| 2677 | 2781 | <ul id="list_errors">'; |
| 2678 | 2782 | |
| 2679 | 2783 | // Cycle through each error and display an error message. |
| 2680 | - foreach ($context['post_errors'] as $error) |
|
| 2681 | - echo ' |
|
| 2784 | + foreach ($context['post_errors'] as $error) { |
|
| 2785 | + echo ' |
|
| 2682 | 2786 | <li>', isset($txt['profile_error_' . $error]) ? $txt['profile_error_' . $error] : $error, '</li>'; |
| 2787 | + } |
|
| 2683 | 2788 | |
| 2684 | 2789 | echo ' |
| 2685 | 2790 | </ul>'; |
@@ -2705,12 +2810,13 @@ discard block |
||
| 2705 | 2810 | <select name="id_group" ', ($context['user']['is_owner'] && $context['member']['group_id'] == 1 ? 'onchange="if (this.value != 1 && !confirm(\'' . $txt['deadmin_confirm'] . '\')) this.value = 1;"' : ''), '>'; |
| 2706 | 2811 | |
| 2707 | 2812 | // Fill the select box with all primary member groups that can be assigned to a member. |
| 2708 | - foreach ($context['member_groups'] as $member_group) |
|
| 2709 | - if (!empty($member_group['can_be_primary'])) |
|
| 2813 | + foreach ($context['member_groups'] as $member_group) { |
|
| 2814 | + if (!empty($member_group['can_be_primary'])) |
|
| 2710 | 2815 | echo ' |
| 2711 | 2816 | <option value="', $member_group['id'], '"', $member_group['is_primary'] ? ' selected' : '', '> |
| 2712 | 2817 | ', $member_group['name'], ' |
| 2713 | 2818 | </option>'; |
| 2819 | + } |
|
| 2714 | 2820 | echo ' |
| 2715 | 2821 | </select> |
| 2716 | 2822 | </dd> |
@@ -2722,10 +2828,11 @@ discard block |
||
| 2722 | 2828 | <input type="hidden" name="additional_groups[]" value="0">'; |
| 2723 | 2829 | |
| 2724 | 2830 | // For each membergroup show a checkbox so members can be assigned to more than one group. |
| 2725 | - foreach ($context['member_groups'] as $member_group) |
|
| 2726 | - if ($member_group['can_be_additional']) |
|
| 2831 | + foreach ($context['member_groups'] as $member_group) { |
|
| 2832 | + if ($member_group['can_be_additional']) |
|
| 2727 | 2833 | echo ' |
| 2728 | 2834 | <label for="additional_groups-', $member_group['id'], '"><input type="checkbox" name="additional_groups[]" value="', $member_group['id'], '" id="additional_groups-', $member_group['id'], '"', $member_group['is_additional'] ? ' checked' : '', '> ', $member_group['name'], '</label><br>'; |
| 2835 | + } |
|
| 2729 | 2836 | echo ' |
| 2730 | 2837 | </span> |
| 2731 | 2838 | <a href="javascript:void(0);" onclick="document.getElementById(\'additional_groupsList\').style.display = \'block\'; document.getElementById(\'additional_groupsLink\').style.display = \'none\'; return false;" id="additional_groupsLink" style="display: none;" class="toggle_down">', $txt['additional_membergroups_show'], '</a> |
@@ -2785,9 +2892,10 @@ discard block |
||
| 2785 | 2892 | <span class="smalltext">', $txt['sig_info'], '</span><br> |
| 2786 | 2893 | <br>'; |
| 2787 | 2894 | |
| 2788 | - if ($context['show_spellchecking']) |
|
| 2789 | - echo ' |
|
| 2895 | + if ($context['show_spellchecking']) { |
|
| 2896 | + echo ' |
|
| 2790 | 2897 | <input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'creator\', \'signature\');" class="button">'; |
| 2898 | + } |
|
| 2791 | 2899 | |
| 2792 | 2900 | echo ' |
| 2793 | 2901 | </dt> |
@@ -2795,17 +2903,20 @@ discard block |
||
| 2795 | 2903 | <textarea class="editor" onkeyup="calcCharLeft();" id="signature" name="signature" rows="5" cols="50">', $context['member']['signature'], '</textarea><br>'; |
| 2796 | 2904 | |
| 2797 | 2905 | // If there is a limit at all! |
| 2798 | - if (!empty($context['signature_limits']['max_length'])) |
|
| 2799 | - echo ' |
|
| 2906 | + if (!empty($context['signature_limits']['max_length'])) { |
|
| 2907 | + echo ' |
|
| 2800 | 2908 | <span class="smalltext">', sprintf($txt['max_sig_characters'], $context['signature_limits']['max_length']), ' <span id="signatureLeft">', $context['signature_limits']['max_length'], '</span></span><br>'; |
| 2909 | + } |
|
| 2801 | 2910 | |
| 2802 | - if (!empty($context['show_preview_button'])) |
|
| 2803 | - echo ' |
|
| 2911 | + if (!empty($context['show_preview_button'])) { |
|
| 2912 | + echo ' |
|
| 2804 | 2913 | <input type="button" name="preview_signature" id="preview_button" value="', $txt['preview_signature'], '" class="button">'; |
| 2914 | + } |
|
| 2805 | 2915 | |
| 2806 | - if ($context['signature_warning']) |
|
| 2807 | - echo ' |
|
| 2916 | + if ($context['signature_warning']) { |
|
| 2917 | + echo ' |
|
| 2808 | 2918 | <span class="smalltext">', $context['signature_warning'], '</span>'; |
| 2919 | + } |
|
| 2809 | 2920 | |
| 2810 | 2921 | // Some javascript used to count how many characters have been used so far in the signature. |
| 2811 | 2922 | echo ' |
@@ -2850,9 +2961,10 @@ discard block |
||
| 2850 | 2961 | <select name="cat" id="cat" size="10" onchange="changeSel(\'\');" onfocus="selectRadioByName(document.forms.creator.avatar_choice, \'server_stored\');">'; |
| 2851 | 2962 | |
| 2852 | 2963 | // This lists all the file categories. |
| 2853 | - foreach ($context['avatars'] as $avatar) |
|
| 2854 | - echo ' |
|
| 2964 | + foreach ($context['avatars'] as $avatar) { |
|
| 2965 | + echo ' |
|
| 2855 | 2966 | <option value="', $avatar['filename'] . ($avatar['is_dir'] ? '/' : ''), '"', ($avatar['checked'] ? ' selected' : ''), '>', $avatar['name'], '</option>'; |
| 2967 | + } |
|
| 2856 | 2968 | echo ' |
| 2857 | 2969 | </select> |
| 2858 | 2970 | </div> |
@@ -2909,16 +3021,17 @@ discard block |
||
| 2909 | 3021 | <div id="avatar_gravatar"> |
| 2910 | 3022 | <img src="' . $context['member']['avatar']['href'] . '" alt="" />'; |
| 2911 | 3023 | |
| 2912 | - if (empty($modSettings['gravatarAllowExtraEmail'])) |
|
| 2913 | - echo ' |
|
| 3024 | + if (empty($modSettings['gravatarAllowExtraEmail'])) { |
|
| 3025 | + echo ' |
|
| 2914 | 3026 | <div class="smalltext">', $txt['gravatar_noAlternateEmail'], '</div>'; |
| 2915 | - else |
|
| 3027 | + } else |
|
| 2916 | 3028 | { |
| 2917 | 3029 | // Depending on other stuff, the stored value here might have some odd things in it from other areas. |
| 2918 | - if ($context['member']['avatar']['external'] == $context['member']['email']) |
|
| 2919 | - $textbox_value = ''; |
|
| 2920 | - else |
|
| 2921 | - $textbox_value = $context['member']['avatar']['external']; |
|
| 3030 | + if ($context['member']['avatar']['external'] == $context['member']['email']) { |
|
| 3031 | + $textbox_value = ''; |
|
| 3032 | + } else { |
|
| 3033 | + $textbox_value = $context['member']['avatar']['external']; |
|
| 3034 | + } |
|
| 2922 | 3035 | |
| 2923 | 3036 | echo ' |
| 2924 | 3037 | <div class="smalltext">', $txt['gravatar_alternateEmail'], '</div> |
@@ -2990,8 +3103,9 @@ discard block |
||
| 2990 | 3103 | $h = !empty($modSettings['avatar_max_height_' . $type]) ? comma_format($modSettings['avatar_max_height_' . $type]) : 0; |
| 2991 | 3104 | |
| 2992 | 3105 | $suffix = (!empty($w) ? 'w' : '') . (!empty($h) ? 'h' : ''); |
| 2993 | - if (empty($suffix)) |
|
| 2994 | - return; |
|
| 3106 | + if (empty($suffix)) { |
|
| 3107 | + return; |
|
| 3108 | + } |
|
| 2995 | 3109 | |
| 2996 | 3110 | echo ' |
| 2997 | 3111 | <div class="smalltext">', sprintf($txt['avatar_max_size_' . $suffix], $w, $h), '</div>'; |
@@ -3016,9 +3130,10 @@ discard block |
||
| 3016 | 3130 | <select name="easyformat" id="easyformat" onchange="document.forms.creator.time_format.value = this.options[this.selectedIndex].value;">'; |
| 3017 | 3131 | |
| 3018 | 3132 | // Help the user by showing a list of common time formats. |
| 3019 | - foreach ($context['easy_timeformats'] as $time_format) |
|
| 3020 | - echo ' |
|
| 3133 | + foreach ($context['easy_timeformats'] as $time_format) { |
|
| 3134 | + echo ' |
|
| 3021 | 3135 | <option value="', $time_format['format'], '"', $time_format['format'] == $context['member']['time_format'] ? ' selected' : '', '>', $time_format['title'], '</option>'; |
| 3136 | + } |
|
| 3022 | 3137 | echo ' |
| 3023 | 3138 | </select><br> |
| 3024 | 3139 | <input type="text" name="time_format" id="time_format" value="', $context['member']['time_format'], '" size="30"> |
@@ -3055,9 +3170,10 @@ discard block |
||
| 3055 | 3170 | <dd> |
| 3056 | 3171 | <select name="smiley_set" id="smiley_set" onchange="document.getElementById(\'smileypr\').src = this.selectedIndex == 0 ? \'', $settings['images_url'], '/blank.png\' : \'', $modSettings['smileys_url'], '/\' + (this.selectedIndex != 1 ? this.options[this.selectedIndex].value : \'', !empty($settings['smiley_sets_default']) ? $settings['smiley_sets_default'] : $modSettings['smiley_sets_default'], '\') + \'/smiley.gif\';">'; |
| 3057 | 3172 | |
| 3058 | - foreach ($context['smiley_sets'] as $set) |
|
| 3059 | - echo ' |
|
| 3173 | + foreach ($context['smiley_sets'] as $set) { |
|
| 3174 | + echo ' |
|
| 3060 | 3175 | <option value="', $set['id'], '"', $set['selected'] ? ' selected' : '', '>', $set['name'], '</option>'; |
| 3176 | + } |
|
| 3061 | 3177 | echo ' |
| 3062 | 3178 | </select> |
| 3063 | 3179 | <img id="smileypr" class="centericon" src="', $context['member']['smiley_set']['id'] != 'none' ? $modSettings['smileys_url'] . '/' . ($context['member']['smiley_set']['id'] != '' ? $context['member']['smiley_set']['id'] : (!empty($settings['smiley_sets_default']) ? $settings['smiley_sets_default'] : $modSettings['smiley_sets_default'])) . '/smiley.gif' : $settings['images_url'] . '/blank.png', '" alt=":)"> |
@@ -3108,10 +3224,11 @@ discard block |
||
| 3108 | 3224 | <img src="', $context['tfa_qr_url'], '" alt=""> |
| 3109 | 3225 | </div>'; |
| 3110 | 3226 | |
| 3111 | - if (!empty($context['from_ajax'])) |
|
| 3112 | - echo ' |
|
| 3227 | + if (!empty($context['from_ajax'])) { |
|
| 3228 | + echo ' |
|
| 3113 | 3229 | <br> |
| 3114 | 3230 | <a href="javascript:self.close();"></a>'; |
| 3231 | + } |
|
| 3115 | 3232 | |
| 3116 | 3233 | echo ' |
| 3117 | 3234 | </div> |
@@ -3150,15 +3267,16 @@ discard block |
||
| 3150 | 3267 | <div class="smalltext">', $txt['tfa_profile_desc'], '</div> |
| 3151 | 3268 | </dt> |
| 3152 | 3269 | <dd>'; |
| 3153 | - if (!$context['tfa_enabled'] && $context['user']['is_owner']) |
|
| 3154 | - echo ' |
|
| 3270 | + if (!$context['tfa_enabled'] && $context['user']['is_owner']) { |
|
| 3271 | + echo ' |
|
| 3155 | 3272 | <a href="', !empty($modSettings['force_ssl']) && $modSettings['force_ssl'] < 2 ? strtr($scripturl, array('http://' => 'https://')) : $scripturl, '?action=profile;area=tfasetup" id="enable_tfa">', $txt['tfa_profile_enable'], '</a>'; |
| 3156 | - elseif (!$context['tfa_enabled']) |
|
| 3157 | - echo ' |
|
| 3273 | + } elseif (!$context['tfa_enabled']) { |
|
| 3274 | + echo ' |
|
| 3158 | 3275 | ', $txt['tfa_profile_disabled']; |
| 3159 | - else |
|
| 3160 | - echo ' |
|
| 3276 | + } else { |
|
| 3277 | + echo ' |
|
| 3161 | 3278 | ', sprintf($txt['tfa_profile_enabled'], $scripturl . '?action=profile;u=' . $context['id_member'] . ';area=tfasetup;disable'); |
| 3279 | + } |
|
| 3162 | 3280 | echo ' |
| 3163 | 3281 | </dd>'; |
| 3164 | 3282 | } |
@@ -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"> |
| 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;"> |
| 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"', !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;"> |
| 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, '"> |
| 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) |
@@ -269,8 +276,8 @@ discard block |
||
| 269 | 276 | <input type="text" name="main_ip" value="', $context['ban_trigger']['ip']['value'], '" size="44" onfocus="document.getElementById(\'main_ip_check\').checked = true;"> |
| 270 | 277 | </dd>'; |
| 271 | 278 | |
| 272 | - if (empty($modSettings['disableHostnameLookup'])) |
|
| 273 | - echo ' |
|
| 279 | + if (empty($modSettings['disableHostnameLookup'])) { |
|
| 280 | + echo ' |
|
| 274 | 281 | <dt> |
| 275 | 282 | <input type="checkbox" name="ban_suggestions[]" id="hostname_check" value="hostname"', $context['ban_trigger']['hostname']['selected'] ? ' checked' : '', '> |
| 276 | 283 | <label for="hostname_check">', $txt['ban_on_hostname'], '</label> |
@@ -278,6 +285,7 @@ discard block |
||
| 278 | 285 | <dd> |
| 279 | 286 | <input type="text" name="hostname" value="', $context['ban_trigger']['hostname']['value'], '" size="44" onfocus="document.getElementById(\'hostname_check\').checked = true;"> |
| 280 | 287 | </dd>'; |
| 288 | + } |
|
| 281 | 289 | |
| 282 | 290 | echo ' |
| 283 | 291 | <dt> |