@@ -23,13 +23,13 @@ discard block |
||
| 23 | 23 | { |
| 24 | 24 | global $context, $txt; |
| 25 | 25 | |
| 26 | - if (!empty($context['simple_action'])) |
|
| 27 | - echo ' |
|
| 26 | + if (!empty($context['simple_action'])) { |
|
| 27 | + echo ' |
|
| 28 | 28 | <strong> |
| 29 | 29 | ', $context['error_title'], ' |
| 30 | 30 | </strong><br> |
| 31 | 31 | <div ', $context['error_code'], 'class="padding">', $context['error_message'], '</div>'; |
| 32 | - else |
|
| 32 | + } else |
|
| 33 | 33 | { |
| 34 | 34 | echo ' |
| 35 | 35 | <div id="fatal_error"> |
@@ -82,21 +82,23 @@ discard block |
||
| 82 | 82 | ', $txt['apply_filter_of_type'], ':'; |
| 83 | 83 | |
| 84 | 84 | $error_types = array(); |
| 85 | - foreach ($context['error_types'] as $type => $details) |
|
| 86 | - $error_types[] = ($details['is_selected'] ? '<img src="' . $settings['images_url'] . '/selected.png" alt=""> ' : '') . '<a href="' . $details['url'] . '" ' . ($details['is_selected'] ? 'style="font-weight: bold;"' : '') . ' title="' . $details['description'] . '">' . $details['label'] . '</a>'; |
|
| 85 | + foreach ($context['error_types'] as $type => $details) { |
|
| 86 | + $error_types[] = ($details['is_selected'] ? '<img src="' . $settings['images_url'] . '/selected.png" alt=""> ' : '') . '<a href="' . $details['url'] . '" ' . ($details['is_selected'] ? 'style="font-weight: bold;"' : '') . ' title="' . $details['description'] . '">' . $details['label'] . '</a>'; |
|
| 87 | + } |
|
| 87 | 88 | |
| 88 | 89 | echo ' |
| 89 | 90 | ', implode(' | ', $error_types), ' |
| 90 | 91 | </td> |
| 91 | 92 | </tr>'; |
| 92 | 93 | |
| 93 | - if ($context['has_filter']) |
|
| 94 | - echo ' |
|
| 94 | + if ($context['has_filter']) { |
|
| 95 | + echo ' |
|
| 95 | 96 | <tr> |
| 96 | 97 | <td colspan="3" class="windowbg"> |
| 97 | 98 | <strong> ', $txt['applying_filter'], ':</strong> ', $context['filter']['entity'], ' ', $context['filter']['value']['html'], ' [<a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', '">', $txt['clear_filter'], '</a>] |
| 98 | 99 | </td> |
| 99 | 100 | </tr>'; |
| 101 | + } |
|
| 100 | 102 | |
| 101 | 103 | echo ' |
| 102 | 104 | <tr> |
@@ -107,11 +109,12 @@ discard block |
||
| 107 | 109 | </tr>'; |
| 108 | 110 | |
| 109 | 111 | // No errors, then show a message |
| 110 | - if (count($context['errors']) == 0) |
|
| 111 | - echo ' |
|
| 112 | + if (count($context['errors']) == 0) { |
|
| 113 | + echo ' |
|
| 112 | 114 | <tr class="windowbg"> |
| 113 | 115 | <td class="centertext" colspan="2">', $txt['errlog_no_entries'], '</td> |
| 114 | 116 | </tr>'; |
| 117 | + } |
|
| 115 | 118 | |
| 116 | 119 | // we have some errors, must be some mods installed :P |
| 117 | 120 | foreach ($context['errors'] as $error) |
@@ -125,19 +128,21 @@ discard block |
||
| 125 | 128 | <a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? '' : ';desc', $context['has_filter'] ? $context['filter']['href'] : '', '" title="', $txt['reverse_direction'], '"><span class="generic_icons sort_' . $context['sort_direction'] . '"></span></a> |
| 126 | 129 | ', $error['time'], '<br>'; |
| 127 | 130 | |
| 128 | - if (!empty($error['member']['ip'])) |
|
| 129 | - echo ' |
|
| 131 | + if (!empty($error['member']['ip'])) { |
|
| 132 | + echo ' |
|
| 130 | 133 | <a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=ip;value=', $error['member']['ip'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_ip'], '"><span class="generic_icons filter centericon"></span></a> |
| 131 | 134 | <strong><a href="', $scripturl, '?action=trackip;searchip=', $error['member']['ip'], '">', $error['member']['ip'], '</a></strong> <br>'; |
| 135 | + } |
|
| 132 | 136 | |
| 133 | 137 | echo ' |
| 134 | 138 | </div> |
| 135 | 139 | <div style="float: left; width: 50%; line-height: 1.8em; padding: 0 4px;">'; |
| 136 | 140 | |
| 137 | - if ($error['member']['session'] != '') |
|
| 138 | - echo ' |
|
| 141 | + if ($error['member']['session'] != '') { |
|
| 142 | + echo ' |
|
| 139 | 143 | <a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=session;value=', $error['member']['session'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_session'], '"><span class="generic_icons filter centericon"></span></a> |
| 140 | 144 | ', $error['member']['session'], '<br>'; |
| 145 | + } |
|
| 141 | 146 | |
| 142 | 147 | echo ' |
| 143 | 148 | <a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=error_type;value=', $error['error_type']['type'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_type'], '"><span class="generic_icons filter centericon"></span></a> |
@@ -151,8 +156,8 @@ discard block |
||
| 151 | 156 | <a style="display: table-cell;" href="', $error['url']['html'], '">', $error['url']['html'], '</a> |
| 152 | 157 | </div>'; |
| 153 | 158 | |
| 154 | - if (!empty($error['file'])) |
|
| 155 | - echo ' |
|
| 159 | + if (!empty($error['file'])) { |
|
| 160 | + echo ' |
|
| 156 | 161 | <div style="float: left; width: 100%; padding: 4px 0; line-height: 1.6em; border-top: 1px solid #e3e3e3;"> |
| 157 | 162 | <a style="display: table-cell; padding: 4px; width: 20px; vertical-align: top;" href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=file;value=', $error['file']['search'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_file'], '"><span class="generic_icons filter"></span></a> |
| 158 | 163 | <div> |
@@ -160,6 +165,7 @@ discard block |
||
| 160 | 165 | ', $txt['line'], ': ', $error['file']['line'], ' |
| 161 | 166 | </div> |
| 162 | 167 | </div>'; |
| 168 | + } |
|
| 163 | 169 | |
| 164 | 170 | echo ' |
| 165 | 171 | </td> |
@@ -187,9 +193,10 @@ discard block |
||
| 187 | 193 | </div> |
| 188 | 194 | </div>'; |
| 189 | 195 | |
| 190 | - if ($context['sort_direction'] == 'down') |
|
| 191 | - echo ' |
|
| 196 | + if ($context['sort_direction'] == 'down') { |
|
| 197 | + echo ' |
|
| 192 | 198 | <input type="hidden" name="desc" value="1">'; |
| 199 | + } |
|
| 193 | 200 | |
| 194 | 201 | echo ' |
| 195 | 202 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -14,8 +14,9 @@ discard block |
||
| 14 | 14 | * @version 2.1 Beta 4 |
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | -if (!defined('SMF')) |
|
| 17 | +if (!defined('SMF')) { |
|
| 18 | 18 | die('No direct access...'); |
| 19 | +} |
|
| 19 | 20 | |
| 20 | 21 | /** |
| 21 | 22 | * Ask them for their login information. (shows a page for the user to type |
@@ -29,8 +30,9 @@ discard block |
||
| 29 | 30 | global $txt, $context, $scripturl, $user_info; |
| 30 | 31 | |
| 31 | 32 | // You are already logged in, go take a tour of the boards |
| 32 | - if (!empty($user_info['id'])) |
|
| 33 | - redirectexit(); |
|
| 33 | + if (!empty($user_info['id'])) { |
|
| 34 | + redirectexit(); |
|
| 35 | + } |
|
| 34 | 36 | |
| 35 | 37 | // We need to load the Login template/language file. |
| 36 | 38 | loadLanguage('Login'); |
@@ -57,10 +59,11 @@ discard block |
||
| 57 | 59 | ); |
| 58 | 60 | |
| 59 | 61 | // Set the login URL - will be used when the login process is done (but careful not to send us to an attachment). |
| 60 | - if (isset($_SESSION['old_url']) && strpos($_SESSION['old_url'], 'dlattach') === false && preg_match('~(board|topic)[=,]~', $_SESSION['old_url']) != 0) |
|
| 61 | - $_SESSION['login_url'] = $_SESSION['old_url']; |
|
| 62 | - elseif (isset($_SESSION['login_url']) && strpos($_SESSION['login_url'], 'dlattach') !== false) |
|
| 63 | - unset($_SESSION['login_url']); |
|
| 62 | + if (isset($_SESSION['old_url']) && strpos($_SESSION['old_url'], 'dlattach') === false && preg_match('~(board|topic)[=,]~', $_SESSION['old_url']) != 0) { |
|
| 63 | + $_SESSION['login_url'] = $_SESSION['old_url']; |
|
| 64 | + } elseif (isset($_SESSION['login_url']) && strpos($_SESSION['login_url'], 'dlattach') !== false) { |
|
| 65 | + unset($_SESSION['login_url']); |
|
| 66 | + } |
|
| 64 | 67 | |
| 65 | 68 | // Create a one time token. |
| 66 | 69 | createToken('login'); |
@@ -83,8 +86,9 @@ discard block |
||
| 83 | 86 | global $cookiename, $modSettings, $context, $sourcedir, $maintenance; |
| 84 | 87 | |
| 85 | 88 | // Check to ensure we're forcing SSL for authentication |
| 86 | - if (!empty($modSettings['force_ssl']) && empty($maintenance) && (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')) |
|
| 87 | - fatal_lang_error('login_ssl_required'); |
|
| 89 | + if (!empty($modSettings['force_ssl']) && empty($maintenance) && (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')) { |
|
| 90 | + fatal_lang_error('login_ssl_required'); |
|
| 91 | + } |
|
| 88 | 92 | |
| 89 | 93 | // Load cookie authentication stuff. |
| 90 | 94 | require_once($sourcedir . '/Subs-Auth.php'); |
@@ -102,19 +106,20 @@ discard block |
||
| 102 | 106 | list (,, $timeout) = $smcFunc['json_decode']($_COOKIE[$cookiename], true); |
| 103 | 107 | |
| 104 | 108 | // That didn't work... Maybe it's using serialize? |
| 105 | - if (is_null($timeout)) |
|
| 106 | - list (,, $timeout) = safe_unserialize($_COOKIE[$cookiename]); |
|
| 107 | - } |
|
| 108 | - elseif (isset($_SESSION['login_' . $cookiename])) |
|
| 109 | + if (is_null($timeout)) { |
|
| 110 | + list (,, $timeout) = safe_unserialize($_COOKIE[$cookiename]); |
|
| 111 | + } |
|
| 112 | + } elseif (isset($_SESSION['login_' . $cookiename])) |
|
| 109 | 113 | { |
| 110 | 114 | list (,, $timeout) = $smcFunc['json_decode']($_SESSION['login_' . $cookiename]); |
| 111 | 115 | |
| 112 | 116 | // Try for old format |
| 113 | - if (is_null($timeout)) |
|
| 114 | - list (,, $timeout) = safe_unserialize($_SESSION['login_' . $cookiename]); |
|
| 117 | + if (is_null($timeout)) { |
|
| 118 | + list (,, $timeout) = safe_unserialize($_SESSION['login_' . $cookiename]); |
|
| 119 | + } |
|
| 120 | + } else { |
|
| 121 | + trigger_error('Login2(): Cannot be logged in without a session or cookie', E_USER_ERROR); |
|
| 115 | 122 | } |
| 116 | - else |
|
| 117 | - trigger_error('Login2(): Cannot be logged in without a session or cookie', E_USER_ERROR); |
|
| 118 | 123 | |
| 119 | 124 | $user_settings['password_salt'] = substr(md5(mt_rand()), 0, 4); |
| 120 | 125 | updateMemberData($user_info['id'], array('password_salt' => $user_settings['password_salt'])); |
@@ -127,10 +132,11 @@ discard block |
||
| 127 | 132 | list ($tfamember, $tfasecret, $exp, $state, $preserve) = $tfadata; |
| 128 | 133 | |
| 129 | 134 | // If we're preserving the cookie, reset it with updated salt |
| 130 | - if (isset($tfamember, $tfasecret, $exp, $state, $preserve) && $preserve && time() < $exp) |
|
| 131 | - setTFACookie(3153600, $user_info['password_salt'], hash_salt($user_settings['tfa_backup'], $user_settings['password_salt']), true); |
|
| 132 | - else |
|
| 133 | - setTFACookie(-3600, 0, ''); |
|
| 135 | + if (isset($tfamember, $tfasecret, $exp, $state, $preserve) && $preserve && time() < $exp) { |
|
| 136 | + setTFACookie(3153600, $user_info['password_salt'], hash_salt($user_settings['tfa_backup'], $user_settings['password_salt']), true); |
|
| 137 | + } else { |
|
| 138 | + setTFACookie(-3600, 0, ''); |
|
| 139 | + } |
|
| 134 | 140 | } |
| 135 | 141 | |
| 136 | 142 | setLoginCookie($timeout - time(), $user_info['id'], hash_salt($user_settings['passwd'], $user_settings['password_salt'])); |
@@ -141,20 +147,20 @@ discard block |
||
| 141 | 147 | elseif (isset($_GET['sa']) && $_GET['sa'] == 'check') |
| 142 | 148 | { |
| 143 | 149 | // Strike! You're outta there! |
| 144 | - if ($_GET['member'] != $user_info['id']) |
|
| 145 | - fatal_lang_error('login_cookie_error', false); |
|
| 150 | + if ($_GET['member'] != $user_info['id']) { |
|
| 151 | + fatal_lang_error('login_cookie_error', false); |
|
| 152 | + } |
|
| 146 | 153 | |
| 147 | 154 | $user_info['can_mod'] = allowedTo('access_mod_center') || (!$user_info['is_guest'] && ($user_info['mod_cache']['gq'] != '0=1' || $user_info['mod_cache']['bq'] != '0=1' || ($modSettings['postmod_active'] && !empty($user_info['mod_cache']['ap'])))); |
| 148 | 155 | |
| 149 | 156 | // Some whitelisting for login_url... |
| 150 | - if (empty($_SESSION['login_url'])) |
|
| 151 | - redirectexit(empty($user_settings['tfa_secret']) ? '' : 'action=logintfa'); |
|
| 152 | - elseif (!empty($_SESSION['login_url']) && (strpos($_SESSION['login_url'], 'http://') === false && strpos($_SESSION['login_url'], 'https://') === false)) |
|
| 157 | + if (empty($_SESSION['login_url'])) { |
|
| 158 | + redirectexit(empty($user_settings['tfa_secret']) ? '' : 'action=logintfa'); |
|
| 159 | + } elseif (!empty($_SESSION['login_url']) && (strpos($_SESSION['login_url'], 'http://') === false && strpos($_SESSION['login_url'], 'https://') === false)) |
|
| 153 | 160 | { |
| 154 | 161 | unset ($_SESSION['login_url']); |
| 155 | 162 | redirectexit(empty($user_settings['tfa_secret']) ? '' : 'action=logintfa'); |
| 156 | - } |
|
| 157 | - else |
|
| 163 | + } else |
|
| 158 | 164 | { |
| 159 | 165 | // Best not to clutter the session data too much... |
| 160 | 166 | $temp = $_SESSION['login_url']; |
@@ -165,8 +171,9 @@ discard block |
||
| 165 | 171 | } |
| 166 | 172 | |
| 167 | 173 | // Beyond this point you are assumed to be a guest trying to login. |
| 168 | - if (!$user_info['is_guest']) |
|
| 169 | - redirectexit(); |
|
| 174 | + if (!$user_info['is_guest']) { |
|
| 175 | + redirectexit(); |
|
| 176 | + } |
|
| 170 | 177 | |
| 171 | 178 | // Are you guessing with a script? |
| 172 | 179 | checkSession(); |
@@ -174,18 +181,21 @@ discard block |
||
| 174 | 181 | spamProtection('login'); |
| 175 | 182 | |
| 176 | 183 | // Set the login_url if it's not already set (but careful not to send us to an attachment). |
| 177 | - if ((empty($_SESSION['login_url']) && isset($_SESSION['old_url']) && strpos($_SESSION['old_url'], 'dlattach') === false && preg_match('~(board|topic)[=,]~', $_SESSION['old_url']) != 0) || (isset($_GET['quicklogin']) && isset($_SESSION['old_url']) && strpos($_SESSION['old_url'], 'login') === false)) |
|
| 178 | - $_SESSION['login_url'] = $_SESSION['old_url']; |
|
| 184 | + if ((empty($_SESSION['login_url']) && isset($_SESSION['old_url']) && strpos($_SESSION['old_url'], 'dlattach') === false && preg_match('~(board|topic)[=,]~', $_SESSION['old_url']) != 0) || (isset($_GET['quicklogin']) && isset($_SESSION['old_url']) && strpos($_SESSION['old_url'], 'login') === false)) { |
|
| 185 | + $_SESSION['login_url'] = $_SESSION['old_url']; |
|
| 186 | + } |
|
| 179 | 187 | |
| 180 | 188 | // Been guessing a lot, haven't we? |
| 181 | - if (isset($_SESSION['failed_login']) && $_SESSION['failed_login'] >= $modSettings['failed_login_threshold'] * 3) |
|
| 182 | - fatal_lang_error('login_threshold_fail', 'login'); |
|
| 189 | + if (isset($_SESSION['failed_login']) && $_SESSION['failed_login'] >= $modSettings['failed_login_threshold'] * 3) { |
|
| 190 | + fatal_lang_error('login_threshold_fail', 'login'); |
|
| 191 | + } |
|
| 183 | 192 | |
| 184 | 193 | // Set up the cookie length. (if it's invalid, just fall through and use the default.) |
| 185 | - if (isset($_POST['cookieneverexp']) || (!empty($_POST['cookielength']) && $_POST['cookielength'] == -1)) |
|
| 186 | - $modSettings['cookieTime'] = 3153600; |
|
| 187 | - elseif (!empty($_POST['cookielength']) && ($_POST['cookielength'] >= 1 && $_POST['cookielength'] <= 525600)) |
|
| 188 | - $modSettings['cookieTime'] = (int) $_POST['cookielength']; |
|
| 194 | + if (isset($_POST['cookieneverexp']) || (!empty($_POST['cookielength']) && $_POST['cookielength'] == -1)) { |
|
| 195 | + $modSettings['cookieTime'] = 3153600; |
|
| 196 | + } elseif (!empty($_POST['cookielength']) && ($_POST['cookielength'] >= 1 && $_POST['cookielength'] <= 525600)) { |
|
| 197 | + $modSettings['cookieTime'] = (int) $_POST['cookielength']; |
|
| 198 | + } |
|
| 189 | 199 | |
| 190 | 200 | loadLanguage('Login'); |
| 191 | 201 | // Load the template stuff. |
@@ -305,8 +315,9 @@ discard block |
||
| 305 | 315 | $other_passwords[] = crypt(md5($_POST['passwrd']), md5($_POST['passwrd'])); |
| 306 | 316 | |
| 307 | 317 | // Snitz style - SHA-256. Technically, this is a downgrade, but most PHP configurations don't support sha256 anyway. |
| 308 | - if (strlen($user_settings['passwd']) == 64 && function_exists('mhash') && defined('MHASH_SHA256')) |
|
| 309 | - $other_passwords[] = bin2hex(mhash(MHASH_SHA256, $_POST['passwrd'])); |
|
| 318 | + if (strlen($user_settings['passwd']) == 64 && function_exists('mhash') && defined('MHASH_SHA256')) { |
|
| 319 | + $other_passwords[] = bin2hex(mhash(MHASH_SHA256, $_POST['passwrd'])); |
|
| 320 | + } |
|
| 310 | 321 | |
| 311 | 322 | // phpBB3 users new hashing. We now support it as well ;). |
| 312 | 323 | $other_passwords[] = phpBB3_password_check($_POST['passwrd'], $user_settings['passwd']); |
@@ -326,27 +337,29 @@ discard block |
||
| 326 | 337 | // Some common md5 ones. |
| 327 | 338 | $other_passwords[] = md5($user_settings['password_salt'] . $_POST['passwrd']); |
| 328 | 339 | $other_passwords[] = md5($_POST['passwrd'] . $user_settings['password_salt']); |
| 329 | - } |
|
| 330 | - elseif (strlen($user_settings['passwd']) == 40) |
|
| 340 | + } elseif (strlen($user_settings['passwd']) == 40) |
|
| 331 | 341 | { |
| 332 | 342 | // Maybe they are using a hash from before the password fix. |
| 333 | 343 | // This is also valid for SMF 1.1 to 2.0 style of hashing, changed to bcrypt in SMF 2.1 |
| 334 | 344 | $other_passwords[] = sha1(strtolower($user_settings['member_name']) . un_htmlspecialchars($_POST['passwrd'])); |
| 335 | 345 | |
| 336 | 346 | // BurningBoard3 style of hashing. |
| 337 | - if (!empty($modSettings['enable_password_conversion'])) |
|
| 338 | - $other_passwords[] = sha1($user_settings['password_salt'] . sha1($user_settings['password_salt'] . sha1($_POST['passwrd']))); |
|
| 347 | + if (!empty($modSettings['enable_password_conversion'])) { |
|
| 348 | + $other_passwords[] = sha1($user_settings['password_salt'] . sha1($user_settings['password_salt'] . sha1($_POST['passwrd']))); |
|
| 349 | + } |
|
| 339 | 350 | |
| 340 | 351 | // Perhaps we converted to UTF-8 and have a valid password being hashed differently. |
| 341 | 352 | if ($context['character_set'] == 'UTF-8' && !empty($modSettings['previousCharacterSet']) && $modSettings['previousCharacterSet'] != 'utf8') |
| 342 | 353 | { |
| 343 | 354 | // Try iconv first, for no particular reason. |
| 344 | - if (function_exists('iconv')) |
|
| 345 | - $other_passwords['iconv'] = sha1(strtolower(iconv('UTF-8', $modSettings['previousCharacterSet'], $user_settings['member_name'])) . un_htmlspecialchars(iconv('UTF-8', $modSettings['previousCharacterSet'], $_POST['passwrd']))); |
|
| 355 | + if (function_exists('iconv')) { |
|
| 356 | + $other_passwords['iconv'] = sha1(strtolower(iconv('UTF-8', $modSettings['previousCharacterSet'], $user_settings['member_name'])) . un_htmlspecialchars(iconv('UTF-8', $modSettings['previousCharacterSet'], $_POST['passwrd']))); |
|
| 357 | + } |
|
| 346 | 358 | |
| 347 | 359 | // Say it aint so, iconv failed! |
| 348 | - if (empty($other_passwords['iconv']) && function_exists('mb_convert_encoding')) |
|
| 349 | - $other_passwords[] = sha1(strtolower(mb_convert_encoding($user_settings['member_name'], 'UTF-8', $modSettings['previousCharacterSet'])) . un_htmlspecialchars(mb_convert_encoding($_POST['passwrd'], 'UTF-8', $modSettings['previousCharacterSet']))); |
|
| 360 | + if (empty($other_passwords['iconv']) && function_exists('mb_convert_encoding')) { |
|
| 361 | + $other_passwords[] = sha1(strtolower(mb_convert_encoding($user_settings['member_name'], 'UTF-8', $modSettings['previousCharacterSet'])) . un_htmlspecialchars(mb_convert_encoding($_POST['passwrd'], 'UTF-8', $modSettings['previousCharacterSet']))); |
|
| 362 | + } |
|
| 350 | 363 | } |
| 351 | 364 | } |
| 352 | 365 | |
@@ -376,8 +389,9 @@ discard block |
||
| 376 | 389 | $_SESSION['failed_login'] = isset($_SESSION['failed_login']) ? ($_SESSION['failed_login'] + 1) : 1; |
| 377 | 390 | |
| 378 | 391 | // Hmm... don't remember it, do you? Here, try the password reminder ;). |
| 379 | - if ($_SESSION['failed_login'] >= $modSettings['failed_login_threshold']) |
|
| 380 | - redirectexit('action=reminder'); |
|
| 392 | + if ($_SESSION['failed_login'] >= $modSettings['failed_login_threshold']) { |
|
| 393 | + redirectexit('action=reminder'); |
|
| 394 | + } |
|
| 381 | 395 | // We'll give you another chance... |
| 382 | 396 | else |
| 383 | 397 | { |
@@ -388,8 +402,7 @@ discard block |
||
| 388 | 402 | return; |
| 389 | 403 | } |
| 390 | 404 | } |
| 391 | - } |
|
| 392 | - elseif (!empty($user_settings['passwd_flood'])) |
|
| 405 | + } elseif (!empty($user_settings['passwd_flood'])) |
|
| 393 | 406 | { |
| 394 | 407 | // Let's be sure they weren't a little hacker. |
| 395 | 408 | validatePasswordFlood($user_settings['id_member'], $user_settings['member_name'], $user_settings['passwd_flood'], true); |
@@ -406,8 +419,9 @@ discard block |
||
| 406 | 419 | } |
| 407 | 420 | |
| 408 | 421 | // Check their activation status. |
| 409 | - if (!checkActivation()) |
|
| 410 | - return; |
|
| 422 | + if (!checkActivation()) { |
|
| 423 | + return; |
|
| 424 | + } |
|
| 411 | 425 | |
| 412 | 426 | DoLogin(); |
| 413 | 427 | } |
@@ -419,8 +433,9 @@ discard block |
||
| 419 | 433 | { |
| 420 | 434 | global $sourcedir, $txt, $context, $user_info, $modSettings, $scripturl; |
| 421 | 435 | |
| 422 | - if (!$user_info['is_guest'] || empty($context['tfa_member']) || empty($modSettings['tfa_mode'])) |
|
| 423 | - fatal_lang_error('no_access', false); |
|
| 436 | + if (!$user_info['is_guest'] || empty($context['tfa_member']) || empty($modSettings['tfa_mode'])) { |
|
| 437 | + fatal_lang_error('no_access', false); |
|
| 438 | + } |
|
| 424 | 439 | |
| 425 | 440 | loadLanguage('Profile'); |
| 426 | 441 | require_once($sourcedir . '/Class-TOTP.php'); |
@@ -428,8 +443,9 @@ discard block |
||
| 428 | 443 | $member = $context['tfa_member']; |
| 429 | 444 | |
| 430 | 445 | // Prevent replay attacks by limiting at least 2 minutes before they can log in again via 2FA |
| 431 | - if (time() - $member['last_login'] < 120) |
|
| 432 | - fatal_lang_error('tfa_wait', false); |
|
| 446 | + if (time() - $member['last_login'] < 120) { |
|
| 447 | + fatal_lang_error('tfa_wait', false); |
|
| 448 | + } |
|
| 433 | 449 | |
| 434 | 450 | $totp = new \TOTP\Auth($member['tfa_secret']); |
| 435 | 451 | $totp->setRange(1); |
@@ -443,8 +459,9 @@ discard block |
||
| 443 | 459 | if (!empty($_POST['tfa_code']) && empty($_POST['tfa_backup'])) |
| 444 | 460 | { |
| 445 | 461 | // Check to ensure we're forcing SSL for authentication |
| 446 | - if (!empty($modSettings['force_ssl']) && empty($maintenance) && (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')) |
|
| 447 | - fatal_lang_error('login_ssl_required'); |
|
| 462 | + if (!empty($modSettings['force_ssl']) && empty($maintenance) && (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')) { |
|
| 463 | + fatal_lang_error('login_ssl_required'); |
|
| 464 | + } |
|
| 448 | 465 | |
| 449 | 466 | $code = $_POST['tfa_code']; |
| 450 | 467 | |
@@ -454,20 +471,19 @@ discard block |
||
| 454 | 471 | |
| 455 | 472 | setTFACookie(3153600, $member['id_member'], hash_salt($member['tfa_backup'], $member['password_salt']), !empty($_POST['tfa_preserve'])); |
| 456 | 473 | redirectexit(); |
| 457 | - } |
|
| 458 | - else |
|
| 474 | + } else |
|
| 459 | 475 | { |
| 460 | 476 | validatePasswordFlood($member['id_member'], $member['member_name'], $member['passwd_flood'], false, true); |
| 461 | 477 | |
| 462 | 478 | $context['tfa_error'] = true; |
| 463 | 479 | $context['tfa_value'] = $_POST['tfa_code']; |
| 464 | 480 | } |
| 465 | - } |
|
| 466 | - elseif (!empty($_POST['tfa_backup'])) |
|
| 481 | + } elseif (!empty($_POST['tfa_backup'])) |
|
| 467 | 482 | { |
| 468 | 483 | // Check to ensure we're forcing SSL for authentication |
| 469 | - if (!empty($modSettings['force_ssl']) && empty($maintenance) && (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')) |
|
| 470 | - fatal_lang_error('login_ssl_required'); |
|
| 484 | + if (!empty($modSettings['force_ssl']) && empty($maintenance) && (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')) { |
|
| 485 | + fatal_lang_error('login_ssl_required'); |
|
| 486 | + } |
|
| 471 | 487 | |
| 472 | 488 | $backup = $_POST['tfa_backup']; |
| 473 | 489 | |
@@ -481,8 +497,7 @@ discard block |
||
| 481 | 497 | )); |
| 482 | 498 | setTFACookie(3153600, $member['id_member'], hash_salt($member['tfa_backup'], $member['password_salt'])); |
| 483 | 499 | redirectexit('action=profile;area=tfasetup;backup'); |
| 484 | - } |
|
| 485 | - else |
|
| 500 | + } else |
|
| 486 | 501 | { |
| 487 | 502 | validatePasswordFlood($member['id_member'], $member['member_name'], $member['passwd_flood'], false, true); |
| 488 | 503 | |
@@ -505,8 +520,9 @@ discard block |
||
| 505 | 520 | { |
| 506 | 521 | global $context, $txt, $scripturl, $user_settings, $modSettings; |
| 507 | 522 | |
| 508 | - if (!isset($context['login_errors'])) |
|
| 509 | - $context['login_errors'] = array(); |
|
| 523 | + if (!isset($context['login_errors'])) { |
|
| 524 | + $context['login_errors'] = array(); |
|
| 525 | + } |
|
| 510 | 526 | |
| 511 | 527 | // What is the true activation status of this account? |
| 512 | 528 | $activation_status = $user_settings['is_activated'] > 10 ? $user_settings['is_activated'] - 10 : $user_settings['is_activated']; |
@@ -518,8 +534,9 @@ discard block |
||
| 518 | 534 | return false; |
| 519 | 535 | } |
| 520 | 536 | // Awaiting approval still? |
| 521 | - elseif ($activation_status == 3) |
|
| 522 | - fatal_lang_error('still_awaiting_approval', 'user'); |
|
| 537 | + elseif ($activation_status == 3) { |
|
| 538 | + fatal_lang_error('still_awaiting_approval', 'user'); |
|
| 539 | + } |
|
| 523 | 540 | // Awaiting deletion, changed their mind? |
| 524 | 541 | elseif ($activation_status == 4) |
| 525 | 542 | { |
@@ -527,8 +544,7 @@ discard block |
||
| 527 | 544 | { |
| 528 | 545 | updateMemberData($user_settings['id_member'], array('is_activated' => 1)); |
| 529 | 546 | updateSettings(array('unapprovedMembers' => ($modSettings['unapprovedMembers'] > 0 ? $modSettings['unapprovedMembers'] - 1 : 0))); |
| 530 | - } |
|
| 531 | - else |
|
| 547 | + } else |
|
| 532 | 548 | { |
| 533 | 549 | $context['disable_login_hashing'] = true; |
| 534 | 550 | $context['login_errors'][] = $txt['awaiting_delete_account']; |
@@ -568,8 +584,9 @@ discard block |
||
| 568 | 584 | setLoginCookie(60 * $modSettings['cookieTime'], $user_settings['id_member'], hash_salt($user_settings['passwd'], $user_settings['password_salt'])); |
| 569 | 585 | |
| 570 | 586 | // Reset the login threshold. |
| 571 | - if (isset($_SESSION['failed_login'])) |
|
| 572 | - unset($_SESSION['failed_login']); |
|
| 587 | + if (isset($_SESSION['failed_login'])) { |
|
| 588 | + unset($_SESSION['failed_login']); |
|
| 589 | + } |
|
| 573 | 590 | |
| 574 | 591 | $user_info['is_guest'] = false; |
| 575 | 592 | $user_settings['additional_groups'] = explode(',', $user_settings['additional_groups']); |
@@ -591,16 +608,18 @@ discard block |
||
| 591 | 608 | 'id_member' => $user_info['id'], |
| 592 | 609 | ) |
| 593 | 610 | ); |
| 594 | - if ($smcFunc['db_num_rows']($request) == 1) |
|
| 595 | - $_SESSION['first_login'] = true; |
|
| 596 | - else |
|
| 597 | - unset($_SESSION['first_login']); |
|
| 611 | + if ($smcFunc['db_num_rows']($request) == 1) { |
|
| 612 | + $_SESSION['first_login'] = true; |
|
| 613 | + } else { |
|
| 614 | + unset($_SESSION['first_login']); |
|
| 615 | + } |
|
| 598 | 616 | $smcFunc['db_free_result']($request); |
| 599 | 617 | |
| 600 | 618 | // You've logged in, haven't you? |
| 601 | 619 | $update = array('member_ip' => $user_info['ip'], 'member_ip2' => $_SERVER['BAN_CHECK_IP']); |
| 602 | - if (empty($user_settings['tfa_secret'])) |
|
| 603 | - $update['last_login'] = time(); |
|
| 620 | + if (empty($user_settings['tfa_secret'])) { |
|
| 621 | + $update['last_login'] = time(); |
|
| 622 | + } |
|
| 604 | 623 | updateMemberData($user_info['id'], $update); |
| 605 | 624 | |
| 606 | 625 | // Get rid of the online entry for that old guest.... |
@@ -614,8 +633,8 @@ discard block |
||
| 614 | 633 | $_SESSION['log_time'] = 0; |
| 615 | 634 | |
| 616 | 635 | // Log this entry, only if we have it enabled. |
| 617 | - if (!empty($modSettings['loginHistoryDays'])) |
|
| 618 | - $smcFunc['db_insert']('insert', |
|
| 636 | + if (!empty($modSettings['loginHistoryDays'])) { |
|
| 637 | + $smcFunc['db_insert']('insert', |
|
| 619 | 638 | '{db_prefix}member_logins', |
| 620 | 639 | array( |
| 621 | 640 | 'id_member' => 'int', 'time' => 'int', 'ip' => 'inet', 'ip2' => 'inet', |
@@ -627,13 +646,15 @@ discard block |
||
| 627 | 646 | 'id_member', 'time' |
| 628 | 647 | ) |
| 629 | 648 | ); |
| 649 | + } |
|
| 630 | 650 | |
| 631 | 651 | // Just log you back out if it's in maintenance mode and you AREN'T an admin. |
| 632 | - if (empty($maintenance) || allowedTo('admin_forum')) |
|
| 633 | - redirectexit('action=login2;sa=check;member=' . $user_info['id'], $context['server']['needs_login_fix']); |
|
| 634 | - else |
|
| 635 | - redirectexit('action=logout;' . $context['session_var'] . '=' . $context['session_id'], $context['server']['needs_login_fix']); |
|
| 636 | -} |
|
| 652 | + if (empty($maintenance) || allowedTo('admin_forum')) { |
|
| 653 | + redirectexit('action=login2;sa=check;member=' . $user_info['id'], $context['server']['needs_login_fix']); |
|
| 654 | + } else { |
|
| 655 | + redirectexit('action=logout;' . $context['session_var'] . '=' . $context['session_id'], $context['server']['needs_login_fix']); |
|
| 656 | + } |
|
| 657 | + } |
|
| 637 | 658 | |
| 638 | 659 | /** |
| 639 | 660 | * Logs the current user out of their account. |
@@ -649,13 +670,15 @@ discard block |
||
| 649 | 670 | global $sourcedir, $user_info, $user_settings, $context, $smcFunc, $cookiename, $modSettings; |
| 650 | 671 | |
| 651 | 672 | // Make sure they aren't being auto-logged out. |
| 652 | - if (!$internal) |
|
| 653 | - checkSession('get'); |
|
| 673 | + if (!$internal) { |
|
| 674 | + checkSession('get'); |
|
| 675 | + } |
|
| 654 | 676 | |
| 655 | 677 | require_once($sourcedir . '/Subs-Auth.php'); |
| 656 | 678 | |
| 657 | - if (isset($_SESSION['pack_ftp'])) |
|
| 658 | - $_SESSION['pack_ftp'] = null; |
|
| 679 | + if (isset($_SESSION['pack_ftp'])) { |
|
| 680 | + $_SESSION['pack_ftp'] = null; |
|
| 681 | + } |
|
| 659 | 682 | |
| 660 | 683 | // It won't be first login anymore. |
| 661 | 684 | unset($_SESSION['first_login']); |
@@ -683,8 +706,9 @@ discard block |
||
| 683 | 706 | |
| 684 | 707 | // And some other housekeeping while we're at it. |
| 685 | 708 | $salt = substr(md5(mt_rand()), 0, 4); |
| 686 | - if (!empty($user_info['id'])) |
|
| 687 | - updateMemberData($user_info['id'], array('password_salt' => $salt)); |
|
| 709 | + if (!empty($user_info['id'])) { |
|
| 710 | + updateMemberData($user_info['id'], array('password_salt' => $salt)); |
|
| 711 | + } |
|
| 688 | 712 | |
| 689 | 713 | if (!empty($modSettings['tfa_mode']) && !empty($user_info['id']) && !empty($_COOKIE[$cookiename . '_tfa'])) |
| 690 | 714 | { |
@@ -693,10 +717,11 @@ discard block |
||
| 693 | 717 | list ($tfamember, $tfasecret, $exp, $state, $preserve) = $tfadata; |
| 694 | 718 | |
| 695 | 719 | // If we're preserving the cookie, reset it with updated salt |
| 696 | - if (isset($tfamember, $tfasecret, $exp, $state, $preserve) && $preserve && time() < $exp) |
|
| 697 | - setTFACookie(3153600, $user_info['id'], hash_salt($user_settings['tfa_backup'], $salt), true); |
|
| 698 | - else |
|
| 699 | - setTFACookie(-3600, 0, ''); |
|
| 720 | + if (isset($tfamember, $tfasecret, $exp, $state, $preserve) && $preserve && time() < $exp) { |
|
| 721 | + setTFACookie(3153600, $user_info['id'], hash_salt($user_settings['tfa_backup'], $salt), true); |
|
| 722 | + } else { |
|
| 723 | + setTFACookie(-3600, 0, ''); |
|
| 724 | + } |
|
| 700 | 725 | } |
| 701 | 726 | |
| 702 | 727 | session_destroy(); |
@@ -704,14 +729,13 @@ discard block |
||
| 704 | 729 | // Off to the merry board index we go! |
| 705 | 730 | if ($redirect) |
| 706 | 731 | { |
| 707 | - if (empty($_SESSION['logout_url'])) |
|
| 708 | - redirectexit('', $context['server']['needs_login_fix']); |
|
| 709 | - elseif (!empty($_SESSION['logout_url']) && (strpos($_SESSION['logout_url'], 'http://') === false && strpos($_SESSION['logout_url'], 'https://') === false)) |
|
| 732 | + if (empty($_SESSION['logout_url'])) { |
|
| 733 | + redirectexit('', $context['server']['needs_login_fix']); |
|
| 734 | + } elseif (!empty($_SESSION['logout_url']) && (strpos($_SESSION['logout_url'], 'http://') === false && strpos($_SESSION['logout_url'], 'https://') === false)) |
|
| 710 | 735 | { |
| 711 | 736 | unset ($_SESSION['logout_url']); |
| 712 | 737 | redirectexit(); |
| 713 | - } |
|
| 714 | - else |
|
| 738 | + } else |
|
| 715 | 739 | { |
| 716 | 740 | $temp = $_SESSION['logout_url']; |
| 717 | 741 | unset($_SESSION['logout_url']); |
@@ -744,8 +768,9 @@ discard block |
||
| 744 | 768 | function phpBB3_password_check($passwd, $passwd_hash) |
| 745 | 769 | { |
| 746 | 770 | // Too long or too short? |
| 747 | - if (strlen($passwd_hash) != 34) |
|
| 748 | - return; |
|
| 771 | + if (strlen($passwd_hash) != 34) { |
|
| 772 | + return; |
|
| 773 | + } |
|
| 749 | 774 | |
| 750 | 775 | // Range of characters allowed. |
| 751 | 776 | $range = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; |
@@ -756,8 +781,9 @@ discard block |
||
| 756 | 781 | $salt = substr($passwd_hash, 4, 8); |
| 757 | 782 | |
| 758 | 783 | $hash = md5($salt . $passwd, true); |
| 759 | - for (; $count != 0; --$count) |
|
| 760 | - $hash = md5($hash . $passwd, true); |
|
| 784 | + for (; $count != 0; --$count) { |
|
| 785 | + $hash = md5($hash . $passwd, true); |
|
| 786 | + } |
|
| 761 | 787 | |
| 762 | 788 | $output = substr($passwd_hash, 0, 12); |
| 763 | 789 | $i = 0; |
@@ -766,21 +792,25 @@ discard block |
||
| 766 | 792 | $value = ord($hash[$i++]); |
| 767 | 793 | $output .= $range[$value & 0x3f]; |
| 768 | 794 | |
| 769 | - if ($i < 16) |
|
| 770 | - $value |= ord($hash[$i]) << 8; |
|
| 795 | + if ($i < 16) { |
|
| 796 | + $value |= ord($hash[$i]) << 8; |
|
| 797 | + } |
|
| 771 | 798 | |
| 772 | 799 | $output .= $range[($value >> 6) & 0x3f]; |
| 773 | 800 | |
| 774 | - if ($i++ >= 16) |
|
| 775 | - break; |
|
| 801 | + if ($i++ >= 16) { |
|
| 802 | + break; |
|
| 803 | + } |
|
| 776 | 804 | |
| 777 | - if ($i < 16) |
|
| 778 | - $value |= ord($hash[$i]) << 16; |
|
| 805 | + if ($i < 16) { |
|
| 806 | + $value |= ord($hash[$i]) << 16; |
|
| 807 | + } |
|
| 779 | 808 | |
| 780 | 809 | $output .= $range[($value >> 12) & 0x3f]; |
| 781 | 810 | |
| 782 | - if ($i++ >= 16) |
|
| 783 | - break; |
|
| 811 | + if ($i++ >= 16) { |
|
| 812 | + break; |
|
| 813 | + } |
|
| 784 | 814 | |
| 785 | 815 | $output .= $range[($value >> 18) & 0x3f]; |
| 786 | 816 | } |
@@ -812,8 +842,9 @@ discard block |
||
| 812 | 842 | require_once($sourcedir . '/Subs-Auth.php'); |
| 813 | 843 | setLoginCookie(-3600, 0); |
| 814 | 844 | |
| 815 | - if (isset($_SESSION['login_' . $cookiename])) |
|
| 816 | - unset($_SESSION['login_' . $cookiename]); |
|
| 845 | + if (isset($_SESSION['login_' . $cookiename])) { |
|
| 846 | + unset($_SESSION['login_' . $cookiename]); |
|
| 847 | + } |
|
| 817 | 848 | } |
| 818 | 849 | |
| 819 | 850 | // We need a member! |
@@ -827,8 +858,9 @@ discard block |
||
| 827 | 858 | } |
| 828 | 859 | |
| 829 | 860 | // Right, have we got a flood value? |
| 830 | - if ($password_flood_value !== false) |
|
| 831 | - @list ($time_stamp, $number_tries) = explode('|', $password_flood_value); |
|
| 861 | + if ($password_flood_value !== false) { |
|
| 862 | + @list ($time_stamp, $number_tries) = explode('|', $password_flood_value); |
|
| 863 | + } |
|
| 832 | 864 | |
| 833 | 865 | // Timestamp or number of tries invalid? |
| 834 | 866 | if (empty($number_tries) || empty($time_stamp)) |
@@ -844,15 +876,17 @@ discard block |
||
| 844 | 876 | $number_tries = $time_stamp < time() - 20 ? 2 : $number_tries; |
| 845 | 877 | |
| 846 | 878 | // They are trying too fast, make them wait longer |
| 847 | - if ($time_stamp < time() - 10) |
|
| 848 | - $time_stamp = time(); |
|
| 879 | + if ($time_stamp < time() - 10) { |
|
| 880 | + $time_stamp = time(); |
|
| 881 | + } |
|
| 849 | 882 | } |
| 850 | 883 | |
| 851 | 884 | $number_tries++; |
| 852 | 885 | |
| 853 | 886 | // Broken the law? |
| 854 | - if ($number_tries > 5) |
|
| 855 | - fatal_lang_error('login_threshold_brute_fail', 'login', [$member_name]); |
|
| 887 | + if ($number_tries > 5) { |
|
| 888 | + fatal_lang_error('login_threshold_brute_fail', 'login', [$member_name]); |
|
| 889 | + } |
|
| 856 | 890 | |
| 857 | 891 | // Otherwise set the members data. If they correct on their first attempt then we actually clear it, otherwise we set it! |
| 858 | 892 | updateMemberData($id_member, array('passwd_flood' => $was_correct && $number_tries == 1 ? '' : $time_stamp . '|' . $number_tries)); |
@@ -13,8 +13,9 @@ discard block |
||
| 13 | 13 | * @version 2.1 Beta 4 |
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | -if (!defined('SMF')) |
|
| 16 | +if (!defined('SMF')) { |
|
| 17 | 17 | die('No direct access...'); |
| 18 | +} |
|
| 18 | 19 | |
| 19 | 20 | /** |
| 20 | 21 | * Activate an account. |
@@ -48,8 +49,9 @@ discard block |
||
| 48 | 49 | logAction('approve_member', array('member' => $memID), 'admin'); |
| 49 | 50 | |
| 50 | 51 | // If we are doing approval, update the stats for the member just in case. |
| 51 | - if (in_array($user_profile[$memID]['is_activated'], array(3, 4, 5, 13, 14, 15))) |
|
| 52 | - updateSettings(array('unapprovedMembers' => ($modSettings['unapprovedMembers'] > 1 ? $modSettings['unapprovedMembers'] - 1 : 0))); |
|
| 52 | + if (in_array($user_profile[$memID]['is_activated'], array(3, 4, 5, 13, 14, 15))) { |
|
| 53 | + updateSettings(array('unapprovedMembers' => ($modSettings['unapprovedMembers'] > 1 ? $modSettings['unapprovedMembers'] - 1 : 0))); |
|
| 54 | + } |
|
| 53 | 55 | |
| 54 | 56 | // Make sure we update the stats too. |
| 55 | 57 | updateStats('member', false); |
@@ -76,8 +78,9 @@ discard block |
||
| 76 | 78 | $issueErrors = array(); |
| 77 | 79 | |
| 78 | 80 | // Doesn't hurt to be overly cautious. |
| 79 | - if (empty($modSettings['warning_enable']) || ($context['user']['is_owner'] && !$cur_profile['warning']) || !allowedTo('issue_warning')) |
|
| 80 | - fatal_lang_error('no_access', false); |
|
| 81 | + if (empty($modSettings['warning_enable']) || ($context['user']['is_owner'] && !$cur_profile['warning']) || !allowedTo('issue_warning')) { |
|
| 82 | + fatal_lang_error('no_access', false); |
|
| 83 | + } |
|
| 81 | 84 | |
| 82 | 85 | // Get the base (errors related) stuff done. |
| 83 | 86 | loadLanguage('Errors'); |
@@ -135,16 +138,18 @@ discard block |
||
| 135 | 138 | |
| 136 | 139 | // This cannot be empty! |
| 137 | 140 | $_POST['warn_reason'] = isset($_POST['warn_reason']) ? trim($_POST['warn_reason']) : ''; |
| 138 | - if ($_POST['warn_reason'] == '' && !$context['user']['is_owner']) |
|
| 139 | - $issueErrors[] = 'warning_no_reason'; |
|
| 141 | + if ($_POST['warn_reason'] == '' && !$context['user']['is_owner']) { |
|
| 142 | + $issueErrors[] = 'warning_no_reason'; |
|
| 143 | + } |
|
| 140 | 144 | $_POST['warn_reason'] = $smcFunc['htmlspecialchars']($_POST['warn_reason']); |
| 141 | 145 | |
| 142 | 146 | $_POST['warning_level'] = (int) $_POST['warning_level']; |
| 143 | 147 | $_POST['warning_level'] = max(0, min(100, $_POST['warning_level'])); |
| 144 | - if ($_POST['warning_level'] < $context['min_allowed']) |
|
| 145 | - $_POST['warning_level'] = $context['min_allowed']; |
|
| 146 | - elseif ($_POST['warning_level'] > $context['max_allowed']) |
|
| 147 | - $_POST['warning_level'] = $context['max_allowed']; |
|
| 148 | + if ($_POST['warning_level'] < $context['min_allowed']) { |
|
| 149 | + $_POST['warning_level'] = $context['min_allowed']; |
|
| 150 | + } elseif ($_POST['warning_level'] > $context['max_allowed']) { |
|
| 151 | + $_POST['warning_level'] = $context['max_allowed']; |
|
| 152 | + } |
|
| 148 | 153 | |
| 149 | 154 | // Do we actually have to issue them with a PM? |
| 150 | 155 | $id_notice = 0; |
@@ -152,8 +157,9 @@ discard block |
||
| 152 | 157 | { |
| 153 | 158 | $_POST['warn_sub'] = trim($_POST['warn_sub']); |
| 154 | 159 | $_POST['warn_body'] = trim($_POST['warn_body']); |
| 155 | - if (empty($_POST['warn_sub']) || empty($_POST['warn_body'])) |
|
| 156 | - $issueErrors[] = 'warning_notify_blank'; |
|
| 160 | + if (empty($_POST['warn_sub']) || empty($_POST['warn_body'])) { |
|
| 161 | + $issueErrors[] = 'warning_notify_blank'; |
|
| 162 | + } |
|
| 157 | 163 | // Send the PM? |
| 158 | 164 | else |
| 159 | 165 | { |
@@ -190,8 +196,8 @@ discard block |
||
| 190 | 196 | if (empty($issueErrors)) |
| 191 | 197 | { |
| 192 | 198 | // Log what we've done! |
| 193 | - if (!$context['user']['is_owner']) |
|
| 194 | - $smcFunc['db_insert']('', |
|
| 199 | + if (!$context['user']['is_owner']) { |
|
| 200 | + $smcFunc['db_insert']('', |
|
| 195 | 201 | '{db_prefix}log_comments', |
| 196 | 202 | array( |
| 197 | 203 | 'id_member' => 'int', 'member_name' => 'string', 'comment_type' => 'string', 'id_recipient' => 'int', 'recipient_name' => 'string-255', |
@@ -203,14 +209,14 @@ discard block |
||
| 203 | 209 | ), |
| 204 | 210 | array('id_comment') |
| 205 | 211 | ); |
| 212 | + } |
|
| 206 | 213 | |
| 207 | 214 | // Make the change. |
| 208 | 215 | updateMemberData($memID, array('warning' => $_POST['warning_level'])); |
| 209 | 216 | |
| 210 | 217 | // Leave a lovely message. |
| 211 | 218 | $context['profile_updated'] = $context['user']['is_owner'] ? $txt['profile_updated_own'] : $txt['profile_warning_success']; |
| 212 | - } |
|
| 213 | - else |
|
| 219 | + } else |
|
| 214 | 220 | { |
| 215 | 221 | // Try to remember some bits. |
| 216 | 222 | $context['warning_data'] = array( |
@@ -229,8 +235,9 @@ discard block |
||
| 229 | 235 | { |
| 230 | 236 | $warning_body = !empty($_POST['warn_body']) ? trim(censorText($_POST['warn_body'])) : ''; |
| 231 | 237 | $context['preview_subject'] = !empty($_POST['warn_sub']) ? trim($smcFunc['htmlspecialchars']($_POST['warn_sub'])) : ''; |
| 232 | - if (empty($_POST['warn_sub']) || empty($_POST['warn_body'])) |
|
| 233 | - $issueErrors[] = 'warning_notify_blank'; |
|
| 238 | + if (empty($_POST['warn_sub']) || empty($_POST['warn_body'])) { |
|
| 239 | + $issueErrors[] = 'warning_notify_blank'; |
|
| 240 | + } |
|
| 234 | 241 | |
| 235 | 242 | if (!empty($_POST['warn_body'])) |
| 236 | 243 | { |
@@ -254,8 +261,9 @@ discard block |
||
| 254 | 261 | { |
| 255 | 262 | // Fill in the suite of errors. |
| 256 | 263 | $context['post_errors'] = array(); |
| 257 | - foreach ($issueErrors as $error) |
|
| 258 | - $context['post_errors'][] = $txt[$error]; |
|
| 264 | + foreach ($issueErrors as $error) { |
|
| 265 | + $context['post_errors'][] = $txt[$error]; |
|
| 266 | + } |
|
| 259 | 267 | } |
| 260 | 268 | |
| 261 | 269 | |
@@ -272,9 +280,10 @@ discard block |
||
| 272 | 280 | $modSettings['warning_mute'] => $txt['profile_warning_effect_mute'], |
| 273 | 281 | ); |
| 274 | 282 | $context['current_level'] = 0; |
| 275 | - foreach ($context['level_effects'] as $limit => $dummy) |
|
| 276 | - if ($context['member']['warning'] >= $limit) |
|
| 283 | + foreach ($context['level_effects'] as $limit => $dummy) { |
|
| 284 | + if ($context['member']['warning'] >= $limit) |
|
| 277 | 285 | $context['current_level'] = $limit; |
| 286 | + } |
|
| 278 | 287 | |
| 279 | 288 | $listOptions = array( |
| 280 | 289 | 'id' => 'view_warnings', |
@@ -337,11 +346,12 @@ discard block |
||
| 337 | 346 | ' . $warning['reason'] . ' |
| 338 | 347 | </div>'; |
| 339 | 348 | |
| 340 | - if (!empty($warning['id_notice'])) |
|
| 341 | - $ret .= ' |
|
| 349 | + if (!empty($warning['id_notice'])) { |
|
| 350 | + $ret .= ' |
|
| 342 | 351 | <div class="floatright"> |
| 343 | 352 | <a href="' . $scripturl . '?action=moderate;area=notice;nid=' . $warning['id_notice'] . '" onclick="window.open(this.href, \'\', \'scrollbars=yes,resizable=yes,width=400,height=250\');return false;" target="_blank" title="' . $txt['profile_warning_previous_notice'] . '"><span class="generic_icons filter centericon"></span></a> |
| 344 | 353 | </div>'; |
| 354 | + } |
|
| 345 | 355 | |
| 346 | 356 | return $ret; |
| 347 | 357 | }, |
@@ -413,8 +423,9 @@ discard block |
||
| 413 | 423 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 414 | 424 | { |
| 415 | 425 | // If we're not warning for a message skip any that are. |
| 416 | - if (!$context['warning_for_message'] && strpos($row['body'], '{MESSAGE}') !== false) |
|
| 417 | - continue; |
|
| 426 | + if (!$context['warning_for_message'] && strpos($row['body'], '{MESSAGE}') !== false) { |
|
| 427 | + continue; |
|
| 428 | + } |
|
| 418 | 429 | |
| 419 | 430 | $context['notification_templates'][] = array( |
| 420 | 431 | 'title' => $row['template_title'], |
@@ -424,16 +435,18 @@ discard block |
||
| 424 | 435 | $smcFunc['db_free_result']($request); |
| 425 | 436 | |
| 426 | 437 | // Setup the "default" templates. |
| 427 | - foreach (array('spamming', 'offence', 'insulting') as $type) |
|
| 428 | - $context['notification_templates'][] = array( |
|
| 438 | + foreach (array('spamming', 'offence', 'insulting') as $type) { |
|
| 439 | + $context['notification_templates'][] = array( |
|
| 429 | 440 | 'title' => $txt['profile_warning_notify_title_' . $type], |
| 430 | 441 | 'body' => sprintf($txt['profile_warning_notify_template_outline' . (!empty($context['warning_for_message']) ? '_post' : '')], $txt['profile_warning_notify_for_' . $type]), |
| 431 | 442 | ); |
| 443 | + } |
|
| 432 | 444 | |
| 433 | 445 | // Replace all the common variables in the templates. |
| 434 | - foreach ($context['notification_templates'] as $k => $name) |
|
| 435 | - $context['notification_templates'][$k]['body'] = strtr($name['body'], array('{MEMBER}' => un_htmlspecialchars($context['member']['name']), '{MESSAGE}' => '[url=' . $scripturl . '?msg=' . $context['warning_for_message'] . ']' . un_htmlspecialchars($context['warned_message_subject']) . '[/url]', '{SCRIPTURL}' => $scripturl, '{FORUMNAME}' => $mbname, '{REGARDS}' => $txt['regards_team'])); |
|
| 436 | -} |
|
| 446 | + foreach ($context['notification_templates'] as $k => $name) { |
|
| 447 | + $context['notification_templates'][$k]['body'] = strtr($name['body'], array('{MEMBER}' => un_htmlspecialchars($context['member']['name']), '{MESSAGE}' => '[url=' . $scripturl . '?msg=' . $context['warning_for_message'] . ']' . un_htmlspecialchars($context['warned_message_subject']) . '[/url]', '{SCRIPTURL}' => $scripturl, '{FORUMNAME}' => $mbname, '{REGARDS}' => $txt['regards_team'])); |
|
| 448 | + } |
|
| 449 | + } |
|
| 437 | 450 | |
| 438 | 451 | /** |
| 439 | 452 | * Get the number of warnings a user has. Callback for $listOptions['get_count'] in issueWarning() |
@@ -517,10 +530,11 @@ discard block |
||
| 517 | 530 | { |
| 518 | 531 | global $txt, $context, $modSettings, $cur_profile; |
| 519 | 532 | |
| 520 | - if (!$context['user']['is_owner']) |
|
| 521 | - isAllowedTo('profile_remove_any'); |
|
| 522 | - elseif (!allowedTo('profile_remove_any')) |
|
| 523 | - isAllowedTo('profile_remove_own'); |
|
| 533 | + if (!$context['user']['is_owner']) { |
|
| 534 | + isAllowedTo('profile_remove_any'); |
|
| 535 | + } elseif (!allowedTo('profile_remove_any')) { |
|
| 536 | + isAllowedTo('profile_remove_own'); |
|
| 537 | + } |
|
| 524 | 538 | |
| 525 | 539 | // Permissions for removing stuff... |
| 526 | 540 | $context['can_delete_posts'] = !$context['user']['is_owner'] && allowedTo('moderate_forum'); |
@@ -547,10 +561,11 @@ discard block |
||
| 547 | 561 | |
| 548 | 562 | // @todo Add a way to delete pms as well? |
| 549 | 563 | |
| 550 | - if (!$context['user']['is_owner']) |
|
| 551 | - isAllowedTo('profile_remove_any'); |
|
| 552 | - elseif (!allowedTo('profile_remove_any')) |
|
| 553 | - isAllowedTo('profile_remove_own'); |
|
| 564 | + if (!$context['user']['is_owner']) { |
|
| 565 | + isAllowedTo('profile_remove_any'); |
|
| 566 | + } elseif (!allowedTo('profile_remove_any')) { |
|
| 567 | + isAllowedTo('profile_remove_own'); |
|
| 568 | + } |
|
| 554 | 569 | |
| 555 | 570 | checkSession(); |
| 556 | 571 | |
@@ -576,8 +591,9 @@ discard block |
||
| 576 | 591 | list ($another) = $smcFunc['db_fetch_row']($request); |
| 577 | 592 | $smcFunc['db_free_result']($request); |
| 578 | 593 | |
| 579 | - if (empty($another)) |
|
| 580 | - fatal_lang_error('at_least_one_admin', 'critical'); |
|
| 594 | + if (empty($another)) { |
|
| 595 | + fatal_lang_error('at_least_one_admin', 'critical'); |
|
| 596 | + } |
|
| 581 | 597 | } |
| 582 | 598 | |
| 583 | 599 | // This file is needed for the deleteMembers function. |
@@ -656,8 +672,9 @@ discard block |
||
| 656 | 672 | ) |
| 657 | 673 | ); |
| 658 | 674 | $topicIDs = array(); |
| 659 | - while ($row = $smcFunc['db_fetch_assoc']($request)) |
|
| 660 | - $topicIDs[] = $row['id_topic']; |
|
| 675 | + while ($row = $smcFunc['db_fetch_assoc']($request)) { |
|
| 676 | + $topicIDs[] = $row['id_topic']; |
|
| 677 | + } |
|
| 661 | 678 | $smcFunc['db_free_result']($request); |
| 662 | 679 | |
| 663 | 680 | // Actually remove the topics. Ignore recycling if we want to perma-delete things... |
@@ -680,8 +697,9 @@ discard block |
||
| 680 | 697 | // This could take a while... but ya know it's gonna be worth it in the end. |
| 681 | 698 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 682 | 699 | { |
| 683 | - if (function_exists('apache_reset_timeout')) |
|
| 684 | - @apache_reset_timeout(); |
|
| 700 | + if (function_exists('apache_reset_timeout')) { |
|
| 701 | + @apache_reset_timeout(); |
|
| 702 | + } |
|
| 685 | 703 | |
| 686 | 704 | removeMessage($row['id_msg']); |
| 687 | 705 | } |
@@ -689,8 +707,9 @@ discard block |
||
| 689 | 707 | } |
| 690 | 708 | |
| 691 | 709 | // Only delete this poor members account if they are actually being booted out of camp. |
| 692 | - if (isset($_POST['deleteAccount'])) |
|
| 693 | - deleteMembers($memID); |
|
| 710 | + if (isset($_POST['deleteAccount'])) { |
|
| 711 | + deleteMembers($memID); |
|
| 712 | + } |
|
| 694 | 713 | } |
| 695 | 714 | // Do they need approval to delete? |
| 696 | 715 | elseif (!empty($modSettings['approveAccountDeletion']) && !allowedTo('moderate_forum')) |
@@ -741,18 +760,18 @@ discard block |
||
| 741 | 760 | { |
| 742 | 761 | foreach ($costs as $duration => $cost) |
| 743 | 762 | { |
| 744 | - if ($cost != 0) |
|
| 745 | - $cost_array[$duration] = $cost; |
|
| 763 | + if ($cost != 0) { |
|
| 764 | + $cost_array[$duration] = $cost; |
|
| 765 | + } |
|
| 746 | 766 | } |
| 747 | - } |
|
| 748 | - else |
|
| 767 | + } else |
|
| 749 | 768 | { |
| 750 | 769 | $cost_array['fixed'] = $costs['fixed']; |
| 751 | 770 | } |
| 752 | 771 | |
| 753 | - if (empty($cost_array)) |
|
| 754 | - unset($context['subscriptions'][$id]); |
|
| 755 | - else |
|
| 772 | + if (empty($cost_array)) { |
|
| 773 | + unset($context['subscriptions'][$id]); |
|
| 774 | + } else |
|
| 756 | 775 | { |
| 757 | 776 | $context['subscriptions'][$id]['member'] = 0; |
| 758 | 777 | $context['subscriptions'][$id]['subscribed'] = false; |
@@ -765,13 +784,15 @@ discard block |
||
| 765 | 784 | foreach ($gateways as $id => $gateway) |
| 766 | 785 | { |
| 767 | 786 | $gateways[$id] = new $gateway['display_class'](); |
| 768 | - if (!$gateways[$id]->gatewayEnabled()) |
|
| 769 | - unset($gateways[$id]); |
|
| 787 | + if (!$gateways[$id]->gatewayEnabled()) { |
|
| 788 | + unset($gateways[$id]); |
|
| 789 | + } |
|
| 770 | 790 | } |
| 771 | 791 | |
| 772 | 792 | // No gateways yet? |
| 773 | - if (empty($gateways)) |
|
| 774 | - fatal_error($txt['paid_admin_not_setup_gateway']); |
|
| 793 | + if (empty($gateways)) { |
|
| 794 | + fatal_error($txt['paid_admin_not_setup_gateway']); |
|
| 795 | + } |
|
| 775 | 796 | |
| 776 | 797 | // Get the current subscriptions. |
| 777 | 798 | $request = $smcFunc['db_query']('', ' |
@@ -786,8 +807,9 @@ discard block |
||
| 786 | 807 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 787 | 808 | { |
| 788 | 809 | // The subscription must exist! |
| 789 | - if (!isset($context['subscriptions'][$row['id_subscribe']])) |
|
| 790 | - continue; |
|
| 810 | + if (!isset($context['subscriptions'][$row['id_subscribe']])) { |
|
| 811 | + continue; |
|
| 812 | + } |
|
| 791 | 813 | |
| 792 | 814 | $context['current'][$row['id_subscribe']] = array( |
| 793 | 815 | 'id' => $row['id_sublog'], |
@@ -801,8 +823,9 @@ discard block |
||
| 801 | 823 | 'status_text' => $row['status'] == 0 ? ($row['payments_pending'] ? $txt['paid_pending'] : $txt['paid_finished']) : $txt['paid_active'], |
| 802 | 824 | ); |
| 803 | 825 | |
| 804 | - if ($row['status'] == 1) |
|
| 805 | - $context['subscriptions'][$row['id_subscribe']]['subscribed'] = true; |
|
| 826 | + if ($row['status'] == 1) { |
|
| 827 | + $context['subscriptions'][$row['id_subscribe']]['subscribed'] = true; |
|
| 828 | + } |
|
| 806 | 829 | } |
| 807 | 830 | $smcFunc['db_free_result']($request); |
| 808 | 831 | |
@@ -853,21 +876,25 @@ discard block |
||
| 853 | 876 | if (isset($_GET['confirm']) && isset($_POST['sub_id']) && is_array($_POST['sub_id'])) |
| 854 | 877 | { |
| 855 | 878 | // Hopefully just one. |
| 856 | - foreach ($_POST['sub_id'] as $k => $v) |
|
| 857 | - $ID_SUB = (int) $k; |
|
| 879 | + foreach ($_POST['sub_id'] as $k => $v) { |
|
| 880 | + $ID_SUB = (int) $k; |
|
| 881 | + } |
|
| 858 | 882 | |
| 859 | - if (!isset($context['subscriptions'][$ID_SUB]) || $context['subscriptions'][$ID_SUB]['active'] == 0) |
|
| 860 | - fatal_lang_error('paid_sub_not_active'); |
|
| 883 | + if (!isset($context['subscriptions'][$ID_SUB]) || $context['subscriptions'][$ID_SUB]['active'] == 0) { |
|
| 884 | + fatal_lang_error('paid_sub_not_active'); |
|
| 885 | + } |
|
| 861 | 886 | |
| 862 | 887 | // Simplify... |
| 863 | 888 | $context['sub'] = $context['subscriptions'][$ID_SUB]; |
| 864 | 889 | $period = 'xx'; |
| 865 | - if ($context['sub']['flexible']) |
|
| 866 | - $period = isset($_POST['cur'][$ID_SUB]) && isset($context['sub']['costs'][$_POST['cur'][$ID_SUB]]) ? $_POST['cur'][$ID_SUB] : 'xx'; |
|
| 890 | + if ($context['sub']['flexible']) { |
|
| 891 | + $period = isset($_POST['cur'][$ID_SUB]) && isset($context['sub']['costs'][$_POST['cur'][$ID_SUB]]) ? $_POST['cur'][$ID_SUB] : 'xx'; |
|
| 892 | + } |
|
| 867 | 893 | |
| 868 | 894 | // Check we have a valid cost. |
| 869 | - if ($context['sub']['flexible'] && $period == 'xx') |
|
| 870 | - fatal_lang_error('paid_sub_not_active'); |
|
| 895 | + if ($context['sub']['flexible'] && $period == 'xx') { |
|
| 896 | + fatal_lang_error('paid_sub_not_active'); |
|
| 897 | + } |
|
| 871 | 898 | |
| 872 | 899 | // Sort out the cost/currency. |
| 873 | 900 | $context['currency'] = $modSettings['paid_currency_code']; |
@@ -880,8 +907,7 @@ discard block |
||
| 880 | 907 | $context['cost'] = sprintf($modSettings['paid_currency_symbol'], $context['value']) . '/' . $txt[$_POST['cur'][$ID_SUB]]; |
| 881 | 908 | // The period value for paypal. |
| 882 | 909 | $context['paypal_period'] = strtoupper(substr($_POST['cur'][$ID_SUB], 0, 1)); |
| 883 | - } |
|
| 884 | - else |
|
| 910 | + } else |
|
| 885 | 911 | { |
| 886 | 912 | // Real cost... |
| 887 | 913 | $context['value'] = $context['sub']['costs']['fixed']; |
@@ -898,13 +924,15 @@ discard block |
||
| 898 | 924 | foreach ($gateways as $id => $gateway) |
| 899 | 925 | { |
| 900 | 926 | $fields = $gateways[$id]->fetchGatewayFields($context['sub']['id'] . '+' . $memID, $context['sub'], $context['value'], $period, $scripturl . '?action=profile;u=' . $memID . ';area=subscriptions;sub_id=' . $context['sub']['id'] . ';done'); |
| 901 | - if (!empty($fields['form'])) |
|
| 902 | - $context['gateways'][] = $fields; |
|
| 927 | + if (!empty($fields['form'])) { |
|
| 928 | + $context['gateways'][] = $fields; |
|
| 929 | + } |
|
| 903 | 930 | } |
| 904 | 931 | |
| 905 | 932 | // Bugger?! |
| 906 | - if (empty($context['gateways'])) |
|
| 907 | - fatal_error($txt['paid_admin_not_setup_gateway']); |
|
| 933 | + if (empty($context['gateways'])) { |
|
| 934 | + fatal_error($txt['paid_admin_not_setup_gateway']); |
|
| 935 | + } |
|
| 908 | 936 | |
| 909 | 937 | // Now we are going to assume they want to take this out ;) |
| 910 | 938 | $new_data = array($context['sub']['id'], $context['value'], $period, 'prepay'); |
@@ -912,16 +940,19 @@ discard block |
||
| 912 | 940 | { |
| 913 | 941 | // What are the details like? |
| 914 | 942 | $current_pending = array(); |
| 915 | - if ($context['current'][$context['sub']['id']]['pending_details'] != '') |
|
| 916 | - $current_pending = $smcFunc['json_decode']($context['current'][$context['sub']['id']]['pending_details'], true); |
|
| 943 | + if ($context['current'][$context['sub']['id']]['pending_details'] != '') { |
|
| 944 | + $current_pending = $smcFunc['json_decode']($context['current'][$context['sub']['id']]['pending_details'], true); |
|
| 945 | + } |
|
| 917 | 946 | // Don't get silly. |
| 918 | - if (count($current_pending) > 9) |
|
| 919 | - $current_pending = array(); |
|
| 947 | + if (count($current_pending) > 9) { |
|
| 948 | + $current_pending = array(); |
|
| 949 | + } |
|
| 920 | 950 | $pending_count = 0; |
| 921 | 951 | // Only record real pending payments as will otherwise confuse the admin! |
| 922 | - foreach ($current_pending as $pending) |
|
| 923 | - if ($pending[3] == 'payback') |
|
| 952 | + foreach ($current_pending as $pending) { |
|
| 953 | + if ($pending[3] == 'payback') |
|
| 924 | 954 | $pending_count++; |
| 955 | + } |
|
| 925 | 956 | |
| 926 | 957 | if (!in_array($new_data, $current_pending)) |
| 927 | 958 | { |
@@ -966,9 +997,9 @@ discard block |
||
| 966 | 997 | |
| 967 | 998 | // Quit. |
| 968 | 999 | return; |
| 1000 | + } else { |
|
| 1001 | + $context['sub_template'] = 'user_subscription'; |
|
| 1002 | + } |
|
| 969 | 1003 | } |
| 970 | - else |
|
| 971 | - $context['sub_template'] = 'user_subscription'; |
|
| 972 | -} |
|
| 973 | 1004 | |
| 974 | 1005 | ?> |
| 975 | 1006 | \ No newline at end of file |
@@ -55,18 +55,20 @@ discard block |
||
| 55 | 55 | <div class="modbox"> |
| 56 | 56 | <ul>'; |
| 57 | 57 | |
| 58 | - foreach ($context['group_requests'] as $request) |
|
| 59 | - echo ' |
|
| 58 | + foreach ($context['group_requests'] as $request) { |
|
| 59 | + echo ' |
|
| 60 | 60 | <li class="smalltext"> |
| 61 | 61 | <a href="', $request['request_href'], '">', $request['group']['name'], '</a> ', $txt['mc_groupr_by'], ' ', $request['member']['link'], ' |
| 62 | 62 | </li>'; |
| 63 | + } |
|
| 63 | 64 | |
| 64 | 65 | // Don't have any watched users right now? |
| 65 | - if (empty($context['group_requests'])) |
|
| 66 | - echo ' |
|
| 66 | + if (empty($context['group_requests'])) { |
|
| 67 | + echo ' |
|
| 67 | 68 | <li> |
| 68 | 69 | <strong class="smalltext">', $txt['mc_group_requests_none'], '</strong> |
| 69 | 70 | </li>'; |
| 71 | + } |
|
| 70 | 72 | |
| 71 | 73 | echo ' |
| 72 | 74 | </ul> |
@@ -124,18 +126,20 @@ discard block |
||
| 124 | 126 | <div class="modbox"> |
| 125 | 127 | <ul>'; |
| 126 | 128 | |
| 127 | - foreach ($context['watched_users'] as $user) |
|
| 128 | - echo ' |
|
| 129 | + foreach ($context['watched_users'] as $user) { |
|
| 130 | + echo ' |
|
| 129 | 131 | <li> |
| 130 | 132 | <span class="smalltext">', sprintf(!empty($user['last_login']) ? $txt['mc_seen'] : $txt['mc_seen_never'], $user['link'], $user['last_login']), '</span> |
| 131 | 133 | </li>'; |
| 134 | + } |
|
| 132 | 135 | |
| 133 | 136 | // Don't have any watched users right now? |
| 134 | - if (empty($context['watched_users'])) |
|
| 135 | - echo ' |
|
| 137 | + if (empty($context['watched_users'])) { |
|
| 138 | + echo ' |
|
| 136 | 139 | <li> |
| 137 | 140 | <strong class="smalltext">', $txt['mc_watched_users_none'], '</strong> |
| 138 | 141 | </li>'; |
| 142 | + } |
|
| 139 | 143 | |
| 140 | 144 | echo ' |
| 141 | 145 | </ul> |
@@ -193,18 +197,20 @@ discard block |
||
| 193 | 197 | <div class="modbox"> |
| 194 | 198 | <ul>'; |
| 195 | 199 | |
| 196 | - foreach ($context['reported_posts'] as $post) |
|
| 197 | - echo ' |
|
| 200 | + foreach ($context['reported_posts'] as $post) { |
|
| 201 | + echo ' |
|
| 198 | 202 | <li> |
| 199 | 203 | <span class="smalltext">', sprintf($txt['mc_post_report'], $post['report_link'], $post['author']['link']), '</span> |
| 200 | 204 | </li>'; |
| 205 | + } |
|
| 201 | 206 | |
| 202 | 207 | // Don't have any watched users right now? |
| 203 | - if (empty($context['reported_posts'])) |
|
| 204 | - echo ' |
|
| 208 | + if (empty($context['reported_posts'])) { |
|
| 209 | + echo ' |
|
| 205 | 210 | <li> |
| 206 | 211 | <strong class="smalltext">', $txt['mc_recent_reports_none'], '</strong> |
| 207 | 212 | </li>'; |
| 213 | + } |
|
| 208 | 214 | |
| 209 | 215 | echo ' |
| 210 | 216 | </ul> |
@@ -262,18 +268,20 @@ discard block |
||
| 262 | 268 | <div class="modbox"> |
| 263 | 269 | <ul>'; |
| 264 | 270 | |
| 265 | - foreach ($context['reported_users'] as $user) |
|
| 266 | - echo ' |
|
| 271 | + foreach ($context['reported_users'] as $user) { |
|
| 272 | + echo ' |
|
| 267 | 273 | <li> |
| 268 | 274 | <span class="smalltext">', $user['user']['link'], '</span> |
| 269 | 275 | </li>'; |
| 276 | + } |
|
| 270 | 277 | |
| 271 | 278 | // Don't have any watched users right now? |
| 272 | - if (empty($context['reported_users'])) |
|
| 273 | - echo ' |
|
| 279 | + if (empty($context['reported_users'])) { |
|
| 280 | + echo ' |
|
| 274 | 281 | <li> |
| 275 | 282 | <strong class="smalltext">', $txt['mc_reported_users_none'], '</strong> |
| 276 | 283 | </li>'; |
| 284 | + } |
|
| 277 | 285 | |
| 278 | 286 | echo ' |
| 279 | 287 | </ul> |
@@ -344,9 +352,10 @@ discard block |
||
| 344 | 352 | <ul class="moderation_notes">'; |
| 345 | 353 | |
| 346 | 354 | // Cycle through the notes. |
| 347 | - foreach ($context['notes'] as $note) |
|
| 348 | - echo ' |
|
| 355 | + foreach ($context['notes'] as $note) { |
|
| 356 | + echo ' |
|
| 349 | 357 | <li class="smalltext">', ($note['can_delete'] ? '<a href="' . $note['delete_href'] . ';' . $context['mod-modnote-del_token_var'] . '=' . $context['mod-modnote-del_token'] . '" data-confirm="' . $txt['mc_reportedp_delete_confirm'] . '" class="you_sure"><span class="generic_icons delete"></span></a>' : ''), $note['time'], ' <strong>', $note['author']['link'], ':</strong> ', $note['text'], '</li>'; |
| 358 | + } |
|
| 350 | 359 | |
| 351 | 360 | echo ' |
| 352 | 361 | </ul> |
@@ -388,16 +397,17 @@ discard block |
||
| 388 | 397 | $remove_button = create_button('delete', 'remove_message', 'remove'); |
| 389 | 398 | |
| 390 | 399 | // No posts? |
| 391 | - if (empty($context['unapproved_items'])) |
|
| 392 | - echo ' |
|
| 400 | + if (empty($context['unapproved_items'])) { |
|
| 401 | + echo ' |
|
| 393 | 402 | <div class="windowbg2"> |
| 394 | 403 | <p class="centertext">', $txt['mc_unapproved_' . $context['current_view'] . '_none_found'], '</p> |
| 395 | 404 | </div>'; |
| 396 | - else |
|
| 397 | - echo ' |
|
| 405 | + } else { |
|
| 406 | + echo ' |
|
| 398 | 407 | <div class="pagesection floatleft"> |
| 399 | 408 | ', $context['page_index'], ' |
| 400 | 409 | </div>'; |
| 410 | + } |
|
| 401 | 411 | |
| 402 | 412 | foreach ($context['unapproved_items'] as $item) |
| 403 | 413 | { |
@@ -414,14 +424,16 @@ discard block |
||
| 414 | 424 | <span class="floatright"> |
| 415 | 425 | <a href="', $scripturl, '?action=moderate;area=postmod;sa=', $context['current_view'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';approve=', $item['id'], '">', $approve_button, '</a>'; |
| 416 | 426 | |
| 417 | - if ($item['can_delete']) |
|
| 418 | - echo ' |
|
| 427 | + if ($item['can_delete']) { |
|
| 428 | + echo ' |
|
| 419 | 429 | ', $context['menu_separator'], ' |
| 420 | 430 | <a href="', $scripturl, '?action=moderate;area=postmod;sa=', $context['current_view'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';delete=', $item['id'], '">', $remove_button, '</a>'; |
| 431 | + } |
|
| 421 | 432 | |
| 422 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) |
|
| 423 | - echo ' |
|
| 433 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) { |
|
| 434 | + echo ' |
|
| 424 | 435 | <input type="checkbox" name="item[]" value="', $item['id'], '" checked> '; |
| 436 | + } |
|
| 425 | 437 | |
| 426 | 438 | echo ' |
| 427 | 439 | </span> |
@@ -431,8 +443,8 @@ discard block |
||
| 431 | 443 | echo ' |
| 432 | 444 | <div class="pagesection">'; |
| 433 | 445 | |
| 434 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) |
|
| 435 | - echo ' |
|
| 446 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) { |
|
| 447 | + echo ' |
|
| 436 | 448 | <div class="floatright"> |
| 437 | 449 | <select name="do" onchange="if (this.value != 0 && confirm(\'', $txt['mc_unapproved_sure'], '\')) submit();"> |
| 438 | 450 | <option value="0">', $txt['with_selected'], ':</option> |
@@ -442,12 +454,14 @@ discard block |
||
| 442 | 454 | </select> |
| 443 | 455 | <noscript><input type="submit" name="mc_go" value="', $txt['go'], '" class="button"></noscript> |
| 444 | 456 | </div>'; |
| 457 | + } |
|
| 445 | 458 | |
| 446 | - if (!empty($context['unapproved_items'])) |
|
| 447 | - echo ' |
|
| 459 | + if (!empty($context['unapproved_items'])) { |
|
| 460 | + echo ' |
|
| 448 | 461 | <div class="floatleft"> |
| 449 | 462 | <div class="pagelinks">', $context['page_index'], '</div> |
| 450 | 463 | </div>'; |
| 464 | + } |
|
| 451 | 465 | |
| 452 | 466 | echo ' |
| 453 | 467 | </div> |
@@ -467,8 +481,9 @@ discard block |
||
| 467 | 481 | global $scripturl, $context, $txt, $delete_button; |
| 468 | 482 | |
| 469 | 483 | // We'll have a delete please bob. |
| 470 | - if (empty($delete_button)) |
|
| 471 | - $delete_button = create_button('delete', 'remove_message', 'remove', 'class="centericon"'); |
|
| 484 | + if (empty($delete_button)) { |
|
| 485 | + $delete_button = create_button('delete', 'remove_message', 'remove', 'class="centericon"'); |
|
| 486 | + } |
|
| 472 | 487 | |
| 473 | 488 | $output_html = ' |
| 474 | 489 | <div> |
@@ -477,10 +492,11 @@ discard block |
||
| 477 | 492 | </div> |
| 478 | 493 | <div class="floatright">'; |
| 479 | 494 | |
| 480 | - if ($post['can_delete']) |
|
| 481 | - $output_html .= ' |
|
| 495 | + if ($post['can_delete']) { |
|
| 496 | + $output_html .= ' |
|
| 482 | 497 | <a href="' . $scripturl . '?action=moderate;area=userwatch;sa=post;delete=' . $post['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" data-confirm="' . $txt['mc_watched_users_delete_post'] . '" class="you_sure">' . $delete_button . '</a> |
| 483 | 498 | <input type="checkbox" name="delete[]" value="' . $post['id'] . '">'; |
| 499 | + } |
|
| 484 | 500 | |
| 485 | 501 | $output_html .= ' |
| 486 | 502 | </div> |
@@ -522,12 +538,12 @@ discard block |
||
| 522 | 538 | <input type="submit" name="save" value="', $txt['save'], '" class="button"> |
| 523 | 539 | </div> |
| 524 | 540 | </form>'; |
| 525 | - } |
|
| 526 | - else |
|
| 527 | - echo ' |
|
| 541 | + } else { |
|
| 542 | + echo ' |
|
| 528 | 543 | <div class="windowbg"> |
| 529 | 544 | <div class="centertext">', $txt['mc_no_settings'], '</div> |
| 530 | 545 | </div>'; |
| 546 | + } |
|
| 531 | 547 | |
| 532 | 548 | echo ' |
| 533 | 549 | </div>'; |
@@ -623,8 +639,8 @@ discard block |
||
| 623 | 639 | </dd> |
| 624 | 640 | </dl>'; |
| 625 | 641 | |
| 626 | - if ($context['template_data']['can_edit_personal']) |
|
| 627 | - echo ' |
|
| 642 | + if ($context['template_data']['can_edit_personal']) { |
|
| 643 | + echo ' |
|
| 628 | 644 | <input type="checkbox" name="make_personal" id="make_personal"', $context['template_data']['personal'] ? ' checked' : '', '> |
| 629 | 645 | <label for="make_personal"> |
| 630 | 646 | <strong>', $txt['mc_warning_template_personal'], '</strong> |
@@ -632,6 +648,7 @@ discard block |
||
| 632 | 648 | <br> |
| 633 | 649 | <span class="smalltext">', $txt['mc_warning_template_personal_desc'], '</span> |
| 634 | 650 | <br>'; |
| 651 | + } |
|
| 635 | 652 | |
| 636 | 653 | echo ' |
| 637 | 654 | <hr> |
@@ -25,18 +25,20 @@ discard block |
||
| 25 | 25 | </div> |
| 26 | 26 | <div class="windowbg2 noup">'; |
| 27 | 27 | |
| 28 | - if (!empty($context['move_board'])) |
|
| 29 | - echo ' |
|
| 28 | + if (!empty($context['move_board'])) { |
|
| 29 | + echo ' |
|
| 30 | 30 | <div class="noticebox"> |
| 31 | 31 | ', $context['move_title'], ' [<a href="', $scripturl, '?action=admin;area=manageboards">', $txt['mboards_cancel_moving'], '</a>]', ' |
| 32 | 32 | </div>'; |
| 33 | + } |
|
| 33 | 34 | |
| 34 | 35 | // No categories so show a label. |
| 35 | - if (empty($context['categories'])) |
|
| 36 | - echo ' |
|
| 36 | + if (empty($context['categories'])) { |
|
| 37 | + echo ' |
|
| 37 | 38 | <div class="windowbg centertext"> |
| 38 | 39 | ', $txt['mboards_no_cats'], ' |
| 39 | 40 | </div>'; |
| 41 | + } |
|
| 40 | 42 | |
| 41 | 43 | // Loop through every category, listing the boards in each as we go. |
| 42 | 44 | foreach ($context['categories'] as $category) |
@@ -54,9 +56,10 @@ discard block |
||
| 54 | 56 | <form action="', $scripturl, '?action=admin;area=manageboards;sa=newboard;cat=', $category['id'], '" method="post" accept-charset="', $context['character_set'], '"> |
| 55 | 57 | <ul id="category_', $category['id'], '" class="nolist">'; |
| 56 | 58 | |
| 57 | - if (!empty($category['move_link'])) |
|
| 58 | - echo ' |
|
| 59 | + if (!empty($category['move_link'])) { |
|
| 60 | + echo ' |
|
| 59 | 61 | <li><a href="', $category['move_link']['href'], '" title="', $category['move_link']['label'], '"><span class="generic_icons select_above"></span></a></li>'; |
| 62 | + } |
|
| 60 | 63 | |
| 61 | 64 | $recycle_board = '<a href="' . $scripturl . '?action=admin;area=manageboards;sa=settings"> <img src="' . $settings['images_url'] . '/post/recycled.png" alt="' . $txt['recycle_board'] . '" title="' . $txt['recycle_board'] . '"></a>'; |
| 62 | 65 | $redirect_board = '<img src="' . $settings['images_url'] . '/new_redirect.png" alt="' . $txt['redirect_board_desc'] . '" title="' . $txt['redirect_board_desc'] . '">'; |
@@ -81,9 +84,10 @@ discard block |
||
| 81 | 84 | echo ' |
| 82 | 85 | <li class="windowbg" style="padding-', $context['right_to_left'] ? 'right' : 'left', ': ', 5 + 30 * $board['move_links'][0]['child_level'], 'px;">'; |
| 83 | 86 | |
| 84 | - foreach ($board['move_links'] as $link) |
|
| 85 | - echo ' |
|
| 87 | + foreach ($board['move_links'] as $link) { |
|
| 88 | + echo ' |
|
| 86 | 89 | <a href="', $link['href'], '" class="move_links" title="', $link['label'], '"><span class="generic_icons select_', $link['class'], '" title="', $link['label'], '"></span></a>'; |
| 90 | + } |
|
| 87 | 91 | |
| 88 | 92 | echo ' |
| 89 | 93 | </li>'; |
@@ -132,9 +136,10 @@ discard block |
||
| 132 | 136 | <select name="cat_order">'; |
| 133 | 137 | |
| 134 | 138 | // Print every existing category into a select box. |
| 135 | - foreach ($context['category_order'] as $order) |
|
| 136 | - echo ' |
|
| 139 | + foreach ($context['category_order'] as $order) { |
|
| 140 | + echo ' |
|
| 137 | 141 | <option', $order['selected'] ? ' selected' : '', ' value="', $order['id'], '">', $order['name'], '</option>'; |
| 142 | + } |
|
| 138 | 143 | echo ' |
| 139 | 144 | </select> |
| 140 | 145 | </dd>'; |
@@ -169,14 +174,15 @@ discard block |
||
| 169 | 174 | { |
| 170 | 175 | foreach ($context['custom_category_settings'] as $catset_id => $catset) |
| 171 | 176 | { |
| 172 | - if (!empty($catset['dt']) && !empty($catset['dd'])) |
|
| 173 | - echo ' |
|
| 177 | + if (!empty($catset['dt']) && !empty($catset['dd'])) { |
|
| 178 | + echo ' |
|
| 174 | 179 | <dt class="clear', !is_numeric($catset_id) ? ' catset_' . $catset_id : '', '"> |
| 175 | 180 | ', $catset['dt'], ' |
| 176 | 181 | </dt> |
| 177 | 182 | <dd', !is_numeric($catset_id) ? ' class="catset_' . $catset_id . '"' : '', '> |
| 178 | 183 | ', $catset['dd'], ' |
| 179 | 184 | </dd>'; |
| 185 | + } |
|
| 180 | 186 | } |
| 181 | 187 | } |
| 182 | 188 | |
@@ -184,21 +190,23 @@ discard block |
||
| 184 | 190 | echo ' |
| 185 | 191 | </dl>'; |
| 186 | 192 | |
| 187 | - if (isset($context['category']['is_new'])) |
|
| 188 | - echo ' |
|
| 193 | + if (isset($context['category']['is_new'])) { |
|
| 194 | + echo ' |
|
| 189 | 195 | <input type="submit" name="add" value="', $txt['mboards_add_cat_button'], '" onclick="return !isEmptyText(this.form.cat_name);" tabindex="', $context['tabindex']++, '" class="button">'; |
| 190 | - else |
|
| 191 | - echo ' |
|
| 196 | + } else { |
|
| 197 | + echo ' |
|
| 192 | 198 | <input type="submit" name="edit" value="', $txt['modify'], '" onclick="return !isEmptyText(this.form.cat_name);" tabindex="', $context['tabindex']++, '" class="button"> |
| 193 | 199 | <input type="submit" name="delete" value="', $txt['mboards_delete_cat'], '" data-confirm="', $txt['catConfirm'], '" class="button you_sure">'; |
| 200 | + } |
|
| 194 | 201 | echo ' |
| 195 | 202 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 196 | 203 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
| 197 | 204 | |
| 198 | 205 | // If this category is empty we don't bother with the next confirmation screen. |
| 199 | - if ($context['category']['is_empty']) |
|
| 200 | - echo ' |
|
| 206 | + if ($context['category']['is_empty']) { |
|
| 207 | + echo ' |
|
| 201 | 208 | <input type="hidden" name="empty" value="1">'; |
| 209 | + } |
|
| 202 | 210 | |
| 203 | 211 | echo ' |
| 204 | 212 | </div> |
@@ -225,9 +233,10 @@ discard block |
||
| 225 | 233 | <p>', $txt['mboards_delete_cat_contains'], ':</p> |
| 226 | 234 | <ul>'; |
| 227 | 235 | |
| 228 | - foreach ($context['category']['children'] as $child) |
|
| 229 | - echo ' |
|
| 236 | + foreach ($context['category']['children'] as $child) { |
|
| 237 | + echo ' |
|
| 230 | 238 | <li>', $child, '</li>'; |
| 239 | + } |
|
| 231 | 240 | |
| 232 | 241 | echo ' |
| 233 | 242 | </ul> |
@@ -241,10 +250,11 @@ discard block |
||
| 241 | 250 | <label for="delete_action1"><input type="radio" id="delete_action1" name="delete_action" value="1"', count($context['category_order']) == 1 ? ' disabled' : '', '>', $txt['mboards_delete_option2'], '</label>: |
| 242 | 251 | <select name="cat_to"', count($context['category_order']) == 1 ? ' disabled' : '', '>'; |
| 243 | 252 | |
| 244 | - foreach ($context['category_order'] as $cat) |
|
| 245 | - if ($cat['id'] != 0) |
|
| 253 | + foreach ($context['category_order'] as $cat) { |
|
| 254 | + if ($cat['id'] != 0) |
|
| 246 | 255 | echo ' |
| 247 | 256 | <option value="', $cat['id'], '">', $cat['true_name'], '</option>'; |
| 257 | + } |
|
| 248 | 258 | |
| 249 | 259 | echo ' |
| 250 | 260 | </select> |
@@ -288,9 +298,10 @@ discard block |
||
| 288 | 298 | </dt> |
| 289 | 299 | <dd> |
| 290 | 300 | <select name="new_cat" onchange="if (this.form.order) {this.form.order.disabled = this.options[this.selectedIndex].value != 0; this.form.board_order.disabled = this.options[this.selectedIndex].value != 0 || this.form.order.options[this.form.order.selectedIndex].value == \'\';}">'; |
| 291 | - foreach ($context['categories'] as $category) |
|
| 292 | - echo ' |
|
| 301 | + foreach ($context['categories'] as $category) { |
|
| 302 | + echo ' |
|
| 293 | 303 | <option', $category['selected'] ? ' selected' : '', ' value="', $category['id'], '">', $category['name'], '</option>'; |
| 304 | + } |
|
| 294 | 305 | echo ' |
| 295 | 306 | </select> |
| 296 | 307 | </dd>'; |
@@ -317,9 +328,10 @@ discard block |
||
| 317 | 328 | echo ' |
| 318 | 329 | <select id="board_order" name="board_order"', !isset($context['board']['is_new']) ? ' disabled' : '', '> |
| 319 | 330 | ', !isset($context['board']['is_new']) ? '<option value="">(' . $txt['mboards_unchanged'] . ')</option>' : ''; |
| 320 | - foreach ($context['board_order'] as $order) |
|
| 321 | - echo ' |
|
| 331 | + foreach ($context['board_order'] as $order) { |
|
| 332 | + echo ' |
|
| 322 | 333 | <option', $order['selected'] ? ' selected' : '', ' value="', $order['id'], '">', $order['name'], '</option>'; |
| 334 | + } |
|
| 323 | 335 | echo ' |
| 324 | 336 | </select> |
| 325 | 337 | </dd>'; |
@@ -348,13 +360,15 @@ discard block |
||
| 348 | 360 | <dd> |
| 349 | 361 | <select name="profile">'; |
| 350 | 362 | |
| 351 | - if (isset($context['board']['is_new'])) |
|
| 352 | - echo ' |
|
| 363 | + if (isset($context['board']['is_new'])) { |
|
| 364 | + echo ' |
|
| 353 | 365 | <option value="-1">[', $txt['permission_profile_inherit'], ']</option>'; |
| 366 | + } |
|
| 354 | 367 | |
| 355 | - foreach ($context['profiles'] as $id => $profile) |
|
| 356 | - echo ' |
|
| 368 | + foreach ($context['profiles'] as $id => $profile) { |
|
| 369 | + echo ' |
|
| 357 | 370 | <option value="', $id, '"', $id == $context['board']['profile'] ? ' selected' : '', '>', $profile['name'], '</option>'; |
| 371 | + } |
|
| 358 | 372 | |
| 359 | 373 | echo ' |
| 360 | 374 | </select> |
@@ -367,8 +381,8 @@ discard block |
||
| 367 | 381 | </dt> |
| 368 | 382 | <dd>'; |
| 369 | 383 | |
| 370 | - if (!empty($modSettings['deny_boards_access'])) |
|
| 371 | - echo ' |
|
| 384 | + if (!empty($modSettings['deny_boards_access'])) { |
|
| 385 | + echo ' |
|
| 372 | 386 | <table> |
| 373 | 387 | <tr> |
| 374 | 388 | <td></td> |
@@ -376,10 +390,11 @@ discard block |
||
| 376 | 390 | <th>', $txt['permissions_option_off'], '</th> |
| 377 | 391 | <th>', $txt['permissions_option_deny'], '</th> |
| 378 | 392 | </tr>'; |
| 393 | + } |
|
| 379 | 394 | |
| 380 | 395 | // List all the membergroups so the user can choose who may access this board. |
| 381 | - foreach ($context['groups'] as $group) |
|
| 382 | - if (empty($modSettings['deny_boards_access'])) |
|
| 396 | + foreach ($context['groups'] as $group) { |
|
| 397 | + if (empty($modSettings['deny_boards_access'])) |
|
| 383 | 398 | echo ' |
| 384 | 399 | <label for="groups_', $group['id'], '"> |
| 385 | 400 | <input type="checkbox" name="groups[', $group['id'], ']" value="allow" id="groups_', $group['id'], '"', in_array($group['id'], $context['board_managers']) ? ' checked disabled' : ($group['allow'] ? ' checked' : ''), '> |
@@ -387,8 +402,9 @@ discard block |
||
| 387 | 402 | ', $group['name'], ' |
| 388 | 403 | </span> |
| 389 | 404 | </label><br>'; |
| 390 | - else |
|
| 391 | - echo ' |
|
| 405 | + } |
|
| 406 | + else { |
|
| 407 | + echo ' |
|
| 392 | 408 | <tr> |
| 393 | 409 | <td> |
| 394 | 410 | <label for="groups_', $group['id'], '_a"> |
@@ -408,16 +424,17 @@ discard block |
||
| 408 | 424 | </td> |
| 409 | 425 | <td></td> |
| 410 | 426 | </tr>'; |
| 427 | + } |
|
| 411 | 428 | |
| 412 | - if (empty($modSettings['deny_boards_access'])) |
|
| 413 | - echo ' |
|
| 429 | + if (empty($modSettings['deny_boards_access'])) { |
|
| 430 | + echo ' |
|
| 414 | 431 | <span class="select_all_box"> |
| 415 | 432 | <em>', $txt['check_all'], '</em> <input type="checkbox" onclick="invertAll(this, this.form, \'groups[\');"> |
| 416 | 433 | </span> |
| 417 | 434 | <br><br> |
| 418 | 435 | </dd>'; |
| 419 | - else |
|
| 420 | - echo ' |
|
| 436 | + } else { |
|
| 437 | + echo ' |
|
| 421 | 438 | <tr class="select_all_box"> |
| 422 | 439 | <td> |
| 423 | 440 | </td> |
@@ -436,6 +453,7 @@ discard block |
||
| 436 | 453 | </tr> |
| 437 | 454 | </table> |
| 438 | 455 | </dd>'; |
| 456 | + } |
|
| 439 | 457 | |
| 440 | 458 | // Options to choose moderators, specify as announcement board and choose whether to count posts here. |
| 441 | 459 | echo ' |
@@ -490,8 +508,8 @@ discard block |
||
| 490 | 508 | </dl> |
| 491 | 509 | </div>'; |
| 492 | 510 | |
| 493 | - if ($context['board']['redirect']) |
|
| 494 | - echo ' |
|
| 511 | + if ($context['board']['redirect']) { |
|
| 512 | + echo ' |
|
| 495 | 513 | <div id="reset_redirect_div"> |
| 496 | 514 | <dl class="settings"> |
| 497 | 515 | <dt> |
@@ -504,6 +522,7 @@ discard block |
||
| 504 | 522 | </dd> |
| 505 | 523 | </dl> |
| 506 | 524 | </div>'; |
| 525 | + } |
|
| 507 | 526 | } |
| 508 | 527 | |
| 509 | 528 | echo ' |
@@ -531,9 +550,10 @@ discard block |
||
| 531 | 550 | <select name="boardtheme" id="boardtheme" onchange="refreshOptions();"> |
| 532 | 551 | <option value="0"', $context['board']['theme'] == 0 ? ' selected' : '', '>', $txt['mboards_theme_default'], '</option>'; |
| 533 | 552 | |
| 534 | - foreach ($context['themes'] as $theme) |
|
| 535 | - echo ' |
|
| 553 | + foreach ($context['themes'] as $theme) { |
|
| 554 | + echo ' |
|
| 536 | 555 | <option value="', $theme['id'], '"', $context['board']['theme'] == $theme['id'] ? ' selected' : '', '>', $theme['name'], '</option>'; |
| 556 | + } |
|
| 537 | 557 | |
| 538 | 558 | echo ' |
| 539 | 559 | </select> |
@@ -562,14 +582,15 @@ discard block |
||
| 562 | 582 | |
| 563 | 583 | foreach ($context['custom_board_settings'] as $cbs_id => $cbs) |
| 564 | 584 | { |
| 565 | - if (!empty($cbs['dt']) && !empty($cbs['dd'])) |
|
| 566 | - echo ' |
|
| 585 | + if (!empty($cbs['dt']) && !empty($cbs['dd'])) { |
|
| 586 | + echo ' |
|
| 567 | 587 | <dt class="clear', !is_numeric($cbs_id) ? ' cbs_' . $cbs_id : '', '"> |
| 568 | 588 | ', $cbs['dt'], ' |
| 569 | 589 | </dt> |
| 570 | 590 | <dd', !is_numeric($cbs_id) ? ' class="cbs_' . $cbs_id . '"' : '', '> |
| 571 | 591 | ', $cbs['dd'], ' |
| 572 | 592 | </dd>'; |
| 593 | + } |
|
| 573 | 594 | } |
| 574 | 595 | |
| 575 | 596 | echo ' |
@@ -577,9 +598,10 @@ discard block |
||
| 577 | 598 | </div>'; |
| 578 | 599 | } |
| 579 | 600 | |
| 580 | - if (!empty($context['board']['is_recycle'])) |
|
| 581 | - echo ' |
|
| 601 | + if (!empty($context['board']['is_recycle'])) { |
|
| 602 | + echo ' |
|
| 582 | 603 | <div class="noticebox">', $txt['mboards_recycle_disabled_delete'], '</div>'; |
| 604 | + } |
|
| 583 | 605 | |
| 584 | 606 | echo ' |
| 585 | 607 | <input type="hidden" name="rid" value="', $context['redirect_location'], '"> |
@@ -587,21 +609,24 @@ discard block |
||
| 587 | 609 | <input type="hidden" name="', $context['admin-be-' . $context['board']['id'] . '_token_var'], '" value="', $context['admin-be-' . $context['board']['id'] . '_token'], '">'; |
| 588 | 610 | |
| 589 | 611 | // If this board has no children don't bother with the next confirmation screen. |
| 590 | - if ($context['board']['no_children']) |
|
| 591 | - echo ' |
|
| 612 | + if ($context['board']['no_children']) { |
|
| 613 | + echo ' |
|
| 592 | 614 | <input type="hidden" name="no_children" value="1">'; |
| 615 | + } |
|
| 593 | 616 | |
| 594 | - if (isset($context['board']['is_new'])) |
|
| 595 | - echo ' |
|
| 617 | + if (isset($context['board']['is_new'])) { |
|
| 618 | + echo ' |
|
| 596 | 619 | <input type="hidden" name="cur_cat" value="', $context['board']['category'], '"> |
| 597 | 620 | <input type="submit" name="add" value="', $txt['mboards_new_board'], '" onclick="return !isEmptyText(this.form.board_name);" class="button">'; |
| 598 | - else |
|
| 599 | - echo ' |
|
| 621 | + } else { |
|
| 622 | + echo ' |
|
| 600 | 623 | <input type="submit" name="edit" value="', $txt['modify'], '" onclick="return !isEmptyText(this.form.board_name);" class="button">'; |
| 624 | + } |
|
| 601 | 625 | |
| 602 | - if (!isset($context['board']['is_new']) && empty($context['board']['is_recycle'])) |
|
| 603 | - echo ' |
|
| 626 | + if (!isset($context['board']['is_new']) && empty($context['board']['is_recycle'])) { |
|
| 627 | + echo ' |
|
| 604 | 628 | <input type="submit" name="delete" value="', $txt['mboards_delete_board'], '" data-confirm="', $txt['boardConfirm'], '" class="button you_sure">'; |
| 629 | + } |
|
| 605 | 630 | echo ' |
| 606 | 631 | </div> |
| 607 | 632 | </form> |
@@ -622,12 +647,13 @@ discard block |
||
| 622 | 647 | sItemListContainerId: \'moderator_container\', |
| 623 | 648 | aListItems: ['; |
| 624 | 649 | |
| 625 | - foreach ($context['board']['moderators'] as $id_member => $member_name) |
|
| 626 | - echo ' |
|
| 650 | + foreach ($context['board']['moderators'] as $id_member => $member_name) { |
|
| 651 | + echo ' |
|
| 627 | 652 | { |
| 628 | 653 | sItemId: ', JavaScriptEscape($id_member), ', |
| 629 | 654 | sItemName: ', JavaScriptEscape($member_name), ' |
| 630 | 655 | }', $id_member == $context['board']['last_moderator_id'] ? '' : ','; |
| 656 | + } |
|
| 631 | 657 | |
| 632 | 658 | echo ' |
| 633 | 659 | ] |
@@ -647,12 +673,13 @@ discard block |
||
| 647 | 673 | sItemListContainerId: \'moderator_group_container\', |
| 648 | 674 | aListItems: ['; |
| 649 | 675 | |
| 650 | - foreach ($context['board']['moderator_groups'] as $id_group => $group_name) |
|
| 651 | - echo ' |
|
| 676 | + foreach ($context['board']['moderator_groups'] as $id_group => $group_name) { |
|
| 677 | + echo ' |
|
| 652 | 678 | { |
| 653 | 679 | sItemId: ', JavaScriptEscape($id_group), ', |
| 654 | 680 | sItemName: ', JavaScriptEscape($group_name), ' |
| 655 | 681 | }', $id_group == $context['board']['last_moderator_group_id'] ? '' : ','; |
| 682 | + } |
|
| 656 | 683 | |
| 657 | 684 | echo ' |
| 658 | 685 | ] |
@@ -678,17 +705,19 @@ discard block |
||
| 678 | 705 | echo ' |
| 679 | 706 | document.getElementById("redirect_address_div").style.display = redirectEnabled ? "" : "none";'; |
| 680 | 707 | |
| 681 | - if ($context['board']['redirect']) |
|
| 682 | - echo ' |
|
| 708 | + if ($context['board']['redirect']) { |
|
| 709 | + echo ' |
|
| 683 | 710 | document.getElementById("reset_redirect_div").style.display = redirectEnabled ? "" : "none";'; |
| 711 | + } |
|
| 684 | 712 | } |
| 685 | 713 | |
| 686 | 714 | // Include any JavaScript added by mods using the 'integrate_edit_board' hook. |
| 687 | 715 | if (!empty($context['custom_refreshOptions']) && is_array($context['custom_refreshOptions'])) |
| 688 | 716 | { |
| 689 | - foreach ($context['custom_refreshOptions'] as $refreshOption) |
|
| 690 | - echo ' |
|
| 717 | + foreach ($context['custom_refreshOptions'] as $refreshOption) { |
|
| 718 | + echo ' |
|
| 691 | 719 | ', $refreshOption; |
| 720 | + } |
|
| 692 | 721 | } |
| 693 | 722 | |
| 694 | 723 | echo ' |
@@ -717,9 +746,10 @@ discard block |
||
| 717 | 746 | <p>', $txt['mboards_delete_board_contains'], '</p> |
| 718 | 747 | <ul>'; |
| 719 | 748 | |
| 720 | - foreach ($context['children'] as $child) |
|
| 721 | - echo ' |
|
| 749 | + foreach ($context['children'] as $child) { |
|
| 750 | + echo ' |
|
| 722 | 751 | <li>', $child['node']['name'], '</li>'; |
| 752 | + } |
|
| 723 | 753 | |
| 724 | 754 | echo ' |
| 725 | 755 | </ul> |
@@ -733,10 +763,11 @@ discard block |
||
| 733 | 763 | <label for="delete_action1"><input type="radio" id="delete_action1" name="delete_action" value="1"', empty($context['can_move_children']) ? ' disabled' : '', '>', $txt['mboards_delete_board_option2'], '</label>: |
| 734 | 764 | <select name="board_to"', empty($context['can_move_children']) ? ' disabled' : '', '>'; |
| 735 | 765 | |
| 736 | - foreach ($context['board_order'] as $board) |
|
| 737 | - if ($board['id'] != $context['board']['id'] && empty($board['is_child'])) |
|
| 766 | + foreach ($context['board_order'] as $board) { |
|
| 767 | + if ($board['id'] != $context['board']['id'] && empty($board['is_child'])) |
|
| 738 | 768 | echo ' |
| 739 | 769 | <option value="', $board['id'], '">', $board['name'], '</option>'; |
| 770 | + } |
|
| 740 | 771 | |
| 741 | 772 | echo ' |
| 742 | 773 | </select> |
@@ -39,9 +39,10 @@ discard block |
||
| 39 | 39 | <select name="year" id="year" onchange="generateDays();"> |
| 40 | 40 | <option value="0000"', $context['holiday']['year'] == '0000' ? ' selected' : '', '>', $txt['every_year'], '</option>'; |
| 41 | 41 | // Show a list of all the years we allow... |
| 42 | - for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++) |
|
| 43 | - echo ' |
|
| 42 | + for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++) { |
|
| 43 | + echo ' |
|
| 44 | 44 | <option value="', $year, '"', $year == $context['holiday']['year'] ? ' selected' : '', '>', $year, '</option>'; |
| 45 | + } |
|
| 45 | 46 | |
| 46 | 47 | echo ' |
| 47 | 48 | </select> |
@@ -49,9 +50,10 @@ discard block |
||
| 49 | 50 | <select name="month" id="month" onchange="generateDays();">'; |
| 50 | 51 | |
| 51 | 52 | // There are 12 months per year - ensure that they all get listed. |
| 52 | - for ($month = 1; $month <= 12; $month++) |
|
| 53 | - echo ' |
|
| 53 | + for ($month = 1; $month <= 12; $month++) { |
|
| 54 | + echo ' |
|
| 54 | 55 | <option value="', $month, '"', $month == $context['holiday']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>'; |
| 56 | + } |
|
| 55 | 57 | |
| 56 | 58 | echo ' |
| 57 | 59 | </select> |
@@ -59,23 +61,25 @@ discard block |
||
| 59 | 61 | <select name="day" id="day" onchange="generateDays();">'; |
| 60 | 62 | |
| 61 | 63 | // This prints out all the days in the current month - this changes dynamically as we switch months. |
| 62 | - for ($day = 1; $day <= $context['holiday']['last_day']; $day++) |
|
| 63 | - echo ' |
|
| 64 | + for ($day = 1; $day <= $context['holiday']['last_day']; $day++) { |
|
| 65 | + echo ' |
|
| 64 | 66 | <option value="', $day, '"', $day == $context['holiday']['day'] ? ' selected' : '', '>', $day, '</option>'; |
| 67 | + } |
|
| 65 | 68 | |
| 66 | 69 | echo ' |
| 67 | 70 | </select> |
| 68 | 71 | </dd> |
| 69 | 72 | </dl>'; |
| 70 | 73 | |
| 71 | - if ($context['is_new']) |
|
| 72 | - echo ' |
|
| 74 | + if ($context['is_new']) { |
|
| 75 | + echo ' |
|
| 73 | 76 | <input type="submit" value="', $txt['holidays_button_add'], '" class="button">'; |
| 74 | - else |
|
| 75 | - echo ' |
|
| 77 | + } else { |
|
| 78 | + echo ' |
|
| 76 | 79 | <input type="submit" name="edit" value="', $txt['holidays_button_edit'], '" class="button"> |
| 77 | 80 | <input type="submit" name="delete" value="', $txt['holidays_button_remove'], '" class="button"> |
| 78 | 81 | <input type="hidden" name="holiday" value="', $context['holiday']['id'], '">'; |
| 82 | + } |
|
| 79 | 83 | echo ' |
| 80 | 84 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 81 | 85 | </div> |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | |
| 232 | 232 | foreach ($message['custom_fields']['above_member'] as $custom) |
| 233 | 233 | echo ' |
| 234 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
| 234 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
| 235 | 235 | |
| 236 | 236 | echo ' |
| 237 | 237 | </ul> |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | if (!empty($message['custom_fields']['below_avatar'])) |
| 269 | 269 | foreach ($message['custom_fields']['below_avatar'] as $custom) |
| 270 | 270 | echo ' |
| 271 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
| 271 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
| 272 | 272 | |
| 273 | 273 | if (!$message['member']['is_guest']) |
| 274 | 274 | echo ' |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | |
| 311 | 311 | foreach ($message['custom_fields']['icons'] as $custom) |
| 312 | 312 | echo ' |
| 313 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
| 313 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
| 314 | 314 | |
| 315 | 315 | echo ' |
| 316 | 316 | </ol> |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | if (!empty($message['custom_fields']['standard'])) |
| 369 | 369 | foreach ($message['custom_fields']['standard'] as $custom) |
| 370 | 370 | echo ' |
| 371 | - <li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>'; |
|
| 371 | + <li class="custom ', $custom['col_name'], '">', $custom['title'], ': ', $custom['value'], '</li>'; |
|
| 372 | 372 | |
| 373 | 373 | // Are we showing the warning status? |
| 374 | 374 | if ($message['member']['can_see_warning']) |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | if (!empty($message['custom_fields']['bottom_poster'])) |
| 380 | 380 | foreach ($message['custom_fields']['bottom_poster'] as $custom) |
| 381 | 381 | echo ' |
| 382 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
| 382 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
| 383 | 383 | } |
| 384 | 384 | |
| 385 | 385 | // Done with the information about the poster... on to the post itself. |
@@ -477,7 +477,7 @@ discard block |
||
| 477 | 477 | |
| 478 | 478 | foreach ($message['custom_fields']['above_signature'] as $custom) |
| 479 | 479 | echo ' |
| 480 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
| 480 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
| 481 | 481 | |
| 482 | 482 | echo ' |
| 483 | 483 | </ul> |
@@ -498,7 +498,7 @@ discard block |
||
| 498 | 498 | |
| 499 | 499 | foreach ($message['custom_fields']['below_signature'] as $custom) |
| 500 | 500 | echo ' |
| 501 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
| 501 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
| 502 | 502 | |
| 503 | 503 | echo ' |
| 504 | 504 | </ul> |
@@ -630,7 +630,7 @@ discard block |
||
| 630 | 630 | while ($message = $context['get_pmessage']('subject')) |
| 631 | 631 | { |
| 632 | 632 | echo ' |
| 633 | - <tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '','"> |
|
| 633 | + <tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '', '"> |
|
| 634 | 634 | <td class="table_icon"> |
| 635 | 635 | <script> |
| 636 | 636 | currentLabels[', $message['id'], '] = {'; |
@@ -902,12 +902,12 @@ discard block |
||
| 902 | 902 | // You can only reply if they are not a guest... |
| 903 | 903 | if (!$message['member']['is_guest']) |
| 904 | 904 | echo ' |
| 905 | - <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button , '</a>', $context['menu_separator'], ' |
|
| 906 | - <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button , '</a> ', $context['menu_separator']; |
|
| 905 | + <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button, '</a>', $context['menu_separator'], ' |
|
| 906 | + <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button, '</a> ', $context['menu_separator']; |
|
| 907 | 907 | // This is for "forwarding" - even if the member is gone. |
| 908 | 908 | else |
| 909 | 909 | echo ' |
| 910 | - <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button , '</a>', $context['menu_separator']; |
|
| 910 | + <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button, '</a>', $context['menu_separator']; |
|
| 911 | 911 | } |
| 912 | 912 | |
| 913 | 913 | echo ' |
@@ -1007,7 +1007,7 @@ discard block |
||
| 1007 | 1007 | <div class="', empty($context['error_type']) || $context['error_type'] != 'serious' ? 'noticebox' : 'errorbox', '"', empty($context['post_error']['messages']) ? ' style="display: none"' : '', ' id="errors"> |
| 1008 | 1008 | <dl> |
| 1009 | 1009 | <dt> |
| 1010 | - <strong id="error_serious">', $txt['error_while_submitting'] , '</strong> |
|
| 1010 | + <strong id="error_serious">', $txt['error_while_submitting'], '</strong> |
|
| 1011 | 1011 | </dt> |
| 1012 | 1012 | <dd class="error" id="error_list"> |
| 1013 | 1013 | ', empty($context['post_error']['messages']) ? '' : implode('<br>', $context['post_error']['messages']), ' |
@@ -1063,7 +1063,7 @@ discard block |
||
| 1063 | 1063 | <span', (isset($context['post_error']['no_subject']) ? ' class="error"' : ''), ' id="caption_subject">', $txt['subject'], ':</span> |
| 1064 | 1064 | </dt> |
| 1065 | 1065 | <dd id="pm_subject"> |
| 1066 | - <input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"',isset($context['post_error']['no_subject']) ? ' class="error"' : '', '/> |
|
| 1066 | + <input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"', isset($context['post_error']['no_subject']) ? ' class="error"' : '', '/> |
|
| 1067 | 1067 | </dd> |
| 1068 | 1068 | </dl><hr>'; |
| 1069 | 1069 | |
@@ -1426,7 +1426,7 @@ discard block |
||
| 1426 | 1426 | echo ' |
| 1427 | 1427 | <div class="padding"> |
| 1428 | 1428 | <input type="submit" name="save" value="', $txt['save'], '" class="button"> |
| 1429 | - <input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'] ,'" class="button you_sure"> |
|
| 1429 | + <input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'], '" class="button you_sure"> |
|
| 1430 | 1430 | </div>'; |
| 1431 | 1431 | |
| 1432 | 1432 | echo ' |
@@ -1590,7 +1590,7 @@ discard block |
||
| 1590 | 1590 | if (!empty($context['rules'])) |
| 1591 | 1591 | echo ' |
| 1592 | 1592 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 1593 | - <input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'] ,'" class="button smalltext you_sure">'; |
|
| 1593 | + <input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'], '" class="button smalltext you_sure">'; |
|
| 1594 | 1594 | |
| 1595 | 1595 | echo ' |
| 1596 | 1596 | </div> |
@@ -1831,9 +1831,9 @@ discard block |
||
| 1831 | 1831 | |
| 1832 | 1832 | echo ' |
| 1833 | 1833 | <select name="acttype[', $k, ']" id="acttype', $k, '" onchange="updateActionDef(', $k, '); rebuildRuleDesc();"> |
| 1834 | - <option value="">', $txt['pm_rule_sel_action'] , ':</option> |
|
| 1835 | - <option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'] , '</option> |
|
| 1836 | - <option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'] , '</option> |
|
| 1834 | + <option value="">', $txt['pm_rule_sel_action'], ':</option> |
|
| 1835 | + <option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'], '</option> |
|
| 1836 | + <option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'], '</option> |
|
| 1837 | 1837 | </select> |
| 1838 | 1838 | <span id="labdiv', $k, '"> |
| 1839 | 1839 | <select name="labdef[', $k, ']" id="labdef', $k, '" onchange="rebuildRuleDesc();"> |
@@ -1945,7 +1945,7 @@ discard block |
||
| 1945 | 1945 | </div> |
| 1946 | 1946 | <ul class="quickbuttons"> |
| 1947 | 1947 | <li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;id_draft=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons modifybutton"></span>', $txt['draft_edit'], '</a></li> |
| 1948 | - <li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;delete=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['draft_remove'] ,'?" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['draft_delete'], '</a></li> |
|
| 1948 | + <li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;delete=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['draft_remove'], '?" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['draft_delete'], '</a></li> |
|
| 1949 | 1949 | </ul> |
| 1950 | 1950 | </div>'; |
| 1951 | 1951 | } |
@@ -21,8 +21,8 @@ discard block |
||
| 21 | 21 | <div id="personal_messages">'; |
| 22 | 22 | |
| 23 | 23 | // Show the capacity bar, if available. |
| 24 | - if (!empty($context['limit_bar'])) |
|
| 25 | - echo ' |
|
| 24 | + if (!empty($context['limit_bar'])) { |
|
| 25 | + echo ' |
|
| 26 | 26 | <div class="cat_bar"> |
| 27 | 27 | <h3 class="catbg"> |
| 28 | 28 | <span class="floatleft">', $txt['pm_capacity'], ':</span> |
@@ -32,14 +32,16 @@ discard block |
||
| 32 | 32 | <span class="floatright', $context['limit_bar']['percent'] > 90 ? ' alert' : '', '">', $context['limit_bar']['text'], '</span> |
| 33 | 33 | </h3> |
| 34 | 34 | </div>'; |
| 35 | + } |
|
| 35 | 36 | |
| 36 | 37 | // Message sent? Show a small indication. |
| 37 | - if (isset($context['pm_sent'])) |
|
| 38 | - echo ' |
|
| 38 | + if (isset($context['pm_sent'])) { |
|
| 39 | + echo ' |
|
| 39 | 40 | <div class="infobox"> |
| 40 | 41 | ', $txt['pm_sent'], ' |
| 41 | 42 | </div>'; |
| 42 | -} |
|
| 43 | + } |
|
| 44 | + } |
|
| 43 | 45 | |
| 44 | 46 | /** |
| 45 | 47 | * Just the end of the index bar, nothing special. |
@@ -72,8 +74,7 @@ discard block |
||
| 72 | 74 | { |
| 73 | 75 | echo ' |
| 74 | 76 | <div class="no_unread">', $txt['pm_no_unread'], '</div>'; |
| 75 | - } |
|
| 76 | - else |
|
| 77 | + } else |
|
| 77 | 78 | { |
| 78 | 79 | foreach ($context['unread_pms'] as $id_pm => $pm_details) |
| 79 | 80 | { |
@@ -193,14 +194,15 @@ discard block |
||
| 193 | 194 | if ($context['get_pmessage']('message', true)) |
| 194 | 195 | { |
| 195 | 196 | // Show the helpful titlebar - generally. |
| 196 | - if ($context['display_mode'] != 1) |
|
| 197 | - echo ' |
|
| 197 | + if ($context['display_mode'] != 1) { |
|
| 198 | + echo ' |
|
| 198 | 199 | <div class="cat_bar"> |
| 199 | 200 | <h3 class="catbg"> |
| 200 | 201 | <span id="author">', $txt['author'], '</span> |
| 201 | 202 | <span id="topic_title">', $txt[$context['display_mode'] == 0 ? 'messages' : 'conversation'], '</span> |
| 202 | 203 | </h3> |
| 203 | 204 | </div>'; |
| 205 | + } |
|
| 204 | 206 | |
| 205 | 207 | // Show a few buttons if we are in conversation mode and outputting the first message. |
| 206 | 208 | if ($context['display_mode'] == 2) |
@@ -229,9 +231,10 @@ discard block |
||
| 229 | 231 | <div class="custom_fields_above_member"> |
| 230 | 232 | <ul class="nolist">'; |
| 231 | 233 | |
| 232 | - foreach ($message['custom_fields']['above_member'] as $custom) |
|
| 233 | - echo ' |
|
| 234 | + foreach ($message['custom_fields']['above_member'] as $custom) { |
|
| 235 | + echo ' |
|
| 234 | 236 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
| 237 | + } |
|
| 235 | 238 | |
| 236 | 239 | echo ' |
| 237 | 240 | </ul> |
@@ -243,9 +246,10 @@ discard block |
||
| 243 | 246 | <a id="msg', $message['id'], '"></a>'; |
| 244 | 247 | |
| 245 | 248 | // Show online and offline buttons? |
| 246 | - if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) |
|
| 247 | - echo ' |
|
| 249 | + if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) { |
|
| 250 | + echo ' |
|
| 248 | 251 | <span class="' . ($message['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $message['member']['online']['text'] . '"></span>'; |
| 252 | + } |
|
| 249 | 253 | |
| 250 | 254 | // Show a link to the member's profile (but only if the sender isn't a guest). |
| 251 | 255 | echo ' |
@@ -258,48 +262,56 @@ discard block |
||
| 258 | 262 | <ul class="user_info">'; |
| 259 | 263 | |
| 260 | 264 | // Show the user's avatar. |
| 261 | - if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) |
|
| 262 | - echo ' |
|
| 265 | + if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) { |
|
| 266 | + echo ' |
|
| 263 | 267 | <li class="avatar"> |
| 264 | 268 | <a href="', $scripturl, '?action=profile;u=', $message['member']['id'], '">', $message['member']['avatar']['image'], '</a> |
| 265 | 269 | </li>'; |
| 270 | + } |
|
| 266 | 271 | |
| 267 | 272 | // Are there any custom fields below the avatar? |
| 268 | - if (!empty($message['custom_fields']['below_avatar'])) |
|
| 269 | - foreach ($message['custom_fields']['below_avatar'] as $custom) |
|
| 273 | + if (!empty($message['custom_fields']['below_avatar'])) { |
|
| 274 | + foreach ($message['custom_fields']['below_avatar'] as $custom) |
|
| 270 | 275 | echo ' |
| 271 | 276 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
| 277 | + } |
|
| 272 | 278 | |
| 273 | - if (!$message['member']['is_guest']) |
|
| 274 | - echo ' |
|
| 279 | + if (!$message['member']['is_guest']) { |
|
| 280 | + echo ' |
|
| 275 | 281 | <li class="icons">', $message['member']['group_icons'], '</li>'; |
| 282 | + } |
|
| 276 | 283 | // Show the member's primary group (like 'Administrator') if they have one. |
| 277 | - if (isset($message['member']['group']) && $message['member']['group'] != '') |
|
| 278 | - echo ' |
|
| 284 | + if (isset($message['member']['group']) && $message['member']['group'] != '') { |
|
| 285 | + echo ' |
|
| 279 | 286 | <li class="membergroup">', $message['member']['group'], '</li>'; |
| 287 | + } |
|
| 280 | 288 | |
| 281 | 289 | // Show the member's custom title, if they have one. |
| 282 | - if (isset($message['member']['title']) && $message['member']['title'] != '') |
|
| 283 | - echo ' |
|
| 290 | + if (isset($message['member']['title']) && $message['member']['title'] != '') { |
|
| 291 | + echo ' |
|
| 284 | 292 | <li class="title">', $message['member']['title'], '</li>'; |
| 293 | + } |
|
| 285 | 294 | |
| 286 | 295 | // Don't show these things for guests. |
| 287 | 296 | if (!$message['member']['is_guest']) |
| 288 | 297 | { |
| 289 | 298 | // Show the post group if and only if they have no other group or the option is on, and they are in a post group. |
| 290 | - if ((empty($modSettings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '') |
|
| 291 | - echo ' |
|
| 299 | + if ((empty($modSettings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '') { |
|
| 300 | + echo ' |
|
| 292 | 301 | <li class="postgroup">', $message['member']['post_group'], '</li>'; |
| 302 | + } |
|
| 293 | 303 | |
| 294 | 304 | // Show how many posts they have made. |
| 295 | - if (!isset($context['disabled_fields']['posts'])) |
|
| 296 | - echo ' |
|
| 305 | + if (!isset($context['disabled_fields']['posts'])) { |
|
| 306 | + echo ' |
|
| 297 | 307 | <li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>'; |
| 308 | + } |
|
| 298 | 309 | |
| 299 | 310 | // Show their personal text? |
| 300 | - if (!empty($modSettings['show_blurb']) && $message['member']['blurb'] != '') |
|
| 301 | - echo ' |
|
| 311 | + if (!empty($modSettings['show_blurb']) && $message['member']['blurb'] != '') { |
|
| 312 | + echo ' |
|
| 302 | 313 | <li class="blurb">', $message['member']['blurb'], '</li>'; |
| 314 | + } |
|
| 303 | 315 | |
| 304 | 316 | // Any custom fields to show as icons? |
| 305 | 317 | if (!empty($message['custom_fields']['icons'])) |
@@ -308,9 +320,10 @@ discard block |
||
| 308 | 320 | <li class="im_icons"> |
| 309 | 321 | <ol>'; |
| 310 | 322 | |
| 311 | - foreach ($message['custom_fields']['icons'] as $custom) |
|
| 312 | - echo ' |
|
| 323 | + foreach ($message['custom_fields']['icons'] as $custom) { |
|
| 324 | + echo ' |
|
| 313 | 325 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
| 326 | + } |
|
| 314 | 327 | |
| 315 | 328 | echo ' |
| 316 | 329 | </ol> |
@@ -318,19 +331,22 @@ discard block |
||
| 318 | 331 | } |
| 319 | 332 | |
| 320 | 333 | // Show the IP to this user for this post - because you can moderate? |
| 321 | - if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) |
|
| 322 | - echo ' |
|
| 334 | + if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) { |
|
| 335 | + echo ' |
|
| 323 | 336 | <li class="poster_ip"><a href="', $scripturl, '?action=', !empty($message['member']['is_guest']) ? 'trackip' : 'profile;area=tracking;sa=ip;u=' . $message['member']['id'], ';searchip=', $message['member']['ip'], '">', $message['member']['ip'], '</a> <a href="', $scripturl, '?action=helpadmin;help=see_admin_ip" onclick="return reqOverlayDiv(this.href);" class="help">(?)</a></li>'; |
| 337 | + } |
|
| 324 | 338 | |
| 325 | 339 | // Or, should we show it because this is you? |
| 326 | - elseif ($message['can_see_ip']) |
|
| 327 | - echo ' |
|
| 340 | + elseif ($message['can_see_ip']) { |
|
| 341 | + echo ' |
|
| 328 | 342 | <li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $message['member']['ip'], '</a></li>'; |
| 343 | + } |
|
| 329 | 344 | |
| 330 | 345 | // Okay, you are logged in, then we can show something about why IPs are logged... |
| 331 | - else |
|
| 332 | - echo ' |
|
| 346 | + else { |
|
| 347 | + echo ' |
|
| 333 | 348 | <li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $txt['logged'], '</a></li>'; |
| 349 | + } |
|
| 334 | 350 | |
| 335 | 351 | // Show the profile, website, email address, and personal message buttons. |
| 336 | 352 | if ($message['member']['show_profile_buttons']) |
@@ -340,24 +356,28 @@ discard block |
||
| 340 | 356 | <ol class="profile_icons">'; |
| 341 | 357 | |
| 342 | 358 | // Show the profile button |
| 343 | - if ($message['member']['can_view_profile']) |
|
| 344 | - echo ' |
|
| 359 | + if ($message['member']['can_view_profile']) { |
|
| 360 | + echo ' |
|
| 345 | 361 | <li><a href="', $message['member']['href'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="' . $txt['view_profile'] . '" title="' . $txt['view_profile'] . '">' : $txt['view_profile']), '</a></li>'; |
| 362 | + } |
|
| 346 | 363 | |
| 347 | 364 | // Don't show an icon if they haven't specified a website. |
| 348 | - if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website'])) |
|
| 349 | - echo ' |
|
| 365 | + if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website'])) { |
|
| 366 | + echo ' |
|
| 350 | 367 | <li><a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank">', ($settings['use_image_buttons'] ? '<span class="generic_icons www centericon" title="' . $message['member']['website']['title'] . '"></span>' : $txt['www']), '</a></li>'; |
| 368 | + } |
|
| 351 | 369 | |
| 352 | 370 | // Don't show the email address if they want it hidden. |
| 353 | - if ($message['member']['show_email']) |
|
| 354 | - echo ' |
|
| 371 | + if ($message['member']['show_email']) { |
|
| 372 | + echo ' |
|
| 355 | 373 | <li><a href="mailto:', $message['member']['email'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<span class="generic_icons mail centericon" title="' . $txt['email'] . '"></span>' : $txt['email']), '</a></li>'; |
| 374 | + } |
|
| 356 | 375 | |
| 357 | 376 | // Since we know this person isn't a guest, you *can* message them. |
| 358 | - if ($context['can_send_pm']) |
|
| 359 | - echo ' |
|
| 377 | + if ($context['can_send_pm']) { |
|
| 378 | + echo ' |
|
| 360 | 379 | <li><a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline'], '">', $settings['use_image_buttons'] ? '<span class="generic_icons im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . ' centericon" title="' . ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']) . '"></span> ' : ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']), '</a></li>'; |
| 380 | + } |
|
| 361 | 381 | |
| 362 | 382 | echo ' |
| 363 | 383 | </ol> |
@@ -365,21 +385,24 @@ discard block |
||
| 365 | 385 | } |
| 366 | 386 | |
| 367 | 387 | // Any custom fields for standard placement? |
| 368 | - if (!empty($message['custom_fields']['standard'])) |
|
| 369 | - foreach ($message['custom_fields']['standard'] as $custom) |
|
| 388 | + if (!empty($message['custom_fields']['standard'])) { |
|
| 389 | + foreach ($message['custom_fields']['standard'] as $custom) |
|
| 370 | 390 | echo ' |
| 371 | 391 | <li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>'; |
| 392 | + } |
|
| 372 | 393 | |
| 373 | 394 | // Are we showing the warning status? |
| 374 | - if ($message['member']['can_see_warning']) |
|
| 375 | - echo ' |
|
| 395 | + if ($message['member']['can_see_warning']) { |
|
| 396 | + echo ' |
|
| 376 | 397 | <li class="warning">', $context['can_issue_warning'] ? '<a href="' . $scripturl . '?action=profile;area=issuewarning;u=' . $message['member']['id'] . '">' : '', '<span class="generic_icons warning_', $message['member']['warning_status'], '"></span>', $context['can_issue_warning'] ? '</a>' : '', '<span class="warn_', $message['member']['warning_status'], '">', $txt['warn_' . $message['member']['warning_status']], '</span></li>'; |
| 398 | + } |
|
| 377 | 399 | |
| 378 | 400 | // Are there any custom fields to show at the bottom of the poster info? |
| 379 | - if (!empty($message['custom_fields']['bottom_poster'])) |
|
| 380 | - foreach ($message['custom_fields']['bottom_poster'] as $custom) |
|
| 401 | + if (!empty($message['custom_fields']['bottom_poster'])) { |
|
| 402 | + foreach ($message['custom_fields']['bottom_poster'] as $custom) |
|
| 381 | 403 | echo ' |
| 382 | 404 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
| 405 | + } |
|
| 383 | 406 | } |
| 384 | 407 | |
| 385 | 408 | // Done with the information about the poster... on to the post itself. |
@@ -398,24 +421,28 @@ discard block |
||
| 398 | 421 | <span class="smalltext">« <strong> ', $txt['sent_to'], ':</strong> '; |
| 399 | 422 | |
| 400 | 423 | // People it was sent directly to.... |
| 401 | - if (!empty($message['recipients']['to'])) |
|
| 402 | - echo implode(', ', $message['recipients']['to']); |
|
| 424 | + if (!empty($message['recipients']['to'])) { |
|
| 425 | + echo implode(', ', $message['recipients']['to']); |
|
| 426 | + } |
|
| 403 | 427 | // Otherwise, we're just going to say "some people"... |
| 404 | - elseif ($context['folder'] != 'sent') |
|
| 405 | - echo '(', $txt['pm_undisclosed_recipients'], ')'; |
|
| 428 | + elseif ($context['folder'] != 'sent') { |
|
| 429 | + echo '(', $txt['pm_undisclosed_recipients'], ')'; |
|
| 430 | + } |
|
| 406 | 431 | |
| 407 | 432 | echo ' |
| 408 | 433 | <strong> ', $txt['on'], ':</strong> ', $message['time'], ' » |
| 409 | 434 | </span>'; |
| 410 | 435 | |
| 411 | 436 | // If we're in the sent items, show who it was sent to besides the "To:" people. |
| 412 | - if (!empty($message['recipients']['bcc'])) |
|
| 413 | - echo ' |
|
| 437 | + if (!empty($message['recipients']['bcc'])) { |
|
| 438 | + echo ' |
|
| 414 | 439 | <br><span class="smalltext">« <strong> ', $txt['pm_bcc'], ':</strong> ', implode(', ', $message['recipients']['bcc']), ' »</span>'; |
| 440 | + } |
|
| 415 | 441 | |
| 416 | - if (!empty($message['is_replied_to'])) |
|
| 417 | - echo ' |
|
| 442 | + if (!empty($message['is_replied_to'])) { |
|
| 443 | + echo ' |
|
| 418 | 444 | <br><span class="smalltext">« ', $context['folder'] == 'sent' ? $txt['pm_sent_is_replied_to'] : $txt['pm_is_replied_to'], ' »</span>'; |
| 445 | + } |
|
| 419 | 446 | |
| 420 | 447 | echo ' |
| 421 | 448 | </div> |
@@ -423,13 +450,15 @@ discard block |
||
| 423 | 450 | <div class="post"> |
| 424 | 451 | <div class="inner" id="msg_', $message['id'], '"', '>', $message['body'], '</div>'; |
| 425 | 452 | |
| 426 | - if ($message['can_report'] || $context['can_send_pm']) |
|
| 427 | - echo ' |
|
| 453 | + if ($message['can_report'] || $context['can_send_pm']) { |
|
| 454 | + echo ' |
|
| 428 | 455 | <div class="under_message">'; |
| 456 | + } |
|
| 429 | 457 | |
| 430 | - if ($message['can_report']) |
|
| 431 | - echo ' |
|
| 458 | + if ($message['can_report']) { |
|
| 459 | + echo ' |
|
| 432 | 460 | <a href="' . $scripturl . '?action=pm;sa=report;l=' . $context['current_label_id'] . ';pmsg=' . $message['id'] . '" class="floatright">' . $txt['pm_report_to_admin'] . '</a>'; |
| 461 | + } |
|
| 433 | 462 | |
| 434 | 463 | echo ' |
| 435 | 464 | <ul class="quickbuttons">'; |
@@ -441,32 +470,36 @@ discard block |
||
| 441 | 470 | if (!$message['member']['is_guest']) |
| 442 | 471 | { |
| 443 | 472 | // Is there than more than one recipient you can reply to? |
| 444 | - if ($message['number_recipients'] > 1) |
|
| 445 | - echo ' |
|
| 473 | + if ($message['number_recipients'] > 1) { |
|
| 474 | + echo ' |
|
| 446 | 475 | <li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=all"><span class="generic_icons reply_all_button"></span>', $txt['reply_to_all'], '</a></li>'; |
| 476 | + } |
|
| 447 | 477 | |
| 448 | 478 | echo ' |
| 449 | 479 | <li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li> |
| 450 | 480 | <li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote', $context['folder'] == 'sent' ? '' : ';u=' . $message['member']['id'], '"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>'; |
| 451 | 481 | } |
| 452 | 482 | // This is for "forwarding" - even if the member is gone. |
| 453 | - else |
|
| 454 | - echo ' |
|
| 483 | + else { |
|
| 484 | + echo ' |
|
| 455 | 485 | <li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote"><span class="generic_icons quote"></span>', $txt['reply_quote'], '</a></li>'; |
| 486 | + } |
|
| 456 | 487 | } |
| 457 | 488 | echo ' |
| 458 | 489 | <li><a href="', $scripturl, '?action=pm;sa=pmactions;pm_actions%5b', $message['id'], '%5D=delete;f=', $context['folder'], ';start=', $context['start'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', addslashes($txt['remove_message_question']), '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['delete'], '</a></li>'; |
| 459 | 490 | |
| 460 | - if (empty($context['display_mode'])) |
|
| 461 | - echo ' |
|
| 491 | + if (empty($context['display_mode'])) { |
|
| 492 | + echo ' |
|
| 462 | 493 | <li><input type="checkbox" name="pms[]" id="deletedisplay', $message['id'], '" value="', $message['id'], '" onclick="document.getElementById(\'deletelisting', $message['id'], '\').checked = this.checked;"></li>'; |
| 494 | + } |
|
| 463 | 495 | |
| 464 | 496 | echo ' |
| 465 | 497 | </ul>'; |
| 466 | 498 | |
| 467 | - if ($message['can_report'] || $context['can_send_pm']) |
|
| 468 | - echo ' |
|
| 499 | + if ($message['can_report'] || $context['can_send_pm']) { |
|
| 500 | + echo ' |
|
| 469 | 501 | </div>'; |
| 502 | + } |
|
| 470 | 503 | |
| 471 | 504 | // Are there any custom profile fields for above the signature? |
| 472 | 505 | if (!empty($message['custom_fields']['above_signature'])) |
@@ -475,9 +508,10 @@ discard block |
||
| 475 | 508 | <div class="custom_fields_above_signature"> |
| 476 | 509 | <ul class="nolist">'; |
| 477 | 510 | |
| 478 | - foreach ($message['custom_fields']['above_signature'] as $custom) |
|
| 479 | - echo ' |
|
| 511 | + foreach ($message['custom_fields']['above_signature'] as $custom) { |
|
| 512 | + echo ' |
|
| 480 | 513 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
| 514 | + } |
|
| 481 | 515 | |
| 482 | 516 | echo ' |
| 483 | 517 | </ul> |
@@ -485,9 +519,10 @@ discard block |
||
| 485 | 519 | } |
| 486 | 520 | |
| 487 | 521 | // Show the member's signature? |
| 488 | - if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) |
|
| 489 | - echo ' |
|
| 522 | + if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) { |
|
| 523 | + echo ' |
|
| 490 | 524 | <div class="signature">', $message['member']['signature'], '</div>'; |
| 525 | + } |
|
| 491 | 526 | |
| 492 | 527 | // Are there any custom profile fields for below the signature? |
| 493 | 528 | if (!empty($message['custom_fields']['below_signature'])) |
@@ -496,9 +531,10 @@ discard block |
||
| 496 | 531 | <div class="custom_fields_below_signature"> |
| 497 | 532 | <ul class="nolist">'; |
| 498 | 533 | |
| 499 | - foreach ($message['custom_fields']['below_signature'] as $custom) |
|
| 500 | - echo ' |
|
| 534 | + foreach ($message['custom_fields']['below_signature'] as $custom) { |
|
| 535 | + echo ' |
|
| 501 | 536 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
| 537 | + } |
|
| 502 | 538 | |
| 503 | 539 | echo ' |
| 504 | 540 | </ul> |
@@ -523,19 +559,21 @@ discard block |
||
| 523 | 559 | { |
| 524 | 560 | echo ' |
| 525 | 561 | <option value="" disabled>', $txt['pm_msg_label_apply'], ':</option>'; |
| 526 | - foreach ($context['labels'] as $label) |
|
| 527 | - if (!isset($message['labels'][$label['id']])) |
|
| 562 | + foreach ($context['labels'] as $label) { |
|
| 563 | + if (!isset($message['labels'][$label['id']])) |
|
| 528 | 564 | echo ' |
| 529 | 565 | <option value="', $label['id'], '"> ', $label['name'], '</option>'; |
| 566 | + } |
|
| 530 | 567 | } |
| 531 | 568 | // ... and are there any that can be removed? |
| 532 | 569 | if (!empty($message['labels']) && (count($message['labels']) > 1 || !isset($message['labels'][-1]))) |
| 533 | 570 | { |
| 534 | 571 | echo ' |
| 535 | 572 | <option value="" disabled>', $txt['pm_msg_label_remove'], ':</option>'; |
| 536 | - foreach ($message['labels'] as $label) |
|
| 537 | - echo ' |
|
| 573 | + foreach ($message['labels'] as $label) { |
|
| 574 | + echo ' |
|
| 538 | 575 | <option value="', $label['id'], '"> ', $label['name'], '</option>'; |
| 576 | + } |
|
| 539 | 577 | } |
| 540 | 578 | echo ' |
| 541 | 579 | </select> |
@@ -555,13 +593,14 @@ discard block |
||
| 555 | 593 | </div>'; |
| 556 | 594 | } |
| 557 | 595 | |
| 558 | - if (empty($context['display_mode'])) |
|
| 559 | - echo ' |
|
| 596 | + if (empty($context['display_mode'])) { |
|
| 597 | + echo ' |
|
| 560 | 598 | |
| 561 | 599 | <div class="pagesection"> |
| 562 | 600 | <div class="floatleft">', $context['page_index'], '</div> |
| 563 | 601 | <div class="floatright"><input type="submit" name="del_selected" value="', $txt['quickmod_delete_selected'], '" style="font-weight: normal;" onclick="if (!confirm(\'', $txt['delete_selected_confirm'], '\')) return false;" class="button"></div> |
| 564 | 602 | </div>'; |
| 603 | + } |
|
| 565 | 604 | |
| 566 | 605 | // Show a few buttons if we are in conversation mode and outputting the first message. |
| 567 | 606 | elseif ($context['display_mode'] == 2 && isset($context['conversation_buttons'])) |
@@ -621,11 +660,12 @@ discard block |
||
| 621 | 660 | </tr> |
| 622 | 661 | </thead> |
| 623 | 662 | <tbody>'; |
| 624 | - if (!$context['show_delete']) |
|
| 625 | - echo ' |
|
| 663 | + if (!$context['show_delete']) { |
|
| 664 | + echo ' |
|
| 626 | 665 | <tr class="windowbg"> |
| 627 | 666 | <td colspan="5">', $txt['pm_alert_none'], '</td> |
| 628 | 667 | </tr>'; |
| 668 | + } |
|
| 629 | 669 | |
| 630 | 670 | while ($message = $context['get_pmessage']('subject')) |
| 631 | 671 | { |
@@ -678,9 +718,10 @@ discard block |
||
| 678 | 718 | |
| 679 | 719 | foreach ($context['labels'] as $label) |
| 680 | 720 | { |
| 681 | - if ($label['id'] != $context['current_label_id']) |
|
| 682 | - echo ' |
|
| 721 | + if ($label['id'] != $context['current_label_id']) { |
|
| 722 | + echo ' |
|
| 683 | 723 | <option value="add_', $label['id'], '"> ', $label['name'], '</option>'; |
| 724 | + } |
|
| 684 | 725 | } |
| 685 | 726 | |
| 686 | 727 | echo ' |
@@ -765,9 +806,10 @@ discard block |
||
| 765 | 806 | <dt class="between">', $txt['pm_search_post_age'], ':</dt> |
| 766 | 807 | <dd>', $txt['pm_search_between'], ' <input type="number" name="minage" value="', empty($context['search_params']['minage']) ? '0' : $context['search_params']['minage'], '" size="5" maxlength="5" min="0" max="9999"> ', $txt['pm_search_between_and'], ' <input type="number" name="maxage" value="', empty($context['search_params']['maxage']) ? '9999' : $context['search_params']['maxage'], '" size="5" maxlength="5" min="0" max="9999"> ', $txt['pm_search_between_days'], '</dd> |
| 767 | 808 | </dl>'; |
| 768 | - if (!$context['currently_using_labels']) |
|
| 769 | - echo ' |
|
| 809 | + if (!$context['currently_using_labels']) { |
|
| 810 | + echo ' |
|
| 770 | 811 | <input type="submit" name="pm_search" value="', $txt['pm_search_go'], '" class="button">'; |
| 812 | + } |
|
| 771 | 813 | echo ' |
| 772 | 814 | <br class="clear_right"> |
| 773 | 815 | </div> |
@@ -787,12 +829,13 @@ discard block |
||
| 787 | 829 | <div id="advanced_panel_div"> |
| 788 | 830 | <ul id="searchLabelsExpand">'; |
| 789 | 831 | |
| 790 | - foreach ($context['search_labels'] as $label) |
|
| 791 | - echo ' |
|
| 832 | + foreach ($context['search_labels'] as $label) { |
|
| 833 | + echo ' |
|
| 792 | 834 | <li> |
| 793 | 835 | <label for="searchlabel_', $label['id'], '"><input type="checkbox" id="searchlabel_', $label['id'], '" name="searchlabel[', $label['id'], ']" value="', $label['id'], '"', $label['checked'] ? ' checked' : '', '> |
| 794 | 836 | ', $label['name'], '</label> |
| 795 | 837 | </li>'; |
| 838 | + } |
|
| 796 | 839 | |
| 797 | 840 | echo ' |
| 798 | 841 | </ul> |
@@ -852,8 +895,8 @@ discard block |
||
| 852 | 895 | </div>'; |
| 853 | 896 | |
| 854 | 897 | // complete results ? |
| 855 | - if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) |
|
| 856 | - echo ' |
|
| 898 | + if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) { |
|
| 899 | + echo ' |
|
| 857 | 900 | <table class="table_grid"> |
| 858 | 901 | <thead> |
| 859 | 902 | <tr class="title_bar"> |
@@ -863,6 +906,7 @@ discard block |
||
| 863 | 906 | </tr> |
| 864 | 907 | </thead> |
| 865 | 908 | <tbody>'; |
| 909 | + } |
|
| 866 | 910 | |
| 867 | 911 | // Print each message out... |
| 868 | 912 | foreach ($context['personal_messages'] as $message) |
@@ -882,11 +926,13 @@ discard block |
||
| 882 | 926 | |
| 883 | 927 | // Show the recipients. |
| 884 | 928 | // @todo This doesn't deal with the sent item searching quite right for bcc. |
| 885 | - if (!empty($message['recipients']['to'])) |
|
| 886 | - echo implode(', ', $message['recipients']['to']); |
|
| 929 | + if (!empty($message['recipients']['to'])) { |
|
| 930 | + echo implode(', ', $message['recipients']['to']); |
|
| 931 | + } |
|
| 887 | 932 | // Otherwise, we're just going to say "some people"... |
| 888 | - elseif ($context['folder'] != 'sent') |
|
| 889 | - echo '(', $txt['pm_undisclosed_recipients'], ')'; |
|
| 933 | + elseif ($context['folder'] != 'sent') { |
|
| 934 | + echo '(', $txt['pm_undisclosed_recipients'], ')'; |
|
| 935 | + } |
|
| 890 | 936 | |
| 891 | 937 | echo ' |
| 892 | 938 | </h3> |
@@ -900,14 +946,16 @@ discard block |
||
| 900 | 946 | $quote_button = create_button('quote.png', 'reply_quote', 'reply_quote', 'class="centericon"'); |
| 901 | 947 | $reply_button = create_button('im_reply.png', 'reply', 'reply', 'class="centericon"'); |
| 902 | 948 | // You can only reply if they are not a guest... |
| 903 | - if (!$message['member']['is_guest']) |
|
| 904 | - echo ' |
|
| 949 | + if (!$message['member']['is_guest']) { |
|
| 950 | + echo ' |
|
| 905 | 951 | <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button , '</a>', $context['menu_separator'], ' |
| 906 | 952 | <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button , '</a> ', $context['menu_separator']; |
| 953 | + } |
|
| 907 | 954 | // This is for "forwarding" - even if the member is gone. |
| 908 | - else |
|
| 909 | - echo ' |
|
| 955 | + else { |
|
| 956 | + echo ' |
|
| 910 | 957 | <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button , '</a>', $context['menu_separator']; |
| 958 | + } |
|
| 911 | 959 | } |
| 912 | 960 | |
| 913 | 961 | echo ' |
@@ -928,17 +976,19 @@ discard block |
||
| 928 | 976 | } |
| 929 | 977 | |
| 930 | 978 | // Finish off the page... |
| 931 | - if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) |
|
| 932 | - echo ' |
|
| 979 | + if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) { |
|
| 980 | + echo ' |
|
| 933 | 981 | </tbody> |
| 934 | 982 | </table>'; |
| 983 | + } |
|
| 935 | 984 | |
| 936 | 985 | // No results? |
| 937 | - if (empty($context['personal_messages'])) |
|
| 938 | - echo ' |
|
| 986 | + if (empty($context['personal_messages'])) { |
|
| 987 | + echo ' |
|
| 939 | 988 | <div class="windowbg"> |
| 940 | 989 | <p class="centertext">', $txt['pm_search_none_found'], '</p> |
| 941 | 990 | </div>'; |
| 991 | + } |
|
| 942 | 992 | |
| 943 | 993 | echo ' |
| 944 | 994 | <div class="pagesection"> |
@@ -962,12 +1012,14 @@ discard block |
||
| 962 | 1012 | <h3 class="catbg">', $txt['pm_send_report'], '</h3> |
| 963 | 1013 | </div> |
| 964 | 1014 | <div class="windowbg">'; |
| 965 | - if (!empty($context['send_log']['sent'])) |
|
| 966 | - foreach ($context['send_log']['sent'] as $log_entry) |
|
| 1015 | + if (!empty($context['send_log']['sent'])) { |
|
| 1016 | + foreach ($context['send_log']['sent'] as $log_entry) |
|
| 967 | 1017 | echo '<span class="error">', $log_entry, '</span><br>'; |
| 968 | - if (!empty($context['send_log']['failed'])) |
|
| 969 | - foreach ($context['send_log']['failed'] as $log_entry) |
|
| 1018 | + } |
|
| 1019 | + if (!empty($context['send_log']['failed'])) { |
|
| 1020 | + foreach ($context['send_log']['failed'] as $log_entry) |
|
| 970 | 1021 | echo '<span class="error">', $log_entry, '</span><br>'; |
| 1022 | + } |
|
| 971 | 1023 | echo ' |
| 972 | 1024 | </div> |
| 973 | 1025 | <br>'; |
@@ -1015,12 +1067,13 @@ discard block |
||
| 1015 | 1067 | </dl> |
| 1016 | 1068 | </div>'; |
| 1017 | 1069 | |
| 1018 | - if (!empty($modSettings['drafts_pm_enabled'])) |
|
| 1019 | - echo ' |
|
| 1070 | + if (!empty($modSettings['drafts_pm_enabled'])) { |
|
| 1071 | + echo ' |
|
| 1020 | 1072 | <div id="draft_section" class="infobox"', isset($context['draft_saved']) ? '' : ' style="display: none;"', '>', |
| 1021 | 1073 | sprintf($txt['draft_pm_saved'], $scripturl . '?action=pm;sa=showpmdrafts'), ' |
| 1022 | 1074 | ', (!empty($modSettings['drafts_keep_days']) ? ' <strong>' . sprintf($txt['draft_save_warning'], $modSettings['drafts_keep_days']) . '</strong>' : ''), ' |
| 1023 | 1075 | </div>'; |
| 1076 | + } |
|
| 1024 | 1077 | |
| 1025 | 1078 | echo ' |
| 1026 | 1079 | <dl id="post_header">'; |
@@ -1075,9 +1128,10 @@ discard block |
||
| 1075 | 1128 | } |
| 1076 | 1129 | |
| 1077 | 1130 | // What about smileys? |
| 1078 | - if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) |
|
| 1079 | - echo ' |
|
| 1131 | + if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) { |
|
| 1132 | + echo ' |
|
| 1080 | 1133 | <div id="smileyBox_message"></div>'; |
| 1134 | + } |
|
| 1081 | 1135 | |
| 1082 | 1136 | // Show BBC buttons, smileys and textbox. |
| 1083 | 1137 | echo ' |
@@ -1124,10 +1178,11 @@ discard block |
||
| 1124 | 1178 | <dt><strong>', $txt['subject'], '</strong></dt> |
| 1125 | 1179 | <dd><strong>', $txt['draft_saved_on'], '</strong></dd>'; |
| 1126 | 1180 | |
| 1127 | - foreach ($context['drafts'] as $draft) |
|
| 1128 | - echo ' |
|
| 1181 | + foreach ($context['drafts'] as $draft) { |
|
| 1182 | + echo ' |
|
| 1129 | 1183 | <dt>', $draft['link'], '</dt> |
| 1130 | 1184 | <dd>', $draft['poster_time'], '</dd>'; |
| 1185 | + } |
|
| 1131 | 1186 | echo ' |
| 1132 | 1187 | </dl> |
| 1133 | 1188 | </div>'; |
@@ -1233,8 +1288,8 @@ discard block |
||
| 1233 | 1288 | }'; |
| 1234 | 1289 | |
| 1235 | 1290 | // Code for showing and hiding drafts |
| 1236 | - if (!empty($context['drafts'])) |
|
| 1237 | - echo ' |
|
| 1291 | + if (!empty($context['drafts'])) { |
|
| 1292 | + echo ' |
|
| 1238 | 1293 | var oSwapDraftOptions = new smc_Toggle({ |
| 1239 | 1294 | bToggleEnabled: true, |
| 1240 | 1295 | bCurrentlyCollapsed: true, |
@@ -1256,13 +1311,14 @@ discard block |
||
| 1256 | 1311 | } |
| 1257 | 1312 | ] |
| 1258 | 1313 | });'; |
| 1314 | + } |
|
| 1259 | 1315 | |
| 1260 | 1316 | echo ' |
| 1261 | 1317 | </script>'; |
| 1262 | 1318 | |
| 1263 | 1319 | // Show the message you're replying to. |
| 1264 | - if ($context['reply']) |
|
| 1265 | - echo ' |
|
| 1320 | + if ($context['reply']) { |
|
| 1321 | + echo ' |
|
| 1266 | 1322 | <br> |
| 1267 | 1323 | <br> |
| 1268 | 1324 | <div class="cat_bar"> |
@@ -1276,6 +1332,7 @@ discard block |
||
| 1276 | 1332 | <hr> |
| 1277 | 1333 | ', $context['quoted_message']['body'], ' |
| 1278 | 1334 | </div><br class="clear">'; |
| 1335 | + } |
|
| 1279 | 1336 | |
| 1280 | 1337 | echo ' |
| 1281 | 1338 | <script> |
@@ -1286,22 +1343,24 @@ discard block |
||
| 1286 | 1343 | sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\', |
| 1287 | 1344 | sToControlId: \'to_control\', |
| 1288 | 1345 | aToRecipients: ['; |
| 1289 | - foreach ($context['recipients']['to'] as $i => $member) |
|
| 1290 | - echo ' |
|
| 1346 | + foreach ($context['recipients']['to'] as $i => $member) { |
|
| 1347 | + echo ' |
|
| 1291 | 1348 | { |
| 1292 | 1349 | sItemId: ', JavaScriptEscape($member['id']), ', |
| 1293 | 1350 | sItemName: ', JavaScriptEscape($member['name']), ' |
| 1294 | 1351 | }', $i == count($context['recipients']['to']) - 1 ? '' : ','; |
| 1352 | + } |
|
| 1295 | 1353 | |
| 1296 | 1354 | echo ' |
| 1297 | 1355 | ], |
| 1298 | 1356 | aBccRecipients: ['; |
| 1299 | - foreach ($context['recipients']['bcc'] as $i => $member) |
|
| 1300 | - echo ' |
|
| 1357 | + foreach ($context['recipients']['bcc'] as $i => $member) { |
|
| 1358 | + echo ' |
|
| 1301 | 1359 | { |
| 1302 | 1360 | sItemId: ', JavaScriptEscape($member['id']), ', |
| 1303 | 1361 | sItemName: ', JavaScriptEscape($member['name']), ' |
| 1304 | 1362 | }', $i == count($context['recipients']['bcc']) - 1 ? '' : ','; |
| 1363 | + } |
|
| 1305 | 1364 | |
| 1306 | 1365 | echo ' |
| 1307 | 1366 | ], |
@@ -1388,26 +1447,28 @@ discard block |
||
| 1388 | 1447 | </th> |
| 1389 | 1448 | <th class="centertext table_icon">'; |
| 1390 | 1449 | |
| 1391 | - if (count($context['labels']) > 2) |
|
| 1392 | - echo ' |
|
| 1450 | + if (count($context['labels']) > 2) { |
|
| 1451 | + echo ' |
|
| 1393 | 1452 | <input type="checkbox" onclick="invertAll(this, this.form);">'; |
| 1453 | + } |
|
| 1394 | 1454 | |
| 1395 | 1455 | echo ' |
| 1396 | 1456 | </th> |
| 1397 | 1457 | </tr> |
| 1398 | 1458 | </thead> |
| 1399 | 1459 | <tbody>'; |
| 1400 | - if (count($context['labels']) < 2) |
|
| 1401 | - echo ' |
|
| 1460 | + if (count($context['labels']) < 2) { |
|
| 1461 | + echo ' |
|
| 1402 | 1462 | <tr class="windowbg"> |
| 1403 | 1463 | <td colspan="2">', $txt['pm_labels_no_exist'], '</td> |
| 1404 | 1464 | </tr>'; |
| 1405 | - else |
|
| 1465 | + } else |
|
| 1406 | 1466 | { |
| 1407 | 1467 | foreach ($context['labels'] as $label) |
| 1408 | 1468 | { |
| 1409 | - if ($label['id'] == -1) |
|
| 1410 | - continue; |
|
| 1469 | + if ($label['id'] == -1) { |
|
| 1470 | + continue; |
|
| 1471 | + } |
|
| 1411 | 1472 | |
| 1412 | 1473 | echo ' |
| 1413 | 1474 | <tr class="windowbg"> |
@@ -1422,12 +1483,13 @@ discard block |
||
| 1422 | 1483 | </tbody> |
| 1423 | 1484 | </table>'; |
| 1424 | 1485 | |
| 1425 | - if (!count($context['labels']) < 2) |
|
| 1426 | - echo ' |
|
| 1486 | + if (!count($context['labels']) < 2) { |
|
| 1487 | + echo ' |
|
| 1427 | 1488 | <div class="padding"> |
| 1428 | 1489 | <input type="submit" name="save" value="', $txt['save'], '" class="button"> |
| 1429 | 1490 | <input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'] ,'" class="button you_sure"> |
| 1430 | 1491 | </div>'; |
| 1492 | + } |
|
| 1431 | 1493 | |
| 1432 | 1494 | echo ' |
| 1433 | 1495 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -1482,9 +1544,10 @@ discard block |
||
| 1482 | 1544 | <dd> |
| 1483 | 1545 | <select name="id_admin"> |
| 1484 | 1546 | <option value="0">', $txt['pm_report_all_admins'], '</option>'; |
| 1485 | - foreach ($context['admins'] as $id => $name) |
|
| 1486 | - echo ' |
|
| 1547 | + foreach ($context['admins'] as $id => $name) { |
|
| 1548 | + echo ' |
|
| 1487 | 1549 | <option value="', $id, '">', $name, '</option>'; |
| 1550 | + } |
|
| 1488 | 1551 | echo ' |
| 1489 | 1552 | </select> |
| 1490 | 1553 | </dd>'; |
@@ -1546,9 +1609,10 @@ discard block |
||
| 1546 | 1609 | </th> |
| 1547 | 1610 | <th class="centertext table_icon">'; |
| 1548 | 1611 | |
| 1549 | - if (!empty($context['rules'])) |
|
| 1550 | - echo ' |
|
| 1612 | + if (!empty($context['rules'])) { |
|
| 1613 | + echo ' |
|
| 1551 | 1614 | <input type="checkbox" onclick="invertAll(this, this.form);">'; |
| 1615 | + } |
|
| 1552 | 1616 | |
| 1553 | 1617 | echo ' |
| 1554 | 1618 | </th> |
@@ -1556,13 +1620,14 @@ discard block |
||
| 1556 | 1620 | </thead> |
| 1557 | 1621 | <tbody>'; |
| 1558 | 1622 | |
| 1559 | - if (empty($context['rules'])) |
|
| 1560 | - echo ' |
|
| 1623 | + if (empty($context['rules'])) { |
|
| 1624 | + echo ' |
|
| 1561 | 1625 | <tr class="windowbg"> |
| 1562 | 1626 | <td colspan="2"> |
| 1563 | 1627 | ', $txt['pm_rules_none'], ' |
| 1564 | 1628 | </td> |
| 1565 | 1629 | </tr>'; |
| 1630 | + } |
|
| 1566 | 1631 | |
| 1567 | 1632 | foreach ($context['rules'] as $rule) |
| 1568 | 1633 | { |
@@ -1583,14 +1648,16 @@ discard block |
||
| 1583 | 1648 | <div class="righttext"> |
| 1584 | 1649 | <a class="button" href="', $scripturl, '?action=pm;sa=manrules;add;rid=0">', $txt['pm_add_rule'], '</a>'; |
| 1585 | 1650 | |
| 1586 | - if (!empty($context['rules'])) |
|
| 1587 | - echo ' |
|
| 1651 | + if (!empty($context['rules'])) { |
|
| 1652 | + echo ' |
|
| 1588 | 1653 | [<a href="', $scripturl, '?action=pm;sa=manrules;apply;', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['pm_js_apply_rules_confirm'], '\');">', $txt['pm_apply_rules'], '</a>]'; |
| 1654 | + } |
|
| 1589 | 1655 | |
| 1590 | - if (!empty($context['rules'])) |
|
| 1591 | - echo ' |
|
| 1656 | + if (!empty($context['rules'])) { |
|
| 1657 | + echo ' |
|
| 1592 | 1658 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 1593 | 1659 | <input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'] ,'" class="button smalltext you_sure">'; |
| 1660 | + } |
|
| 1594 | 1661 | |
| 1595 | 1662 | echo ' |
| 1596 | 1663 | </div> |
@@ -1612,14 +1679,16 @@ discard block |
||
| 1612 | 1679 | var groups = new Array() |
| 1613 | 1680 | var labels = new Array()'; |
| 1614 | 1681 | |
| 1615 | - foreach ($context['groups'] as $id => $title) |
|
| 1616 | - echo ' |
|
| 1682 | + foreach ($context['groups'] as $id => $title) { |
|
| 1683 | + echo ' |
|
| 1617 | 1684 | groups[', $id, '] = "', addslashes($title), '";'; |
| 1685 | + } |
|
| 1618 | 1686 | |
| 1619 | - foreach ($context['labels'] as $label) |
|
| 1620 | - if ($label['id'] != -1) |
|
| 1687 | + foreach ($context['labels'] as $label) { |
|
| 1688 | + if ($label['id'] != -1) |
|
| 1621 | 1689 | echo ' |
| 1622 | 1690 | labels[', ($label['id']), '] = "', addslashes($label['name']), '";'; |
| 1691 | + } |
|
| 1623 | 1692 | |
| 1624 | 1693 | echo ' |
| 1625 | 1694 | function addCriteriaOption() |
@@ -1634,8 +1703,9 @@ discard block |
||
| 1634 | 1703 | |
| 1635 | 1704 | setOuterHTML(document.getElementById("criteriaAddHere"), \'<br><select name="ruletype[\' + criteriaNum + \']" id="ruletype\' + criteriaNum + \'" onchange="updateRuleDef(\' + criteriaNum + \'); rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_criteria_pick']), ':<\' + \'/option><option value="mid">', addslashes($txt['pm_rule_mid']), '<\' + \'/option><option value="gid">', addslashes($txt['pm_rule_gid']), '<\' + \'/option><option value="sub">', addslashes($txt['pm_rule_sub']), '<\' + \'/option><option value="msg">', addslashes($txt['pm_rule_msg']), '<\' + \'/option><option value="bud">', addslashes($txt['pm_rule_bud']), '<\' + \'/option><\' + \'/select> <span id="defdiv\' + criteriaNum + \'" style="display: none;"><input type="text" name="ruledef[\' + criteriaNum + \']" id="ruledef\' + criteriaNum + \'" onkeyup="rebuildRuleDesc();" value=""><\' + \'/span><span id="defseldiv\' + criteriaNum + \'" style="display: none;"><select name="ruledefgroup[\' + criteriaNum + \']" id="ruledefgroup\' + criteriaNum + \'" onchange="rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_sel_group']), '<\' + \'/option>'; |
| 1636 | 1705 | |
| 1637 | - foreach ($context['groups'] as $id => $group) |
|
| 1638 | - echo '<option value="', $id, '">', strtr($group, array("'" => "\'")), '<\' + \'/option>'; |
|
| 1706 | + foreach ($context['groups'] as $id => $group) { |
|
| 1707 | + echo '<option value="', $id, '">', strtr($group, array("'" => "\'")), '<\' + \'/option>'; |
|
| 1708 | + } |
|
| 1639 | 1709 | |
| 1640 | 1710 | echo '<\' + \'/select><\' + \'/span><span id="criteriaAddHere"><\' + \'/span>\'); |
| 1641 | 1711 | } |
@@ -1652,9 +1722,10 @@ discard block |
||
| 1652 | 1722 | |
| 1653 | 1723 | setOuterHTML(document.getElementById("actionAddHere"), \'<br><select name="acttype[\' + actionNum + \']" id="acttype\' + actionNum + \'" onchange="updateActionDef(\' + actionNum + \'); rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_sel_action']), ':<\' + \'/option><option value="lab">', addslashes($txt['pm_rule_label']), '<\' + \'/option><option value="del">', addslashes($txt['pm_rule_delete']), '<\' + \'/option><\' + \'/select> <span id="labdiv\' + actionNum + \'" style="display: none;"><select name="labdef[\' + actionNum + \']" id="labdef\' + actionNum + \'" onchange="rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_sel_label']), '<\' + \'/option>'; |
| 1654 | 1724 | |
| 1655 | - foreach ($context['labels'] as $label) |
|
| 1656 | - if ($label['id'] != -1) |
|
| 1725 | + foreach ($context['labels'] as $label) { |
|
| 1726 | + if ($label['id'] != -1) |
|
| 1657 | 1727 | echo '<option value="', ($label['id']), '">', addslashes($label['name']), '<\' + \'/option>'; |
| 1728 | + } |
|
| 1658 | 1729 | |
| 1659 | 1730 | echo '<\' + \'/select><\' + \'/span><span id="actionAddHere"><\' + \'/span>\'); |
| 1660 | 1731 | } |
@@ -1768,18 +1839,20 @@ discard block |
||
| 1768 | 1839 | $isFirst = true; |
| 1769 | 1840 | foreach ($context['rule']['criteria'] as $k => $criteria) |
| 1770 | 1841 | { |
| 1771 | - if (!$isFirst && $criteria['t'] == '') |
|
| 1772 | - echo '<div id="removeonjs1">'; |
|
| 1773 | - elseif (!$isFirst) |
|
| 1774 | - echo '<br>'; |
|
| 1842 | + if (!$isFirst && $criteria['t'] == '') { |
|
| 1843 | + echo '<div id="removeonjs1">'; |
|
| 1844 | + } elseif (!$isFirst) { |
|
| 1845 | + echo '<br>'; |
|
| 1846 | + } |
|
| 1775 | 1847 | |
| 1776 | 1848 | echo ' |
| 1777 | 1849 | <select name="ruletype[', $k, ']" id="ruletype', $k, '" onchange="updateRuleDef(', $k, '); rebuildRuleDesc();"> |
| 1778 | 1850 | <option value="">', $txt['pm_rule_criteria_pick'], ':</option>'; |
| 1779 | 1851 | |
| 1780 | - foreach (array('mid', 'gid', 'sub', 'msg', 'bud') as $cr) |
|
| 1781 | - echo ' |
|
| 1852 | + foreach (array('mid', 'gid', 'sub', 'msg', 'bud') as $cr) { |
|
| 1853 | + echo ' |
|
| 1782 | 1854 | <option value="', $cr, '"', $criteria['t'] == $cr ? ' selected' : '', '>', $txt['pm_rule_' . $cr], '</option>'; |
| 1855 | + } |
|
| 1783 | 1856 | |
| 1784 | 1857 | echo ' |
| 1785 | 1858 | </select> |
@@ -1790,18 +1863,20 @@ discard block |
||
| 1790 | 1863 | <select name="ruledefgroup[', $k, ']" id="ruledefgroup', $k, '" onchange="rebuildRuleDesc();"> |
| 1791 | 1864 | <option value="">', $txt['pm_rule_sel_group'], '</option>'; |
| 1792 | 1865 | |
| 1793 | - foreach ($context['groups'] as $id => $group) |
|
| 1794 | - echo ' |
|
| 1866 | + foreach ($context['groups'] as $id => $group) { |
|
| 1867 | + echo ' |
|
| 1795 | 1868 | <option value="', $id, '"', $criteria['t'] == 'gid' && $criteria['v'] == $id ? ' selected' : '', '>', $group, '</option>'; |
| 1869 | + } |
|
| 1796 | 1870 | echo ' |
| 1797 | 1871 | </select> |
| 1798 | 1872 | </span>'; |
| 1799 | 1873 | |
| 1800 | 1874 | // If this is the dummy we add a means to hide for non js users. |
| 1801 | - if ($isFirst) |
|
| 1802 | - $isFirst = false; |
|
| 1803 | - elseif ($criteria['t'] == '') |
|
| 1804 | - echo '</div>'; |
|
| 1875 | + if ($isFirst) { |
|
| 1876 | + $isFirst = false; |
|
| 1877 | + } elseif ($criteria['t'] == '') { |
|
| 1878 | + echo '</div>'; |
|
| 1879 | + } |
|
| 1805 | 1880 | } |
| 1806 | 1881 | |
| 1807 | 1882 | echo ' |
@@ -1824,10 +1899,11 @@ discard block |
||
| 1824 | 1899 | $isFirst = true; |
| 1825 | 1900 | foreach ($context['rule']['actions'] as $k => $action) |
| 1826 | 1901 | { |
| 1827 | - if (!$isFirst && $action['t'] == '') |
|
| 1828 | - echo '<div id="removeonjs2">'; |
|
| 1829 | - elseif (!$isFirst) |
|
| 1830 | - echo '<br>'; |
|
| 1902 | + if (!$isFirst && $action['t'] == '') { |
|
| 1903 | + echo '<div id="removeonjs2">'; |
|
| 1904 | + } elseif (!$isFirst) { |
|
| 1905 | + echo '<br>'; |
|
| 1906 | + } |
|
| 1831 | 1907 | |
| 1832 | 1908 | echo ' |
| 1833 | 1909 | <select name="acttype[', $k, ']" id="acttype', $k, '" onchange="updateActionDef(', $k, '); rebuildRuleDesc();"> |
@@ -1838,20 +1914,22 @@ discard block |
||
| 1838 | 1914 | <span id="labdiv', $k, '"> |
| 1839 | 1915 | <select name="labdef[', $k, ']" id="labdef', $k, '" onchange="rebuildRuleDesc();"> |
| 1840 | 1916 | <option value="">', $txt['pm_rule_sel_label'], '</option>'; |
| 1841 | - foreach ($context['labels'] as $label) |
|
| 1842 | - if ($label['id'] != -1) |
|
| 1917 | + foreach ($context['labels'] as $label) { |
|
| 1918 | + if ($label['id'] != -1) |
|
| 1843 | 1919 | echo ' |
| 1844 | 1920 | <option value="', ($label['id']), '"', $action['t'] == 'lab' && $action['v'] == $label['id'] ? ' selected' : '', '>', $label['name'], '</option>'; |
| 1921 | + } |
|
| 1845 | 1922 | |
| 1846 | 1923 | echo ' |
| 1847 | 1924 | </select> |
| 1848 | 1925 | </span>'; |
| 1849 | 1926 | |
| 1850 | - if ($isFirst) |
|
| 1851 | - $isFirst = false; |
|
| 1852 | - elseif ($action['t'] == '') |
|
| 1853 | - echo ' |
|
| 1927 | + if ($isFirst) { |
|
| 1928 | + $isFirst = false; |
|
| 1929 | + } elseif ($action['t'] == '') { |
|
| 1930 | + echo ' |
|
| 1854 | 1931 | </div>'; |
| 1932 | + } |
|
| 1855 | 1933 | } |
| 1856 | 1934 | |
| 1857 | 1935 | echo ' |
@@ -1875,22 +1953,25 @@ discard block |
||
| 1875 | 1953 | echo ' |
| 1876 | 1954 | <script>'; |
| 1877 | 1955 | |
| 1878 | - foreach ($context['rule']['criteria'] as $k => $c) |
|
| 1879 | - echo ' |
|
| 1956 | + foreach ($context['rule']['criteria'] as $k => $c) { |
|
| 1957 | + echo ' |
|
| 1880 | 1958 | updateRuleDef(', $k, ');'; |
| 1959 | + } |
|
| 1881 | 1960 | |
| 1882 | - foreach ($context['rule']['actions'] as $k => $c) |
|
| 1883 | - echo ' |
|
| 1961 | + foreach ($context['rule']['actions'] as $k => $c) { |
|
| 1962 | + echo ' |
|
| 1884 | 1963 | updateActionDef(', $k, ');'; |
| 1964 | + } |
|
| 1885 | 1965 | |
| 1886 | 1966 | echo ' |
| 1887 | 1967 | rebuildRuleDesc();'; |
| 1888 | 1968 | |
| 1889 | 1969 | // If this isn't a new rule and we have JS enabled remove the JS compatibility stuff. |
| 1890 | - if ($context['rid']) |
|
| 1891 | - echo ' |
|
| 1970 | + if ($context['rid']) { |
|
| 1971 | + echo ' |
|
| 1892 | 1972 | document.getElementById("removeonjs1").style.display = "none"; |
| 1893 | 1973 | document.getElementById("removeonjs2").style.display = "none";'; |
| 1974 | + } |
|
| 1894 | 1975 | |
| 1895 | 1976 | echo ' |
| 1896 | 1977 | document.getElementById("addonjs1").style.display = ""; |
@@ -1918,12 +1999,12 @@ discard block |
||
| 1918 | 1999 | </div>'; |
| 1919 | 2000 | |
| 1920 | 2001 | // No drafts? Just show an informative message. |
| 1921 | - if (empty($context['drafts'])) |
|
| 1922 | - echo ' |
|
| 2002 | + if (empty($context['drafts'])) { |
|
| 2003 | + echo ' |
|
| 1923 | 2004 | <div class="windowbg2 centertext"> |
| 1924 | 2005 | ', $txt['draft_none'], ' |
| 1925 | 2006 | </div>'; |
| 1926 | - else |
|
| 2007 | + } else |
|
| 1927 | 2008 | { |
| 1928 | 2009 | // For every draft to be displayed, give it its own div, and show the important details of the draft. |
| 1929 | 2010 | foreach ($context['drafts'] as $draft) |
@@ -416,8 +416,8 @@ discard block |
||
| 416 | 416 | </div> |
| 417 | 417 | <div class="progressBar" role="progressBar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span></span></div> |
| 418 | 418 | <div class="attach-ui"> |
| 419 | - <a data-dz-remove class="button cancel">', $txt['modify_cancel'] ,'</a> |
|
| 420 | - <a class="button upload">', $txt['upload'] ,'</a> |
|
| 419 | + <a data-dz-remove class="button cancel">', $txt['modify_cancel'], '</a> |
|
| 420 | + <a class="button upload">', $txt['upload'], '</a> |
|
| 421 | 421 | </div> |
| 422 | 422 | </div> |
| 423 | 423 | </div> |
@@ -435,10 +435,10 @@ discard block |
||
| 435 | 435 | </dt> |
| 436 | 436 | <dd class="smalltext fallback"> |
| 437 | 437 | <div id="attachUpload" class="descbox"> |
| 438 | - <h5>', $txt['attach_drop_zone'] ,'</h5> |
|
| 439 | - <a class="button" id="attach-cancelAll">', $txt['attached_cancelAll'] ,'</a> |
|
| 440 | - <a class="button" id="attach-uploadAll">', $txt['attached_uploadAll'] ,'</a> |
|
| 441 | - <a class="button fileinput-button">', $txt['attach_add'] ,'</a> |
|
| 438 | + <h5>', $txt['attach_drop_zone'], '</h5> |
|
| 439 | + <a class="button" id="attach-cancelAll">', $txt['attached_cancelAll'], '</a> |
|
| 440 | + <a class="button" id="attach-uploadAll">', $txt['attached_uploadAll'], '</a> |
|
| 441 | + <a class="button fileinput-button">', $txt['attach_add'], '</a> |
|
| 442 | 442 | <div id="total-progress" class="progressBar" role="progressBar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span></span></div> |
| 443 | 443 | <div class="fallback"> |
| 444 | 444 | <input type="file" multiple="multiple" name="attachment[]" id="attachment1" class="fallback"> (<a href="javascript:void(0);" onclick="cleanFileInput(\'attachment1\');">', $txt['clean_attach'], '</a>) |
@@ -545,7 +545,7 @@ discard block |
||
| 545 | 545 | // Option to delete an event if user is editing one. |
| 546 | 546 | if ($context['make_event'] && !$context['event']['new']) |
| 547 | 547 | echo ' |
| 548 | - <input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'] ,'" class="button you_sure">'; |
|
| 548 | + <input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'], '" class="button you_sure">'; |
|
| 549 | 549 | |
| 550 | 550 | echo ' |
| 551 | 551 | </span> |
@@ -799,7 +799,7 @@ discard block |
||
| 799 | 799 | });'; |
| 800 | 800 | |
| 801 | 801 | echo ' |
| 802 | - var oEditorID = "', $context['post_box_name'] ,'"; |
|
| 802 | + var oEditorID = "', $context['post_box_name'], '"; |
|
| 803 | 803 | var oEditorObject = oEditorHandle_', $context['post_box_name'], '; |
| 804 | 804 | </script>'; |
| 805 | 805 | |
@@ -831,7 +831,7 @@ discard block |
||
| 831 | 831 | { |
| 832 | 832 | echo ' |
| 833 | 833 | <ul class="quickbuttons" id="msg_', $post['id'], '_quote"> |
| 834 | - <li style="display:none;" id="quoteSelected_', $post['id'], '" data-msgid="', $post['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'] ,'</a></li> |
|
| 834 | + <li style="display:none;" id="quoteSelected_', $post['id'], '" data-msgid="', $post['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'], '</a></li> |
|
| 835 | 835 | <li id="post_modify"><a href="#postmodify" onclick="return insertQuoteFast(', $post['id'], ');"><span class="generic_icons quote"></span>', $txt['quote'], '</a></li> |
| 836 | 836 | </ul>'; |
| 837 | 837 | } |
@@ -918,7 +918,7 @@ discard block |
||
| 918 | 918 | <head> |
| 919 | 919 | <meta charset="', $context['character_set'], '"> |
| 920 | 920 | <title>', $txt['spell_check'], '</title> |
| 921 | - <link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'] ,'"> |
|
| 921 | + <link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'], '"> |
|
| 922 | 922 | <style> |
| 923 | 923 | body, td |
| 924 | 924 | { |
@@ -951,8 +951,8 @@ discard block |
||
| 951 | 951 | var spell_formname = window.opener.spell_formname; |
| 952 | 952 | var spell_fieldname = window.opener.spell_fieldname; |
| 953 | 953 | </script> |
| 954 | - <script src="', $settings['default_theme_url'], '/scripts/spellcheck.js', $modSettings['browser_cache'] ,'"></script> |
|
| 955 | - <script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script> |
|
| 954 | + <script src="', $settings['default_theme_url'], '/scripts/spellcheck.js', $modSettings['browser_cache'], '"></script> |
|
| 955 | + <script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script> |
|
| 956 | 956 | <script> |
| 957 | 957 | ', $context['spell_js'], ' |
| 958 | 958 | </script> |
@@ -994,7 +994,7 @@ discard block |
||
| 994 | 994 | <head> |
| 995 | 995 | <meta charset="', $context['character_set'], '"> |
| 996 | 996 | <title>', $txt['retrieving_quote'], '</title> |
| 997 | - <script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script> |
|
| 997 | + <script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script> |
|
| 998 | 998 | </head> |
| 999 | 999 | <body> |
| 1000 | 1000 | ', $txt['retrieving_quote'], ' |
@@ -22,22 +22,24 @@ discard block |
||
| 22 | 22 | <script>'; |
| 23 | 23 | |
| 24 | 24 | // When using Go Back due to fatal_error, allow the form to be re-submitted with changes. |
| 25 | - if (isBrowser('is_firefox')) |
|
| 26 | - echo ' |
|
| 25 | + if (isBrowser('is_firefox')) { |
|
| 26 | + echo ' |
|
| 27 | 27 | window.addEventListener("pageshow", reActivate, false);'; |
| 28 | + } |
|
| 28 | 29 | |
| 29 | 30 | // Start with message icons - and any missing from this theme. |
| 30 | 31 | echo ' |
| 31 | 32 | var icon_urls = {'; |
| 32 | - foreach ($context['icons'] as $icon) |
|
| 33 | - echo ' |
|
| 33 | + foreach ($context['icons'] as $icon) { |
|
| 34 | + echo ' |
|
| 34 | 35 | \'', $icon['value'], '\': \'', $icon['url'], '\'', $icon['is_last'] ? '' : ','; |
| 36 | + } |
|
| 35 | 37 | echo ' |
| 36 | 38 | };'; |
| 37 | 39 | |
| 38 | 40 | // If this is a poll - use some javascript to ensure the user doesn't create a poll with illegal option combinations. |
| 39 | - if ($context['make_poll']) |
|
| 40 | - echo ' |
|
| 41 | + if ($context['make_poll']) { |
|
| 42 | + echo ' |
|
| 41 | 43 | var pollOptionNum = 0, pollTabIndex; |
| 42 | 44 | var pollOptionId = ', $context['last_choice_id'], '; |
| 43 | 45 | function addPollOption() |
@@ -56,11 +58,13 @@ discard block |
||
| 56 | 58 | |
| 57 | 59 | setOuterHTML(document.getElementById(\'pollMoreOptions\'), ', JavaScriptEscape('<dt><label for="options-'), ' + pollOptionId + ', JavaScriptEscape('">' . $txt['option'] . ' '), ' + pollOptionNum + ', JavaScriptEscape('</label>:</dt><dd><input type="text" name="options['), ' + pollOptionId + ', JavaScriptEscape(']" id="options-'), ' + pollOptionId + ', JavaScriptEscape('" value="" size="80" maxlength="255" tabindex="'), ' + pollTabIndex + ', JavaScriptEscape('"></dd><p id="pollMoreOptions"></p>'), '); |
| 58 | 60 | }'; |
| 61 | + } |
|
| 59 | 62 | |
| 60 | 63 | // If we are making a calendar event we want to ensure we show the current days in a month etc... this is done here. |
| 61 | - if ($context['make_event']) |
|
| 62 | - echo ' |
|
| 64 | + if ($context['make_event']) { |
|
| 65 | + echo ' |
|
| 63 | 66 | var monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];'; |
| 67 | + } |
|
| 64 | 68 | |
| 65 | 69 | // End of the javascript, start the form and display the link tree. |
| 66 | 70 | echo ' |
@@ -80,9 +84,10 @@ discard block |
||
| 80 | 84 | </div> |
| 81 | 85 | </div><br>'; |
| 82 | 86 | |
| 83 | - if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board']))) |
|
| 84 | - echo ' |
|
| 87 | + if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board']))) { |
|
| 88 | + echo ' |
|
| 85 | 89 | <input type="hidden" name="eventid" value="', $context['event']['id'], '">'; |
| 90 | + } |
|
| 86 | 91 | |
| 87 | 92 | // Start the main table. |
| 88 | 93 | echo ' |
@@ -117,18 +122,20 @@ discard block |
||
| 117 | 122 | } |
| 118 | 123 | |
| 119 | 124 | // If it's locked, show a message to warn the replier. |
| 120 | - if (!empty($context['locked'])) |
|
| 121 | - echo ' |
|
| 125 | + if (!empty($context['locked'])) { |
|
| 126 | + echo ' |
|
| 122 | 127 | <div class="errorbox"> |
| 123 | 128 | ', $txt['topic_locked_no_reply'], ' |
| 124 | 129 | </div>'; |
| 130 | + } |
|
| 125 | 131 | |
| 126 | - if (!empty($modSettings['drafts_post_enabled'])) |
|
| 127 | - echo ' |
|
| 132 | + if (!empty($modSettings['drafts_post_enabled'])) { |
|
| 133 | + echo ' |
|
| 128 | 134 | <div id="draft_section" class="infobox"', isset($context['draft_saved']) ? '' : ' style="display: none;"', '>', |
| 129 | 135 | sprintf($txt['draft_saved'], $scripturl . '?action=profile;u=' . $context['user']['id'] . ';area=showdrafts'), ' |
| 130 | 136 | ', (!empty($modSettings['drafts_keep_days']) ? ' <strong>' . sprintf($txt['draft_save_warning'], $modSettings['drafts_keep_days']) . '</strong>' : ''), ' |
| 131 | 137 | </div>'; |
| 138 | + } |
|
| 132 | 139 | |
| 133 | 140 | // The post header... important stuff |
| 134 | 141 | echo ' |
@@ -180,9 +187,10 @@ discard block |
||
| 180 | 187 | { |
| 181 | 188 | echo ' |
| 182 | 189 | <optgroup label="', $category['name'], '">'; |
| 183 | - foreach ($category['boards'] as $board) |
|
| 184 | - echo ' |
|
| 190 | + foreach ($category['boards'] as $board) { |
|
| 191 | + echo ' |
|
| 185 | 192 | <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=>' : '', ' ', $board['name'], ' </option>'; |
| 193 | + } |
|
| 186 | 194 | echo ' |
| 187 | 195 | </optgroup>'; |
| 188 | 196 | } |
@@ -218,9 +226,10 @@ discard block |
||
| 218 | 226 | <span class="label">', $txt['calendar_timezone'], '</span> |
| 219 | 227 | <select name="tz" id="tz"', !empty($context['event']['allday']) ? ' disabled' : '', '>'; |
| 220 | 228 | |
| 221 | - foreach ($context['all_timezones'] as $tz => $tzname) |
|
| 222 | - echo ' |
|
| 229 | + foreach ($context['all_timezones'] as $tz => $tzname) { |
|
| 230 | + echo ' |
|
| 223 | 231 | <option value="', $tz, '"', $tz == $context['event']['tz'] ? ' selected' : '', '>', $tzname, '</option>'; |
| 232 | + } |
|
| 224 | 233 | |
| 225 | 234 | echo ' |
| 226 | 235 | </select> |
@@ -286,14 +295,15 @@ discard block |
||
| 286 | 295 | <input type="checkbox" id="poll_change_vote" name="poll_change_vote"', !empty($context['poll']['change_vote']) ? ' checked' : '', '> |
| 287 | 296 | </dd>'; |
| 288 | 297 | |
| 289 | - if ($context['poll_options']['guest_vote_enabled']) |
|
| 290 | - echo ' |
|
| 298 | + if ($context['poll_options']['guest_vote_enabled']) { |
|
| 299 | + echo ' |
|
| 291 | 300 | <dt> |
| 292 | 301 | <label for="poll_guest_vote">', $txt['poll_guest_vote'], ':</label> |
| 293 | 302 | </dt> |
| 294 | 303 | <dd> |
| 295 | 304 | <input type="checkbox" id="poll_guest_vote" name="poll_guest_vote"', !empty($context['poll_options']['guest_vote']) ? ' checked' : '', '> |
| 296 | 305 | </dd>'; |
| 306 | + } |
|
| 297 | 307 | |
| 298 | 308 | echo ' |
| 299 | 309 | <dt> |
@@ -314,8 +324,8 @@ discard block |
||
| 314 | 324 | ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'); |
| 315 | 325 | |
| 316 | 326 | // If we're editing and displaying edit details, show a box where they can say why |
| 317 | - if (isset($context['editing']) && $modSettings['show_modify']) |
|
| 318 | - echo ' |
|
| 327 | + if (isset($context['editing']) && $modSettings['show_modify']) { |
|
| 328 | + echo ' |
|
| 319 | 329 | <dl> |
| 320 | 330 | <dt class="clear"> |
| 321 | 331 | <span id="caption_edit_reason">', $txt['reason_for_edit'], ':</span> |
@@ -324,20 +334,23 @@ discard block |
||
| 324 | 334 | <input type="text" name="modify_reason"', isset($context['last_modified_reason']) ? ' value="' . $context['last_modified_reason'] . '"' : '', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="80"> |
| 325 | 335 | </dd> |
| 326 | 336 | </dl>'; |
| 337 | + } |
|
| 327 | 338 | |
| 328 | 339 | // If this message has been edited in the past - display when it was. |
| 329 | - if (isset($context['last_modified'])) |
|
| 330 | - echo ' |
|
| 340 | + if (isset($context['last_modified'])) { |
|
| 341 | + echo ' |
|
| 331 | 342 | <div class="padding smalltext"> |
| 332 | 343 | ', $context['last_modified_text'], ' |
| 333 | 344 | </div>'; |
| 345 | + } |
|
| 334 | 346 | |
| 335 | 347 | // If the admin has enabled the hiding of the additional options - show a link and image for it. |
| 336 | - if (!empty($modSettings['additional_options_collapsable'])) |
|
| 337 | - echo ' |
|
| 348 | + if (!empty($modSettings['additional_options_collapsable'])) { |
|
| 349 | + echo ' |
|
| 338 | 350 | <div id="postAdditionalOptionsHeader"> |
| 339 | 351 | <strong><a href="#" id="postMoreExpandLink"> ', $context['can_post_attachment'] ? $txt['post_additionalopt_attach'] : $txt['post_additionalopt'], '</a></strong> |
| 340 | 352 | </div>'; |
| 353 | + } |
|
| 341 | 354 | |
| 342 | 355 | echo ' |
| 343 | 356 | <div id="postAdditionalOptions">'; |
@@ -369,19 +382,21 @@ discard block |
||
| 369 | 382 | <input type="hidden" name="attach_del[]" value="0"> |
| 370 | 383 | ', $txt['uncheck_unwatchd_attach'], ': |
| 371 | 384 | </dd>'; |
| 372 | - foreach ($context['current_attachments'] as $attachment) |
|
| 373 | - echo ' |
|
| 385 | + foreach ($context['current_attachments'] as $attachment) { |
|
| 386 | + echo ' |
|
| 374 | 387 | <dd class="smalltext"> |
| 375 | 388 | <label for="attachment_', $attachment['attachID'], '"><input type="checkbox" id="attachment_', $attachment['attachID'], '" name="attach_del[]" value="', $attachment['attachID'], '"', empty($attachment['unchecked']) ? ' checked' : '', '> ', $attachment['name'], (empty($attachment['approved']) ? ' (' . $txt['awaiting_approval'] . ')' : ''), |
| 376 | 389 | !empty($modSettings['attachmentPostLimit']) || !empty($modSettings['attachmentSizeLimit']) ? sprintf($txt['attach_kb'], comma_format(round(max($attachment['size'], 1024) / 1024), 0)) : '', '</label> |
| 377 | 390 | </dd>'; |
| 391 | + } |
|
| 378 | 392 | |
| 379 | 393 | echo ' |
| 380 | 394 | </dl>'; |
| 381 | 395 | |
| 382 | - if (!empty($context['files_in_session_warning'])) |
|
| 383 | - echo ' |
|
| 396 | + if (!empty($context['files_in_session_warning'])) { |
|
| 397 | + echo ' |
|
| 384 | 398 | <div class="smalltext">', $context['files_in_session_warning'], '</div>'; |
| 399 | + } |
|
| 385 | 400 | } |
| 386 | 401 | |
| 387 | 402 | // Is the user allowed to post any additional ones? If so give them the boxes to do it! |
@@ -445,8 +460,8 @@ discard block |
||
| 445 | 460 | ', empty($modSettings['attachmentSizeLimit']) ? '' : ('<input type="hidden" name="MAX_FILE_SIZE" value="' . $modSettings['attachmentSizeLimit'] * 1024 . '">'); |
| 446 | 461 | |
| 447 | 462 | // Show more boxes if they aren't approaching that limit. |
| 448 | - if ($context['num_allowed_attachments'] > 1) |
|
| 449 | - echo ' |
|
| 463 | + if ($context['num_allowed_attachments'] > 1) { |
|
| 464 | + echo ' |
|
| 450 | 465 | <script> |
| 451 | 466 | var allowed_attachments = ', $context['num_allowed_attachments'], '; |
| 452 | 467 | var current_attachment = 1; |
@@ -467,9 +482,10 @@ discard block |
||
| 467 | 482 | </div> |
| 468 | 483 | </div> |
| 469 | 484 | </dd>'; |
| 470 | - else |
|
| 471 | - echo ' |
|
| 485 | + } else { |
|
| 486 | + echo ' |
|
| 472 | 487 | </dd>'; |
| 488 | + } |
|
| 473 | 489 | |
| 474 | 490 | // Add any template changes for an alternative upload system here. |
| 475 | 491 | call_integration_hook('integrate_upload_template'); |
@@ -478,21 +494,25 @@ discard block |
||
| 478 | 494 | <dd class="smalltext">'; |
| 479 | 495 | |
| 480 | 496 | // Show some useful information such as allowed extensions, maximum size and amount of attachments allowed. |
| 481 | - if (!empty($modSettings['attachmentCheckExtensions'])) |
|
| 482 | - echo ' |
|
| 497 | + if (!empty($modSettings['attachmentCheckExtensions'])) { |
|
| 498 | + echo ' |
|
| 483 | 499 | ', $txt['allowed_types'], ': ', $context['allowed_extensions'], '<br>'; |
| 500 | + } |
|
| 484 | 501 | |
| 485 | - if (!empty($context['attachment_restrictions'])) |
|
| 486 | - echo ' |
|
| 502 | + if (!empty($context['attachment_restrictions'])) { |
|
| 503 | + echo ' |
|
| 487 | 504 | ', $txt['attach_restrictions'], ' ', implode(', ', $context['attachment_restrictions']), '<br>'; |
| 505 | + } |
|
| 488 | 506 | |
| 489 | - if ($context['num_allowed_attachments'] == 0) |
|
| 490 | - echo ' |
|
| 507 | + if ($context['num_allowed_attachments'] == 0) { |
|
| 508 | + echo ' |
|
| 491 | 509 | ', $txt['attach_limit_nag'], '<br>'; |
| 510 | + } |
|
| 492 | 511 | |
| 493 | - if (!$context['can_post_attachment_unapproved']) |
|
| 494 | - echo ' |
|
| 512 | + if (!$context['can_post_attachment_unapproved']) { |
|
| 513 | + echo ' |
|
| 495 | 514 | <span class="alert">', $txt['attachment_requires_approval'], '</span>', '<br>'; |
| 515 | + } |
|
| 496 | 516 | |
| 497 | 517 | echo ' |
| 498 | 518 | </dd> |
@@ -515,10 +535,11 @@ discard block |
||
| 515 | 535 | <dt><strong>', $txt['subject'], '</strong></dt> |
| 516 | 536 | <dd><strong>', $txt['draft_saved_on'], '</strong></dd>'; |
| 517 | 537 | |
| 518 | - foreach ($context['drafts'] as $draft) |
|
| 519 | - echo ' |
|
| 538 | + foreach ($context['drafts'] as $draft) { |
|
| 539 | + echo ' |
|
| 520 | 540 | <dt>', $draft['link'], '</dt> |
| 521 | 541 | <dd>', $draft['poster_time'], '</dd>'; |
| 542 | + } |
|
| 522 | 543 | echo ' |
| 523 | 544 | </dl> |
| 524 | 545 | </div>'; |
@@ -543,9 +564,10 @@ discard block |
||
| 543 | 564 | ', template_control_richedit_buttons($context['post_box_name']); |
| 544 | 565 | |
| 545 | 566 | // Option to delete an event if user is editing one. |
| 546 | - if ($context['make_event'] && !$context['event']['new']) |
|
| 547 | - echo ' |
|
| 567 | + if ($context['make_event'] && !$context['event']['new']) { |
|
| 568 | + echo ' |
|
| 548 | 569 | <input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'] ,'" class="button you_sure">'; |
| 570 | + } |
|
| 549 | 571 | |
| 550 | 572 | echo ' |
| 551 | 573 | </span> |
@@ -554,9 +576,10 @@ discard block |
||
| 554 | 576 | <br class="clear">'; |
| 555 | 577 | |
| 556 | 578 | // Assuming this isn't a new topic pass across the last message id. |
| 557 | - if (isset($context['topic_last_message'])) |
|
| 558 | - echo ' |
|
| 579 | + if (isset($context['topic_last_message'])) { |
|
| 580 | + echo ' |
|
| 559 | 581 | <input type="hidden" name="last_msg" value="', $context['topic_last_message'], '">'; |
| 582 | + } |
|
| 560 | 583 | |
| 561 | 584 | echo ' |
| 562 | 585 | <input type="hidden" name="additional_options" id="additional_options" value="', $context['show_additional_options'] ? '1' : '0', '"> |
@@ -698,9 +721,10 @@ discard block |
||
| 698 | 721 | |
| 699 | 722 | newPostsHTML += \'<div class="windowbg\' + (++reply_counter % 2 == 0 ? \'2\' : \'\') + \'"><div id="msg\' + newPosts[i].getAttribute("id") + \'"><div class="floatleft"><h5>', $txt['posted_by'], ': \' + newPosts[i].getElementsByTagName("poster")[0].firstChild.nodeValue + \'</h5><span class="smalltext">« <strong>', $txt['on'], ':</strong> \' + newPosts[i].getElementsByTagName("time")[0].firstChild.nodeValue + \' »</span> <span class="new_posts" id="image_new_\' + newPosts[i].getAttribute("id") + \'">', $txt['new'], '</span></div>\';'; |
| 700 | 723 | |
| 701 | - if ($context['can_quote']) |
|
| 702 | - echo ' |
|
| 724 | + if ($context['can_quote']) { |
|
| 725 | + echo ' |
|
| 703 | 726 | newPostsHTML += \'<ul class="quickbuttons" id="msg_\' + newPosts[i].getAttribute("id") + \'_quote"><li><a href="#postmodify" onclick="return insertQuoteFast(\\\'\' + newPosts[i].getAttribute("id") + \'\\\');" class="quote_button"><span>', $txt['quote'], '</span><\' + \'/a></li></ul>\';'; |
| 727 | + } |
|
| 704 | 728 | |
| 705 | 729 | echo ' |
| 706 | 730 | newPostsHTML += \'<br class="clear">\'; |
@@ -743,8 +767,8 @@ discard block |
||
| 743 | 767 | }'; |
| 744 | 768 | |
| 745 | 769 | // Code for showing and hiding additional options. |
| 746 | - if (!empty($modSettings['additional_options_collapsable'])) |
|
| 747 | - echo ' |
|
| 770 | + if (!empty($modSettings['additional_options_collapsable'])) { |
|
| 771 | + echo ' |
|
| 748 | 772 | var oSwapAdditionalOptions = new smc_Toggle({ |
| 749 | 773 | bToggleEnabled: true, |
| 750 | 774 | bCurrentlyCollapsed: ', $context['show_additional_options'] ? 'false' : 'true', ', |
@@ -772,10 +796,11 @@ discard block |
||
| 772 | 796 | } |
| 773 | 797 | ] |
| 774 | 798 | });'; |
| 799 | + } |
|
| 775 | 800 | |
| 776 | 801 | // Code for showing and hiding drafts |
| 777 | - if (!empty($context['drafts'])) |
|
| 778 | - echo ' |
|
| 802 | + if (!empty($context['drafts'])) { |
|
| 803 | + echo ' |
|
| 779 | 804 | var oSwapDraftOptions = new smc_Toggle({ |
| 780 | 805 | bToggleEnabled: true, |
| 781 | 806 | bCurrentlyCollapsed: true, |
@@ -797,6 +822,7 @@ discard block |
||
| 797 | 822 | } |
| 798 | 823 | ] |
| 799 | 824 | });'; |
| 825 | + } |
|
| 800 | 826 | |
| 801 | 827 | echo ' |
| 802 | 828 | var oEditorID = "', $context['post_box_name'] ,'"; |
@@ -817,8 +843,9 @@ discard block |
||
| 817 | 843 | foreach ($context['previous_posts'] as $post) |
| 818 | 844 | { |
| 819 | 845 | $ignoring = false; |
| 820 | - if (!empty($post['is_ignored'])) |
|
| 821 | - $ignored_posts[] = $ignoring = $post['id']; |
|
| 846 | + if (!empty($post['is_ignored'])) { |
|
| 847 | + $ignored_posts[] = $ignoring = $post['id']; |
|
| 848 | + } |
|
| 822 | 849 | |
| 823 | 850 | echo ' |
| 824 | 851 | <div class="windowbg"> |
@@ -1001,10 +1028,10 @@ discard block |
||
| 1001 | 1028 | <div id="temporary_posting_area" style="display: none;"></div> |
| 1002 | 1029 | <script>'; |
| 1003 | 1030 | |
| 1004 | - if ($context['close_window']) |
|
| 1005 | - echo ' |
|
| 1031 | + if ($context['close_window']) { |
|
| 1032 | + echo ' |
|
| 1006 | 1033 | window.close();'; |
| 1007 | - else |
|
| 1034 | + } else |
|
| 1008 | 1035 | { |
| 1009 | 1036 | // Lucky for us, Internet Explorer has an "innerText" feature which basically converts entities <--> text. Use it if possible ;). |
| 1010 | 1037 | echo ' |
@@ -1058,11 +1085,12 @@ discard block |
||
| 1058 | 1085 | </p> |
| 1059 | 1086 | <ul>'; |
| 1060 | 1087 | |
| 1061 | - foreach ($context['groups'] as $group) |
|
| 1062 | - echo ' |
|
| 1088 | + foreach ($context['groups'] as $group) { |
|
| 1089 | + echo ' |
|
| 1063 | 1090 | <li> |
| 1064 | 1091 | <label for="who_', $group['id'], '"><input type="checkbox" name="who[', $group['id'], ']" id="who_', $group['id'], '" value="', $group['id'], '" checked> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em> |
| 1065 | 1092 | </li>'; |
| 1093 | + } |
|
| 1066 | 1094 | |
| 1067 | 1095 | echo ' |
| 1068 | 1096 | <li> |
@@ -52,9 +52,10 @@ discard block |
||
| 52 | 52 | <legend>', $txt['membergroups_edit_select_group_type'], '</legend> |
| 53 | 53 | <label for="group_type_private"><input type="radio" name="group_type" id="group_type_private" value="0" checked onclick="swapPostGroup(0);">', $txt['membergroups_group_type_private'], '</label><br>'; |
| 54 | 54 | |
| 55 | - if ($context['allow_protected']) |
|
| 56 | - echo ' |
|
| 55 | + if ($context['allow_protected']) { |
|
| 56 | + echo ' |
|
| 57 | 57 | <label for="group_type_protected"><input type="radio" name="group_type" id="group_type_protected" value="1" onclick="swapPostGroup(0);">', $txt['membergroups_group_type_protected'], '</label><br>'; |
| 58 | + } |
|
| 58 | 59 | |
| 59 | 60 | echo ' |
| 60 | 61 | <label for="group_type_request"><input type="radio" name="group_type" id="group_type_request" value="2" onclick="swapPostGroup(0);">', $txt['membergroups_group_type_request'], '</label><br> |
@@ -64,14 +65,15 @@ discard block |
||
| 64 | 65 | </dd>'; |
| 65 | 66 | } |
| 66 | 67 | |
| 67 | - if ($context['post_group'] || $context['undefined_group']) |
|
| 68 | - echo ' |
|
| 68 | + if ($context['post_group'] || $context['undefined_group']) { |
|
| 69 | + echo ' |
|
| 69 | 70 | <dt id="min_posts_text"> |
| 70 | 71 | <strong>', $txt['membergroups_min_posts'], ':</strong> |
| 71 | 72 | </dt> |
| 72 | 73 | <dd> |
| 73 | 74 | <input type="number" name="min_posts" id="min_posts_input" size="5"> |
| 74 | 75 | </dd>'; |
| 76 | + } |
|
| 75 | 77 | if (!$context['post_group'] || !empty($modSettings['permission_enable_postgroups'])) |
| 76 | 78 | { |
| 77 | 79 | echo ' |
@@ -87,9 +89,10 @@ discard block |
||
| 87 | 89 | <select name="inheritperm" id="inheritperm_select" onclick="document.getElementById(\'perm_type_inherit\').checked = true;"> |
| 88 | 90 | <option value="-1">', $txt['membergroups_guests'], '</option> |
| 89 | 91 | <option value="0" selected>', $txt['membergroups_members'], '</option>'; |
| 90 | - foreach ($context['groups'] as $group) |
|
| 91 | - echo ' |
|
| 92 | + foreach ($context['groups'] as $group) { |
|
| 93 | + echo ' |
|
| 92 | 94 | <option value="', $group['id'], '">', $group['name'], '</option>'; |
| 95 | + } |
|
| 93 | 96 | echo ' |
| 94 | 97 | </select> |
| 95 | 98 | <br> |
@@ -98,9 +101,10 @@ discard block |
||
| 98 | 101 | <select name="copyperm" id="copyperm_select" onclick="document.getElementById(\'perm_type_copy\').checked = true;"> |
| 99 | 102 | <option value="-1">', $txt['membergroups_guests'], '</option> |
| 100 | 103 | <option value="0" selected>', $txt['membergroups_members'], '</option>'; |
| 101 | - foreach ($context['groups'] as $group) |
|
| 102 | - echo ' |
|
| 104 | + foreach ($context['groups'] as $group) { |
|
| 105 | + echo ' |
|
| 103 | 106 | <option value="', $group['id'], '">', $group['name'], '</option>'; |
| 107 | + } |
|
| 104 | 108 | echo ' |
| 105 | 109 | </select> |
| 106 | 110 | <br> |
@@ -173,8 +177,8 @@ discard block |
||
| 173 | 177 | <input type="text" name="group_name" id="group_name_input" value="', $context['group']['editable_name'], '" size="30"> |
| 174 | 178 | </dd>'; |
| 175 | 179 | |
| 176 | - if ($context['group']['id'] != 3 && $context['group']['id'] != 4) |
|
| 177 | - echo ' |
|
| 180 | + if ($context['group']['id'] != 3 && $context['group']['id'] != 4) { |
|
| 181 | + echo ' |
|
| 178 | 182 | |
| 179 | 183 | <dt id="group_desc_text"> |
| 180 | 184 | <label for="group_desc_input"><strong>', $txt['membergroups_edit_desc'], ':</strong></label> |
@@ -182,6 +186,7 @@ discard block |
||
| 182 | 186 | <dd> |
| 183 | 187 | <textarea name="group_desc" id="group_desc_input" rows="4" cols="40">', $context['group']['description'], '</textarea> |
| 184 | 188 | </dd>'; |
| 189 | + } |
|
| 185 | 190 | |
| 186 | 191 | // Group type... |
| 187 | 192 | if ($context['group']['allow_post_group']) |
@@ -195,9 +200,10 @@ discard block |
||
| 195 | 200 | <legend>', $txt['membergroups_edit_select_group_type'], '</legend> |
| 196 | 201 | <label for="group_type_private"><input type="radio" name="group_type" id="group_type_private" value="0"', !$context['group']['is_post_group'] && $context['group']['type'] == 0 ? ' checked' : '', ' onclick="swapPostGroup(0);">', $txt['membergroups_group_type_private'], '</label><br>'; |
| 197 | 202 | |
| 198 | - if ($context['group']['allow_protected']) |
|
| 199 | - echo ' |
|
| 203 | + if ($context['group']['allow_protected']) { |
|
| 204 | + echo ' |
|
| 200 | 205 | <label for="group_type_protected"><input type="radio" name="group_type" id="group_type_protected" value="1"', $context['group']['type'] == 1 ? ' checked' : '', ' onclick="swapPostGroup(0);">', $txt['membergroups_group_type_protected'], '</label><br>'; |
| 206 | + } |
|
| 201 | 207 | |
| 202 | 208 | echo ' |
| 203 | 209 | <label for="group_type_request"><input type="radio" name="group_type" id="group_type_request" value="2"', $context['group']['type'] == 2 ? ' checked' : '', ' onclick="swapPostGroup(0);">', $txt['membergroups_group_type_request'], '</label><br> |
@@ -207,8 +213,8 @@ discard block |
||
| 207 | 213 | </dd>'; |
| 208 | 214 | } |
| 209 | 215 | |
| 210 | - if ($context['group']['id'] != 3 && $context['group']['id'] != 4) |
|
| 211 | - echo ' |
|
| 216 | + if ($context['group']['id'] != 3 && $context['group']['id'] != 4) { |
|
| 217 | + echo ' |
|
| 212 | 218 | <dt id="group_moderators_text"> |
| 213 | 219 | <label for="group_moderators"><strong>', $txt['moderators'], ':</strong></label> |
| 214 | 220 | </dt> |
@@ -226,6 +232,7 @@ discard block |
||
| 226 | 232 | <option value="2"', $context['group']['hidden'] == 2 ? ' selected' : '', '>', $txt['membergroups_edit_hidden_all'], '</option> |
| 227 | 233 | </select> |
| 228 | 234 | </dd>'; |
| 235 | + } |
|
| 229 | 236 | |
| 230 | 237 | // Can they inherit permissions? |
| 231 | 238 | if ($context['group']['id'] > 1 && $context['group']['id'] != 3) |
@@ -242,9 +249,10 @@ discard block |
||
| 242 | 249 | <option value="0"', $context['group']['inherited_from'] == 0 ? ' selected' : '', '>', $txt['membergroups_edit_inherit_permissions_from'], ': ', $txt['membergroups_members'], '</option>'; |
| 243 | 250 | |
| 244 | 251 | // For all the inheritable groups show an option. |
| 245 | - foreach ($context['inheritable_groups'] as $id => $group) |
|
| 246 | - echo ' |
|
| 252 | + foreach ($context['inheritable_groups'] as $id => $group) { |
|
| 253 | + echo ' |
|
| 247 | 254 | <option value="', $id, '"', $context['group']['inherited_from'] == $id ? ' selected' : '', '>', $txt['membergroups_edit_inherit_permissions_from'], ': ', $group, '</option>'; |
| 255 | + } |
|
| 248 | 256 | |
| 249 | 257 | echo ' |
| 250 | 258 | </select> |
@@ -252,8 +260,8 @@ discard block |
||
| 252 | 260 | </dd>'; |
| 253 | 261 | } |
| 254 | 262 | |
| 255 | - if ($context['group']['allow_post_group']) |
|
| 256 | - echo ' |
|
| 263 | + if ($context['group']['allow_post_group']) { |
|
| 264 | + echo ' |
|
| 257 | 265 | |
| 258 | 266 | <dt id="min_posts_text"> |
| 259 | 267 | <label for="min_posts_input"><strong>', $txt['membergroups_min_posts'], ':</strong></label> |
@@ -261,6 +269,7 @@ discard block |
||
| 261 | 269 | <dd> |
| 262 | 270 | <input type="number" name="min_posts" id="min_posts_input"', $context['group']['is_post_group'] ? ' value="' . $context['group']['min_posts'] . '"' : '', ' size="6"> |
| 263 | 271 | </dd>'; |
| 272 | + } |
|
| 264 | 273 | echo ' |
| 265 | 274 | <dt> |
| 266 | 275 | <label for="online_color_input"><strong>', $txt['membergroups_online_color'], ':</strong></label> |
@@ -302,9 +311,10 @@ discard block |
||
| 302 | 311 | } |
| 303 | 312 | |
| 304 | 313 | // No? Hide the entire control. |
| 305 | - else |
|
| 306 | - echo ' |
|
| 314 | + else { |
|
| 315 | + echo ' |
|
| 307 | 316 | <input type="hidden" name="icon_image" value="">'; |
| 317 | + } |
|
| 308 | 318 | |
| 309 | 319 | echo ' |
| 310 | 320 | <dt> |
@@ -315,8 +325,8 @@ discard block |
||
| 315 | 325 | <input type="text" name="max_messages" id="max_messages_input" value="', $context['group']['id'] == 1 ? 0 : $context['group']['max_messages'], '" size="6"', $context['group']['id'] == 1 ? ' disabled' : '', '> |
| 316 | 326 | </dd>'; |
| 317 | 327 | //Force 2FA for this membergroup? |
| 318 | - if (!empty($modSettings['tfa_mode']) && $modSettings['tfa_mode'] == 2) |
|
| 319 | - echo ' |
|
| 328 | + if (!empty($modSettings['tfa_mode']) && $modSettings['tfa_mode'] == 2) { |
|
| 329 | + echo ' |
|
| 320 | 330 | <dt> |
| 321 | 331 | <label for="group_tfa_force_input"><strong>', $txt['membergroups_tfa_force'], ':</strong></label><br> |
| 322 | 332 | <span class="smalltext">', $txt['membergroups_tfa_force_note'], '</span> |
@@ -324,6 +334,7 @@ discard block |
||
| 324 | 334 | <dd> |
| 325 | 335 | <input type="checkbox" name="group_tfa_force"', $context['group']['tfa_required'] ? ' checked' : '', '> |
| 326 | 336 | </dd>'; |
| 337 | + } |
|
| 327 | 338 | |
| 328 | 339 | if (!empty($context['categories'])) |
| 329 | 340 | { |
@@ -333,10 +344,11 @@ discard block |
||
| 333 | 344 | <span class="smalltext">' . $txt['membergroups_new_board_post_groups'] . '</span>' : '', ' |
| 334 | 345 | </dt> |
| 335 | 346 | <dd>'; |
| 336 | - if (!empty($context['can_manage_boards'])) |
|
| 337 | - echo $txt['membergroups_can_manage_access']; |
|
| 338 | - else |
|
| 339 | - template_add_edit_group_boards_list(); |
|
| 347 | + if (!empty($context['can_manage_boards'])) { |
|
| 348 | + echo $txt['membergroups_can_manage_access']; |
|
| 349 | + } else { |
|
| 350 | + template_add_edit_group_boards_list(); |
|
| 351 | + } |
|
| 340 | 352 | |
| 341 | 353 | echo ' |
| 342 | 354 | </dd>'; |
@@ -365,20 +377,21 @@ discard block |
||
| 365 | 377 | sItemListContainerId: \'moderator_container\', |
| 366 | 378 | aListItems: ['; |
| 367 | 379 | |
| 368 | - foreach ($context['group']['moderators'] as $id_member => $member_name) |
|
| 369 | - echo ' |
|
| 380 | + foreach ($context['group']['moderators'] as $id_member => $member_name) { |
|
| 381 | + echo ' |
|
| 370 | 382 | { |
| 371 | 383 | sItemId: ', JavaScriptEscape($id_member), ', |
| 372 | 384 | sItemName: ', JavaScriptEscape($member_name), ' |
| 373 | 385 | }', $id_member == $context['group']['last_moderator_id'] ? '' : ','; |
| 386 | + } |
|
| 374 | 387 | |
| 375 | 388 | echo ' |
| 376 | 389 | ] |
| 377 | 390 | }); |
| 378 | 391 | </script>'; |
| 379 | 392 | |
| 380 | - if ($context['group']['allow_post_group']) |
|
| 381 | - echo ' |
|
| 393 | + if ($context['group']['allow_post_group']) { |
|
| 394 | + echo ' |
|
| 382 | 395 | <script> |
| 383 | 396 | function swapPostGroup(isChecked) |
| 384 | 397 | { |
@@ -426,7 +439,8 @@ discard block |
||
| 426 | 439 | |
| 427 | 440 | swapPostGroup(', $context['group']['is_post_group'] ? 'true' : 'false', '); |
| 428 | 441 | </script>'; |
| 429 | -} |
|
| 442 | + } |
|
| 443 | + } |
|
| 430 | 444 | |
| 431 | 445 | /** |
| 432 | 446 | * The template for determining which boards a group has access to. |
@@ -443,13 +457,13 @@ discard block |
||
| 443 | 457 | |
| 444 | 458 | foreach ($context['categories'] as $category) |
| 445 | 459 | { |
| 446 | - if (empty($modSettings['deny_boards_access'])) |
|
| 447 | - echo ' |
|
| 460 | + if (empty($modSettings['deny_boards_access'])) { |
|
| 461 | + echo ' |
|
| 448 | 462 | <li class="category"> |
| 449 | 463 | <a href="javascript:void(0);" onclick="selectBoards([', implode(', ', $category['child_ids']), '], \'new_group\'); return false;"><strong>', $category['name'], '</strong></a> |
| 450 | 464 | <ul style="width:100%">'; |
| 451 | - else |
|
| 452 | - echo ' |
|
| 465 | + } else { |
|
| 466 | + echo ' |
|
| 453 | 467 | <li class="category"> |
| 454 | 468 | <strong>', $category['name'], '</strong> |
| 455 | 469 | <span class="select_all_box"> |
@@ -462,16 +476,17 @@ discard block |
||
| 462 | 476 | </select> |
| 463 | 477 | </span> |
| 464 | 478 | <ul style="width:100%" id="boards_list_', $category['id'], '">'; |
| 479 | + } |
|
| 465 | 480 | |
| 466 | 481 | foreach ($category['boards'] as $board) |
| 467 | 482 | { |
| 468 | - if (empty($modSettings['deny_boards_access'])) |
|
| 469 | - echo ' |
|
| 483 | + if (empty($modSettings['deny_boards_access'])) { |
|
| 484 | + echo ' |
|
| 470 | 485 | <li class="board" style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;"> |
| 471 | 486 | <input type="checkbox" name="boardaccess[', $board['id'], ']" id="brd', $board['id'], '" value="allow"', $board['allow'] ? ' checked' : '', '> <label for="brd', $board['id'], '">', $board['name'], '</label> |
| 472 | 487 | </li>'; |
| 473 | - else |
|
| 474 | - echo ' |
|
| 488 | + } else { |
|
| 489 | + echo ' |
|
| 475 | 490 | <li class="board" style="width:100%"> |
| 476 | 491 | <span style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">', $board['name'], ': </span> |
| 477 | 492 | <span style="width:50%;float:right"> |
@@ -480,6 +495,7 @@ discard block |
||
| 480 | 495 | <input type="radio" name="boardaccess[', $board['id'], ']" id="deny_brd', $board['id'], '" value="deny"', $board['deny'] ? ' checked' : '', '> <label for="deny_brd', $board['id'], '">', $txt['permissions_option_deny'], '</label> |
| 481 | 496 | </span> |
| 482 | 497 | </li>'; |
| 498 | + } |
|
| 483 | 499 | } |
| 484 | 500 | |
| 485 | 501 | echo ' |
@@ -490,13 +506,13 @@ discard block |
||
| 490 | 506 | echo ' |
| 491 | 507 | </ul>'; |
| 492 | 508 | |
| 493 | - if (empty($modSettings['deny_boards_access'])) |
|
| 494 | - echo ' |
|
| 509 | + if (empty($modSettings['deny_boards_access'])) { |
|
| 510 | + echo ' |
|
| 495 | 511 | <br class="clear"><br> |
| 496 | 512 | <input type="checkbox" id="checkall_check" onclick="invertAll(this, this.form, \'boardaccess\');"> <label for="checkall_check"><em>', $txt['check_all'], '</em></label> |
| 497 | 513 | </fieldset>'; |
| 498 | - else |
|
| 499 | - echo ' |
|
| 514 | + } else { |
|
| 515 | + echo ' |
|
| 500 | 516 | <br class="clear"> |
| 501 | 517 | <span class="select_all_box"> |
| 502 | 518 | <em>', $txt['all'], ': </em> |
@@ -512,15 +528,17 @@ discard block |
||
| 512 | 528 | }); |
| 513 | 529 | }); |
| 514 | 530 | </script>'; |
| 531 | + } |
|
| 515 | 532 | |
| 516 | - if ($collapse) |
|
| 517 | - echo ' |
|
| 533 | + if ($collapse) { |
|
| 534 | + echo ' |
|
| 518 | 535 | <a href="javascript:void(0);" onclick="document.getElementById(\'visible_boards\').style.display = \'block\'; document.getElementById(\'visible_boards_link\').style.display = \'none\'; return false;" id="visible_boards_link" style="display: none;">[ ', $txt['membergroups_select_visible_boards'], ' ]</a> |
| 519 | 536 | <script> |
| 520 | 537 | document.getElementById("visible_boards_link").style.display = ""; |
| 521 | 538 | document.getElementById("visible_boards").style.display = "none"; |
| 522 | 539 | </script>'; |
| 523 | -} |
|
| 540 | + } |
|
| 541 | + } |
|
| 524 | 542 | |
| 525 | 543 | /** |
| 526 | 544 | * Templatine for viewing the members of a group. |
@@ -544,14 +562,15 @@ discard block |
||
| 544 | 562 | <span ', $context['group']['online_color'] ? 'style="color: ' . $context['group']['online_color'] . ';"' : '', '>', $context['group']['name'], '</span> ', $context['group']['icons'], ' |
| 545 | 563 | </dd>'; |
| 546 | 564 | //Any description to show? |
| 547 | - if (!empty($context['group']['description'])) |
|
| 548 | - echo ' |
|
| 565 | + if (!empty($context['group']['description'])) { |
|
| 566 | + echo ' |
|
| 549 | 567 | <dt> |
| 550 | 568 | <strong>' . $txt['membergroups_members_description'] . ':</strong> |
| 551 | 569 | </dt> |
| 552 | 570 | <dd> |
| 553 | 571 | ', $context['group']['description'], ' |
| 554 | 572 | </dd>'; |
| 573 | + } |
|
| 555 | 574 | |
| 556 | 575 | echo ' |
| 557 | 576 | <dt> |
@@ -564,8 +583,9 @@ discard block |
||
| 564 | 583 | if (!empty($context['group']['moderators'])) |
| 565 | 584 | { |
| 566 | 585 | $moderators = array(); |
| 567 | - foreach ($context['group']['moderators'] as $moderator) |
|
| 568 | - $moderators[] = '<a href="' . $scripturl . '?action=profile;u=' . $moderator['id'] . '">' . $moderator['name'] . '</a>'; |
|
| 586 | + foreach ($context['group']['moderators'] as $moderator) { |
|
| 587 | + $moderators[] = '<a href="' . $scripturl . '?action=profile;u=' . $moderator['id'] . '">' . $moderator['name'] . '</a>'; |
|
| 588 | + } |
|
| 569 | 589 | |
| 570 | 590 | echo ' |
| 571 | 591 | <dt> |
@@ -591,27 +611,30 @@ discard block |
||
| 591 | 611 | <tr class="title_bar"> |
| 592 | 612 | <th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=name', $context['sort_by'] == 'name' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['name'], $context['sort_by'] == 'name' ? ' <span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>'; |
| 593 | 613 | |
| 594 | - if ($context['can_send_email']) |
|
| 595 | - echo ' |
|
| 614 | + if ($context['can_send_email']) { |
|
| 615 | + echo ' |
|
| 596 | 616 | <th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=email', $context['sort_by'] == 'email' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['email'], $context['sort_by'] == 'email' ? ' <span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>'; |
| 617 | + } |
|
| 597 | 618 | |
| 598 | 619 | echo ' |
| 599 | 620 | <th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=active', $context['sort_by'] == 'active' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['membergroups_members_last_active'], $context['sort_by'] == 'active' ? '<span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th> |
| 600 | 621 | <th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=registered', $context['sort_by'] == 'registered' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['date_registered'], $context['sort_by'] == 'registered' ? '<span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th> |
| 601 | 622 | <th ', empty($context['group']['assignable']) ? ' colspan="2"' : '', '><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=posts', $context['sort_by'] == 'posts' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['posts'], $context['sort_by'] == 'posts' ? ' <span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>'; |
| 602 | - if (!empty($context['group']['assignable'])) |
|
| 603 | - echo ' |
|
| 623 | + if (!empty($context['group']['assignable'])) { |
|
| 624 | + echo ' |
|
| 604 | 625 | <th style="width: 4%"><input type="checkbox" onclick="invertAll(this, this.form);"></th>'; |
| 626 | + } |
|
| 605 | 627 | echo ' |
| 606 | 628 | </tr> |
| 607 | 629 | </thead> |
| 608 | 630 | <tbody>'; |
| 609 | 631 | |
| 610 | - if (empty($context['members'])) |
|
| 611 | - echo ' |
|
| 632 | + if (empty($context['members'])) { |
|
| 633 | + echo ' |
|
| 612 | 634 | <tr class="windowbg"> |
| 613 | 635 | <td colspan="6">', $txt['membergroups_members_no_members'], '</td> |
| 614 | 636 | </tr>'; |
| 637 | + } |
|
| 615 | 638 | |
| 616 | 639 | foreach ($context['members'] as $member) |
| 617 | 640 | { |
@@ -630,9 +653,10 @@ discard block |
||
| 630 | 653 | <td>', $member['last_online'], '</td> |
| 631 | 654 | <td>', $member['registered'], '</td> |
| 632 | 655 | <td', empty($context['group']['assignable']) ? ' colspan="2"' : '', '>', $member['posts'], '</td>'; |
| 633 | - if (!empty($context['group']['assignable'])) |
|
| 634 | - echo ' |
|
| 656 | + if (!empty($context['group']['assignable'])) { |
|
| 657 | + echo ' |
|
| 635 | 658 | <td style="width: 4%"><input type="checkbox" name="rem[]" value="', $member['id'], '" ', ($context['user']['id'] == $member['id'] && $context['group']['id'] == 1 ? 'onclick="if (this.checked) return confirm(\'' . $txt['membergroups_members_deadmin_confirm'] . '\')" ' : ''), '/></td>'; |
| 659 | + } |
|
| 636 | 660 | echo ' |
| 637 | 661 | </tr>'; |
| 638 | 662 | } |
@@ -641,11 +665,12 @@ discard block |
||
| 641 | 665 | </tbody> |
| 642 | 666 | </table>'; |
| 643 | 667 | |
| 644 | - if (!empty($context['group']['assignable'])) |
|
| 645 | - echo ' |
|
| 668 | + if (!empty($context['group']['assignable'])) { |
|
| 669 | + echo ' |
|
| 646 | 670 | <div class="floatright"> |
| 647 | 671 | <input type="submit" name="remove" value="', $txt['membergroups_members_remove'], '" class="button "> |
| 648 | 672 | </div>'; |
| 673 | + } |
|
| 649 | 674 | |
| 650 | 675 | echo ' |
| 651 | 676 | <div class="pagesection flow_hidden"> |
@@ -679,8 +704,8 @@ discard block |
||
| 679 | 704 | </form> |
| 680 | 705 | </div>'; |
| 681 | 706 | |
| 682 | - if (!empty($context['group']['assignable'])) |
|
| 683 | - echo ' |
|
| 707 | + if (!empty($context['group']['assignable'])) { |
|
| 708 | + echo ' |
|
| 684 | 709 | <script> |
| 685 | 710 | var oAddMemberSuggest = new smc_AutoSuggest({ |
| 686 | 711 | sSelf: \'oAddMemberSuggest\', |
@@ -696,7 +721,8 @@ discard block |
||
| 696 | 721 | sItemListContainerId: \'toAddItemContainer\' |
| 697 | 722 | }); |
| 698 | 723 | </script>'; |
| 699 | -} |
|
| 724 | + } |
|
| 725 | + } |
|
| 700 | 726 | |
| 701 | 727 | /** |
| 702 | 728 | * Allow the moderator to enter a reason to each user being rejected. |
@@ -716,8 +742,8 @@ discard block |
||
| 716 | 742 | <dl class="settings">'; |
| 717 | 743 | |
| 718 | 744 | // Loop through and print out a reason box for each... |
| 719 | - foreach ($context['group_requests'] as $request) |
|
| 720 | - echo ' |
|
| 745 | + foreach ($context['group_requests'] as $request) { |
|
| 746 | + echo ' |
|
| 721 | 747 | <dt> |
| 722 | 748 | <strong>', sprintf($txt['mc_groupr_reason_desc'], $request['member_link'], $request['group_link']), ':</strong> |
| 723 | 749 | </dt> |
@@ -725,6 +751,7 @@ discard block |
||
| 725 | 751 | <input type="hidden" name="groupr[]" value="', $request['id'], '"> |
| 726 | 752 | <textarea name="groupreason[', $request['id'], ']" rows="3" cols="40" style="min-width: 80%; max-width: 99%;"></textarea> |
| 727 | 753 | </dd>'; |
| 754 | + } |
|
| 728 | 755 | |
| 729 | 756 | echo ' |
| 730 | 757 | </dl> |