@@ -180,7 +180,7 @@ |
||
| 180 | 180 | * |
| 181 | 181 | * @access public |
| 182 | 182 | * @param string $dir A valid path |
| 183 | - * @return boolean If this was successful or not. |
|
| 183 | + * @return boolean|null If this was successful or not. |
|
| 184 | 184 | */ |
| 185 | 185 | public function setCachedir($dir = null) |
| 186 | 186 | { |
@@ -53,25 +53,25 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | public function getData($key, $ttl = null) |
| 55 | 55 | { |
| 56 | - $key = $this->prefix . strtr($key, ':/', '-_'); |
|
| 56 | + $key = $this->prefix.strtr($key, ':/', '-_'); |
|
| 57 | 57 | $cachedir = $this->cachedir; |
| 58 | 58 | |
| 59 | 59 | // SMF Data returns $value and $expired. $expired has a unix timestamp of when this expires. |
| 60 | - if (file_exists($cachedir . '/data_' . $key . '.php') && filesize($cachedir . '/data_' . $key . '.php') > 10) |
|
| 60 | + if (file_exists($cachedir.'/data_'.$key.'.php') && filesize($cachedir.'/data_'.$key.'.php') > 10) |
|
| 61 | 61 | { |
| 62 | 62 | // Work around Zend's opcode caching (PHP 5.5+), they would cache older files for a couple of seconds |
| 63 | 63 | // causing newer files to take effect a while later. |
| 64 | 64 | if (function_exists('opcache_invalidate')) |
| 65 | - opcache_invalidate($cachedir . '/data_' . $key . '.php', true); |
|
| 65 | + opcache_invalidate($cachedir.'/data_'.$key.'.php', true); |
|
| 66 | 66 | |
| 67 | 67 | if (function_exists('apc_delete_file')) |
| 68 | - @apc_delete_file($cachedir . '/data_' . $key . '.php'); |
|
| 68 | + @apc_delete_file($cachedir.'/data_'.$key.'.php'); |
|
| 69 | 69 | |
| 70 | 70 | // php will cache file_exists et all, we can't 100% depend on its results so proceed with caution |
| 71 | - @include($cachedir . '/data_' . $key . '.php'); |
|
| 71 | + @include($cachedir.'/data_'.$key.'.php'); |
|
| 72 | 72 | if (!empty($expired) && isset($value)) |
| 73 | 73 | { |
| 74 | - @unlink($cachedir . '/data_' . $key . '.php'); |
|
| 74 | + @unlink($cachedir.'/data_'.$key.'.php'); |
|
| 75 | 75 | unset($value); |
| 76 | 76 | } |
| 77 | 77 | } |
@@ -84,30 +84,30 @@ discard block |
||
| 84 | 84 | */ |
| 85 | 85 | public function putData($key, $value, $ttl = null) |
| 86 | 86 | { |
| 87 | - $key = $this->prefix . strtr($key, ':/', '-_'); |
|
| 87 | + $key = $this->prefix.strtr($key, ':/', '-_'); |
|
| 88 | 88 | $cachedir = $this->cachedir; |
| 89 | 89 | |
| 90 | 90 | // Work around Zend's opcode caching (PHP 5.5+), they would cache older files for a couple of seconds |
| 91 | 91 | // causing newer files to take effect a while later. |
| 92 | 92 | if (function_exists('opcache_invalidate')) |
| 93 | - opcache_invalidate($cachedir . '/data_' . $key . '.php', true); |
|
| 93 | + opcache_invalidate($cachedir.'/data_'.$key.'.php', true); |
|
| 94 | 94 | |
| 95 | 95 | if (function_exists('apc_delete_file')) |
| 96 | - @apc_delete_file($cachedir . '/data_' . $key . '.php'); |
|
| 96 | + @apc_delete_file($cachedir.'/data_'.$key.'.php'); |
|
| 97 | 97 | |
| 98 | 98 | // Otherwise custom cache? |
| 99 | 99 | if ($value === null) |
| 100 | - @unlink($cachedir . '/data_' . $key . '.php'); |
|
| 100 | + @unlink($cachedir.'/data_'.$key.'.php'); |
|
| 101 | 101 | else |
| 102 | 102 | { |
| 103 | - $cache_data = '<' . '?' . 'php if (!defined(\'SMF\')) die; if (' . (time() + $ttl) . ' < time()) $expired = true; else{$expired = false; $value = \'' . addcslashes($value, '\\\'') . '\';}' . '?' . '>'; |
|
| 103 | + $cache_data = '<'.'?'.'php if (!defined(\'SMF\')) die; if ('.(time() + $ttl).' < time()) $expired = true; else{$expired = false; $value = \''.addcslashes($value, '\\\'').'\';}'.'?'.'>'; |
|
| 104 | 104 | |
| 105 | 105 | // Write out the cache file, check that the cache write was successful; all the data must be written |
| 106 | 106 | // If it fails due to low diskspace, or other, remove the cache file |
| 107 | - $fileSize = file_put_contents($cachedir . '/data_' . $key . '.php', $cache_data, LOCK_EX); |
|
| 107 | + $fileSize = file_put_contents($cachedir.'/data_'.$key.'.php', $cache_data, LOCK_EX); |
|
| 108 | 108 | if ($fileSize !== strlen($cache_data)) |
| 109 | 109 | { |
| 110 | - @unlink($cachedir . '/data_' . $key . '.php'); |
|
| 110 | + @unlink($cachedir.'/data_'.$key.'.php'); |
|
| 111 | 111 | return false; |
| 112 | 112 | } |
| 113 | 113 | else |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | while ($file = readdir($dh)) |
| 132 | 132 | { |
| 133 | 133 | if ($file != '.' && $file != '..' && $file != 'index.php' && $file != '.htaccess' && (!$type || substr($file, 0, strlen($type)) == $type)) |
| 134 | - @unlink($cachedir . '/' . $file); |
|
| 134 | + @unlink($cachedir.'/'.$file); |
|
| 135 | 135 | } |
| 136 | 136 | closedir($dh); |
| 137 | 137 | |
@@ -44,6 +44,10 @@ discard block |
||
| 44 | 44 | $this->Buf = range(0, 279); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | + /** |
|
| 48 | + * @param string $data |
|
| 49 | + * @param integer $datLen |
|
| 50 | + */ |
|
| 47 | 51 | public function decompress($data, &$datLen) |
| 48 | 52 | { |
| 49 | 53 | $stLen = strlen($data); |
@@ -63,6 +67,11 @@ discard block |
||
| 63 | 67 | return $ret; |
| 64 | 68 | } |
| 65 | 69 | |
| 70 | + /** |
|
| 71 | + * @param boolean $bInit |
|
| 72 | + * |
|
| 73 | + * @return integer |
|
| 74 | + */ |
|
| 66 | 75 | public function LZWCommand(&$data, $bInit) |
| 67 | 76 | { |
| 68 | 77 | if ($bInit) |
@@ -253,6 +262,10 @@ discard block |
||
| 253 | 262 | unset($this->m_nColors, $this->m_arColors); |
| 254 | 263 | } |
| 255 | 264 | |
| 265 | + /** |
|
| 266 | + * @param string $lpData |
|
| 267 | + * @param integer $num |
|
| 268 | + */ |
|
| 256 | 269 | public function load($lpData, $num) |
| 257 | 270 | { |
| 258 | 271 | $this->m_nColors = 0; |
@@ -324,6 +337,9 @@ discard block |
||
| 324 | 337 | unset($this->m_bSorted, $this->m_nTableSize, $this->m_nBgColor, $this->m_nPixelRatio, $this->m_colorTable); |
| 325 | 338 | } |
| 326 | 339 | |
| 340 | + /** |
|
| 341 | + * @param integer $hdrLen |
|
| 342 | + */ |
|
| 327 | 343 | public function load($lpData, &$hdrLen) |
| 328 | 344 | { |
| 329 | 345 | $hdrLen = 0; |
@@ -370,6 +386,10 @@ discard block |
||
| 370 | 386 | unset($this->m_bInterlace, $this->m_bSorted, $this->m_nTableSize, $this->m_colorTable); |
| 371 | 387 | } |
| 372 | 388 | |
| 389 | + /** |
|
| 390 | + * @param string $lpData |
|
| 391 | + * @param integer $hdrLen |
|
| 392 | + */ |
|
| 373 | 393 | public function load($lpData, &$hdrLen) |
| 374 | 394 | { |
| 375 | 395 | $hdrLen = 0; |
@@ -412,6 +432,10 @@ discard block |
||
| 412 | 432 | $this->m_lzw = new gif_lzw_compression(); |
| 413 | 433 | } |
| 414 | 434 | |
| 435 | + /** |
|
| 436 | + * @param string $data |
|
| 437 | + * @param integer $datLen |
|
| 438 | + */ |
|
| 415 | 439 | public function load($data, &$datLen) |
| 416 | 440 | { |
| 417 | 441 | $datLen = 0; |
@@ -464,6 +488,10 @@ discard block |
||
| 464 | 488 | return false; |
| 465 | 489 | } |
| 466 | 490 | |
| 491 | + /** |
|
| 492 | + * @param string $data |
|
| 493 | + * @param integer $extLen |
|
| 494 | + */ |
|
| 467 | 495 | public function skipExt(&$data, &$extLen) |
| 468 | 496 | { |
| 469 | 497 | $extLen = 0; |
@@ -38,8 +38,8 @@ discard block |
||
| 38 | 38 | $this->MAX_LZW_BITS = 12; |
| 39 | 39 | unset($this->Next, $this->Vals, $this->Stack, $this->Buf); |
| 40 | 40 | |
| 41 | - $this->Next = range(0, (1 << $this->MAX_LZW_BITS) - 1); |
|
| 42 | - $this->Vals = range(0, (1 << $this->MAX_LZW_BITS) - 1); |
|
| 41 | + $this->Next = range(0, (1 << $this->MAX_LZW_BITS) - 1); |
|
| 42 | + $this->Vals = range(0, (1 << $this->MAX_LZW_BITS) - 1); |
|
| 43 | 43 | $this->Stack = range(0, (1 << ($this->MAX_LZW_BITS + 1)) - 1); |
| 44 | 44 | $this->Buf = range(0, 279); |
| 45 | 45 | } |
@@ -278,9 +278,9 @@ discard block |
||
| 278 | 278 | for ($i = 0; $i < $this->m_nColors; $i++) |
| 279 | 279 | { |
| 280 | 280 | $ret .= |
| 281 | - chr(($this->m_arColors[$i] & 0x000000FF)) . // R |
|
| 282 | - chr(($this->m_arColors[$i] & 0x0000FF00) >> 8) . // G |
|
| 283 | - chr(($this->m_arColors[$i] & 0x00FF0000) >> 16); // B |
|
| 281 | + chr(($this->m_arColors[$i] & 0x000000FF)).// R |
|
| 282 | + chr(($this->m_arColors[$i] & 0x0000FF00) >> 8).// G |
|
| 283 | + chr(($this->m_arColors[$i] & 0x00FF0000) >> 16); // B |
|
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | return $ret; |
@@ -290,14 +290,14 @@ discard block |
||
| 290 | 290 | { |
| 291 | 291 | $rgb = intval($rgb) & 0xFFFFFF; |
| 292 | 292 | $r1 = ($rgb & 0x0000FF); |
| 293 | - $g1 = ($rgb & 0x00FF00) >> 8; |
|
| 293 | + $g1 = ($rgb & 0x00FF00) >> 8; |
|
| 294 | 294 | $b1 = ($rgb & 0xFF0000) >> 16; |
| 295 | 295 | $idx = -1; |
| 296 | 296 | |
| 297 | 297 | for ($i = 0; $i < $this->m_nColors; $i++) |
| 298 | 298 | { |
| 299 | 299 | $r2 = ($this->m_arColors[$i] & 0x000000FF); |
| 300 | - $g2 = ($this->m_arColors[$i] & 0x0000FF00) >> 8; |
|
| 300 | + $g2 = ($this->m_arColors[$i] & 0x0000FF00) >> 8; |
|
| 301 | 301 | $b2 = ($this->m_arColors[$i] & 0x00FF0000) >> 16; |
| 302 | 302 | $d = abs($r2 - $r1) + abs($g2 - $g1) + abs($b2 - $b1); |
| 303 | 303 | |
@@ -547,8 +547,8 @@ discard block |
||
| 547 | 547 | $this->m_data = substr($this->m_data, $this->m_gih->m_nWidth); |
| 548 | 548 | |
| 549 | 549 | $data = |
| 550 | - substr($data, 0, $y * $this->m_gih->m_nWidth) . |
|
| 551 | - $lne . |
|
| 550 | + substr($data, 0, $y * $this->m_gih->m_nWidth). |
|
| 551 | + $lne. |
|
| 552 | 552 | substr($data, ($y + 1) * $this->m_gih->m_nWidth); |
| 553 | 553 | } |
| 554 | 554 | } |
@@ -659,15 +659,15 @@ discard block |
||
| 659 | 659 | |
| 660 | 660 | // Now, we want the header... |
| 661 | 661 | $out .= "\x00\x00\x00\x0D"; |
| 662 | - $tmp = 'IHDR' . pack('N', (int) $this->header->m_nWidth) . pack('N', (int) $this->header->m_nHeight) . "\x08\x03\x00\x00\x00"; |
|
| 663 | - $out .= $tmp . pack('N', smf_crc32($tmp)); |
|
| 662 | + $tmp = 'IHDR'.pack('N', (int) $this->header->m_nWidth).pack('N', (int) $this->header->m_nHeight)."\x08\x03\x00\x00\x00"; |
|
| 663 | + $out .= $tmp.pack('N', smf_crc32($tmp)); |
|
| 664 | 664 | |
| 665 | 665 | // The palette, assuming we have one to speak of... |
| 666 | 666 | if ($colors > 0) |
| 667 | 667 | { |
| 668 | 668 | $out .= pack('N', (int) $colors * 3); |
| 669 | - $tmp = 'PLTE' . $pal; |
|
| 670 | - $out .= $tmp . pack('N', smf_crc32($tmp)); |
|
| 669 | + $tmp = 'PLTE'.$pal; |
|
| 670 | + $out .= $tmp.pack('N', smf_crc32($tmp)); |
|
| 671 | 671 | } |
| 672 | 672 | |
| 673 | 673 | // Do we have any transparency we want to make available? |
@@ -680,16 +680,16 @@ discard block |
||
| 680 | 680 | for ($i = 0; $i < $colors; $i++) |
| 681 | 681 | $tmp .= $i == $this->image->m_nTrans ? "\x00" : "\xFF"; |
| 682 | 682 | |
| 683 | - $out .= $tmp . pack('N', smf_crc32($tmp)); |
|
| 683 | + $out .= $tmp.pack('N', smf_crc32($tmp)); |
|
| 684 | 684 | } |
| 685 | 685 | |
| 686 | 686 | // Here's the data itself! |
| 687 | 687 | $out .= pack('N', strlen($bmp)); |
| 688 | - $tmp = 'IDAT' . $bmp; |
|
| 689 | - $out .= $tmp . pack('N', smf_crc32($tmp)); |
|
| 688 | + $tmp = 'IDAT'.$bmp; |
|
| 689 | + $out .= $tmp.pack('N', smf_crc32($tmp)); |
|
| 690 | 690 | |
| 691 | 691 | // EOF marker... |
| 692 | - $out .= "\x00\x00\x00\x00" . 'IEND' . "\xAE\x42\x60\x82"; |
|
| 692 | + $out .= "\x00\x00\x00\x00".'IEND'."\xAE\x42\x60\x82"; |
|
| 693 | 693 | |
| 694 | 694 | return $out; |
| 695 | 695 | } |
@@ -698,7 +698,7 @@ discard block |
||
| 698 | 698 | // 64-bit only functions? |
| 699 | 699 | if (!function_exists('smf_crc32')) |
| 700 | 700 | { |
| 701 | - require_once $sourcedir . '/Subs-Compat.php'; |
|
| 701 | + require_once $sourcedir.'/Subs-Compat.php'; |
|
| 702 | 702 | } |
| 703 | 703 | |
| 704 | 704 | ?> |
| 705 | 705 | \ No newline at end of file |
@@ -56,6 +56,7 @@ discard block |
||
| 56 | 56 | * @param array $wordsSearch Search words |
| 57 | 57 | * @param array $wordsExclude Words to exclude |
| 58 | 58 | * @param bool $isExcluded Whether the specfied word should be excluded |
| 59 | + * @return void |
|
| 59 | 60 | */ |
| 60 | 61 | public function prepareIndexes($word, array &$wordsSearch, array &$wordsExclude, $isExcluded); |
| 61 | 62 | |
@@ -130,7 +131,7 @@ discard block |
||
| 130 | 131 | * @param array $excludedIndexWords Indexed words that should be excluded |
| 131 | 132 | * @param array $participants |
| 132 | 133 | * @param array $searchArray |
| 133 | - * @return mixed |
|
| 134 | + * @return integer |
|
| 134 | 135 | */ |
| 135 | 136 | public function searchQuery(array $query_params, array $searchWords, array $excludedIndexWords, array &$participants, array &$searchArray); |
| 136 | 137 | } |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | |
| 224 | 224 | global $smcFunc; |
| 225 | 225 | |
| 226 | - $result = $smcFunc['db_query']('',' |
|
| 226 | + $result = $smcFunc['db_query']('', ' |
|
| 227 | 227 | SELECT DISTINCT id_search |
| 228 | 228 | FROM {db_prefix}log_search_results |
| 229 | 229 | WHERE id_msg = {int:id_msg}', |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | if (count($id_searchs) < 1) |
| 240 | 240 | return; |
| 241 | 241 | |
| 242 | - $smcFunc['db_query']('',' |
|
| 242 | + $smcFunc['db_query']('', ' |
|
| 243 | 243 | DELETE FROM {db_prefix}log_search_results |
| 244 | 244 | WHERE id_search in ({array_int:id_searchs})', |
| 245 | 245 | array( |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | ) |
| 248 | 248 | ); |
| 249 | 249 | |
| 250 | - $smcFunc['db_query']('',' |
|
| 250 | + $smcFunc['db_query']('', ' |
|
| 251 | 251 | DELETE FROM {db_prefix}log_search_topics |
| 252 | 252 | WHERE id_search in ({array_int:id_searchs})', |
| 253 | 253 | array( |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | ) |
| 256 | 256 | ); |
| 257 | 257 | |
| 258 | - $smcFunc['db_query']('',' |
|
| 258 | + $smcFunc['db_query']('', ' |
|
| 259 | 259 | DELETE FROM {db_prefix}log_search_messages |
| 260 | 260 | WHERE id_search in ({array_int:id_searchs})', |
| 261 | 261 | array( |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | /** |
| 280 | 280 | * Generate the timestamp for the calculation |
| 281 | 281 | * |
| 282 | - * @return integer Timestamp |
|
| 282 | + * @return double Timestamp |
|
| 283 | 283 | */ |
| 284 | 284 | public function generateTimestamp() |
| 285 | 285 | { |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | * Truncate the given hash down to just what we need |
| 291 | 291 | * |
| 292 | 292 | * @param string $hash Hash to truncate |
| 293 | - * @return string Truncated hash value |
|
| 293 | + * @return integer Truncated hash value |
|
| 294 | 294 | */ |
| 295 | 295 | public function truncateHash($hash) |
| 296 | 296 | { |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | */ |
| 115 | 115 | public function setInitKey($key) |
| 116 | 116 | { |
| 117 | - if (preg_match('/^[' . implode('', array_keys($this->getLookup())) . ']+$/', $key) == false) { |
|
| 117 | + if (preg_match('/^['.implode('', array_keys($this->getLookup())).']+$/', $key) == false) { |
|
| 118 | 118 | throw new \InvalidArgumentException('Invalid base32 hash!'); |
| 119 | 119 | } |
| 120 | 120 | $this->initKey = $key; |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | |
| 250 | 250 | $hash = hash_hmac( |
| 251 | 251 | 'sha1', |
| 252 | - pack('N*', 0) . pack('N*', $timestamp), |
|
| 252 | + pack('N*', 0).pack('N*', $timestamp), |
|
| 253 | 253 | $initKey, |
| 254 | 254 | true |
| 255 | 255 | ); |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | { |
| 316 | 316 | $lookup = $this->getLookup(); |
| 317 | 317 | |
| 318 | - if (preg_match('/^[' . implode('', array_keys($lookup)) . ']+$/', $hash) == false) { |
|
| 318 | + if (preg_match('/^['.implode('', array_keys($lookup)).']+$/', $hash) == false) { |
|
| 319 | 319 | throw new \InvalidArgumentException('Invalid base32 hash!'); |
| 320 | 320 | } |
| 321 | 321 | |
@@ -347,8 +347,8 @@ discard block |
||
| 347 | 347 | */ |
| 348 | 348 | public function getQrCodeUrl($name, $code) |
| 349 | 349 | { |
| 350 | - $urlencoded = urlencode('otpauth://totp/' . urlencode($name) . '?secret=' . $code); |
|
| 351 | - return 'https://chart.googleapis.com/chart?chs=280x280&chld=M|0&cht=qr&chl=' . $urlencoded; |
|
| 350 | + $urlencoded = urlencode('otpauth://totp/'.urlencode($name).'?secret='.$code); |
|
| 351 | + return 'https://chart.googleapis.com/chart?chs=280x280&chld=M|0&cht=qr&chl='.$urlencoded; |
|
| 352 | 352 | } |
| 353 | 353 | } |
| 354 | 354 | |
@@ -64,7 +64,8 @@ discard block |
||
| 64 | 64 | { |
| 65 | 65 | $this->buildLookup(); |
| 66 | 66 | |
| 67 | - if ($initKey !== null) { |
|
| 67 | + if ($initKey !== null) |
|
| 68 | + { |
|
| 68 | 69 | $this->setInitKey($initKey); |
| 69 | 70 | } |
| 70 | 71 | } |
@@ -98,7 +99,8 @@ discard block |
||
| 98 | 99 | */ |
| 99 | 100 | public function setRange($range) |
| 100 | 101 | { |
| 101 | - if (!is_numeric($range)) { |
|
| 102 | + if (!is_numeric($range)) |
|
| 103 | + { |
|
| 102 | 104 | throw new \InvalidArgumentException('Invalid window range'); |
| 103 | 105 | } |
| 104 | 106 | $this->range = $range; |
@@ -114,7 +116,8 @@ discard block |
||
| 114 | 116 | */ |
| 115 | 117 | public function setInitKey($key) |
| 116 | 118 | { |
| 117 | - if (preg_match('/^[' . implode('', array_keys($this->getLookup())) . ']+$/', $key) == false) { |
|
| 119 | + if (preg_match('/^[' . implode('', array_keys($this->getLookup())) . ']+$/', $key) == false) |
|
| 120 | + { |
|
| 118 | 121 | throw new \InvalidArgumentException('Invalid base32 hash!'); |
| 119 | 122 | } |
| 120 | 123 | $this->initKey = $key; |
@@ -140,7 +143,8 @@ discard block |
||
| 140 | 143 | */ |
| 141 | 144 | public function setLookup($lookup) |
| 142 | 145 | { |
| 143 | - if (!is_array($lookup)) { |
|
| 146 | + if (!is_array($lookup)) |
|
| 147 | + { |
|
| 144 | 148 | throw new \InvalidArgumentException('Lookup value must be an array'); |
| 145 | 149 | } |
| 146 | 150 | $this->lookup = $lookup; |
@@ -176,7 +180,8 @@ discard block |
||
| 176 | 180 | */ |
| 177 | 181 | public function setRefresh($seconds) |
| 178 | 182 | { |
| 179 | - if (!is_numeric($seconds)) { |
|
| 183 | + if (!is_numeric($seconds)) |
|
| 184 | + { |
|
| 180 | 185 | throw new \InvalidArgumentException('Seconds must be numeric'); |
| 181 | 186 | } |
| 182 | 187 | $this->refreshSeconds = $seconds; |
@@ -217,7 +222,8 @@ discard block |
||
| 217 | 222 | */ |
| 218 | 223 | public function validateCode($code, $initKey = null, $timestamp = null, $range = null) |
| 219 | 224 | { |
| 220 | - if (strlen($code) !== $this->getCodeLength()) { |
|
| 225 | + if (strlen($code) !== $this->getCodeLength()) |
|
| 226 | + { |
|
| 221 | 227 | throw new \InvalidArgumentException('Incorrect code length'); |
| 222 | 228 | } |
| 223 | 229 | |
@@ -227,8 +233,10 @@ discard block |
||
| 227 | 233 | |
| 228 | 234 | $binary = $this->base32_decode($initKey); |
| 229 | 235 | |
| 230 | - for ($time = ($timestamp - $range); $time <= ($timestamp + $range); $time++) { |
|
| 231 | - if ($this->generateOneTime($binary, $time) == $code) { |
|
| 236 | + for ($time = ($timestamp - $range); $time <= ($timestamp + $range); $time++) |
|
| 237 | + { |
|
| 238 | + if ($this->generateOneTime($binary, $time) == $code) |
|
| 239 | + { |
|
| 232 | 240 | return true; |
| 233 | 241 | } |
| 234 | 242 | } |
@@ -269,7 +277,8 @@ discard block |
||
| 269 | 277 | $lookup = implode('', array_keys($this->getLookup())); |
| 270 | 278 | $code = ''; |
| 271 | 279 | |
| 272 | - for ($i = 0; $i < $length; $i++) { |
|
| 280 | + for ($i = 0; $i < $length; $i++) |
|
| 281 | + { |
|
| 273 | 282 | $code .= $lookup[mt_rand(0, strlen($lookup) - 1)]; |
| 274 | 283 | } |
| 275 | 284 | |
@@ -315,7 +324,8 @@ discard block |
||
| 315 | 324 | { |
| 316 | 325 | $lookup = $this->getLookup(); |
| 317 | 326 | |
| 318 | - if (preg_match('/^[' . implode('', array_keys($lookup)) . ']+$/', $hash) == false) { |
|
| 327 | + if (preg_match('/^[' . implode('', array_keys($lookup)) . ']+$/', $hash) == false) |
|
| 328 | + { |
|
| 319 | 329 | throw new \InvalidArgumentException('Invalid base32 hash!'); |
| 320 | 330 | } |
| 321 | 331 | |
@@ -324,12 +334,14 @@ discard block |
||
| 324 | 334 | $length = 0; |
| 325 | 335 | $binary = ''; |
| 326 | 336 | |
| 327 | - for ($i = 0; $i < strlen($hash); $i++) { |
|
| 337 | + for ($i = 0; $i < strlen($hash); $i++) |
|
| 338 | + { |
|
| 328 | 339 | $buffer = $buffer << 5; |
| 329 | 340 | $buffer += $lookup[$hash[$i]]; |
| 330 | 341 | $length += 5; |
| 331 | 342 | |
| 332 | - if ($length >= 8) { |
|
| 343 | + if ($length >= 8) |
|
| 344 | + { |
|
| 333 | 345 | $length -= 8; |
| 334 | 346 | $binary .= chr(($buffer & (0xFF << $length)) >> $length); |
| 335 | 347 | } |
@@ -382,7 +382,7 @@ |
||
| 382 | 382 | * @param array $parameters Not used? |
| 383 | 383 | * @param string $if_exists What to do if the index exists. If 'update', the definition will be updated. |
| 384 | 384 | * @param string $error |
| 385 | - * @return boolean Whether or not the operation was successful |
|
| 385 | + * @return false|null Whether or not the operation was successful |
|
| 386 | 386 | */ |
| 387 | 387 | function smf_db_add_index($table_name, $index_info, $parameters = array(), $if_exists = 'update', $error = 'fatal') |
| 388 | 388 | { |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | 'pm_labeled_messages', 'pm_labels', 'pm_recipients', 'pm_rules', 'poll_choices', 'polls', 'scheduled_tasks', 'sessions', 'settings', 'smileys', |
| 55 | 55 | 'spiders', 'subscriptions', 'themes', 'topics', 'user_alerts', 'user_alerts_prefs', 'user_drafts', 'user_likes'); |
| 56 | 56 | foreach ($reservedTables as $k => $table_name) |
| 57 | - $reservedTables[$k] = strtolower($db_prefix . $table_name); |
|
| 57 | + $reservedTables[$k] = strtolower($db_prefix.$table_name); |
|
| 58 | 58 | |
| 59 | 59 | // We in turn may need the extra stuff. |
| 60 | 60 | db_extend('extra'); |
@@ -127,8 +127,8 @@ discard block |
||
| 127 | 127 | $smcFunc['db_transaction']('begin'); |
| 128 | 128 | $db_trans = true; |
| 129 | 129 | $smcFunc['db_drop_table']($table_name.'_old'); |
| 130 | - $smcFunc['db_query']('',' |
|
| 131 | - RENAME TABLE '. $table_name .' TO ' . $table_name . '_old', |
|
| 130 | + $smcFunc['db_query']('', ' |
|
| 131 | + RENAME TABLE '. $table_name.' TO '.$table_name.'_old', |
|
| 132 | 132 | array( |
| 133 | 133 | 'security_override' => true, |
| 134 | 134 | ) |
@@ -140,9 +140,9 @@ discard block |
||
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | // Righty - let's do the damn thing! |
| 143 | - $table_query = 'CREATE TABLE ' . $table_name . "\n" . '('; |
|
| 143 | + $table_query = 'CREATE TABLE '.$table_name."\n".'('; |
|
| 144 | 144 | foreach ($columns as $column) |
| 145 | - $table_query .= "\n\t" . smf_db_create_query_column($column) . ','; |
|
| 145 | + $table_query .= "\n\t".smf_db_create_query_column($column).','; |
|
| 146 | 146 | |
| 147 | 147 | // Loop through the indexes next... |
| 148 | 148 | foreach ($indexes as $index) |
@@ -151,12 +151,12 @@ discard block |
||
| 151 | 151 | |
| 152 | 152 | // Is it the primary? |
| 153 | 153 | if (isset($index['type']) && $index['type'] == 'primary') |
| 154 | - $table_query .= "\n\t" . 'PRIMARY KEY (' . implode(',', $index['columns']) . '),'; |
|
| 154 | + $table_query .= "\n\t".'PRIMARY KEY ('.implode(',', $index['columns']).'),'; |
|
| 155 | 155 | else |
| 156 | 156 | { |
| 157 | 157 | if (empty($index['name'])) |
| 158 | 158 | $index['name'] = implode('_', $index['columns']); |
| 159 | - $table_query .= "\n\t" . (isset($index['type']) && $index['type'] == 'unique' ? 'UNIQUE' : 'KEY') . ' ' . $index['name'] . ' (' . $columns . '),'; |
|
| 159 | + $table_query .= "\n\t".(isset($index['type']) && $index['type'] == 'unique' ? 'UNIQUE' : 'KEY').' '.$index['name'].' ('.$columns.'),'; |
|
| 160 | 160 | } |
| 161 | 161 | } |
| 162 | 162 | |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | $parameters['engine'] = in_array('InnoDB', $engines) ? 'InnoDB' : 'MyISAM'; |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | - $table_query .= ') ENGINE=' . $parameters['engine']; |
|
| 189 | + $table_query .= ') ENGINE='.$parameters['engine']; |
|
| 190 | 190 | if (!empty($db_character_set) && $db_character_set == 'utf8') |
| 191 | 191 | $table_query .= ' DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci'; |
| 192 | 192 | |
@@ -202,13 +202,13 @@ discard block |
||
| 202 | 202 | { |
| 203 | 203 | $same_col = array(); |
| 204 | 204 | |
| 205 | - $request = $smcFunc['db_query']('',' |
|
| 205 | + $request = $smcFunc['db_query']('', ' |
|
| 206 | 206 | SELECT count(*), column_name |
| 207 | 207 | FROM information_schema.columns |
| 208 | 208 | WHERE table_name in ({string:table1},{string:table2}) AND table_schema = {string:schema} |
| 209 | 209 | GROUP BY column_name |
| 210 | 210 | HAVING count(*) > 1', |
| 211 | - array ( |
|
| 211 | + array( |
|
| 212 | 212 | 'table1' => $table_name, |
| 213 | 213 | 'table2' => $table_name.'_old', |
| 214 | 214 | 'schema' => $db_name, |
@@ -220,16 +220,16 @@ discard block |
||
| 220 | 220 | $same_col[] = $row['column_name']; |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | - $smcFunc['db_query']('',' |
|
| 224 | - INSERT INTO ' . $table_name .'(' |
|
| 225 | - . implode($same_col, ',') . |
|
| 223 | + $smcFunc['db_query']('', ' |
|
| 224 | + INSERT INTO ' . $table_name.'(' |
|
| 225 | + . implode($same_col, ','). |
|
| 226 | 226 | ') |
| 227 | - SELECT '. implode($same_col, ',') . ' |
|
| 228 | - FROM ' . $table_name . '_old', |
|
| 227 | + SELECT '. implode($same_col, ',').' |
|
| 228 | + FROM ' . $table_name.'_old', |
|
| 229 | 229 | array() |
| 230 | 230 | ); |
| 231 | 231 | |
| 232 | - $smcFunc['db_drop_table']($table_name . '_old'); |
|
| 232 | + $smcFunc['db_drop_table']($table_name.'_old'); |
|
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | return true; |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | // Does it exist? |
| 262 | 262 | if (in_array($full_table_name, $smcFunc['db_list_tables']())) |
| 263 | 263 | { |
| 264 | - $query = 'DROP TABLE ' . $table_name; |
|
| 264 | + $query = 'DROP TABLE '.$table_name; |
|
| 265 | 265 | $smcFunc['db_query']('', |
| 266 | 266 | $query, |
| 267 | 267 | array( |
@@ -312,8 +312,8 @@ discard block |
||
| 312 | 312 | |
| 313 | 313 | // Now add the thing! |
| 314 | 314 | $query = ' |
| 315 | - ALTER TABLE ' . $table_name . ' |
|
| 316 | - ADD ' . smf_db_create_query_column($column_info) . (empty($column_info['auto']) ? '' : ' primary key'); |
|
| 315 | + ALTER TABLE ' . $table_name.' |
|
| 316 | + ADD ' . smf_db_create_query_column($column_info).(empty($column_info['auto']) ? '' : ' primary key'); |
|
| 317 | 317 | $smcFunc['db_query']('', $query, |
| 318 | 318 | array( |
| 319 | 319 | 'security_override' => true, |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | if ($column['name'] == $column_name) |
| 345 | 345 | { |
| 346 | 346 | $smcFunc['db_query']('', ' |
| 347 | - ALTER TABLE ' . $table_name . ' |
|
| 347 | + ALTER TABLE ' . $table_name.' |
|
| 348 | 348 | DROP COLUMN ' . $column_name, |
| 349 | 349 | array( |
| 350 | 350 | 'security_override' => true, |
@@ -405,13 +405,13 @@ discard block |
||
| 405 | 405 | $unsigned = in_array($type, array('int', 'tinyint', 'smallint', 'mediumint', 'bigint')) && !empty($column_info['unsigned']) ? 'unsigned ' : ''; |
| 406 | 406 | |
| 407 | 407 | if ($size !== null) |
| 408 | - $type = $type . '(' . $size . ')'; |
|
| 408 | + $type = $type.'('.$size.')'; |
|
| 409 | 409 | |
| 410 | 410 | $smcFunc['db_query']('', ' |
| 411 | - ALTER TABLE ' . $table_name . ' |
|
| 412 | - CHANGE COLUMN `' . $old_column . '` `' . $column_info['name'] . '` ' . $type . ' ' . (!empty($unsigned) ? $unsigned : '') . (empty($column_info['null']) ? 'NOT NULL' : '') . ' ' . |
|
| 413 | - (!isset($column_info['default']) ? '' : 'default \'' . $smcFunc['db_escape_string']($column_info['default']) . '\'') . ' ' . |
|
| 414 | - (empty($column_info['auto']) ? '' : 'auto_increment') . ' ', |
|
| 411 | + ALTER TABLE ' . $table_name.' |
|
| 412 | + CHANGE COLUMN `' . $old_column.'` `'.$column_info['name'].'` '.$type.' '.(!empty($unsigned) ? $unsigned : '').(empty($column_info['null']) ? 'NOT NULL' : '').' '. |
|
| 413 | + (!isset($column_info['default']) ? '' : 'default \''.$smcFunc['db_escape_string']($column_info['default']).'\'').' '. |
|
| 414 | + (empty($column_info['auto']) ? '' : 'auto_increment').' ', |
|
| 415 | 415 | array( |
| 416 | 416 | 'security_override' => true, |
| 417 | 417 | ) |
@@ -471,8 +471,8 @@ discard block |
||
| 471 | 471 | if (!empty($index_info['type']) && $index_info['type'] == 'primary') |
| 472 | 472 | { |
| 473 | 473 | $smcFunc['db_query']('', ' |
| 474 | - ALTER TABLE ' . $table_name . ' |
|
| 475 | - ADD PRIMARY KEY (' . $columns . ')', |
|
| 474 | + ALTER TABLE ' . $table_name.' |
|
| 475 | + ADD PRIMARY KEY (' . $columns.')', |
|
| 476 | 476 | array( |
| 477 | 477 | 'security_override' => true, |
| 478 | 478 | ) |
@@ -481,8 +481,8 @@ discard block |
||
| 481 | 481 | else |
| 482 | 482 | { |
| 483 | 483 | $smcFunc['db_query']('', ' |
| 484 | - ALTER TABLE ' . $table_name . ' |
|
| 485 | - ADD ' . (isset($index_info['type']) && $index_info['type'] == 'unique' ? 'UNIQUE' : 'INDEX') . ' ' . $index_info['name'] . ' (' . $columns . ')', |
|
| 484 | + ALTER TABLE ' . $table_name.' |
|
| 485 | + ADD ' . (isset($index_info['type']) && $index_info['type'] == 'unique' ? 'UNIQUE' : 'INDEX').' '.$index_info['name'].' ('.$columns.')', |
|
| 486 | 486 | array( |
| 487 | 487 | 'security_override' => true, |
| 488 | 488 | ) |
@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | { |
| 516 | 516 | // Dropping primary key? |
| 517 | 517 | $smcFunc['db_query']('', ' |
| 518 | - ALTER TABLE ' . $table_name . ' |
|
| 518 | + ALTER TABLE ' . $table_name.' |
|
| 519 | 519 | DROP PRIMARY KEY', |
| 520 | 520 | array( |
| 521 | 521 | 'security_override' => true, |
@@ -528,7 +528,7 @@ discard block |
||
| 528 | 528 | { |
| 529 | 529 | // Drop the bugger... |
| 530 | 530 | $smcFunc['db_query']('', ' |
| 531 | - ALTER TABLE ' . $table_name . ' |
|
| 531 | + ALTER TABLE ' . $table_name.' |
|
| 532 | 532 | DROP INDEX ' . $index_name, |
| 533 | 533 | array( |
| 534 | 534 | 'security_override' => true, |
@@ -644,7 +644,7 @@ discard block |
||
| 644 | 644 | SHOW FIELDS |
| 645 | 645 | FROM {raw:table_name}', |
| 646 | 646 | array( |
| 647 | - 'table_name' => substr($table_name, 0, 1) == '`' ? $table_name : '`' . $table_name . '`', |
|
| 647 | + 'table_name' => substr($table_name, 0, 1) == '`' ? $table_name : '`'.$table_name.'`', |
|
| 648 | 648 | ) |
| 649 | 649 | ); |
| 650 | 650 | $columns = array(); |
@@ -712,7 +712,7 @@ discard block |
||
| 712 | 712 | SHOW KEYS |
| 713 | 713 | FROM {raw:table_name}', |
| 714 | 714 | array( |
| 715 | - 'table_name' => substr($table_name, 0, 1) == '`' ? $table_name : '`' . $table_name . '`', |
|
| 715 | + 'table_name' => substr($table_name, 0, 1) == '`' ? $table_name : '`'.$table_name.'`', |
|
| 716 | 716 | ) |
| 717 | 717 | ); |
| 718 | 718 | $indexes = array(); |
@@ -744,7 +744,7 @@ discard block |
||
| 744 | 744 | |
| 745 | 745 | // Is it a partial index? |
| 746 | 746 | if (!empty($row['Sub_part'])) |
| 747 | - $indexes[$row['Key_name']]['columns'][] = $row['Column_name'] . '(' . $row['Sub_part'] . ')'; |
|
| 747 | + $indexes[$row['Key_name']]['columns'][] = $row['Column_name'].'('.$row['Sub_part'].')'; |
|
| 748 | 748 | else |
| 749 | 749 | $indexes[$row['Key_name']]['columns'][] = $row['Column_name']; |
| 750 | 750 | } |
@@ -770,7 +770,7 @@ discard block |
||
| 770 | 770 | $default = 'auto_increment'; |
| 771 | 771 | } |
| 772 | 772 | elseif (isset($column['default']) && $column['default'] !== null) |
| 773 | - $default = 'default \'' . $smcFunc['db_escape_string']($column['default']) . '\''; |
|
| 773 | + $default = 'default \''.$smcFunc['db_escape_string']($column['default']).'\''; |
|
| 774 | 774 | else |
| 775 | 775 | $default = ''; |
| 776 | 776 | |
@@ -782,10 +782,10 @@ discard block |
||
| 782 | 782 | $unsigned = in_array($type, array('int', 'tinyint', 'smallint', 'mediumint', 'bigint')) && !empty($column['unsigned']) ? 'unsigned ' : ''; |
| 783 | 783 | |
| 784 | 784 | if ($size !== null) |
| 785 | - $type = $type . '(' . $size . ')'; |
|
| 785 | + $type = $type.'('.$size.')'; |
|
| 786 | 786 | |
| 787 | 787 | // Now just put it together! |
| 788 | - return '`' . $column['name'] . '` ' . $type . ' ' . (!empty($unsigned) ? $unsigned : '') . (!empty($column['null']) ? '' : 'NOT NULL') . ' ' . $default; |
|
| 788 | + return '`'.$column['name'].'` '.$type.' '.(!empty($unsigned) ? $unsigned : '').(!empty($column['null']) ? '' : 'NOT NULL').' '.$default; |
|
| 789 | 789 | } |
| 790 | 790 | |
| 791 | 791 | ?> |
| 792 | 792 | \ No newline at end of file |
@@ -475,7 +475,7 @@ |
||
| 475 | 475 | * Used by fatal_error(), fatal_lang_error() |
| 476 | 476 | * |
| 477 | 477 | * @param string $error The error |
| 478 | - * @param array $sprintf An array of data to be sprintf()'d into the specified message |
|
| 478 | + * @param boolean $sprintf An array of data to be sprintf()'d into the specified message |
|
| 479 | 479 | */ |
| 480 | 480 | function log_error_online($error, $sprintf = array()) |
| 481 | 481 | { |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | $backtrace = debug_backtrace(); |
| 46 | 46 | |
| 47 | 47 | // are we in a loop? |
| 48 | - if($error_call > 2) |
|
| 48 | + if ($error_call > 2) |
|
| 49 | 49 | { |
| 50 | 50 | var_dump($backtrace); |
| 51 | 51 | die('Error loop.'); |
@@ -83,11 +83,11 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | // Don't log the session hash in the url twice, it's a waste. |
| 85 | 85 | if (!empty($smcFunc['htmlspecialchars'])) |
| 86 | - $query_string = $smcFunc['htmlspecialchars']((SMF == 'SSI' || SMF == 'BACKGROUND' ? '' : '?') . preg_replace(array('~;sesc=[^&;]+~', '~' . session_name() . '=' . session_id() . '[&;]~'), array(';sesc', ''), $query_string)); |
|
| 86 | + $query_string = $smcFunc['htmlspecialchars']((SMF == 'SSI' || SMF == 'BACKGROUND' ? '' : '?').preg_replace(array('~;sesc=[^&;]+~', '~'.session_name().'='.session_id().'[&;]~'), array(';sesc', ''), $query_string)); |
|
| 87 | 87 | |
| 88 | 88 | // Just so we know what board error messages are from. |
| 89 | 89 | if (isset($_POST['board']) && !isset($_GET['board'])) |
| 90 | - $query_string .= ($query_string == '' ? 'board=' : ';board=') . $_POST['board']; |
|
| 90 | + $query_string .= ($query_string == '' ? 'board=' : ';board=').$_POST['board']; |
|
| 91 | 91 | |
| 92 | 92 | // What types of categories do we have? |
| 93 | 93 | $known_error_types = array( |
@@ -263,9 +263,9 @@ discard block |
||
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | if (isset($array[$i]) && !empty($array[$i]['args'])) |
| 266 | - $file = realpath($settings['current_include_filename']) . ' (' . $array[$i]['args'][0] . ' sub template - eval?)'; |
|
| 266 | + $file = realpath($settings['current_include_filename']).' ('.$array[$i]['args'][0].' sub template - eval?)'; |
|
| 267 | 267 | else |
| 268 | - $file = realpath($settings['current_include_filename']) . ' (eval?)'; |
|
| 268 | + $file = realpath($settings['current_include_filename']).' (eval?)'; |
|
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | if (isset($db_show_debug) && $db_show_debug === true) |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | |
| 286 | 286 | $error_type = stripos($error_string, 'undefined') !== false ? 'undefined_vars' : 'general'; |
| 287 | 287 | |
| 288 | - $message = log_error($error_level . ': ' . $error_string, $error_type, $file, $line); |
|
| 288 | + $message = log_error($error_level.': '.$error_string, $error_type, $file, $line); |
|
| 289 | 289 | |
| 290 | 290 | // Let's give integrations a chance to ouput a bit differently |
| 291 | 291 | call_integration_hook('integrate_output_error', array($message, $error_type, $error_level, $file, $line)); |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | $context['error_title'] = $txt['error_occured']; |
| 338 | 338 | $context['error_message'] = isset($context['error_message']) ? $context['error_message'] : $error_message; |
| 339 | 339 | |
| 340 | - $context['error_code'] = isset($error_code) ? 'id="' . $error_code . '" ' : ''; |
|
| 340 | + $context['error_code'] = isset($error_code) ? 'id="'.$error_code.'" ' : ''; |
|
| 341 | 341 | |
| 342 | 342 | if (empty($context['page_title'])) |
| 343 | 343 | $context['page_title'] = $context['error_title']; |
@@ -419,7 +419,7 @@ discard block |
||
| 419 | 419 | global $mbname, $modSettings, $maintenance; |
| 420 | 420 | global $db_connection, $webmaster_email, $db_last_error, $db_error_send, $smcFunc, $sourcedir; |
| 421 | 421 | |
| 422 | - require_once($sourcedir . '/Logging.php'); |
|
| 422 | + require_once($sourcedir.'/Logging.php'); |
|
| 423 | 423 | set_fatal_error_headers(); |
| 424 | 424 | |
| 425 | 425 | // For our purposes, we're gonna want this on if at all possible. |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | |
| 438 | 438 | // Language files aren't loaded yet :(. |
| 439 | 439 | $db_error = @$smcFunc['db_error']($db_connection); |
| 440 | - @mail($webmaster_email, $mbname . ': SMF Database Error!', 'There has been a problem with the database!' . ($db_error == '' ? '' : "\n" . $smcFunc['db_title'] . ' reported:' . "\n" . $db_error) . "\n\n" . 'This is a notice email to let you know that SMF could not connect to the database, contact your host if this continues.'); |
|
| 440 | + @mail($webmaster_email, $mbname.': SMF Database Error!', 'There has been a problem with the database!'.($db_error == '' ? '' : "\n".$smcFunc['db_title'].' reported:'."\n".$db_error)."\n\n".'This is a notice email to let you know that SMF could not connect to the database, contact your host if this continues.'); |
|
| 441 | 441 | } |
| 442 | 442 | |
| 443 | 443 | // What to do? Language files haven't and can't be loaded yet... |
@@ -495,7 +495,7 @@ discard block |
||
| 495 | 495 | |
| 496 | 496 | // Don't cache this page! |
| 497 | 497 | header('expires: Mon, 26 Jul 1997 05:00:00 GMT'); |
| 498 | - header('last-modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); |
|
| 498 | + header('last-modified: '.gmdate('D, d M Y H:i:s').' GMT'); |
|
| 499 | 499 | header('cache-control: no-cache'); |
| 500 | 500 | |
| 501 | 501 | // Send the right error codes. |
@@ -524,7 +524,7 @@ discard block |
||
| 524 | 524 | if (SMF == 'SSI' || SMF == 'BACKGROUND') |
| 525 | 525 | return; |
| 526 | 526 | |
| 527 | - $session_id = !empty($user_info['is_guest']) ? 'ip' . $user_info['ip'] : session_id(); |
|
| 527 | + $session_id = !empty($user_info['is_guest']) ? 'ip'.$user_info['ip'] : session_id(); |
|
| 528 | 528 | |
| 529 | 529 | // First, we have to get the online log, because we need to break apart the serialized string. |
| 530 | 530 | $request = $smcFunc['db_query']('', ' |
@@ -549,7 +549,7 @@ discard block |
||
| 549 | 549 | $url['error'] = $error; |
| 550 | 550 | // Url field got a max length of 1024 in db |
| 551 | 551 | if (strlen($url['error']) > 500) |
| 552 | - $url['error'] = substr($url['error'],0,500); |
|
| 552 | + $url['error'] = substr($url['error'], 0, 500); |
|
| 553 | 553 | |
| 554 | 554 | if (!empty($sprintf)) |
| 555 | 555 | $url['error_params'] = $sprintf; |
@@ -929,7 +929,7 @@ discard block |
||
| 929 | 929 | * Doesn't clean the inputs |
| 930 | 930 | * |
| 931 | 931 | * @param array $items_ids The items to remove |
| 932 | - * @param bool|int $group_id The ID of the group these triggers are associated with or false if deleting them from all groups |
|
| 932 | + * @param integer $group_id The ID of the group these triggers are associated with or false if deleting them from all groups |
|
| 933 | 933 | * @return bool Always returns true |
| 934 | 934 | */ |
| 935 | 935 | function removeBanTriggers($items_ids = array(), $group_id = false) |
@@ -1123,7 +1123,7 @@ discard block |
||
| 1123 | 1123 | * Errors in $context['ban_errors'] |
| 1124 | 1124 | * |
| 1125 | 1125 | * @param array $triggers The triggers to validate |
| 1126 | - * @return array An array of riggers and log info ready to be used |
|
| 1126 | + * @return integer An array of riggers and log info ready to be used |
|
| 1127 | 1127 | */ |
| 1128 | 1128 | function validateTriggers(&$triggers) |
| 1129 | 1129 | { |
@@ -784,7 +784,7 @@ discard block |
||
| 784 | 784 | ) |
| 785 | 785 | ); |
| 786 | 786 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 787 | - $error_ips[] = inet_dtop($row['ip']); |
|
| 787 | + $error_ips[] = inet_dtop($row['ip']); |
|
| 788 | 788 | $smcFunc['db_free_result']($request); |
| 789 | 789 | |
| 790 | 790 | return $error_ips; |
@@ -2168,9 +2168,9 @@ discard block |
||
| 2168 | 2168 | |
| 2169 | 2169 | if ($low == '255.255.255.255') return 'unknown'; |
| 2170 | 2170 | if ($low == $high) |
| 2171 | - return $low; |
|
| 2171 | + return $low; |
|
| 2172 | 2172 | else |
| 2173 | - return $low . '-' . $high; |
|
| 2173 | + return $low . '-' . $high; |
|
| 2174 | 2174 | } |
| 2175 | 2175 | |
| 2176 | 2176 | /** |
@@ -58,22 +58,22 @@ discard block |
||
| 58 | 58 | 'tabs' => array( |
| 59 | 59 | 'list' => array( |
| 60 | 60 | 'description' => $txt['ban_description'], |
| 61 | - 'href' => $scripturl . '?action=admin;area=ban;sa=list', |
|
| 61 | + 'href' => $scripturl.'?action=admin;area=ban;sa=list', |
|
| 62 | 62 | 'is_selected' => $_REQUEST['sa'] == 'list' || $_REQUEST['sa'] == 'edit' || $_REQUEST['sa'] == 'edittrigger', |
| 63 | 63 | ), |
| 64 | 64 | 'add' => array( |
| 65 | 65 | 'description' => $txt['ban_description'], |
| 66 | - 'href' => $scripturl . '?action=admin;area=ban;sa=add', |
|
| 66 | + 'href' => $scripturl.'?action=admin;area=ban;sa=add', |
|
| 67 | 67 | 'is_selected' => $_REQUEST['sa'] == 'add', |
| 68 | 68 | ), |
| 69 | 69 | 'browse' => array( |
| 70 | 70 | 'description' => $txt['ban_trigger_browse_description'], |
| 71 | - 'href' => $scripturl . '?action=admin;area=ban;sa=browse', |
|
| 71 | + 'href' => $scripturl.'?action=admin;area=ban;sa=browse', |
|
| 72 | 72 | 'is_selected' => $_REQUEST['sa'] == 'browse', |
| 73 | 73 | ), |
| 74 | 74 | 'log' => array( |
| 75 | 75 | 'description' => $txt['ban_log_description'], |
| 76 | - 'href' => $scripturl . '?action=admin;area=ban;sa=log', |
|
| 76 | + 'href' => $scripturl.'?action=admin;area=ban;sa=log', |
|
| 77 | 77 | 'is_selected' => $_REQUEST['sa'] == 'log', |
| 78 | 78 | 'is_last' => true, |
| 79 | 79 | ), |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | 'id' => 'ban_list', |
| 130 | 130 | 'title' => $txt['ban_title'], |
| 131 | 131 | 'items_per_page' => $modSettings['defaultMaxListItems'], |
| 132 | - 'base_href' => $scripturl . '?action=admin;area=ban;sa=list', |
|
| 132 | + 'base_href' => $scripturl.'?action=admin;area=ban;sa=list', |
|
| 133 | 133 | 'default_sort_col' => 'added', |
| 134 | 134 | 'default_sort_dir' => 'desc', |
| 135 | 135 | 'get_items' => array( |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | ), |
| 238 | 238 | 'data' => array( |
| 239 | 239 | 'sprintf' => array( |
| 240 | - 'format' => '<a href="' . $scripturl . '?action=admin;area=ban;sa=edit;bg=%1$d">' . $txt['modify'] . '</a>', |
|
| 240 | + 'format' => '<a href="'.$scripturl.'?action=admin;area=ban;sa=edit;bg=%1$d">'.$txt['modify'].'</a>', |
|
| 241 | 241 | 'params' => array( |
| 242 | 242 | 'id_ban_group' => false, |
| 243 | 243 | ), |
@@ -262,16 +262,16 @@ discard block |
||
| 262 | 262 | ), |
| 263 | 263 | ), |
| 264 | 264 | 'form' => array( |
| 265 | - 'href' => $scripturl . '?action=admin;area=ban;sa=list', |
|
| 265 | + 'href' => $scripturl.'?action=admin;area=ban;sa=list', |
|
| 266 | 266 | ), |
| 267 | 267 | 'additional_rows' => array( |
| 268 | 268 | array( |
| 269 | 269 | 'position' => 'top_of_list', |
| 270 | - 'value' => '<input type="submit" name="removeBans" value="' . $txt['ban_remove_selected'] . '" class="button">', |
|
| 270 | + 'value' => '<input type="submit" name="removeBans" value="'.$txt['ban_remove_selected'].'" class="button">', |
|
| 271 | 271 | ), |
| 272 | 272 | array( |
| 273 | 273 | 'position' => 'bottom_of_list', |
| 274 | - 'value' => '<input type="submit" name="removeBans" value="' . $txt['ban_remove_selected'] . '" class="button">', |
|
| 274 | + 'value' => '<input type="submit" name="removeBans" value="'.$txt['ban_remove_selected'].'" class="button">', |
|
| 275 | 275 | ), |
| 276 | 276 | ), |
| 277 | 277 | 'javascript' => ' |
@@ -283,15 +283,15 @@ discard block |
||
| 283 | 283 | if (removeItems == 0) |
| 284 | 284 | { |
| 285 | 285 | e.preventDefault(); |
| 286 | - return alert("'. $txt['select_item_check'] .'"); |
|
| 286 | + return alert("'. $txt['select_item_check'].'"); |
|
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | |
| 290 | - return confirm("'. $txt['ban_remove_selected_confirm'] .'"); |
|
| 290 | + return confirm("'. $txt['ban_remove_selected_confirm'].'"); |
|
| 291 | 291 | });', |
| 292 | 292 | ); |
| 293 | 293 | |
| 294 | - require_once($sourcedir . '/Subs-List.php'); |
|
| 294 | + require_once($sourcedir.'/Subs-List.php'); |
|
| 295 | 295 | createList($listOptions); |
| 296 | 296 | |
| 297 | 297 | $context['sub_template'] = 'show_list'; |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | // Template needs this to show errors using javascript |
| 376 | 376 | loadLanguage('Errors'); |
| 377 | 377 | createToken('admin-bet'); |
| 378 | - $context['form_url'] = $scripturl . '?action=admin;area=ban;sa=edit'; |
|
| 378 | + $context['form_url'] = $scripturl.'?action=admin;area=ban;sa=edit'; |
|
| 379 | 379 | |
| 380 | 380 | if (!empty($context['ban_errors'])) |
| 381 | 381 | foreach ($context['ban_errors'] as $error) |
@@ -389,11 +389,11 @@ discard block |
||
| 389 | 389 | $context['ban_group_id'] = $ban_group_id; |
| 390 | 390 | |
| 391 | 391 | // We're going to want this for making our list. |
| 392 | - require_once($sourcedir . '/Subs-List.php'); |
|
| 392 | + require_once($sourcedir.'/Subs-List.php'); |
|
| 393 | 393 | |
| 394 | 394 | $listOptions = array( |
| 395 | 395 | 'id' => 'ban_items', |
| 396 | - 'base_href' => $scripturl . '?action=admin;area=ban;sa=edit;bg=' . $ban_group_id, |
|
| 396 | + 'base_href' => $scripturl.'?action=admin;area=ban;sa=edit;bg='.$ban_group_id, |
|
| 397 | 397 | 'no_items_label' => $txt['ban_no_triggers'], |
| 398 | 398 | 'items_per_page' => $modSettings['defaultMaxListItems'], |
| 399 | 399 | 'get_items' => array( |
@@ -418,11 +418,11 @@ discard block |
||
| 418 | 418 | 'function' => function($ban_item) use ($txt) |
| 419 | 419 | { |
| 420 | 420 | if (in_array($ban_item['type'], array('ip', 'hostname', 'email'))) |
| 421 | - return '<strong>' . $txt[$ban_item['type']] . ':</strong> ' . $ban_item[$ban_item['type']]; |
|
| 421 | + return '<strong>'.$txt[$ban_item['type']].':</strong> '.$ban_item[$ban_item['type']]; |
|
| 422 | 422 | elseif ($ban_item['type'] == 'user') |
| 423 | - return '<strong>' . $txt['username'] . ':</strong> ' . $ban_item['user']['link']; |
|
| 423 | + return '<strong>'.$txt['username'].':</strong> '.$ban_item['user']['link']; |
|
| 424 | 424 | else |
| 425 | - return '<strong>' . $txt['unknown'] . ':</strong> ' . $ban_item['no_bantype_selected']; |
|
| 425 | + return '<strong>'.$txt['unknown'].':</strong> '.$ban_item['no_bantype_selected']; |
|
| 426 | 426 | }, |
| 427 | 427 | 'style' => 'text-align: left;', |
| 428 | 428 | ), |
@@ -445,7 +445,7 @@ discard block |
||
| 445 | 445 | 'data' => array( |
| 446 | 446 | 'function' => function($ban_item) use ($txt, $context, $scripturl) |
| 447 | 447 | { |
| 448 | - return '<a href="' . $scripturl . '?action=admin;area=ban;sa=edittrigger;bg=' . $context['ban_group_id'] . ';bi=' . $ban_item['id'] . '">' . $txt['ban_edit_trigger'] . '</a>'; |
|
| 448 | + return '<a href="'.$scripturl.'?action=admin;area=ban;sa=edittrigger;bg='.$context['ban_group_id'].';bi='.$ban_item['id'].'">'.$txt['ban_edit_trigger'].'</a>'; |
|
| 449 | 449 | }, |
| 450 | 450 | 'style' => 'text-align: center;', |
| 451 | 451 | ), |
@@ -467,34 +467,34 @@ discard block |
||
| 467 | 467 | ), |
| 468 | 468 | ), |
| 469 | 469 | 'form' => array( |
| 470 | - 'href' => $scripturl . '?action=admin;area=ban;sa=edit;bg=' . $ban_group_id, |
|
| 470 | + 'href' => $scripturl.'?action=admin;area=ban;sa=edit;bg='.$ban_group_id, |
|
| 471 | 471 | ), |
| 472 | 472 | 'additional_rows' => array( |
| 473 | 473 | array( |
| 474 | 474 | 'position' => 'above_table_headers', |
| 475 | 475 | 'value' => ' |
| 476 | - <input type="submit" name="remove_selection" value="' . $txt['ban_remove_selected_triggers'] . '" class="button"> <a class="button" href="' . $scripturl . '?action=admin;area=ban;sa=edittrigger;bg=' . $ban_group_id . '">' . $txt['ban_add_trigger'] . '</a>', |
|
| 476 | + <input type="submit" name="remove_selection" value="' . $txt['ban_remove_selected_triggers'].'" class="button"> <a class="button" href="'.$scripturl.'?action=admin;area=ban;sa=edittrigger;bg='.$ban_group_id.'">'.$txt['ban_add_trigger'].'</a>', |
|
| 477 | 477 | 'style' => 'text-align: right;', |
| 478 | 478 | ), |
| 479 | 479 | array( |
| 480 | 480 | 'position' => 'above_table_headers', |
| 481 | 481 | 'value' => ' |
| 482 | - <input type="hidden" name="bg" value="' . $ban_group_id . '"> |
|
| 483 | - <input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '"> |
|
| 484 | - <input type="hidden" name="' . $context['admin-bet_token_var'] . '" value="' . $context['admin-bet_token'] . '">', |
|
| 482 | + <input type="hidden" name="bg" value="' . $ban_group_id.'"> |
|
| 483 | + <input type="hidden" name="' . $context['session_var'].'" value="'.$context['session_id'].'"> |
|
| 484 | + <input type="hidden" name="' . $context['admin-bet_token_var'].'" value="'.$context['admin-bet_token'].'">', |
|
| 485 | 485 | ), |
| 486 | 486 | array( |
| 487 | 487 | 'position' => 'below_table_data', |
| 488 | 488 | 'value' => ' |
| 489 | - <input type="submit" name="remove_selection" value="' . $txt['ban_remove_selected_triggers'] . '" class="button"> <a class="button" href="' . $scripturl . '?action=admin;area=ban;sa=edittrigger;bg=' . $ban_group_id . '">' . $txt['ban_add_trigger'] . '</a>', |
|
| 489 | + <input type="submit" name="remove_selection" value="' . $txt['ban_remove_selected_triggers'].'" class="button"> <a class="button" href="'.$scripturl.'?action=admin;area=ban;sa=edittrigger;bg='.$ban_group_id.'">'.$txt['ban_add_trigger'].'</a>', |
|
| 490 | 490 | 'style' => 'text-align: right;', |
| 491 | 491 | ), |
| 492 | 492 | array( |
| 493 | 493 | 'position' => 'below_table_data', |
| 494 | 494 | 'value' => ' |
| 495 | - <input type="hidden" name="bg" value="' . $ban_group_id . '"> |
|
| 496 | - <input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '"> |
|
| 497 | - <input type="hidden" name="' . $context['admin-bet_token_var'] . '" value="' . $context['admin-bet_token'] . '">', |
|
| 495 | + <input type="hidden" name="bg" value="' . $ban_group_id.'"> |
|
| 496 | + <input type="hidden" name="' . $context['session_var'].'" value="'.$context['session_id'].'"> |
|
| 497 | + <input type="hidden" name="' . $context['admin-bet_token_var'].'" value="'.$context['admin-bet_token'].'">', |
|
| 498 | 498 | ), |
| 499 | 499 | ), |
| 500 | 500 | 'javascript' => ' |
@@ -506,11 +506,11 @@ discard block |
||
| 506 | 506 | if (removeItems == 0) |
| 507 | 507 | { |
| 508 | 508 | e.preventDefault(); |
| 509 | - return alert("'. $txt['select_item_check'] .'"); |
|
| 509 | + return alert("'. $txt['select_item_check'].'"); |
|
| 510 | 510 | } |
| 511 | 511 | |
| 512 | 512 | |
| 513 | - return confirm("'. $txt['ban_remove_selected_confirm'] .'"); |
|
| 513 | + return confirm("'. $txt['ban_remove_selected_confirm'].'"); |
|
| 514 | 514 | });', |
| 515 | 515 | ); |
| 516 | 516 | createList($listOptions); |
@@ -566,8 +566,8 @@ discard block |
||
| 566 | 566 | |
| 567 | 567 | if (!empty($context['ban_suggestions']['member']['id'])) |
| 568 | 568 | { |
| 569 | - $context['ban_suggestions']['href'] = $scripturl . '?action=profile;u=' . $context['ban_suggestions']['member']['id']; |
|
| 570 | - $context['ban_suggestions']['member']['link'] = '<a href="' . $context['ban_suggestions']['href'] . '">' . $context['ban_suggestions']['member']['name'] . '</a>'; |
|
| 569 | + $context['ban_suggestions']['href'] = $scripturl.'?action=profile;u='.$context['ban_suggestions']['member']['id']; |
|
| 570 | + $context['ban_suggestions']['member']['link'] = '<a href="'.$context['ban_suggestions']['href'].'">'.$context['ban_suggestions']['member']['name'].'</a>'; |
|
| 571 | 571 | |
| 572 | 572 | // Default the ban name to the name of the banned member. |
| 573 | 573 | $context['ban']['name'] = $context['ban_suggestions']['member']['name']; |
@@ -699,8 +699,8 @@ discard block |
||
| 699 | 699 | $ban_items[$row['id_ban']]['user'] = array( |
| 700 | 700 | 'id' => $row['id_member'], |
| 701 | 701 | 'name' => $row['real_name'], |
| 702 | - 'href' => $scripturl . '?action=profile;u=' . $row['id_member'], |
|
| 703 | - 'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>', |
|
| 702 | + 'href' => $scripturl.'?action=profile;u='.$row['id_member'], |
|
| 703 | + 'link' => '<a href="'.$scripturl.'?action=profile;u='.$row['id_member'].'">'.$row['real_name'].'</a>', |
|
| 704 | 704 | ); |
| 705 | 705 | } |
| 706 | 706 | // Invalid ban (member probably doesn't exist anymore). |
@@ -900,7 +900,7 @@ discard block |
||
| 900 | 900 | |
| 901 | 901 | // Update the member table to represent the new ban situation. |
| 902 | 902 | updateBanMembers(); |
| 903 | - redirectexit('action=admin;area=ban;sa=edit;bg=' . $ban_group_id); |
|
| 903 | + redirectexit('action=admin;area=ban;sa=edit;bg='.$ban_group_id); |
|
| 904 | 904 | } |
| 905 | 905 | |
| 906 | 906 | /** |
@@ -1033,8 +1033,8 @@ discard block |
||
| 1033 | 1033 | $ban_items[$row['id_ban']]['user'] = array( |
| 1034 | 1034 | 'id' => $row['id_member'], |
| 1035 | 1035 | 'name' => $row['real_name'], |
| 1036 | - 'href' => $scripturl . '?action=profile;u=' . $row['id_member'], |
|
| 1037 | - 'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>', |
|
| 1036 | + 'href' => $scripturl.'?action=profile;u='.$row['id_member'], |
|
| 1037 | + 'link' => '<a href="'.$scripturl.'?action=profile;u='.$row['id_member'].'">'.$row['real_name'].'</a>', |
|
| 1038 | 1038 | ); |
| 1039 | 1039 | $log_info[] = array( |
| 1040 | 1040 | 'bantype' => 'user', |
@@ -1429,7 +1429,7 @@ discard block |
||
| 1429 | 1429 | |
| 1430 | 1430 | // Log the addion of the ban entries into the moderation log. |
| 1431 | 1431 | foreach ($logs as $log) |
| 1432 | - logAction('ban' . ($removal == true ? 'remove' : ''), array( |
|
| 1432 | + logAction('ban'.($removal == true ? 'remove' : ''), array( |
|
| 1433 | 1433 | $log_name_map[$log['bantype']] => $log['value'], |
| 1434 | 1434 | 'new' => empty($new) ? 0 : 1, |
| 1435 | 1435 | 'remove' => empty($removal) ? 0 : 1, |
@@ -1600,7 +1600,7 @@ discard block |
||
| 1600 | 1600 | global $context, $smcFunc, $scripturl; |
| 1601 | 1601 | |
| 1602 | 1602 | $context['sub_template'] = 'ban_edit_trigger'; |
| 1603 | - $context['form_url'] = $scripturl . '?action=admin;area=ban;sa=edittrigger'; |
|
| 1603 | + $context['form_url'] = $scripturl.'?action=admin;area=ban;sa=edittrigger'; |
|
| 1604 | 1604 | |
| 1605 | 1605 | $ban_group = isset($_REQUEST['bg']) ? (int) $_REQUEST['bg'] : 0; |
| 1606 | 1606 | $ban_id = isset($_REQUEST['bi']) ? (int) $_REQUEST['bi'] : 0; |
@@ -1611,7 +1611,7 @@ discard block |
||
| 1611 | 1611 | if (isset($_POST['add_new_trigger']) && !empty($_POST['ban_suggestions'])) |
| 1612 | 1612 | { |
| 1613 | 1613 | saveTriggers($_POST['ban_suggestions'], $ban_group, 0, $ban_id); |
| 1614 | - redirectexit('action=admin;area=ban;sa=edit' . (!empty($ban_group) ? ';bg=' . $ban_group : '')); |
|
| 1614 | + redirectexit('action=admin;area=ban;sa=edit'.(!empty($ban_group) ? ';bg='.$ban_group : '')); |
|
| 1615 | 1615 | } |
| 1616 | 1616 | elseif (isset($_POST['edit_trigger']) && !empty($_POST['ban_suggestions'])) |
| 1617 | 1617 | { |
@@ -1620,12 +1620,12 @@ discard block |
||
| 1620 | 1620 | if (!empty($_POST['ban_suggestions'])) |
| 1621 | 1621 | saveTriggers($_POST['ban_suggestions'], $ban_group); |
| 1622 | 1622 | |
| 1623 | - redirectexit('action=admin;area=ban;sa=edit' . (!empty($ban_group) ? ';bg=' . $ban_group : '')); |
|
| 1623 | + redirectexit('action=admin;area=ban;sa=edit'.(!empty($ban_group) ? ';bg='.$ban_group : '')); |
|
| 1624 | 1624 | } |
| 1625 | 1625 | elseif (isset($_POST['edit_trigger'])) |
| 1626 | 1626 | { |
| 1627 | 1627 | removeBanTriggers($ban_id); |
| 1628 | - redirectexit('action=admin;area=ban;sa=edit' . (!empty($ban_group) ? ';bg=' . $ban_group : '')); |
|
| 1628 | + redirectexit('action=admin;area=ban;sa=edit'.(!empty($ban_group) ? ';bg='.$ban_group : '')); |
|
| 1629 | 1629 | } |
| 1630 | 1630 | |
| 1631 | 1631 | loadJavaScriptFile('suggest.js', array('minimize' => true), 'smf_suggest'); |
@@ -1734,7 +1734,7 @@ discard block |
||
| 1734 | 1734 | 'id' => 'ban_trigger_list', |
| 1735 | 1735 | 'title' => $txt['ban_trigger_browse'], |
| 1736 | 1736 | 'items_per_page' => $modSettings['defaultMaxListItems'], |
| 1737 | - 'base_href' => $scripturl . '?action=admin;area=ban;sa=browse;entity=' . $context['selected_entity'], |
|
| 1737 | + 'base_href' => $scripturl.'?action=admin;area=ban;sa=browse;entity='.$context['selected_entity'], |
|
| 1738 | 1738 | 'default_sort_col' => 'banned_entity', |
| 1739 | 1739 | 'no_items_label' => $txt['ban_no_triggers'], |
| 1740 | 1740 | 'get_items' => array( |
@@ -1761,7 +1761,7 @@ discard block |
||
| 1761 | 1761 | ), |
| 1762 | 1762 | 'data' => array( |
| 1763 | 1763 | 'sprintf' => array( |
| 1764 | - 'format' => '<a href="' . $scripturl . '?action=admin;area=ban;sa=edit;bg=%1$d">%2$s</a>', |
|
| 1764 | + 'format' => '<a href="'.$scripturl.'?action=admin;area=ban;sa=edit;bg=%1$d">%2$s</a>', |
|
| 1765 | 1765 | 'params' => array( |
| 1766 | 1766 | 'id_ban_group' => false, |
| 1767 | 1767 | 'name' => false, |
@@ -1802,18 +1802,18 @@ discard block |
||
| 1802 | 1802 | ), |
| 1803 | 1803 | ), |
| 1804 | 1804 | 'form' => array( |
| 1805 | - 'href' => $scripturl . '?action=admin;area=ban;sa=browse;entity=' . $context['selected_entity'], |
|
| 1805 | + 'href' => $scripturl.'?action=admin;area=ban;sa=browse;entity='.$context['selected_entity'], |
|
| 1806 | 1806 | 'include_start' => true, |
| 1807 | 1807 | 'include_sort' => true, |
| 1808 | 1808 | ), |
| 1809 | 1809 | 'additional_rows' => array( |
| 1810 | 1810 | array( |
| 1811 | 1811 | 'position' => 'above_column_headers', |
| 1812 | - 'value' => '<a href="' . $scripturl . '?action=admin;area=ban;sa=browse;entity=ip">' . ($context['selected_entity'] == 'ip' ? '<img src="' . $settings['images_url'] . '/selected.png" alt=">"> ' : '') . $txt['ip'] . '</a> | <a href="' . $scripturl . '?action=admin;area=ban;sa=browse;entity=hostname">' . ($context['selected_entity'] == 'hostname' ? '<img src="' . $settings['images_url'] . '/selected.png" alt=">"> ' : '') . $txt['hostname'] . '</a> | <a href="' . $scripturl . '?action=admin;area=ban;sa=browse;entity=email">' . ($context['selected_entity'] == 'email' ? '<img src="' . $settings['images_url'] . '/selected.png" alt=">"> ' : '') . $txt['email'] . '</a> | <a href="' . $scripturl . '?action=admin;area=ban;sa=browse;entity=member">' . ($context['selected_entity'] == 'member' ? '<img src="' . $settings['images_url'] . '/selected.png" alt=">"> ' : '') . $txt['username'] . '</a>', |
|
| 1812 | + 'value' => '<a href="'.$scripturl.'?action=admin;area=ban;sa=browse;entity=ip">'.($context['selected_entity'] == 'ip' ? '<img src="'.$settings['images_url'].'/selected.png" alt=">"> ' : '').$txt['ip'].'</a> | <a href="'.$scripturl.'?action=admin;area=ban;sa=browse;entity=hostname">'.($context['selected_entity'] == 'hostname' ? '<img src="'.$settings['images_url'].'/selected.png" alt=">"> ' : '').$txt['hostname'].'</a> | <a href="'.$scripturl.'?action=admin;area=ban;sa=browse;entity=email">'.($context['selected_entity'] == 'email' ? '<img src="'.$settings['images_url'].'/selected.png" alt=">"> ' : '').$txt['email'].'</a> | <a href="'.$scripturl.'?action=admin;area=ban;sa=browse;entity=member">'.($context['selected_entity'] == 'member' ? '<img src="'.$settings['images_url'].'/selected.png" alt=">"> ' : '').$txt['username'].'</a>', |
|
| 1813 | 1813 | ), |
| 1814 | 1814 | array( |
| 1815 | 1815 | 'position' => 'bottom_of_list', |
| 1816 | - 'value' => '<input type="submit" name="remove_triggers" value="' . $txt['ban_remove_selected_triggers'] . '" data-confirm="' . $txt['ban_remove_selected_triggers_confirm'] . '" class="button you_sure">', |
|
| 1816 | + 'value' => '<input type="submit" name="remove_triggers" value="'.$txt['ban_remove_selected_triggers'].'" data-confirm="'.$txt['ban_remove_selected_triggers_confirm'].'" class="button you_sure">', |
|
| 1817 | 1817 | ), |
| 1818 | 1818 | ), |
| 1819 | 1819 | ); |
@@ -1866,7 +1866,7 @@ discard block |
||
| 1866 | 1866 | { |
| 1867 | 1867 | $listOptions['columns']['banned_entity']['data'] = array( |
| 1868 | 1868 | 'sprintf' => array( |
| 1869 | - 'format' => '<a href="' . $scripturl . '?action=profile;u=%1$d">%2$s</a>', |
|
| 1869 | + 'format' => '<a href="'.$scripturl.'?action=profile;u=%1$d">%2$s</a>', |
|
| 1870 | 1870 | 'params' => array( |
| 1871 | 1871 | 'id_member' => false, |
| 1872 | 1872 | 'real_name' => false, |
@@ -1880,7 +1880,7 @@ discard block |
||
| 1880 | 1880 | } |
| 1881 | 1881 | |
| 1882 | 1882 | // Create the list. |
| 1883 | - require_once($sourcedir . '/Subs-List.php'); |
|
| 1883 | + require_once($sourcedir.'/Subs-List.php'); |
|
| 1884 | 1884 | createList($listOptions); |
| 1885 | 1885 | |
| 1886 | 1886 | // The list is the only thing to show, so make it the default sub template. |
@@ -1911,11 +1911,11 @@ discard block |
||
| 1911 | 1911 | SELECT |
| 1912 | 1912 | bi.id_ban, bi.ip_low, bi.ip_high, bi.hostname, bi.email_address, bi.hits, |
| 1913 | 1913 | bg.id_ban_group, bg.name' . ($trigger_type === 'member' ? ', |
| 1914 | - mem.id_member, mem.real_name' : '') . ' |
|
| 1914 | + mem.id_member, mem.real_name' : '').' |
|
| 1915 | 1915 | FROM {db_prefix}ban_items AS bi |
| 1916 | 1916 | INNER JOIN {db_prefix}ban_groups AS bg ON (bg.id_ban_group = bi.id_ban_group)' . ($trigger_type === 'member' ? ' |
| 1917 | 1917 | INNER JOIN {db_prefix}members AS mem ON (mem.id_member = bi.id_member)' : ' |
| 1918 | - WHERE ' . $where[$trigger_type]) . ' |
|
| 1918 | + WHERE ' . $where[$trigger_type]).' |
|
| 1919 | 1919 | ORDER BY {raw:sort} |
| 1920 | 1920 | LIMIT {int:start}, {int:max}', |
| 1921 | 1921 | array( |
@@ -1997,7 +1997,7 @@ discard block |
||
| 1997 | 1997 | 'id' => 'ban_log', |
| 1998 | 1998 | 'title' => $txt['ban_log'], |
| 1999 | 1999 | 'items_per_page' => $modSettings['defaultMaxListItems'], |
| 2000 | - 'base_href' => $context['admin_area'] == 'ban' ? $scripturl . '?action=admin;area=ban;sa=log' : $scripturl . '?action=admin;area=logs;sa=banlog', |
|
| 2000 | + 'base_href' => $context['admin_area'] == 'ban' ? $scripturl.'?action=admin;area=ban;sa=log' : $scripturl.'?action=admin;area=logs;sa=banlog', |
|
| 2001 | 2001 | 'default_sort_col' => 'date', |
| 2002 | 2002 | 'get_items' => array( |
| 2003 | 2003 | 'function' => 'list_getBanLogEntries', |
@@ -2013,7 +2013,7 @@ discard block |
||
| 2013 | 2013 | ), |
| 2014 | 2014 | 'data' => array( |
| 2015 | 2015 | 'sprintf' => array( |
| 2016 | - 'format' => '<a href="' . $scripturl . '?action=trackip;searchip=%1$s">%1$s</a>', |
|
| 2016 | + 'format' => '<a href="'.$scripturl.'?action=trackip;searchip=%1$s">%1$s</a>', |
|
| 2017 | 2017 | 'params' => array( |
| 2018 | 2018 | 'ip' => false, |
| 2019 | 2019 | ), |
@@ -2042,7 +2042,7 @@ discard block |
||
| 2042 | 2042 | ), |
| 2043 | 2043 | 'data' => array( |
| 2044 | 2044 | 'sprintf' => array( |
| 2045 | - 'format' => '<a href="' . $scripturl . '?action=profile;u=%1$d">%2$s</a>', |
|
| 2045 | + 'format' => '<a href="'.$scripturl.'?action=profile;u=%1$d">%2$s</a>', |
|
| 2046 | 2046 | 'params' => array( |
| 2047 | 2047 | 'id_member' => false, |
| 2048 | 2048 | 'real_name' => false, |
@@ -2086,7 +2086,7 @@ discard block |
||
| 2086 | 2086 | ), |
| 2087 | 2087 | ), |
| 2088 | 2088 | 'form' => array( |
| 2089 | - 'href' => $context['admin_area'] == 'ban' ? $scripturl . '?action=admin;area=ban;sa=log' : $scripturl . '?action=admin;area=logs;sa=banlog', |
|
| 2089 | + 'href' => $context['admin_area'] == 'ban' ? $scripturl.'?action=admin;area=ban;sa=log' : $scripturl.'?action=admin;area=logs;sa=banlog', |
|
| 2090 | 2090 | 'include_start' => true, |
| 2091 | 2091 | 'include_sort' => true, |
| 2092 | 2092 | 'token' => 'admin-bl', |
@@ -2095,21 +2095,21 @@ discard block |
||
| 2095 | 2095 | array( |
| 2096 | 2096 | 'position' => 'top_of_list', |
| 2097 | 2097 | 'value' => ' |
| 2098 | - <input type="submit" name="removeSelected" value="' . $txt['ban_log_remove_selected'] . '" data-confirm="' . $txt['ban_log_remove_selected_confirm'] . '" class="button you_sure"> |
|
| 2099 | - <input type="submit" name="removeAll" value="' . $txt['ban_log_remove_all'] . '" data-confirm="' . $txt['ban_log_remove_all_confirm'] . '" class="button you_sure">', |
|
| 2098 | + <input type="submit" name="removeSelected" value="' . $txt['ban_log_remove_selected'].'" data-confirm="'.$txt['ban_log_remove_selected_confirm'].'" class="button you_sure"> |
|
| 2099 | + <input type="submit" name="removeAll" value="' . $txt['ban_log_remove_all'].'" data-confirm="'.$txt['ban_log_remove_all_confirm'].'" class="button you_sure">', |
|
| 2100 | 2100 | ), |
| 2101 | 2101 | array( |
| 2102 | 2102 | 'position' => 'bottom_of_list', |
| 2103 | 2103 | 'value' => ' |
| 2104 | - <input type="submit" name="removeSelected" value="' . $txt['ban_log_remove_selected'] . '" data-confirm="' . $txt['ban_log_remove_selected_confirm'] . '" class="button you_sure"> |
|
| 2105 | - <input type="submit" name="removeAll" value="' . $txt['ban_log_remove_all'] . '" data-confirm="' . $txt['ban_log_remove_all_confirm'] . '" class="button you_sure">', |
|
| 2104 | + <input type="submit" name="removeSelected" value="' . $txt['ban_log_remove_selected'].'" data-confirm="'.$txt['ban_log_remove_selected_confirm'].'" class="button you_sure"> |
|
| 2105 | + <input type="submit" name="removeAll" value="' . $txt['ban_log_remove_all'].'" data-confirm="'.$txt['ban_log_remove_all_confirm'].'" class="button you_sure">', |
|
| 2106 | 2106 | ), |
| 2107 | 2107 | ), |
| 2108 | 2108 | ); |
| 2109 | 2109 | |
| 2110 | 2110 | createToken('admin-bl'); |
| 2111 | 2111 | |
| 2112 | - require_once($sourcedir . '/Subs-List.php'); |
|
| 2112 | + require_once($sourcedir.'/Subs-List.php'); |
|
| 2113 | 2113 | createList($listOptions); |
| 2114 | 2114 | |
| 2115 | 2115 | $context['page_title'] = $txt['ban_log']; |
@@ -2197,7 +2197,7 @@ discard block |
||
| 2197 | 2197 | if ($low == $high) |
| 2198 | 2198 | return $low; |
| 2199 | 2199 | else |
| 2200 | - return $low . '-' . $high; |
|
| 2200 | + return $low.'-'.$high; |
|
| 2201 | 2201 | } |
| 2202 | 2202 | |
| 2203 | 2203 | /** |
@@ -2234,7 +2234,7 @@ discard block |
||
| 2234 | 2234 | list ($error_id_ban, $error_ban_name) = $smcFunc['db_fetch_row']($request); |
| 2235 | 2235 | fatal_lang_error('ban_trigger_already_exists', false, array( |
| 2236 | 2236 | $fullip, |
| 2237 | - '<a href="' . $scripturl . '?action=admin;area=ban;sa=edit;bg=' . $error_id_ban . '">' . $error_ban_name . '</a>', |
|
| 2237 | + '<a href="'.$scripturl.'?action=admin;area=ban;sa=edit;bg='.$error_id_ban.'">'.$error_ban_name.'</a>', |
|
| 2238 | 2238 | )); |
| 2239 | 2239 | } |
| 2240 | 2240 | $smcFunc['db_free_result']($request); |
@@ -2303,8 +2303,8 @@ discard block |
||
| 2303 | 2303 | $count = 0; |
| 2304 | 2304 | foreach ($memberEmailWild as $email) |
| 2305 | 2305 | { |
| 2306 | - $queryPart[] = 'mem.email_address LIKE {string:wild_' . $count . '}'; |
|
| 2307 | - $queryValues['wild_' . $count++] = $email; |
|
| 2306 | + $queryPart[] = 'mem.email_address LIKE {string:wild_'.$count.'}'; |
|
| 2307 | + $queryValues['wild_'.$count++] = $email; |
|
| 2308 | 2308 | } |
| 2309 | 2309 | |
| 2310 | 2310 | // Find all banned members. |
@@ -1452,7 +1452,7 @@ |
||
| 1452 | 1452 | * |
| 1453 | 1453 | * @param int $id_subscribe The subscription ID |
| 1454 | 1454 | * @param int $id_member The ID of the member |
| 1455 | - * @param int|string $renewal 0 if we're forcing start/end time, otherwise a string indicating how long to renew the subscription for ('D', 'W', 'M' or 'Y') |
|
| 1455 | + * @param integer $renewal 0 if we're forcing start/end time, otherwise a string indicating how long to renew the subscription for ('D', 'W', 'M' or 'Y') |
|
| 1456 | 1456 | * @param int $forceStartTime If set, forces the subscription to start at the specified time |
| 1457 | 1457 | * @param int $forceEndTime If set, forces the subscription to end at the specified time |
| 1458 | 1458 | */ |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | 'dummy_currency' => array('select', 'paid_currency', array('usd' => $txt['usd'], 'eur' => $txt['eur'], 'gbp' => $txt['gbp'], 'cad' => $txt['cad'], 'aud' => $txt['aud'], 'other' => $txt['other']), 'javascript' => 'onchange="toggleOther();"'), |
| 106 | 106 | array('text', 'paid_currency_code', 'subtext' => $txt['paid_currency_code_desc'], 'size' => 5, 'force_div_id' => 'custom_currency_code_div'), |
| 107 | 107 | array('text', 'paid_currency_symbol', 'subtext' => $txt['paid_currency_symbol_desc'], 'size' => 8, 'force_div_id' => 'custom_currency_symbol_div'), |
| 108 | - array('check', 'paidsubs_test', 'subtext' => $txt['paidsubs_test_desc'], 'onclick' => 'return document.getElementById(\'paidsubs_test\').checked ? confirm(\'' . $txt['paidsubs_test_confirm'] . '\') : true;'), |
|
| 108 | + array('check', 'paidsubs_test', 'subtext' => $txt['paidsubs_test_desc'], 'onclick' => 'return document.getElementById(\'paidsubs_test\').checked ? confirm(\''.$txt['paidsubs_test_confirm'].'\') : true;'), |
|
| 109 | 109 | ); |
| 110 | 110 | |
| 111 | 111 | // Now load all the other gateway settings. |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | $setting_data = $gatewayClass->getGatewaySettings(); |
| 117 | 117 | if (!empty($setting_data)) |
| 118 | 118 | { |
| 119 | - $config_vars[] = array('title', $gatewayClass->title, 'text_label' => (isset($txt['paidsubs_gateway_title_' . $gatewayClass->title]) ? $txt['paidsubs_gateway_title_' . $gatewayClass->title] : $gatewayClass->title)); |
|
| 119 | + $config_vars[] = array('title', $gatewayClass->title, 'text_label' => (isset($txt['paidsubs_gateway_title_'.$gatewayClass->title]) ? $txt['paidsubs_gateway_title_'.$gatewayClass->title] : $gatewayClass->title)); |
|
| 120 | 120 | $config_vars = array_merge($config_vars, $setting_data); |
| 121 | 121 | } |
| 122 | 122 | } |
@@ -170,14 +170,14 @@ discard block |
||
| 170 | 170 | return $config_vars; |
| 171 | 171 | |
| 172 | 172 | // Get the settings template fired up. |
| 173 | - require_once($sourcedir . '/ManageServer.php'); |
|
| 173 | + require_once($sourcedir.'/ManageServer.php'); |
|
| 174 | 174 | |
| 175 | 175 | // Some important context stuff |
| 176 | 176 | $context['page_title'] = $txt['settings']; |
| 177 | 177 | $context['sub_template'] = 'show_settings'; |
| 178 | 178 | |
| 179 | 179 | // Get the final touches in place. |
| 180 | - $context['post_url'] = $scripturl . '?action=admin;area=paidsubscribe;save;sa=settings'; |
|
| 180 | + $context['post_url'] = $scripturl.'?action=admin;area=paidsubscribe;save;sa=settings'; |
|
| 181 | 181 | |
| 182 | 182 | // Saving the settings? |
| 183 | 183 | if (isset($_GET['save'])) |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | ); |
| 201 | 201 | |
| 202 | 202 | // This may well affect the next trigger, whether we're enabling or not. |
| 203 | - require_once($sourcedir . '/ScheduledTasks.php'); |
|
| 203 | + require_once($sourcedir.'/ScheduledTasks.php'); |
|
| 204 | 204 | CalculateNextTrigger('paid_subscriptions'); |
| 205 | 205 | } |
| 206 | 206 | |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | if ($_POST['paid_currency'] != 'other') |
| 225 | 225 | { |
| 226 | 226 | $_POST['paid_currency_code'] = $_POST['paid_currency']; |
| 227 | - $_POST['paid_currency_symbol'] = $txt[$_POST['paid_currency'] . '_symbol']; |
|
| 227 | + $_POST['paid_currency_symbol'] = $txt[$_POST['paid_currency'].'_symbol']; |
|
| 228 | 228 | } |
| 229 | 229 | unset($config_vars['dummy_currency']); |
| 230 | 230 | } |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | |
| 251 | 251 | // Not made the settings yet? |
| 252 | 252 | if (empty($modSettings['paid_currency_symbol'])) |
| 253 | - fatal_lang_error('paid_not_set_currency', false, $scripturl . '?action=admin;area=paidsubscribe;sa=settings'); |
|
| 253 | + fatal_lang_error('paid_not_set_currency', false, $scripturl.'?action=admin;area=paidsubscribe;sa=settings'); |
|
| 254 | 254 | |
| 255 | 255 | // Some basic stuff. |
| 256 | 256 | $context['page_title'] = $txt['paid_subs_view']; |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | 'id' => 'subscription_list', |
| 261 | 261 | 'title' => $txt['subscriptions'], |
| 262 | 262 | 'items_per_page' => $modSettings['defaultMaxListItems'], |
| 263 | - 'base_href' => $scripturl . '?action=admin;area=paidsubscribe;sa=view', |
|
| 263 | + 'base_href' => $scripturl.'?action=admin;area=paidsubscribe;sa=view', |
|
| 264 | 264 | 'get_items' => array( |
| 265 | 265 | 'function' => function($start, $items_per_page) use ($context) |
| 266 | 266 | { |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | 'data' => array( |
| 308 | 308 | 'function' => function($rowData) use ($txt) |
| 309 | 309 | { |
| 310 | - return $rowData['flexible'] ? '<em>' . $txt['flexible'] . '</em>' : $rowData['cost'] . ' / ' . $rowData['length']; |
|
| 310 | + return $rowData['flexible'] ? '<em>'.$txt['flexible'].'</em>' : $rowData['cost'].' / '.$rowData['length']; |
|
| 311 | 311 | }, |
| 312 | 312 | ), |
| 313 | 313 | ), |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | 'data' => array( |
| 351 | 351 | 'function' => function($rowData) use ($txt) |
| 352 | 352 | { |
| 353 | - return '<span style="color: ' . ($rowData['active'] ? 'green' : 'red') . '">' . ($rowData['active'] ? $txt['yes'] : $txt['no']) . '</span>'; |
|
| 353 | + return '<span style="color: '.($rowData['active'] ? 'green' : 'red').'">'.($rowData['active'] ? $txt['yes'] : $txt['no']).'</span>'; |
|
| 354 | 354 | }, |
| 355 | 355 | 'class' => 'centercol', |
| 356 | 356 | ), |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | 'data' => array( |
| 360 | 360 | 'function' => function($rowData) use ($txt, $scripturl) |
| 361 | 361 | { |
| 362 | - return '<a href="' . $scripturl . '?action=admin;area=paidsubscribe;sa=modify;sid=' . $rowData['id'] . '">' . $txt['modify'] . '</a>'; |
|
| 362 | + return '<a href="'.$scripturl.'?action=admin;area=paidsubscribe;sa=modify;sid='.$rowData['id'].'">'.$txt['modify'].'</a>'; |
|
| 363 | 363 | }, |
| 364 | 364 | 'class' => 'centercol', |
| 365 | 365 | ), |
@@ -368,28 +368,28 @@ discard block |
||
| 368 | 368 | 'data' => array( |
| 369 | 369 | 'function' => function($rowData) use ($scripturl, $txt) |
| 370 | 370 | { |
| 371 | - return '<a href="' . $scripturl . '?action=admin;area=paidsubscribe;sa=modify;delete;sid=' . $rowData['id'] . '">' . $txt['delete'] . '</a>'; |
|
| 371 | + return '<a href="'.$scripturl.'?action=admin;area=paidsubscribe;sa=modify;delete;sid='.$rowData['id'].'">'.$txt['delete'].'</a>'; |
|
| 372 | 372 | }, |
| 373 | 373 | 'class' => 'centercol', |
| 374 | 374 | ), |
| 375 | 375 | ), |
| 376 | 376 | ), |
| 377 | 377 | 'form' => array( |
| 378 | - 'href' => $scripturl . '?action=admin;area=paidsubscribe;sa=modify', |
|
| 378 | + 'href' => $scripturl.'?action=admin;area=paidsubscribe;sa=modify', |
|
| 379 | 379 | ), |
| 380 | 380 | 'additional_rows' => array( |
| 381 | 381 | array( |
| 382 | 382 | 'position' => 'above_table_headers', |
| 383 | - 'value' => '<input type="submit" name="add" value="' . $txt['paid_add_subscription'] . '" class="button">', |
|
| 383 | + 'value' => '<input type="submit" name="add" value="'.$txt['paid_add_subscription'].'" class="button">', |
|
| 384 | 384 | ), |
| 385 | 385 | array( |
| 386 | 386 | 'position' => 'below_table_data', |
| 387 | - 'value' => '<input type="submit" name="add" value="' . $txt['paid_add_subscription'] . '" class="button">', |
|
| 387 | + 'value' => '<input type="submit" name="add" value="'.$txt['paid_add_subscription'].'" class="button">', |
|
| 388 | 388 | ), |
| 389 | 389 | ), |
| 390 | 390 | ); |
| 391 | 391 | |
| 392 | - require_once($sourcedir . '/Subs-List.php'); |
|
| 392 | + require_once($sourcedir.'/Subs-List.php'); |
|
| 393 | 393 | createList($listOptions); |
| 394 | 394 | |
| 395 | 395 | $context['sub_template'] = 'show_list'; |
@@ -409,7 +409,7 @@ discard block |
||
| 409 | 409 | |
| 410 | 410 | // Setup the template. |
| 411 | 411 | $context['sub_template'] = $context['action_type'] == 'delete' ? 'delete_subscription' : 'modify_subscription'; |
| 412 | - $context['page_title'] = $txt['paid_' . $context['action_type'] . '_subscription']; |
|
| 412 | + $context['page_title'] = $txt['paid_'.$context['action_type'].'_subscription']; |
|
| 413 | 413 | |
| 414 | 414 | // Delete it? |
| 415 | 415 | if (isset($_POST['delete_confirm']) && isset($_REQUEST['delete'])) |
@@ -537,10 +537,10 @@ discard block |
||
| 537 | 537 | fatal_lang_error('paid_invalid_duration', false); |
| 538 | 538 | |
| 539 | 539 | if ($_POST['span_value'] > $limits[$_POST['span_unit']]) |
| 540 | - fatal_lang_error('paid_invalid_duration_' . $_POST['span_unit'], false); |
|
| 540 | + fatal_lang_error('paid_invalid_duration_'.$_POST['span_unit'], false); |
|
| 541 | 541 | |
| 542 | 542 | // Clean the span. |
| 543 | - $span = $_POST['span_value'] . $_POST['span_unit']; |
|
| 543 | + $span = $_POST['span_value'].$_POST['span_unit']; |
|
| 544 | 544 | |
| 545 | 545 | // Sort out the cost. |
| 546 | 546 | $cost = array('fixed' => sprintf('%01.2f', strtr($_POST['cost'], ',', '.'))); |
@@ -616,7 +616,7 @@ discard block |
||
| 616 | 616 | UPDATE {db_prefix}subscriptions |
| 617 | 617 | SET name = SUBSTRING({string:name}, 1, 60), description = SUBSTRING({string:description}, 1, 255), active = {int:is_active}, |
| 618 | 618 | length = SUBSTRING({string:length}, 1, 4), cost = {string:cost}' . ($disableGroups ? '' : ', id_group = {int:id_group}, |
| 619 | - add_groups = {string:additional_groups}') . ', repeatable = {int:repeatable}, allow_partial = {int:allow_partial}, |
|
| 619 | + add_groups = {string:additional_groups}').', repeatable = {int:repeatable}, allow_partial = {int:allow_partial}, |
|
| 620 | 620 | email_complete = {string:email_complete}, reminder = {int:reminder} |
| 621 | 621 | WHERE id_subscribe = {int:current_subscription}', |
| 622 | 622 | array( |
@@ -792,13 +792,13 @@ discard block |
||
| 792 | 792 | |
| 793 | 793 | // Are we searching for people? |
| 794 | 794 | $search_string = isset($_POST['ssearch']) && !empty($_POST['sub_search']) ? ' AND COALESCE(mem.real_name, {string:guest}) LIKE {string:search}' : ''; |
| 795 | - $search_vars = empty($_POST['sub_search']) ? array() : array('search' => '%' . $_POST['sub_search'] . '%', 'guest' => $txt['guest']); |
|
| 795 | + $search_vars = empty($_POST['sub_search']) ? array() : array('search' => '%'.$_POST['sub_search'].'%', 'guest' => $txt['guest']); |
|
| 796 | 796 | |
| 797 | 797 | $listOptions = array( |
| 798 | 798 | 'id' => 'subscribed_users_list', |
| 799 | 799 | 'title' => sprintf($txt['view_users_subscribed'], $row['name']), |
| 800 | 800 | 'items_per_page' => $modSettings['defaultMaxListItems'], |
| 801 | - 'base_href' => $scripturl . '?action=admin;area=paidsubscribe;sa=viewsub;sid=' . $context['sub_id'], |
|
| 801 | + 'base_href' => $scripturl.'?action=admin;area=paidsubscribe;sa=viewsub;sid='.$context['sub_id'], |
|
| 802 | 802 | 'default_sort_col' => 'name', |
| 803 | 803 | 'get_items' => array( |
| 804 | 804 | 'function' => 'list_getSubscribedUsers', |
@@ -826,7 +826,7 @@ discard block |
||
| 826 | 826 | 'data' => array( |
| 827 | 827 | 'function' => function($rowData) use ($scripturl, $txt) |
| 828 | 828 | { |
| 829 | - return $rowData['id_member'] == 0 ? $txt['guest'] : '<a href="' . $scripturl . '?action=profile;u=' . $rowData['id_member'] . '">' . $rowData['name'] . '</a>'; |
|
| 829 | + return $rowData['id_member'] == 0 ? $txt['guest'] : '<a href="'.$scripturl.'?action=profile;u='.$rowData['id_member'].'">'.$rowData['name'].'</a>'; |
|
| 830 | 830 | }, |
| 831 | 831 | ), |
| 832 | 832 | 'sort' => array( |
@@ -896,7 +896,7 @@ discard block |
||
| 896 | 896 | 'data' => array( |
| 897 | 897 | 'function' => function($rowData) use ($scripturl, $txt) |
| 898 | 898 | { |
| 899 | - return '<a href="' . $scripturl . '?action=admin;area=paidsubscribe;sa=modifyuser;lid=' . $rowData['id'] . '">' . $txt['modify'] . '</a>'; |
|
| 899 | + return '<a href="'.$scripturl.'?action=admin;area=paidsubscribe;sa=modifyuser;lid='.$rowData['id'].'">'.$txt['modify'].'</a>'; |
|
| 900 | 900 | }, |
| 901 | 901 | 'class' => 'centercol', |
| 902 | 902 | ), |
@@ -909,29 +909,29 @@ discard block |
||
| 909 | 909 | 'data' => array( |
| 910 | 910 | 'function' => function($rowData) |
| 911 | 911 | { |
| 912 | - return '<input type="checkbox" name="delsub[' . $rowData['id'] . ']">'; |
|
| 912 | + return '<input type="checkbox" name="delsub['.$rowData['id'].']">'; |
|
| 913 | 913 | }, |
| 914 | 914 | 'class' => 'centercol', |
| 915 | 915 | ), |
| 916 | 916 | ), |
| 917 | 917 | ), |
| 918 | 918 | 'form' => array( |
| 919 | - 'href' => $scripturl . '?action=admin;area=paidsubscribe;sa=modifyuser;sid=' . $context['sub_id'], |
|
| 919 | + 'href' => $scripturl.'?action=admin;area=paidsubscribe;sa=modifyuser;sid='.$context['sub_id'], |
|
| 920 | 920 | ), |
| 921 | 921 | 'additional_rows' => array( |
| 922 | 922 | array( |
| 923 | 923 | 'position' => 'below_table_data', |
| 924 | 924 | 'value' => ' |
| 925 | - <input type="submit" name="add" value="' . $txt['add_subscriber'] . '" class="button"> |
|
| 926 | - <input type="submit" name="finished" value="' . $txt['complete_selected'] . '" data-confirm="' . $txt['complete_are_sure'] . '" class="button you_sure"> |
|
| 927 | - <input type="submit" name="delete" value="' . $txt['delete_selected'] . '" data-confirm="' . $txt['delete_are_sure'] . '" class="button you_sure"> |
|
| 925 | + <input type="submit" name="add" value="' . $txt['add_subscriber'].'" class="button"> |
|
| 926 | + <input type="submit" name="finished" value="' . $txt['complete_selected'].'" data-confirm="'.$txt['complete_are_sure'].'" class="button you_sure"> |
|
| 927 | + <input type="submit" name="delete" value="' . $txt['delete_selected'].'" data-confirm="'.$txt['delete_are_sure'].'" class="button you_sure"> |
|
| 928 | 928 | ', |
| 929 | 929 | ), |
| 930 | 930 | array( |
| 931 | 931 | 'position' => 'top_of_list', |
| 932 | 932 | 'value' => ' |
| 933 | 933 | <div class="flow_auto"> |
| 934 | - <input type="submit" name="ssearch" value="' . $txt['search_sub'] . '" class="button" style="margin-top: 3px;"> |
|
| 934 | + <input type="submit" name="ssearch" value="' . $txt['search_sub'].'" class="button" style="margin-top: 3px;"> |
|
| 935 | 935 | <input type="text" name="sub_search" value="" class="floatright"> |
| 936 | 936 | </div> |
| 937 | 937 | ', |
@@ -939,7 +939,7 @@ discard block |
||
| 939 | 939 | ), |
| 940 | 940 | ); |
| 941 | 941 | |
| 942 | - require_once($sourcedir . '/Subs-List.php'); |
|
| 942 | + require_once($sourcedir.'/Subs-List.php'); |
|
| 943 | 943 | createList($listOptions); |
| 944 | 944 | |
| 945 | 945 | $context['sub_template'] = 'show_list'; |
@@ -964,7 +964,7 @@ discard block |
||
| 964 | 964 | SELECT COUNT(*) AS total_subs |
| 965 | 965 | FROM {db_prefix}log_subscribed AS ls |
| 966 | 966 | LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = ls.id_member) |
| 967 | - WHERE ls.id_subscribe = {int:current_subscription} ' . $search_string . ' |
|
| 967 | + WHERE ls.id_subscribe = {int:current_subscription} ' . $search_string.' |
|
| 968 | 968 | AND (ls.end_time != {int:no_end_time} OR ls.payments_pending != {int:no_pending_payments})', |
| 969 | 969 | array_merge($search_vars, array( |
| 970 | 970 | 'current_subscription' => $id_sub, |
@@ -999,7 +999,7 @@ discard block |
||
| 999 | 999 | ls.status, ls.payments_pending |
| 1000 | 1000 | FROM {db_prefix}log_subscribed AS ls |
| 1001 | 1001 | LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = ls.id_member) |
| 1002 | - WHERE ls.id_subscribe = {int:current_subscription} ' . $search_string . ' |
|
| 1002 | + WHERE ls.id_subscribe = {int:current_subscription} ' . $search_string.' |
|
| 1003 | 1003 | AND (ls.end_time != {int:no_end_time} OR ls.payments_pending != {int:no_payments_pending}) |
| 1004 | 1004 | ORDER BY {raw:sort} |
| 1005 | 1005 | LIMIT {int:start}, {int:max}', |
@@ -1046,7 +1046,7 @@ discard block |
||
| 1046 | 1046 | |
| 1047 | 1047 | // Setup the template. |
| 1048 | 1048 | $context['sub_template'] = 'modify_user_subscription'; |
| 1049 | - $context['page_title'] = $txt[$context['action_type'] . '_subscriber']; |
|
| 1049 | + $context['page_title'] = $txt[$context['action_type'].'_subscriber']; |
|
| 1050 | 1050 | |
| 1051 | 1051 | // If we haven't been passed the subscription ID get it. |
| 1052 | 1052 | if ($context['log_id'] && !$context['sub_id']) |
@@ -1129,7 +1129,7 @@ discard block |
||
| 1129 | 1129 | '{db_prefix}log_subscribed', |
| 1130 | 1130 | array( |
| 1131 | 1131 | 'id_subscribe' => 'int', 'id_member' => 'int', 'old_id_group' => 'int', 'start_time' => 'int', |
| 1132 | - 'end_time' => 'int', 'status' => 'int','pending_details' => 'string-65534' |
|
| 1132 | + 'end_time' => 'int', 'status' => 'int', 'pending_details' => 'string-65534' |
|
| 1133 | 1133 | ), |
| 1134 | 1134 | array( |
| 1135 | 1135 | $context['sub_id'], $id_member, $id_group, $starttime, |
@@ -1181,7 +1181,7 @@ discard block |
||
| 1181 | 1181 | } |
| 1182 | 1182 | |
| 1183 | 1183 | // Done - redirect... |
| 1184 | - redirectexit('action=admin;area=paidsubscribe;sa=viewsub;sid=' . $context['sub_id']); |
|
| 1184 | + redirectexit('action=admin;area=paidsubscribe;sa=viewsub;sid='.$context['sub_id']); |
|
| 1185 | 1185 | } |
| 1186 | 1186 | // Deleting? |
| 1187 | 1187 | elseif (isset($_REQUEST['delete']) || isset($_REQUEST['finished'])) |
@@ -1207,7 +1207,7 @@ discard block |
||
| 1207 | 1207 | removeSubscription($row['id_subscribe'], $row['id_member'], isset($_REQUEST['delete'])); |
| 1208 | 1208 | $smcFunc['db_free_result']($request); |
| 1209 | 1209 | } |
| 1210 | - redirectexit('action=admin;area=paidsubscribe;sa=viewsub;sid=' . $context['sub_id']); |
|
| 1210 | + redirectexit('action=admin;area=paidsubscribe;sa=viewsub;sid='.$context['sub_id']); |
|
| 1211 | 1211 | } |
| 1212 | 1212 | |
| 1213 | 1213 | // Default attributes. |
@@ -1220,7 +1220,7 @@ discard block |
||
| 1220 | 1220 | 'month' => (int) strftime('%m', time()), |
| 1221 | 1221 | 'day' => (int) strftime('%d', time()), |
| 1222 | 1222 | 'hour' => (int) strftime('%H', time()), |
| 1223 | - 'min' => (int) strftime('%M', time()) < 10 ? '0' . (int) strftime('%M', time()) : (int) strftime('%M', time()), |
|
| 1223 | + 'min' => (int) strftime('%M', time()) < 10 ? '0'.(int) strftime('%M', time()) : (int) strftime('%M', time()), |
|
| 1224 | 1224 | 'last_day' => 0, |
| 1225 | 1225 | ), |
| 1226 | 1226 | 'end' => array( |
@@ -1228,7 +1228,7 @@ discard block |
||
| 1228 | 1228 | 'month' => (int) strftime('%m', time()), |
| 1229 | 1229 | 'day' => (int) strftime('%d', time()), |
| 1230 | 1230 | 'hour' => (int) strftime('%H', time()), |
| 1231 | - 'min' => (int) strftime('%M', time()) < 10 ? '0' . (int) strftime('%M', time()) : (int) strftime('%M', time()), |
|
| 1231 | + 'min' => (int) strftime('%M', time()) < 10 ? '0'.(int) strftime('%M', time()) : (int) strftime('%M', time()), |
|
| 1232 | 1232 | 'last_day' => 0, |
| 1233 | 1233 | ), |
| 1234 | 1234 | 'status' => 1, |
@@ -1291,7 +1291,7 @@ discard block |
||
| 1291 | 1291 | { |
| 1292 | 1292 | if ($cost != 0 && $cost == $pending[1] && $duration == $pending[2]) |
| 1293 | 1293 | $context['pending_payments'][$id] = array( |
| 1294 | - 'desc' => sprintf($modSettings['paid_currency_symbol'], $cost . '/' . $txt[$duration]), |
|
| 1294 | + 'desc' => sprintf($modSettings['paid_currency_symbol'], $cost.'/'.$txt[$duration]), |
|
| 1295 | 1295 | ); |
| 1296 | 1296 | } |
| 1297 | 1297 | } |
@@ -1331,7 +1331,7 @@ discard block |
||
| 1331 | 1331 | ); |
| 1332 | 1332 | |
| 1333 | 1333 | // Reload |
| 1334 | - redirectexit('action=admin;area=paidsubscribe;sa=modifyuser;lid=' . $context['log_id']); |
|
| 1334 | + redirectexit('action=admin;area=paidsubscribe;sa=modifyuser;lid='.$context['log_id']); |
|
| 1335 | 1335 | } |
| 1336 | 1336 | } |
| 1337 | 1337 | } |
@@ -1345,7 +1345,7 @@ discard block |
||
| 1345 | 1345 | 'month' => (int) strftime('%m', $row['start_time']), |
| 1346 | 1346 | 'day' => (int) strftime('%d', $row['start_time']), |
| 1347 | 1347 | 'hour' => (int) strftime('%H', $row['start_time']), |
| 1348 | - 'min' => (int) strftime('%M', $row['start_time']) < 10 ? '0' . (int) strftime('%M', $row['start_time']) : (int) strftime('%M', $row['start_time']), |
|
| 1348 | + 'min' => (int) strftime('%M', $row['start_time']) < 10 ? '0'.(int) strftime('%M', $row['start_time']) : (int) strftime('%M', $row['start_time']), |
|
| 1349 | 1349 | 'last_day' => 0, |
| 1350 | 1350 | ), |
| 1351 | 1351 | 'end' => array( |
@@ -1353,7 +1353,7 @@ discard block |
||
| 1353 | 1353 | 'month' => (int) strftime('%m', $row['end_time']), |
| 1354 | 1354 | 'day' => (int) strftime('%d', $row['end_time']), |
| 1355 | 1355 | 'hour' => (int) strftime('%H', $row['end_time']), |
| 1356 | - 'min' => (int) strftime('%M', $row['end_time']) < 10 ? '0' . (int) strftime('%M', $row['end_time']) : (int) strftime('%M', $row['end_time']), |
|
| 1356 | + 'min' => (int) strftime('%M', $row['end_time']) < 10 ? '0'.(int) strftime('%M', $row['end_time']) : (int) strftime('%M', $row['end_time']), |
|
| 1357 | 1357 | 'last_day' => 0, |
| 1358 | 1358 | ), |
| 1359 | 1359 | 'status' => $row['status'], |
@@ -1857,7 +1857,7 @@ discard block |
||
| 1857 | 1857 | if (isset($match[2])) |
| 1858 | 1858 | { |
| 1859 | 1859 | $num_length = $match[1]; |
| 1860 | - $length = $match[1] . ' '; |
|
| 1860 | + $length = $match[1].' '; |
|
| 1861 | 1861 | switch ($match[2]) |
| 1862 | 1862 | { |
| 1863 | 1863 | case 'D': |
@@ -1952,24 +1952,24 @@ discard block |
||
| 1952 | 1952 | { |
| 1953 | 1953 | while (($file = readdir($dh)) !== false) |
| 1954 | 1954 | { |
| 1955 | - if (is_file($sourcedir . '/' . $file) && preg_match('~^Subscriptions-([A-Za-z\d]+)\.php$~', $file, $matches)) |
|
| 1955 | + if (is_file($sourcedir.'/'.$file) && preg_match('~^Subscriptions-([A-Za-z\d]+)\.php$~', $file, $matches)) |
|
| 1956 | 1956 | { |
| 1957 | 1957 | // Check this is definitely a valid gateway! |
| 1958 | - $fp = fopen($sourcedir . '/' . $file, 'rb'); |
|
| 1958 | + $fp = fopen($sourcedir.'/'.$file, 'rb'); |
|
| 1959 | 1959 | $header = fread($fp, 4096); |
| 1960 | 1960 | fclose($fp); |
| 1961 | 1961 | |
| 1962 | - if (strpos($header, '// SMF Payment Gateway: ' . strtolower($matches[1])) !== false) |
|
| 1962 | + if (strpos($header, '// SMF Payment Gateway: '.strtolower($matches[1])) !== false) |
|
| 1963 | 1963 | { |
| 1964 | - require_once($sourcedir . '/' . $file); |
|
| 1964 | + require_once($sourcedir.'/'.$file); |
|
| 1965 | 1965 | |
| 1966 | 1966 | $gateways[] = array( |
| 1967 | 1967 | 'filename' => $file, |
| 1968 | 1968 | 'code' => strtolower($matches[1]), |
| 1969 | 1969 | // Don't need anything snazzier than this yet. |
| 1970 | - 'valid_version' => class_exists(strtolower($matches[1]) . '_payment') && class_exists(strtolower($matches[1]) . '_display'), |
|
| 1971 | - 'payment_class' => strtolower($matches[1]) . '_payment', |
|
| 1972 | - 'display_class' => strtolower($matches[1]) . '_display', |
|
| 1970 | + 'valid_version' => class_exists(strtolower($matches[1]).'_payment') && class_exists(strtolower($matches[1]).'_display'), |
|
| 1971 | + 'payment_class' => strtolower($matches[1]).'_payment', |
|
| 1972 | + 'display_class' => strtolower($matches[1]).'_display', |
|
| 1973 | 1973 | ); |
| 1974 | 1974 | } |
| 1975 | 1975 | } |
@@ -4070,7 +4070,7 @@ |
||
| 4070 | 4070 | * |
| 4071 | 4071 | * @param int $pmID The ID of the PM |
| 4072 | 4072 | * @param string $validFor Which folders this is valud for - can be 'inbox', 'outbox' or 'in_or_outbox' |
| 4073 | - * @return boolean Whether the PM is accessible in that folder for the current user |
|
| 4073 | + * @return boolean|null Whether the PM is accessible in that folder for the current user |
|
| 4074 | 4074 | */ |
| 4075 | 4075 | function isAccessiblePM($pmID, $validFor = 'in_or_outbox') |
| 4076 | 4076 | { |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | isAllowedTo('pm_read'); |
| 34 | 34 | |
| 35 | 35 | // This file contains the basic functions for sending a PM. |
| 36 | - require_once($sourcedir . '/Subs-Post.php'); |
|
| 36 | + require_once($sourcedir.'/Subs-Post.php'); |
|
| 37 | 37 | |
| 38 | 38 | loadLanguage('PersonalMessage+Drafts'); |
| 39 | 39 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | // Load up the members maximum message capacity. |
| 44 | 44 | if ($user_info['is_admin']) |
| 45 | 45 | $context['message_limit'] = 0; |
| 46 | - elseif (($context['message_limit'] = cache_get_data('msgLimit:' . $user_info['id'], 360)) === null) |
|
| 46 | + elseif (($context['message_limit'] = cache_get_data('msgLimit:'.$user_info['id'], 360)) === null) |
|
| 47 | 47 | { |
| 48 | 48 | // @todo Why do we do this? It seems like if they have any limit we should use it. |
| 49 | 49 | $request = $smcFunc['db_query']('', ' |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $context['message_limit'] = $minMessage == 0 ? 0 : $maxMessage; |
| 61 | 61 | |
| 62 | 62 | // Save us doing it again! |
| 63 | - cache_put_data('msgLimit:' . $user_info['id'], $context['message_limit'], 360); |
|
| 63 | + cache_put_data('msgLimit:'.$user_info['id'], $context['message_limit'], 360); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | // Prepare the context for the capacity bar. |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $context['labels'] = array(); |
| 85 | 85 | |
| 86 | 86 | // Load the label data. |
| 87 | - if ($user_settings['new_pm'] || ($context['labels'] = cache_get_data('labelCounts:' . $user_info['id'], 720)) === null) |
|
| 87 | + if ($user_settings['new_pm'] || ($context['labels'] = cache_get_data('labelCounts:'.$user_info['id'], 720)) === null) |
|
| 88 | 88 | { |
| 89 | 89 | // Looks like we need to reseek! |
| 90 | 90 | |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | $smcFunc['db_free_result']($result); |
| 146 | 146 | |
| 147 | 147 | // Store it please! |
| 148 | - cache_put_data('labelCounts:' . $user_info['id'], $context['labels'], 720); |
|
| 148 | + cache_put_data('labelCounts:'.$user_info['id'], $context['labels'], 720); |
|
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | // Now we have the labels, and assuming we have unsorted mail, apply our rules! |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | $context['folder'] = !isset($_REQUEST['f']) || $_REQUEST['f'] != 'sent' ? 'inbox' : 'sent'; |
| 174 | 174 | |
| 175 | 175 | // This is convenient. Do you know how annoying it is to do this every time?! |
| 176 | - $context['current_label_redirect'] = 'action=pm;f=' . $context['folder'] . (isset($_GET['start']) ? ';start=' . $_GET['start'] : '') . (isset($_REQUEST['l']) ? ';l=' . $_REQUEST['l'] : ''); |
|
| 176 | + $context['current_label_redirect'] = 'action=pm;f='.$context['folder'].(isset($_GET['start']) ? ';start='.$_GET['start'] : '').(isset($_REQUEST['l']) ? ';l='.$_REQUEST['l'] : ''); |
|
| 177 | 177 | $context['can_issue_warning'] = allowedTo('issue_warning') && $modSettings['warning_settings'][0] == 1; |
| 178 | 178 | |
| 179 | 179 | // Are PM drafts enabled? |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | |
| 183 | 183 | // Build the linktree for all the actions... |
| 184 | 184 | $context['linktree'][] = array( |
| 185 | - 'url' => $scripturl . '?action=pm', |
|
| 185 | + 'url' => $scripturl.'?action=pm', |
|
| 186 | 186 | 'name' => $txt['personal_messages'] |
| 187 | 187 | ); |
| 188 | 188 | |
@@ -235,23 +235,23 @@ discard block |
||
| 235 | 235 | 'areas' => array( |
| 236 | 236 | 'inbox' => array( |
| 237 | 237 | 'label' => $txt['inbox'], |
| 238 | - 'custom_url' => $scripturl . '?action=pm', |
|
| 238 | + 'custom_url' => $scripturl.'?action=pm', |
|
| 239 | 239 | 'amt' => 0, |
| 240 | 240 | ), |
| 241 | 241 | 'send' => array( |
| 242 | 242 | 'label' => $txt['new_message'], |
| 243 | - 'custom_url' => $scripturl . '?action=pm;sa=send', |
|
| 243 | + 'custom_url' => $scripturl.'?action=pm;sa=send', |
|
| 244 | 244 | 'permission' => 'pm_send', |
| 245 | 245 | 'amt' => 0, |
| 246 | 246 | ), |
| 247 | 247 | 'sent' => array( |
| 248 | 248 | 'label' => $txt['sent_items'], |
| 249 | - 'custom_url' => $scripturl . '?action=pm;f=sent', |
|
| 249 | + 'custom_url' => $scripturl.'?action=pm;f=sent', |
|
| 250 | 250 | 'amt' => 0, |
| 251 | 251 | ), |
| 252 | 252 | 'drafts' => array( |
| 253 | 253 | 'label' => $txt['drafts_show'], |
| 254 | - 'custom_url' => $scripturl . '?action=pm;sa=showpmdrafts', |
|
| 254 | + 'custom_url' => $scripturl.'?action=pm;sa=showpmdrafts', |
|
| 255 | 255 | 'permission' => 'pm_draft', |
| 256 | 256 | 'enabled' => !empty($modSettings['drafts_pm_enabled']), |
| 257 | 257 | 'amt' => 0, |
@@ -269,11 +269,11 @@ discard block |
||
| 269 | 269 | 'areas' => array( |
| 270 | 270 | 'search' => array( |
| 271 | 271 | 'label' => $txt['pm_search_bar_title'], |
| 272 | - 'custom_url' => $scripturl . '?action=pm;sa=search', |
|
| 272 | + 'custom_url' => $scripturl.'?action=pm;sa=search', |
|
| 273 | 273 | ), |
| 274 | 274 | 'prune' => array( |
| 275 | 275 | 'label' => $txt['pm_prune'], |
| 276 | - 'custom_url' => $scripturl . '?action=pm;sa=prune' |
|
| 276 | + 'custom_url' => $scripturl.'?action=pm;sa=prune' |
|
| 277 | 277 | ), |
| 278 | 278 | ), |
| 279 | 279 | ), |
@@ -282,15 +282,15 @@ discard block |
||
| 282 | 282 | 'areas' => array( |
| 283 | 283 | 'manlabels' => array( |
| 284 | 284 | 'label' => $txt['pm_manage_labels'], |
| 285 | - 'custom_url' => $scripturl . '?action=pm;sa=manlabels', |
|
| 285 | + 'custom_url' => $scripturl.'?action=pm;sa=manlabels', |
|
| 286 | 286 | ), |
| 287 | 287 | 'manrules' => array( |
| 288 | 288 | 'label' => $txt['pm_manage_rules'], |
| 289 | - 'custom_url' => $scripturl . '?action=pm;sa=manrules', |
|
| 289 | + 'custom_url' => $scripturl.'?action=pm;sa=manrules', |
|
| 290 | 290 | ), |
| 291 | 291 | 'settings' => array( |
| 292 | 292 | 'label' => $txt['pm_settings'], |
| 293 | - 'custom_url' => $scripturl . '?action=pm;sa=settings', |
|
| 293 | + 'custom_url' => $scripturl.'?action=pm;sa=settings', |
|
| 294 | 294 | ), |
| 295 | 295 | ), |
| 296 | 296 | ), |
@@ -311,9 +311,9 @@ discard block |
||
| 311 | 311 | $pm_areas['labels']['amt'] += $label['unread_messages']; |
| 312 | 312 | |
| 313 | 313 | // Add the label to the menu. |
| 314 | - $pm_areas['labels']['areas']['label' . $label['id']] = array( |
|
| 314 | + $pm_areas['labels']['areas']['label'.$label['id']] = array( |
|
| 315 | 315 | 'label' => $label['name'], |
| 316 | - 'custom_url' => $scripturl . '?action=pm;l=' . $label['id'], |
|
| 316 | + 'custom_url' => $scripturl.'?action=pm;l='.$label['id'], |
|
| 317 | 317 | 'amt' => $label['unread_messages'], |
| 318 | 318 | 'unread_messages' => $label['unread_messages'], |
| 319 | 319 | 'messages' => $label['messages'], |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | ); |
| 344 | 344 | } |
| 345 | 345 | |
| 346 | - require_once($sourcedir . '/Subs-Menu.php'); |
|
| 346 | + require_once($sourcedir.'/Subs-Menu.php'); |
|
| 347 | 347 | |
| 348 | 348 | // Set a few options for the menu. |
| 349 | 349 | $menuOptions = array( |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | |
| 362 | 362 | // Make a note of the Unique ID for this menu. |
| 363 | 363 | $context['pm_menu_id'] = $context['max_menu_id']; |
| 364 | - $context['pm_menu_name'] = 'menu_data_' . $context['pm_menu_id']; |
|
| 364 | + $context['pm_menu_name'] = 'menu_data_'.$context['pm_menu_id']; |
|
| 365 | 365 | |
| 366 | 366 | // Set the selected item. |
| 367 | 367 | $current_area = $pm_include_data['current_area']; |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | |
| 437 | 437 | $row['replied_to_you'] = $row['id_pm'] != $row['id_pm_head']; |
| 438 | 438 | $row['time'] = timeformat($row['timestamp']); |
| 439 | - $row['pm_link'] = '<a href="' . $scripturl . '?action=pm;f=inbox;pmsg=' . $row['id_pm'] . '">' . $row['subject'] . '</a>'; |
|
| 439 | + $row['pm_link'] = '<a href="'.$scripturl.'?action=pm;f=inbox;pmsg='.$row['id_pm'].'">'.$row['subject'].'</a>'; |
|
| 440 | 440 | $context['unread_pms'][$row['id_pm']] = $row; |
| 441 | 441 | } |
| 442 | 442 | $smcFunc['db_free_result']($request); |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | |
| 490 | 490 | if (!empty($sig_limits[5]) || !empty($sig_limits[6])) |
| 491 | 491 | addInlineCss(' |
| 492 | - .signature img { ' . (!empty($sig_limits[5]) ? 'max-width: ' . (int) $sig_limits[5] . 'px; ' : '') . (!empty($sig_limits[6]) ? 'max-height: ' . (int) $sig_limits[6] . 'px; ' : '') . '}'); |
|
| 492 | + .signature img { ' . (!empty($sig_limits[5]) ? 'max-width: '.(int) $sig_limits[5].'px; ' : '').(!empty($sig_limits[6]) ? 'max-height: '.(int) $sig_limits[6].'px; ' : '').'}'); |
|
| 493 | 493 | } |
| 494 | 494 | |
| 495 | 495 | $labelJoin = ''; |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | } |
| 513 | 513 | |
| 514 | 514 | // Set the index bar correct! |
| 515 | - messageIndexBar($context['current_label_id'] == -1 ? $context['folder'] : 'label' . $context['current_label_id']); |
|
| 515 | + messageIndexBar($context['current_label_id'] == -1 ? $context['folder'] : 'label'.$context['current_label_id']); |
|
| 516 | 516 | |
| 517 | 517 | // Sorting the folder. |
| 518 | 518 | $sort_methods = array( |
@@ -546,21 +546,21 @@ discard block |
||
| 546 | 546 | // Now, build the link tree! |
| 547 | 547 | if ($context['current_label_id'] == -1) |
| 548 | 548 | $context['linktree'][] = array( |
| 549 | - 'url' => $scripturl . '?action=pm;f=' . $context['folder'], |
|
| 549 | + 'url' => $scripturl.'?action=pm;f='.$context['folder'], |
|
| 550 | 550 | 'name' => $pmbox |
| 551 | 551 | ); |
| 552 | 552 | |
| 553 | 553 | // Build it further for a label. |
| 554 | 554 | if ($context['current_label_id'] != -1) |
| 555 | 555 | $context['linktree'][] = array( |
| 556 | - 'url' => $scripturl . '?action=pm;f=' . $context['folder'] . ';l=' . $context['current_label_id'], |
|
| 557 | - 'name' => $txt['pm_current_label'] . ': ' . $context['current_label'] |
|
| 556 | + 'url' => $scripturl.'?action=pm;f='.$context['folder'].';l='.$context['current_label_id'], |
|
| 557 | + 'name' => $txt['pm_current_label'].': '.$context['current_label'] |
|
| 558 | 558 | ); |
| 559 | 559 | |
| 560 | 560 | // Figure out how many messages there are. |
| 561 | 561 | if ($context['folder'] == 'sent') |
| 562 | 562 | $request = $smcFunc['db_query']('', ' |
| 563 | - SELECT COUNT(' . ($context['display_mode'] == 2 ? 'DISTINCT pm.id_pm_head' : '*') . ') |
|
| 563 | + SELECT COUNT(' . ($context['display_mode'] == 2 ? 'DISTINCT pm.id_pm_head' : '*').') |
|
| 564 | 564 | FROM {db_prefix}personal_messages AS pm |
| 565 | 565 | WHERE pm.id_member_from = {int:current_member} |
| 566 | 566 | AND pm.deleted_by_sender = {int:not_deleted}', |
@@ -571,11 +571,11 @@ discard block |
||
| 571 | 571 | ); |
| 572 | 572 | else |
| 573 | 573 | $request = $smcFunc['db_query']('', ' |
| 574 | - SELECT COUNT(' . ($context['display_mode'] == 2 ? 'DISTINCT pm.id_pm_head' : '*') . ') |
|
| 574 | + SELECT COUNT(' . ($context['display_mode'] == 2 ? 'DISTINCT pm.id_pm_head' : '*').') |
|
| 575 | 575 | FROM {db_prefix}pm_recipients AS pmr' . ($context['display_mode'] == 2 ? ' |
| 576 | - INNER JOIN {db_prefix}personal_messages AS pm ON (pm.id_pm = pmr.id_pm)' : '') . $labelJoin . ' |
|
| 576 | + INNER JOIN {db_prefix}personal_messages AS pm ON (pm.id_pm = pmr.id_pm)' : '').$labelJoin.' |
|
| 577 | 577 | WHERE pmr.id_member = {int:current_member} |
| 578 | - AND pmr.deleted = {int:not_deleted}' . $labelQuery . $labelQuery2, |
|
| 578 | + AND pmr.deleted = {int:not_deleted}' . $labelQuery.$labelQuery2, |
|
| 579 | 579 | array( |
| 580 | 580 | 'current_member' => $user_info['id'], |
| 581 | 581 | 'not_deleted' => 0, |
@@ -613,11 +613,11 @@ discard block |
||
| 613 | 613 | { |
| 614 | 614 | if ($context['folder'] == 'sent') |
| 615 | 615 | $request = $smcFunc['db_query']('', ' |
| 616 | - SELECT COUNT(' . ($context['display_mode'] == 2 ? 'DISTINCT pm.id_pm_head' : '*') . ') |
|
| 616 | + SELECT COUNT(' . ($context['display_mode'] == 2 ? 'DISTINCT pm.id_pm_head' : '*').') |
|
| 617 | 617 | FROM {db_prefix}personal_messages |
| 618 | 618 | WHERE id_member_from = {int:current_member} |
| 619 | 619 | AND deleted_by_sender = {int:not_deleted} |
| 620 | - AND id_pm ' . ($descending ? '>' : '<') . ' {int:id_pm}', |
|
| 620 | + AND id_pm ' . ($descending ? '>' : '<').' {int:id_pm}', |
|
| 621 | 621 | array( |
| 622 | 622 | 'current_member' => $user_info['id'], |
| 623 | 623 | 'not_deleted' => 0, |
@@ -626,12 +626,12 @@ discard block |
||
| 626 | 626 | ); |
| 627 | 627 | else |
| 628 | 628 | $request = $smcFunc['db_query']('', ' |
| 629 | - SELECT COUNT(' . ($context['display_mode'] == 2 ? 'DISTINCT pm.id_pm_head' : '*') . ') |
|
| 629 | + SELECT COUNT(' . ($context['display_mode'] == 2 ? 'DISTINCT pm.id_pm_head' : '*').') |
|
| 630 | 630 | FROM {db_prefix}pm_recipients AS pmr' . ($context['display_mode'] == 2 ? ' |
| 631 | - INNER JOIN {db_prefix}personal_messages AS pm ON (pm.id_pm = pmr.id_pm)' : '') . $labelJoin . ' |
|
| 631 | + INNER JOIN {db_prefix}personal_messages AS pm ON (pm.id_pm = pmr.id_pm)' : '').$labelJoin.' |
|
| 632 | 632 | WHERE pmr.id_member = {int:current_member} |
| 633 | - AND pmr.deleted = {int:not_deleted}' . $labelQuery . $labelQuery2 . ' |
|
| 634 | - AND pmr.id_pm ' . ($descending ? '>' : '<') . ' {int:id_pm}', |
|
| 633 | + AND pmr.deleted = {int:not_deleted}' . $labelQuery.$labelQuery2.' |
|
| 634 | + AND pmr.id_pm ' . ($descending ? '>' : '<').' {int:id_pm}', |
|
| 635 | 635 | array( |
| 636 | 636 | 'current_member' => $user_info['id'], |
| 637 | 637 | 'not_deleted' => 0, |
@@ -657,15 +657,15 @@ discard block |
||
| 657 | 657 | } |
| 658 | 658 | |
| 659 | 659 | // Set up the page index. |
| 660 | - $context['page_index'] = constructPageIndex($scripturl . '?action=pm;f=' . $context['folder'] . (isset($_REQUEST['l']) ? ';l=' . (int) $_REQUEST['l'] : '') . ';sort=' . $context['sort_by'] . ($descending ? ';desc' : ''), $_GET['start'], $max_messages, $maxPerPage); |
|
| 660 | + $context['page_index'] = constructPageIndex($scripturl.'?action=pm;f='.$context['folder'].(isset($_REQUEST['l']) ? ';l='.(int) $_REQUEST['l'] : '').';sort='.$context['sort_by'].($descending ? ';desc' : ''), $_GET['start'], $max_messages, $maxPerPage); |
|
| 661 | 661 | $context['start'] = $_GET['start']; |
| 662 | 662 | |
| 663 | 663 | // Determine the navigation context. |
| 664 | 664 | $context['links'] = array( |
| 665 | - 'first' => $_GET['start'] >= $maxPerPage ? $scripturl . '?action=pm;start=0' : '', |
|
| 666 | - 'prev' => $_GET['start'] >= $maxPerPage ? $scripturl . '?action=pm;start=' . ($_GET['start'] - $maxPerPage) : '', |
|
| 667 | - 'next' => $_GET['start'] + $maxPerPage < $max_messages ? $scripturl . '?action=pm;start=' . ($_GET['start'] + $maxPerPage) : '', |
|
| 668 | - 'last' => $_GET['start'] + $maxPerPage < $max_messages ? $scripturl . '?action=pm;start=' . (floor(($max_messages - 1) / $maxPerPage) * $maxPerPage) : '', |
|
| 665 | + 'first' => $_GET['start'] >= $maxPerPage ? $scripturl.'?action=pm;start=0' : '', |
|
| 666 | + 'prev' => $_GET['start'] >= $maxPerPage ? $scripturl.'?action=pm;start='.($_GET['start'] - $maxPerPage) : '', |
|
| 667 | + 'next' => $_GET['start'] + $maxPerPage < $max_messages ? $scripturl.'?action=pm;start='.($_GET['start'] + $maxPerPage) : '', |
|
| 668 | + 'last' => $_GET['start'] + $maxPerPage < $max_messages ? $scripturl.'?action=pm;start='.(floor(($max_messages - 1) / $maxPerPage) * $maxPerPage) : '', |
|
| 669 | 669 | 'up' => $scripturl, |
| 670 | 670 | ); |
| 671 | 671 | $context['page_info'] = array( |
@@ -693,14 +693,14 @@ discard block |
||
| 693 | 693 | INNER JOIN {db_prefix}pm_recipients AS pmr ON (pmr.id_pm = pm.id_pm |
| 694 | 694 | AND pmr.id_member = {int:current_member} |
| 695 | 695 | AND pmr.deleted = {int:deleted_by} |
| 696 | - ' . $labelQuery . ')') . $labelJoin . ($context['sort_by'] == 'name' ? (' |
|
| 697 | - LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = {raw:pm_member})') : '') . ' |
|
| 696 | + ' . $labelQuery.')').$labelJoin.($context['sort_by'] == 'name' ? (' |
|
| 697 | + LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = {raw:pm_member})') : '').' |
|
| 698 | 698 | WHERE ' . ($context['folder'] == 'sent' ? 'pm.id_member_from = {int:current_member} |
| 699 | - AND pm.deleted_by_sender = {int:deleted_by}' : '1=1') . (empty($pmsg) ? '' : ' |
|
| 700 | - AND pm.id_pm = {int:pmsg}') . $labelQuery2 . ' |
|
| 701 | - GROUP BY pm.id_pm_head'.($_GET['sort'] != 'pm.id_pm' ? ',' . $_GET['sort'] : '') . ' |
|
| 702 | - ORDER BY ' . ($_GET['sort'] == 'pm.id_pm' ? 'id_pm' : '{raw:sort}') . ($descending ? ' DESC' : ' ASC') . (empty($_GET['pmsg']) ? ' |
|
| 703 | - LIMIT ' . $_GET['start'] . ', ' . $maxPerPage : ''), |
|
| 699 | + AND pm.deleted_by_sender = {int:deleted_by}' : '1=1').(empty($pmsg) ? '' : ' |
|
| 700 | + AND pm.id_pm = {int:pmsg}').$labelQuery2.' |
|
| 701 | + GROUP BY pm.id_pm_head'.($_GET['sort'] != 'pm.id_pm' ? ','.$_GET['sort'] : '').' |
|
| 702 | + ORDER BY ' . ($_GET['sort'] == 'pm.id_pm' ? 'id_pm' : '{raw:sort}').($descending ? ' DESC' : ' ASC').(empty($_GET['pmsg']) ? ' |
|
| 703 | + LIMIT ' . $_GET['start'].', '.$maxPerPage : ''), |
|
| 704 | 704 | array( |
| 705 | 705 | 'current_member' => $user_info['id'], |
| 706 | 706 | 'deleted_by' => 0, |
@@ -716,18 +716,18 @@ discard block |
||
| 716 | 716 | // @todo SLOW This query uses a filesort. (inbox only.) |
| 717 | 717 | $request = $smcFunc['db_query']('', ' |
| 718 | 718 | SELECT pm.id_pm, pm.id_pm_head, pm.id_member_from |
| 719 | - FROM {db_prefix}personal_messages AS pm' . ($context['folder'] == 'sent' ? '' . ($context['sort_by'] == 'name' ? ' |
|
| 719 | + FROM {db_prefix}personal_messages AS pm' . ($context['folder'] == 'sent' ? ''.($context['sort_by'] == 'name' ? ' |
|
| 720 | 720 | LEFT JOIN {db_prefix}pm_recipients AS pmr ON (pmr.id_pm = pm.id_pm)' : '') : ' |
| 721 | 721 | INNER JOIN {db_prefix}pm_recipients AS pmr ON (pmr.id_pm = pm.id_pm |
| 722 | 722 | AND pmr.id_member = {int:current_member} |
| 723 | 723 | AND pmr.deleted = {int:is_deleted} |
| 724 | - ' . $labelQuery . ')') . $labelJoin . ($context['sort_by'] == 'name' ? (' |
|
| 725 | - LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = {raw:pm_member})') : '') . ' |
|
| 724 | + ' . $labelQuery.')').$labelJoin.($context['sort_by'] == 'name' ? (' |
|
| 725 | + LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = {raw:pm_member})') : '').' |
|
| 726 | 726 | WHERE ' . ($context['folder'] == 'sent' ? 'pm.id_member_from = {int:current_member} |
| 727 | - AND pm.deleted_by_sender = {int:is_deleted}' : '1=1') . (empty($pmsg) ? '' : ' |
|
| 728 | - AND pm.id_pm = {int:pmsg}') . $labelQuery2 . ' |
|
| 729 | - ORDER BY ' . ($_GET['sort'] == 'pm.id_pm' && $context['folder'] != 'sent' ? 'pmr.id_pm' : '{raw:sort}') . ($descending ? ' DESC' : ' ASC') . (empty($pmsg) ? ' |
|
| 730 | - LIMIT ' . $_GET['start'] . ', ' . $maxPerPage : ''), |
|
| 727 | + AND pm.deleted_by_sender = {int:is_deleted}' : '1=1').(empty($pmsg) ? '' : ' |
|
| 728 | + AND pm.id_pm = {int:pmsg}').$labelQuery2.' |
|
| 729 | + ORDER BY ' . ($_GET['sort'] == 'pm.id_pm' && $context['folder'] != 'sent' ? 'pmr.id_pm' : '{raw:sort}').($descending ? ' DESC' : ' ASC').(empty($pmsg) ? ' |
|
| 730 | + LIMIT ' . $_GET['start'].', '.$maxPerPage : ''), |
|
| 731 | 731 | array( |
| 732 | 732 | 'current_member' => $user_info['id'], |
| 733 | 733 | 'is_deleted' => 0, |
@@ -838,7 +838,7 @@ discard block |
||
| 838 | 838 | { |
| 839 | 839 | if ($context['folder'] == 'sent' || empty($row['bcc'])) |
| 840 | 840 | { |
| 841 | - $recipients[$row['id_pm']][empty($row['bcc']) ? 'to' : 'bcc'][] = empty($row['id_member_to']) ? $txt['guest_title'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member_to'] . '">' . $row['to_name'] . '</a>'; |
|
| 841 | + $recipients[$row['id_pm']][empty($row['bcc']) ? 'to' : 'bcc'][] = empty($row['id_member_to']) ? $txt['guest_title'] : '<a href="'.$scripturl.'?action=profile;u='.$row['id_member_to'].'">'.$row['to_name'].'</a>'; |
|
| 842 | 842 | |
| 843 | 843 | $context['folder'] == 'sent' && $context['display_mode'] != 2 ? $context['message_replied'][$row['id_pm']] = $row['is_read'] & 2 : ''; |
| 844 | 844 | } |
@@ -893,7 +893,7 @@ discard block |
||
| 893 | 893 | // Get the order right. |
| 894 | 894 | $orderBy = array(); |
| 895 | 895 | foreach (array_reverse($pms) as $pm) |
| 896 | - $orderBy[] = 'pm.id_pm = ' . $pm; |
|
| 896 | + $orderBy[] = 'pm.id_pm = '.$pm; |
|
| 897 | 897 | |
| 898 | 898 | // Seperate query for these bits! |
| 899 | 899 | $subjects_request = $smcFunc['db_query']('', ' |
@@ -902,7 +902,7 @@ discard block |
||
| 902 | 902 | FROM {db_prefix}personal_messages AS pm |
| 903 | 903 | LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = pm.id_member_from) |
| 904 | 904 | WHERE pm.id_pm IN ({array_int:pm_list}) |
| 905 | - ORDER BY ' . implode(', ', $orderBy) . ' |
|
| 905 | + ORDER BY ' . implode(', ', $orderBy).' |
|
| 906 | 906 | LIMIT {int:limit}', |
| 907 | 907 | array( |
| 908 | 908 | 'pm_list' => $pms, |
@@ -915,11 +915,11 @@ discard block |
||
| 915 | 915 | $messages_request = $smcFunc['db_query']('', ' |
| 916 | 916 | SELECT pm.id_pm, pm.subject, pm.id_member_from, pm.body, pm.msgtime, pm.from_name |
| 917 | 917 | FROM {db_prefix}personal_messages AS pm' . ($context['folder'] == 'sent' ? ' |
| 918 | - LEFT JOIN {db_prefix}pm_recipients AS pmr ON (pmr.id_pm = pm.id_pm)' : '') . ($context['sort_by'] == 'name' ? ' |
|
| 919 | - LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = {raw:id_member})' : '') . ' |
|
| 918 | + LEFT JOIN {db_prefix}pm_recipients AS pmr ON (pmr.id_pm = pm.id_pm)' : '').($context['sort_by'] == 'name' ? ' |
|
| 919 | + LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = {raw:id_member})' : '').' |
|
| 920 | 920 | WHERE pm.id_pm IN ({array_int:display_pms})' . ($context['folder'] == 'sent' ? ' |
| 921 | - GROUP BY pm.id_pm, pm.subject, pm.id_member_from, pm.body, pm.msgtime, pm.from_name' : '') . ' |
|
| 922 | - ORDER BY ' . ($context['display_mode'] == 2 ? 'pm.id_pm' : '{raw:sort}') . ($descending ? ' DESC' : ' ASC') . ' |
|
| 921 | + GROUP BY pm.id_pm, pm.subject, pm.id_member_from, pm.body, pm.msgtime, pm.from_name' : '').' |
|
| 922 | + ORDER BY ' . ($context['display_mode'] == 2 ? 'pm.id_pm' : '{raw:sort}').($descending ? ' DESC' : ' ASC').' |
|
| 923 | 923 | LIMIT {int:limit}', |
| 924 | 924 | array( |
| 925 | 925 | 'display_pms' => $display_pms, |
@@ -933,7 +933,7 @@ discard block |
||
| 933 | 933 | if ($context['display_mode'] == 2) |
| 934 | 934 | { |
| 935 | 935 | $context['conversation_buttons'] = array( |
| 936 | - 'delete' => array('text' => 'delete_conversation', 'image' => 'delete.png', 'url' => $scripturl . '?action=pm;sa=pmactions;pm_actions[' . $context['current_pm'] . ']=delete;conversation;f=' . $context['folder'] . ';start=' . $context['start'] . ($context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '') . ';' . $context['session_var'] . '=' . $context['session_id'], 'custom' => 'data-confirm="' . $txt['remove_conversation'] . '"', 'class' => 'you_sure'), |
|
| 936 | + 'delete' => array('text' => 'delete_conversation', 'image' => 'delete.png', 'url' => $scripturl.'?action=pm;sa=pmactions;pm_actions['.$context['current_pm'].']=delete;conversation;f='.$context['folder'].';start='.$context['start'].($context['current_label_id'] != -1 ? ';l='.$context['current_label_id'] : '').';'.$context['session_var'].'='.$context['session_id'], 'custom' => 'data-confirm="'.$txt['remove_conversation'].'"', 'class' => 'you_sure'), |
|
| 937 | 937 | ); |
| 938 | 938 | |
| 939 | 939 | // Allow mods to add additional buttons here |
@@ -1002,7 +1002,7 @@ discard block |
||
| 1002 | 1002 | 'member' => array( |
| 1003 | 1003 | 'id' => $subject['id_member_from'], |
| 1004 | 1004 | 'name' => $subject['from_name'], |
| 1005 | - 'link' => ($subject['id_member_from'] != 0) ? '<a href="' . $scripturl . '?action=profile;u=' . $subject['id_member_from'] . '">' . $subject['from_name'] . '</a>' : $subject['from_name'], |
|
| 1005 | + 'link' => ($subject['id_member_from'] != 0) ? '<a href="'.$scripturl.'?action=profile;u='.$subject['id_member_from'].'">'.$subject['from_name'].'</a>' : $subject['from_name'], |
|
| 1006 | 1006 | ), |
| 1007 | 1007 | 'recipients' => &$recipients[$subject['id_pm']], |
| 1008 | 1008 | 'subject' => $subject['subject'], |
@@ -1068,7 +1068,7 @@ discard block |
||
| 1068 | 1068 | censorText($message['subject']); |
| 1069 | 1069 | |
| 1070 | 1070 | // Run UBBC interpreter on the message. |
| 1071 | - $message['body'] = parse_bbc($message['body'], true, 'pm' . $message['id_pm']); |
|
| 1071 | + $message['body'] = parse_bbc($message['body'], true, 'pm'.$message['id_pm']); |
|
| 1072 | 1072 | |
| 1073 | 1073 | // Send the array. |
| 1074 | 1074 | $output = array( |
@@ -1165,14 +1165,14 @@ discard block |
||
| 1165 | 1165 | if ($search_error == 'messages') |
| 1166 | 1166 | continue; |
| 1167 | 1167 | |
| 1168 | - $context['search_errors']['messages'][] = $txt['error_' . $search_error]; |
|
| 1168 | + $context['search_errors']['messages'][] = $txt['error_'.$search_error]; |
|
| 1169 | 1169 | } |
| 1170 | 1170 | } |
| 1171 | 1171 | |
| 1172 | 1172 | $context['page_title'] = $txt['pm_search_title']; |
| 1173 | 1173 | $context['sub_template'] = 'search'; |
| 1174 | 1174 | $context['linktree'][] = array( |
| 1175 | - 'url' => $scripturl . '?action=pm;sa=search', |
|
| 1175 | + 'url' => $scripturl.'?action=pm;sa=search', |
|
| 1176 | 1176 | 'name' => $txt['pm_search_bar_title'], |
| 1177 | 1177 | ); |
| 1178 | 1178 | } |
@@ -1266,8 +1266,8 @@ discard block |
||
| 1266 | 1266 | $where_clause = array(); |
| 1267 | 1267 | foreach ($possible_users as $k => $v) |
| 1268 | 1268 | { |
| 1269 | - $where_params['name_' . $k] = $v; |
|
| 1270 | - $where_clause[] = '{raw:real_name} LIKE {string:name_' . $k . '}'; |
|
| 1269 | + $where_params['name_'.$k] = $v; |
|
| 1270 | + $where_clause[] = '{raw:real_name} LIKE {string:name_'.$k.'}'; |
|
| 1271 | 1271 | if (!isset($where_params['real_name'])) |
| 1272 | 1272 | $where_params['real_name'] = $smcFunc['db_case_sensitive'] ? 'LOWER(real_name)' : 'real_name'; |
| 1273 | 1273 | } |
@@ -1287,7 +1287,7 @@ discard block |
||
| 1287 | 1287 | elseif ($smcFunc['db_num_rows']($request) == 0) |
| 1288 | 1288 | { |
| 1289 | 1289 | $userQuery = 'AND pm.id_member_from = 0 AND ({raw:pm_from_name} LIKE {raw:guest_user_name_implode})'; |
| 1290 | - $searchq_parameters['guest_user_name_implode'] = '\'' . implode('\' OR ' . ($smcFunc['db_case_sensitive'] ? 'LOWER(pm.from_name)' : 'pm.from_name') . ' LIKE \'', $possible_users) . '\''; |
|
| 1290 | + $searchq_parameters['guest_user_name_implode'] = '\''.implode('\' OR '.($smcFunc['db_case_sensitive'] ? 'LOWER(pm.from_name)' : 'pm.from_name').' LIKE \'', $possible_users).'\''; |
|
| 1291 | 1291 | $searchq_parameters['pm_from_name'] = $smcFunc['db_case_sensitive'] ? 'LOWER(pm.from_name)' : 'pm.from_name'; |
| 1292 | 1292 | } |
| 1293 | 1293 | else |
@@ -1296,7 +1296,7 @@ discard block |
||
| 1296 | 1296 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 1297 | 1297 | $memberlist[] = $row['id_member']; |
| 1298 | 1298 | $userQuery = 'AND (pm.id_member_from IN ({array_int:member_list}) OR (pm.id_member_from = 0 AND ({raw:pm_from_name} LIKE {raw:guest_user_name_implode})))'; |
| 1299 | - $searchq_parameters['guest_user_name_implode'] = '\'' . implode('\' OR ' . ($smcFunc['db_case_sensitive'] ? 'LOWER(pm.from_name)' : 'pm.from_name') . ' LIKE \'', $possible_users) . '\''; |
|
| 1299 | + $searchq_parameters['guest_user_name_implode'] = '\''.implode('\' OR '.($smcFunc['db_case_sensitive'] ? 'LOWER(pm.from_name)' : 'pm.from_name').' LIKE \'', $possible_users).'\''; |
|
| 1300 | 1300 | $searchq_parameters['member_list'] = $memberlist; |
| 1301 | 1301 | $searchq_parameters['pm_from_name'] = $smcFunc['db_case_sensitive'] ? 'LOWER(pm.from_name)' : 'pm.from_name'; |
| 1302 | 1302 | } |
@@ -1366,7 +1366,7 @@ discard block |
||
| 1366 | 1366 | else |
| 1367 | 1367 | { |
| 1368 | 1368 | // Searching the inbox - PM doesn't have to be labeled |
| 1369 | - $labelQuery = ' AND (' . substr($labelQuery, 5) . ' OR pml.id_label IN ({array_int:labels}))'; |
|
| 1369 | + $labelQuery = ' AND ('.substr($labelQuery, 5).' OR pml.id_label IN ({array_int:labels}))'; |
|
| 1370 | 1370 | $labelJoin = ' LEFT JOIN {db_prefix}pm_labeled_messages AS pml ON (pml.id_pm = pmr.id_pm)'; |
| 1371 | 1371 | } |
| 1372 | 1372 | |
@@ -1382,11 +1382,11 @@ discard block |
||
| 1382 | 1382 | $context['search_errors']['invalid_search_string'] = true; |
| 1383 | 1383 | |
| 1384 | 1384 | // Extract phrase parts first (e.g. some words "this is a phrase" some more words.) |
| 1385 | - preg_match_all('~(?:^|\s)([-]?)"([^"]+)"(?:$|\s)~' . ($context['utf8'] ? 'u' : ''), $search_params['search'], $matches, PREG_PATTERN_ORDER); |
|
| 1385 | + preg_match_all('~(?:^|\s)([-]?)"([^"]+)"(?:$|\s)~'.($context['utf8'] ? 'u' : ''), $search_params['search'], $matches, PREG_PATTERN_ORDER); |
|
| 1386 | 1386 | $searchArray = $matches[2]; |
| 1387 | 1387 | |
| 1388 | 1388 | // Remove the phrase parts and extract the words. |
| 1389 | - $tempSearch = explode(' ', preg_replace('~(?:^|\s)(?:[-]?)"(?:[^"]+)"(?:$|\s)~' . ($context['utf8'] ? 'u' : ''), ' ', $search_params['search'])); |
|
| 1389 | + $tempSearch = explode(' ', preg_replace('~(?:^|\s)(?:[-]?)"(?:[^"]+)"(?:$|\s)~'.($context['utf8'] ? 'u' : ''), ' ', $search_params['search'])); |
|
| 1390 | 1390 | |
| 1391 | 1391 | // A minus sign in front of a word excludes the word.... so... |
| 1392 | 1392 | $excludedWords = array(); |
@@ -1432,7 +1432,7 @@ discard block |
||
| 1432 | 1432 | // Create an array of replacements for highlighting. |
| 1433 | 1433 | $context['mark'] = array(); |
| 1434 | 1434 | foreach ($searchArray as $word) |
| 1435 | - $context['mark'][$word] = '<strong class="highlight">' . $word . '</strong>'; |
|
| 1435 | + $context['mark'][$word] = '<strong class="highlight">'.$word.'</strong>'; |
|
| 1436 | 1436 | |
| 1437 | 1437 | // This contains *everything* |
| 1438 | 1438 | $searchWords = array_merge($searchArray, $excludedWords); |
@@ -1451,7 +1451,7 @@ discard block |
||
| 1451 | 1451 | // Now we have all the parameters, combine them together for pagination and the like... |
| 1452 | 1452 | $context['params'] = array(); |
| 1453 | 1453 | foreach ($search_params as $k => $v) |
| 1454 | - $context['params'][] = $k . '|\'|' . $v; |
|
| 1454 | + $context['params'][] = $k.'|\'|'.$v; |
|
| 1455 | 1455 | $context['params'] = base64_encode(implode('|"|', $context['params'])); |
| 1456 | 1456 | |
| 1457 | 1457 | // Compile the subject query part. |
@@ -1463,10 +1463,10 @@ discard block |
||
| 1463 | 1463 | continue; |
| 1464 | 1464 | |
| 1465 | 1465 | if ($search_params['subject_only']) |
| 1466 | - $andQueryParts[] = 'pm.subject' . (in_array($word, $excludedWords) ? ' NOT' : '') . ' LIKE {string:search_' . $index . '}'; |
|
| 1466 | + $andQueryParts[] = 'pm.subject'.(in_array($word, $excludedWords) ? ' NOT' : '').' LIKE {string:search_'.$index.'}'; |
|
| 1467 | 1467 | else |
| 1468 | - $andQueryParts[] = '(pm.subject' . (in_array($word, $excludedWords) ? ' NOT' : '') . ' LIKE {string:search_' . $index . '} ' . (in_array($word, $excludedWords) ? 'AND pm.body NOT' : 'OR pm.body') . ' LIKE {string:search_' . $index . '})'; |
|
| 1469 | - $searchq_parameters['search_' . $index] = '%' . strtr($word, array('_' => '\\_', '%' => '\\%')) . '%'; |
|
| 1468 | + $andQueryParts[] = '(pm.subject'.(in_array($word, $excludedWords) ? ' NOT' : '').' LIKE {string:search_'.$index.'} '.(in_array($word, $excludedWords) ? 'AND pm.body NOT' : 'OR pm.body').' LIKE {string:search_'.$index.'})'; |
|
| 1469 | + $searchq_parameters['search_'.$index] = '%'.strtr($word, array('_' => '\\_', '%' => '\\%')).'%'; |
|
| 1470 | 1470 | } |
| 1471 | 1471 | |
| 1472 | 1472 | $searchQuery = ' 1=1'; |
@@ -1476,9 +1476,9 @@ discard block |
||
| 1476 | 1476 | // Age limits? |
| 1477 | 1477 | $timeQuery = ''; |
| 1478 | 1478 | if (!empty($search_params['minage'])) |
| 1479 | - $timeQuery .= ' AND pm.msgtime < ' . (time() - $search_params['minage'] * 86400); |
|
| 1479 | + $timeQuery .= ' AND pm.msgtime < '.(time() - $search_params['minage'] * 86400); |
|
| 1480 | 1480 | if (!empty($search_params['maxage'])) |
| 1481 | - $timeQuery .= ' AND pm.msgtime > ' . (time() - $search_params['maxage'] * 86400); |
|
| 1481 | + $timeQuery .= ' AND pm.msgtime > '.(time() - $search_params['maxage'] * 86400); |
|
| 1482 | 1482 | |
| 1483 | 1483 | // If we have errors - return back to the first screen... |
| 1484 | 1484 | if (!empty($context['search_errors'])) |
@@ -1492,14 +1492,14 @@ discard block |
||
| 1492 | 1492 | SELECT COUNT(*) |
| 1493 | 1493 | FROM {db_prefix}pm_recipients AS pmr |
| 1494 | 1494 | INNER JOIN {db_prefix}personal_messages AS pm ON (pm.id_pm = pmr.id_pm) |
| 1495 | - ' . $labelJoin . ' |
|
| 1495 | + ' . $labelJoin.' |
|
| 1496 | 1496 | WHERE ' . ($context['folder'] == 'inbox' ? ' |
| 1497 | 1497 | pmr.id_member = {int:current_member} |
| 1498 | 1498 | AND pmr.deleted = {int:not_deleted}' : ' |
| 1499 | 1499 | pm.id_member_from = {int:current_member} |
| 1500 | - AND pm.deleted_by_sender = {int:not_deleted}') . ' |
|
| 1501 | - ' . $userQuery . $labelQuery . $timeQuery . ' |
|
| 1502 | - AND (' . $searchQuery . ')', |
|
| 1500 | + AND pm.deleted_by_sender = {int:not_deleted}').' |
|
| 1501 | + ' . $userQuery.$labelQuery.$timeQuery.' |
|
| 1502 | + AND (' . $searchQuery.')', |
|
| 1503 | 1503 | array_merge($searchq_parameters, array( |
| 1504 | 1504 | 'current_member' => $user_info['id'], |
| 1505 | 1505 | 'not_deleted' => 0, |
@@ -1514,14 +1514,14 @@ discard block |
||
| 1514 | 1514 | SELECT pm.id_pm, pm.id_pm_head, pm.id_member_from |
| 1515 | 1515 | FROM {db_prefix}pm_recipients AS pmr |
| 1516 | 1516 | INNER JOIN {db_prefix}personal_messages AS pm ON (pm.id_pm = pmr.id_pm) |
| 1517 | - ' . $labelJoin . ' |
|
| 1517 | + ' . $labelJoin.' |
|
| 1518 | 1518 | WHERE ' . ($context['folder'] == 'inbox' ? ' |
| 1519 | 1519 | pmr.id_member = {int:current_member} |
| 1520 | 1520 | AND pmr.deleted = {int:not_deleted}' : ' |
| 1521 | 1521 | pm.id_member_from = {int:current_member} |
| 1522 | - AND pm.deleted_by_sender = {int:not_deleted}') . ' |
|
| 1523 | - ' . $userQuery . $labelQuery . $timeQuery . ' |
|
| 1524 | - AND (' . $searchQuery . ') |
|
| 1522 | + AND pm.deleted_by_sender = {int:not_deleted}').' |
|
| 1523 | + ' . $userQuery.$labelQuery.$timeQuery.' |
|
| 1524 | + AND (' . $searchQuery.') |
|
| 1525 | 1525 | ORDER BY {raw:sort} {raw:sort_dir} |
| 1526 | 1526 | LIMIT {int:start}, {int:max}', |
| 1527 | 1527 | array_merge($searchq_parameters, array( |
@@ -1573,7 +1573,7 @@ discard block |
||
| 1573 | 1573 | loadMemberData($posters); |
| 1574 | 1574 | |
| 1575 | 1575 | // Sort out the page index. |
| 1576 | - $context['page_index'] = constructPageIndex($scripturl . '?action=pm;sa=search2;params=' . $context['params'], $_GET['start'], $numResults, $modSettings['search_results_per_page'], false); |
|
| 1576 | + $context['page_index'] = constructPageIndex($scripturl.'?action=pm;sa=search2;params='.$context['params'], $_GET['start'], $numResults, $modSettings['search_results_per_page'], false); |
|
| 1577 | 1577 | |
| 1578 | 1578 | $context['message_labels'] = array(); |
| 1579 | 1579 | $context['message_replied'] = array(); |
@@ -1596,7 +1596,7 @@ discard block |
||
| 1596 | 1596 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 1597 | 1597 | { |
| 1598 | 1598 | if ($context['folder'] == 'sent' || empty($row['bcc'])) |
| 1599 | - $recipients[$row['id_pm']][empty($row['bcc']) ? 'to' : 'bcc'][] = empty($row['id_member_to']) ? $txt['guest_title'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member_to'] . '">' . $row['to_name'] . '</a>'; |
|
| 1599 | + $recipients[$row['id_pm']][empty($row['bcc']) ? 'to' : 'bcc'][] = empty($row['id_member_to']) ? $txt['guest_title'] : '<a href="'.$scripturl.'?action=profile;u='.$row['id_member_to'].'">'.$row['to_name'].'</a>'; |
|
| 1600 | 1600 | |
| 1601 | 1601 | if ($row['id_member_to'] == $user_info['id'] && $context['folder'] != 'sent') |
| 1602 | 1602 | { |
@@ -1673,9 +1673,9 @@ discard block |
||
| 1673 | 1673 | censorText($row['subject']); |
| 1674 | 1674 | |
| 1675 | 1675 | // Parse out any BBC... |
| 1676 | - $row['body'] = parse_bbc($row['body'], true, 'pm' . $row['id_pm']); |
|
| 1676 | + $row['body'] = parse_bbc($row['body'], true, 'pm'.$row['id_pm']); |
|
| 1677 | 1677 | |
| 1678 | - $href = $scripturl . '?action=pm;f=' . $context['folder'] . (isset($context['first_label'][$row['id_pm']]) ? ';l=' . $context['first_label'][$row['id_pm']] : '') . ';pmid=' . ($context['display_mode'] == 2 && isset($real_pm_ids[$head_pms[$row['id_pm']]]) ? $real_pm_ids[$head_pms[$row['id_pm']]] : $row['id_pm']) . '#msg' . $row['id_pm']; |
|
| 1678 | + $href = $scripturl.'?action=pm;f='.$context['folder'].(isset($context['first_label'][$row['id_pm']]) ? ';l='.$context['first_label'][$row['id_pm']] : '').';pmid='.($context['display_mode'] == 2 && isset($real_pm_ids[$head_pms[$row['id_pm']]]) ? $real_pm_ids[$head_pms[$row['id_pm']]] : $row['id_pm']).'#msg'.$row['id_pm']; |
|
| 1679 | 1679 | $context['personal_messages'][] = array( |
| 1680 | 1680 | 'id' => $row['id_pm'], |
| 1681 | 1681 | 'member' => &$memberContext[$row['id_member_from']], |
@@ -1687,7 +1687,7 @@ discard block |
||
| 1687 | 1687 | 'fully_labeled' => count($context['message_labels'][$row['id_pm']]) == count($context['labels']), |
| 1688 | 1688 | 'is_replied_to' => &$context['message_replied'][$row['id_pm']], |
| 1689 | 1689 | 'href' => $href, |
| 1690 | - 'link' => '<a href="' . $href . '">' . $row['subject'] . '</a>', |
|
| 1690 | + 'link' => '<a href="'.$href.'">'.$row['subject'].'</a>', |
|
| 1691 | 1691 | 'counter' => ++$counter, |
| 1692 | 1692 | ); |
| 1693 | 1693 | } |
@@ -1699,9 +1699,9 @@ discard block |
||
| 1699 | 1699 | // Finish off the context. |
| 1700 | 1700 | $context['page_title'] = $txt['pm_search_title']; |
| 1701 | 1701 | $context['sub_template'] = 'search_results'; |
| 1702 | - $context['menu_data_' . $context['pm_menu_id']]['current_area'] = 'search'; |
|
| 1702 | + $context['menu_data_'.$context['pm_menu_id']]['current_area'] = 'search'; |
|
| 1703 | 1703 | $context['linktree'][] = array( |
| 1704 | - 'url' => $scripturl . '?action=pm;sa=search', |
|
| 1704 | + 'url' => $scripturl.'?action=pm;sa=search', |
|
| 1705 | 1705 | 'name' => $txt['pm_search_bar_title'], |
| 1706 | 1706 | ); |
| 1707 | 1707 | } |
@@ -1785,11 +1785,11 @@ discard block |
||
| 1785 | 1785 | pm.body, pm.subject, pm.msgtime, mem.member_name, COALESCE(mem.id_member, 0) AS id_member, |
| 1786 | 1786 | COALESCE(mem.real_name, pm.from_name) AS real_name |
| 1787 | 1787 | FROM {db_prefix}personal_messages AS pm' . (!$isReceived ? '' : ' |
| 1788 | - INNER JOIN {db_prefix}pm_recipients AS pmr ON (pmr.id_pm = {int:id_pm})') . ' |
|
| 1788 | + INNER JOIN {db_prefix}pm_recipients AS pmr ON (pmr.id_pm = {int:id_pm})').' |
|
| 1789 | 1789 | LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = pm.id_member_from) |
| 1790 | 1790 | WHERE pm.id_pm = {int:id_pm}' . (!$isReceived ? ' |
| 1791 | 1791 | AND pm.id_member_from = {int:current_member}' : ' |
| 1792 | - AND pmr.id_member = {int:current_member}') . ' |
|
| 1792 | + AND pmr.id_member = {int:current_member}').' |
|
| 1793 | 1793 | LIMIT 1', |
| 1794 | 1794 | array( |
| 1795 | 1795 | 'current_member' => $user_info['id'], |
@@ -1821,24 +1821,24 @@ discard block |
||
| 1821 | 1821 | } |
| 1822 | 1822 | $form_subject = $row_quoted['subject']; |
| 1823 | 1823 | if ($context['reply'] && trim($context['response_prefix']) != '' && $smcFunc['strpos']($form_subject, trim($context['response_prefix'])) !== 0) |
| 1824 | - $form_subject = $context['response_prefix'] . $form_subject; |
|
| 1824 | + $form_subject = $context['response_prefix'].$form_subject; |
|
| 1825 | 1825 | |
| 1826 | 1826 | if (isset($_REQUEST['quote'])) |
| 1827 | 1827 | { |
| 1828 | 1828 | // Remove any nested quotes and <br>... |
| 1829 | - $form_message = preg_replace('~<br ?/?' . '>~i', "\n", $row_quoted['body']); |
|
| 1829 | + $form_message = preg_replace('~<br ?/?'.'>~i', "\n", $row_quoted['body']); |
|
| 1830 | 1830 | if (!empty($modSettings['removeNestedQuotes'])) |
| 1831 | 1831 | $form_message = preg_replace(array('~\n?\[quote.*?\].+?\[/quote\]\n?~is', '~^\n~', '~\[/quote\]~'), '', $form_message); |
| 1832 | 1832 | if (empty($row_quoted['id_member'])) |
| 1833 | - $form_message = '[quote author="' . $row_quoted['real_name'] . '"]' . "\n" . $form_message . "\n" . '[/quote]'; |
|
| 1833 | + $form_message = '[quote author="'.$row_quoted['real_name'].'"]'."\n".$form_message."\n".'[/quote]'; |
|
| 1834 | 1834 | else |
| 1835 | - $form_message = '[quote author=' . $row_quoted['real_name'] . ' link=action=profile;u=' . $row_quoted['id_member'] . ' date=' . $row_quoted['msgtime'] . ']' . "\n" . $form_message . "\n" . '[/quote]'; |
|
| 1835 | + $form_message = '[quote author='.$row_quoted['real_name'].' link=action=profile;u='.$row_quoted['id_member'].' date='.$row_quoted['msgtime'].']'."\n".$form_message."\n".'[/quote]'; |
|
| 1836 | 1836 | } |
| 1837 | 1837 | else |
| 1838 | 1838 | $form_message = ''; |
| 1839 | 1839 | |
| 1840 | 1840 | // Do the BBC thang on the message. |
| 1841 | - $row_quoted['body'] = parse_bbc($row_quoted['body'], true, 'pm' . $row_quoted['id_pm']); |
|
| 1841 | + $row_quoted['body'] = parse_bbc($row_quoted['body'], true, 'pm'.$row_quoted['id_pm']); |
|
| 1842 | 1842 | |
| 1843 | 1843 | // Set up the quoted message array. |
| 1844 | 1844 | $context['quoted_message'] = array( |
@@ -1848,8 +1848,8 @@ discard block |
||
| 1848 | 1848 | 'name' => $row_quoted['real_name'], |
| 1849 | 1849 | 'username' => $row_quoted['member_name'], |
| 1850 | 1850 | 'id' => $row_quoted['id_member'], |
| 1851 | - 'href' => !empty($row_quoted['id_member']) ? $scripturl . '?action=profile;u=' . $row_quoted['id_member'] : '', |
|
| 1852 | - 'link' => !empty($row_quoted['id_member']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row_quoted['id_member'] . '">' . $row_quoted['real_name'] . '</a>' : $row_quoted['real_name'], |
|
| 1851 | + 'href' => !empty($row_quoted['id_member']) ? $scripturl.'?action=profile;u='.$row_quoted['id_member'] : '', |
|
| 1852 | + 'link' => !empty($row_quoted['id_member']) ? '<a href="'.$scripturl.'?action=profile;u='.$row_quoted['id_member'].'">'.$row_quoted['real_name'].'</a>' : $row_quoted['real_name'], |
|
| 1853 | 1853 | ), |
| 1854 | 1854 | 'subject' => $row_quoted['subject'], |
| 1855 | 1855 | 'time' => timeformat($row_quoted['msgtime']), |
@@ -1933,7 +1933,7 @@ discard block |
||
| 1933 | 1933 | $names = array(); |
| 1934 | 1934 | foreach ($context['recipients']['to'] as $to) |
| 1935 | 1935 | $names[] = $to['name']; |
| 1936 | - $context['to_value'] = empty($names) ? '' : '"' . implode('", "', $names) . '"'; |
|
| 1936 | + $context['to_value'] = empty($names) ? '' : '"'.implode('", "', $names).'"'; |
|
| 1937 | 1937 | } |
| 1938 | 1938 | else |
| 1939 | 1939 | $context['to_value'] = ''; |
@@ -1945,7 +1945,7 @@ discard block |
||
| 1945 | 1945 | |
| 1946 | 1946 | // And build the link tree. |
| 1947 | 1947 | $context['linktree'][] = array( |
| 1948 | - 'url' => $scripturl . '?action=pm;sa=send', |
|
| 1948 | + 'url' => $scripturl.'?action=pm;sa=send', |
|
| 1949 | 1949 | 'name' => $txt['new_message'] |
| 1950 | 1950 | ); |
| 1951 | 1951 | |
@@ -1954,13 +1954,13 @@ discard block |
||
| 1954 | 1954 | // Generate a list of drafts that they can load in to the editor |
| 1955 | 1955 | if (!empty($context['drafts_pm_save'])) |
| 1956 | 1956 | { |
| 1957 | - require_once($sourcedir . '/Drafts.php'); |
|
| 1957 | + require_once($sourcedir.'/Drafts.php'); |
|
| 1958 | 1958 | $pm_seed = isset($_REQUEST['pmsg']) ? $_REQUEST['pmsg'] : (isset($_REQUEST['quote']) ? $_REQUEST['quote'] : 0); |
| 1959 | 1959 | ShowDrafts($user_info['id'], $pm_seed, 1); |
| 1960 | 1960 | } |
| 1961 | 1961 | |
| 1962 | 1962 | // Needed for the WYSIWYG editor. |
| 1963 | - require_once($sourcedir . '/Subs-Editor.php'); |
|
| 1963 | + require_once($sourcedir.'/Subs-Editor.php'); |
|
| 1964 | 1964 | |
| 1965 | 1965 | // Now create the editor. |
| 1966 | 1966 | $editorOptions = array( |
@@ -2011,7 +2011,7 @@ discard block |
||
| 2011 | 2011 | list ($memID) = $memberResult; |
| 2012 | 2012 | |
| 2013 | 2013 | // drafts is where the functions reside |
| 2014 | - require_once($sourcedir . '/Drafts.php'); |
|
| 2014 | + require_once($sourcedir.'/Drafts.php'); |
|
| 2015 | 2015 | showPMDrafts($memID); |
| 2016 | 2016 | } |
| 2017 | 2017 | |
@@ -2029,7 +2029,7 @@ discard block |
||
| 2029 | 2029 | |
| 2030 | 2030 | if (!isset($_REQUEST['xml'])) |
| 2031 | 2031 | { |
| 2032 | - $context['menu_data_' . $context['pm_menu_id']]['current_area'] = 'send'; |
|
| 2032 | + $context['menu_data_'.$context['pm_menu_id']]['current_area'] = 'send'; |
|
| 2033 | 2033 | $context['sub_template'] = 'send'; |
| 2034 | 2034 | loadJavaScriptFile('PersonalMessage.js', array('defer' => false, 'minimize' => true), 'smf_pms'); |
| 2035 | 2035 | loadJavaScriptFile('suggest.js', array('defer' => false, 'minimize' => true), 'smf_suggest'); |
@@ -2082,11 +2082,11 @@ discard block |
||
| 2082 | 2082 | pm.body, pm.subject, pm.msgtime, mem.member_name, COALESCE(mem.id_member, 0) AS id_member, |
| 2083 | 2083 | COALESCE(mem.real_name, pm.from_name) AS real_name |
| 2084 | 2084 | FROM {db_prefix}personal_messages AS pm' . ($context['folder'] == 'sent' ? '' : ' |
| 2085 | - INNER JOIN {db_prefix}pm_recipients AS pmr ON (pmr.id_pm = {int:replied_to})') . ' |
|
| 2085 | + INNER JOIN {db_prefix}pm_recipients AS pmr ON (pmr.id_pm = {int:replied_to})').' |
|
| 2086 | 2086 | LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = pm.id_member_from) |
| 2087 | 2087 | WHERE pm.id_pm = {int:replied_to}' . ($context['folder'] == 'sent' ? ' |
| 2088 | 2088 | AND pm.id_member_from = {int:current_member}' : ' |
| 2089 | - AND pmr.id_member = {int:current_member}') . ' |
|
| 2089 | + AND pmr.id_member = {int:current_member}').' |
|
| 2090 | 2090 | LIMIT 1', |
| 2091 | 2091 | array( |
| 2092 | 2092 | 'current_member' => $user_info['id'], |
@@ -2114,19 +2114,19 @@ discard block |
||
| 2114 | 2114 | 'name' => $row_quoted['real_name'], |
| 2115 | 2115 | 'username' => $row_quoted['member_name'], |
| 2116 | 2116 | 'id' => $row_quoted['id_member'], |
| 2117 | - 'href' => !empty($row_quoted['id_member']) ? $scripturl . '?action=profile;u=' . $row_quoted['id_member'] : '', |
|
| 2118 | - 'link' => !empty($row_quoted['id_member']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row_quoted['id_member'] . '">' . $row_quoted['real_name'] . '</a>' : $row_quoted['real_name'], |
|
| 2117 | + 'href' => !empty($row_quoted['id_member']) ? $scripturl.'?action=profile;u='.$row_quoted['id_member'] : '', |
|
| 2118 | + 'link' => !empty($row_quoted['id_member']) ? '<a href="'.$scripturl.'?action=profile;u='.$row_quoted['id_member'].'">'.$row_quoted['real_name'].'</a>' : $row_quoted['real_name'], |
|
| 2119 | 2119 | ), |
| 2120 | 2120 | 'subject' => $row_quoted['subject'], |
| 2121 | 2121 | 'time' => timeformat($row_quoted['msgtime']), |
| 2122 | 2122 | 'timestamp' => forum_time(true, $row_quoted['msgtime']), |
| 2123 | - 'body' => parse_bbc($row_quoted['body'], true, 'pm' . $row_quoted['id_pm']), |
|
| 2123 | + 'body' => parse_bbc($row_quoted['body'], true, 'pm'.$row_quoted['id_pm']), |
|
| 2124 | 2124 | ); |
| 2125 | 2125 | } |
| 2126 | 2126 | |
| 2127 | 2127 | // Build the link tree.... |
| 2128 | 2128 | $context['linktree'][] = array( |
| 2129 | - 'url' => $scripturl . '?action=pm;sa=send', |
|
| 2129 | + 'url' => $scripturl.'?action=pm;sa=send', |
|
| 2130 | 2130 | 'name' => $txt['new_message'] |
| 2131 | 2131 | ); |
| 2132 | 2132 | |
@@ -2144,11 +2144,11 @@ discard block |
||
| 2144 | 2144 | foreach ($error_types as $error_type) |
| 2145 | 2145 | { |
| 2146 | 2146 | $context['post_error'][$error_type] = true; |
| 2147 | - if (isset($txt['error_' . $error_type])) |
|
| 2147 | + if (isset($txt['error_'.$error_type])) |
|
| 2148 | 2148 | { |
| 2149 | 2149 | if ($error_type == 'long_message') |
| 2150 | - $txt['error_' . $error_type] = sprintf($txt['error_' . $error_type], $modSettings['max_messageLength']); |
|
| 2151 | - $context['post_error']['messages'][] = $txt['error_' . $error_type]; |
|
| 2150 | + $txt['error_'.$error_type] = sprintf($txt['error_'.$error_type], $modSettings['max_messageLength']); |
|
| 2151 | + $context['post_error']['messages'][] = $txt['error_'.$error_type]; |
|
| 2152 | 2152 | } |
| 2153 | 2153 | |
| 2154 | 2154 | // If it's not a minor error flag it as such. |
@@ -2157,7 +2157,7 @@ discard block |
||
| 2157 | 2157 | } |
| 2158 | 2158 | |
| 2159 | 2159 | // We need to load the editor once more. |
| 2160 | - require_once($sourcedir . '/Subs-Editor.php'); |
|
| 2160 | + require_once($sourcedir.'/Subs-Editor.php'); |
|
| 2161 | 2161 | |
| 2162 | 2162 | // Create it... |
| 2163 | 2163 | $editorOptions = array( |
@@ -2179,7 +2179,7 @@ discard block |
||
| 2179 | 2179 | $context['require_verification'] = !$user_info['is_admin'] && !empty($modSettings['pm_posts_verification']) && $user_info['posts'] < $modSettings['pm_posts_verification']; |
| 2180 | 2180 | if ($context['require_verification'] && !isset($_REQUEST['xml'])) |
| 2181 | 2181 | { |
| 2182 | - require_once($sourcedir . '/Subs-Editor.php'); |
|
| 2182 | + require_once($sourcedir.'/Subs-Editor.php'); |
|
| 2183 | 2183 | $verificationOptions = array( |
| 2184 | 2184 | 'id' => 'pm', |
| 2185 | 2185 | ); |
@@ -2187,8 +2187,8 @@ discard block |
||
| 2187 | 2187 | $context['visual_verification_id'] = $verificationOptions['id']; |
| 2188 | 2188 | } |
| 2189 | 2189 | |
| 2190 | - $context['to_value'] = empty($named_recipients['to']) ? '' : '"' . implode('", "', $named_recipients['to']) . '"'; |
|
| 2191 | - $context['bcc_value'] = empty($named_recipients['bcc']) ? '' : '"' . implode('", "', $named_recipients['bcc']) . '"'; |
|
| 2190 | + $context['to_value'] = empty($named_recipients['to']) ? '' : '"'.implode('", "', $named_recipients['to']).'"'; |
|
| 2191 | + $context['bcc_value'] = empty($named_recipients['bcc']) ? '' : '"'.implode('", "', $named_recipients['bcc']).'"'; |
|
| 2192 | 2192 | |
| 2193 | 2193 | call_integration_hook('integrate_pm_error'); |
| 2194 | 2194 | |
@@ -2208,11 +2208,11 @@ discard block |
||
| 2208 | 2208 | global $user_info, $modSettings, $smcFunc; |
| 2209 | 2209 | |
| 2210 | 2210 | isAllowedTo('pm_send'); |
| 2211 | - require_once($sourcedir . '/Subs-Auth.php'); |
|
| 2211 | + require_once($sourcedir.'/Subs-Auth.php'); |
|
| 2212 | 2212 | |
| 2213 | 2213 | // PM Drafts enabled and needed? |
| 2214 | 2214 | if ($context['drafts_pm_save'] && (isset($_POST['save_draft']) || isset($_POST['id_pm_draft']))) |
| 2215 | - require_once($sourcedir . '/Drafts.php'); |
|
| 2215 | + require_once($sourcedir.'/Drafts.php'); |
|
| 2216 | 2216 | |
| 2217 | 2217 | loadLanguage('PersonalMessage', '', false); |
| 2218 | 2218 | |
@@ -2269,9 +2269,9 @@ discard block |
||
| 2269 | 2269 | { |
| 2270 | 2270 | // First, let's see if there's user ID's given. |
| 2271 | 2271 | $recipientList[$recipientType] = array(); |
| 2272 | - if (!empty($_POST['recipient_' . $recipientType]) && is_array($_POST['recipient_' . $recipientType])) |
|
| 2272 | + if (!empty($_POST['recipient_'.$recipientType]) && is_array($_POST['recipient_'.$recipientType])) |
|
| 2273 | 2273 | { |
| 2274 | - foreach ($_POST['recipient_' . $recipientType] as $recipient) |
|
| 2274 | + foreach ($_POST['recipient_'.$recipientType] as $recipient) |
|
| 2275 | 2275 | $recipientList[$recipientType][] = (int) $recipient; |
| 2276 | 2276 | } |
| 2277 | 2277 | |
@@ -2340,7 +2340,7 @@ discard block |
||
| 2340 | 2340 | { |
| 2341 | 2341 | if (!empty($namesNotFound[$recipientType])) |
| 2342 | 2342 | { |
| 2343 | - $post_errors[] = 'bad_' . $recipientType; |
|
| 2343 | + $post_errors[] = 'bad_'.$recipientType; |
|
| 2344 | 2344 | |
| 2345 | 2345 | // Since we already have a post error, remove the previous one. |
| 2346 | 2346 | $post_errors = array_diff($post_errors, array('no_to')); |
@@ -2372,7 +2372,7 @@ discard block |
||
| 2372 | 2372 | // Wrong verification code? |
| 2373 | 2373 | if (!$user_info['is_admin'] && !isset($_REQUEST['xml']) && !empty($modSettings['pm_posts_verification']) && $user_info['posts'] < $modSettings['pm_posts_verification']) |
| 2374 | 2374 | { |
| 2375 | - require_once($sourcedir . '/Subs-Editor.php'); |
|
| 2375 | + require_once($sourcedir.'/Subs-Editor.php'); |
|
| 2376 | 2376 | $verificationOptions = array( |
| 2377 | 2377 | 'id' => 'pm', |
| 2378 | 2378 | ); |
@@ -2402,7 +2402,7 @@ discard block |
||
| 2402 | 2402 | censorText($context['preview_message']); |
| 2403 | 2403 | |
| 2404 | 2404 | // Set a descriptive title. |
| 2405 | - $context['page_title'] = $txt['preview'] . ' - ' . $context['preview_subject']; |
|
| 2405 | + $context['page_title'] = $txt['preview'].' - '.$context['preview_subject']; |
|
| 2406 | 2406 | |
| 2407 | 2407 | // Pretend they messed up but don't ignore if they really did :P. |
| 2408 | 2408 | return messagePostError($post_errors, $namedRecipientList, $recipientList); |
@@ -2414,7 +2414,7 @@ discard block |
||
| 2414 | 2414 | // Maybe we couldn't find one? |
| 2415 | 2415 | foreach ($namesNotFound as $recipientType => $names) |
| 2416 | 2416 | { |
| 2417 | - $post_errors[] = 'bad_' . $recipientType; |
|
| 2417 | + $post_errors[] = 'bad_'.$recipientType; |
|
| 2418 | 2418 | foreach ($names as $name) |
| 2419 | 2419 | $context['send_log']['failed'][] = sprintf($txt['pm_error_user_not_found'], $name); |
| 2420 | 2420 | } |
@@ -2479,7 +2479,7 @@ discard block |
||
| 2479 | 2479 | // Message sent successfully? |
| 2480 | 2480 | if (!empty($context['send_log']) && empty($context['send_log']['failed'])) |
| 2481 | 2481 | { |
| 2482 | - $context['current_label_redirect'] = $context['current_label_redirect'] . ';done=sent'; |
|
| 2482 | + $context['current_label_redirect'] = $context['current_label_redirect'].';done=sent'; |
|
| 2483 | 2483 | |
| 2484 | 2484 | // If we had a PM draft for this one, then its time to remove it since it was just sent |
| 2485 | 2485 | if ($context['drafts_pm_save'] && !empty($_POST['id_pm_draft'])) |
@@ -2751,7 +2751,7 @@ discard block |
||
| 2751 | 2751 | |
| 2752 | 2752 | // Back to the folder. |
| 2753 | 2753 | $_SESSION['pm_selected'] = array_keys($to_label); |
| 2754 | - redirectexit($context['current_label_redirect'] . (count($to_label) == 1 ? '#msg' . $_SESSION['pm_selected'][0] : ''), count($to_label) == 1 && isBrowser('ie')); |
|
| 2754 | + redirectexit($context['current_label_redirect'].(count($to_label) == 1 ? '#msg'.$_SESSION['pm_selected'][0] : ''), count($to_label) == 1 && isBrowser('ie')); |
|
| 2755 | 2755 | } |
| 2756 | 2756 | |
| 2757 | 2757 | /** |
@@ -2852,7 +2852,7 @@ discard block |
||
| 2852 | 2852 | |
| 2853 | 2853 | // Build the link tree elements. |
| 2854 | 2854 | $context['linktree'][] = array( |
| 2855 | - 'url' => $scripturl . '?action=pm;sa=prune', |
|
| 2855 | + 'url' => $scripturl.'?action=pm;sa=prune', |
|
| 2856 | 2856 | 'name' => $txt['pm_prune'] |
| 2857 | 2857 | ); |
| 2858 | 2858 | |
@@ -2914,7 +2914,7 @@ discard block |
||
| 2914 | 2914 | SELECT id_member, COUNT(*) AS num_deleted_messages, CASE WHEN is_read & 1 >= 1 THEN 1 ELSE 0 END AS is_read |
| 2915 | 2915 | FROM {db_prefix}pm_recipients |
| 2916 | 2916 | WHERE id_member IN ({array_int:member_list}) |
| 2917 | - AND deleted = {int:not_deleted}' . $where . ' |
|
| 2917 | + AND deleted = {int:not_deleted}' . $where.' |
|
| 2918 | 2918 | GROUP BY id_member, is_read', |
| 2919 | 2919 | array( |
| 2920 | 2920 | 'member_list' => $owner, |
@@ -2926,9 +2926,9 @@ discard block |
||
| 2926 | 2926 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 2927 | 2927 | { |
| 2928 | 2928 | if ($row['is_read']) |
| 2929 | - updateMemberData($row['id_member'], array('instant_messages' => $where == '' ? 0 : 'instant_messages - ' . $row['num_deleted_messages'])); |
|
| 2929 | + updateMemberData($row['id_member'], array('instant_messages' => $where == '' ? 0 : 'instant_messages - '.$row['num_deleted_messages'])); |
|
| 2930 | 2930 | else |
| 2931 | - updateMemberData($row['id_member'], array('instant_messages' => $where == '' ? 0 : 'instant_messages - ' . $row['num_deleted_messages'], 'unread_messages' => $where == '' ? 0 : 'unread_messages - ' . $row['num_deleted_messages'])); |
|
| 2931 | + updateMemberData($row['id_member'], array('instant_messages' => $where == '' ? 0 : 'instant_messages - '.$row['num_deleted_messages'], 'unread_messages' => $where == '' ? 0 : 'unread_messages - '.$row['num_deleted_messages'])); |
|
| 2932 | 2932 | |
| 2933 | 2933 | // If this is the current member we need to make their message count correct. |
| 2934 | 2934 | if ($user_info['id'] == $row['id_member']) |
@@ -3035,7 +3035,7 @@ discard block |
||
| 3035 | 3035 | } |
| 3036 | 3036 | |
| 3037 | 3037 | // Any cached numbers may be wrong now. |
| 3038 | - cache_put_data('labelCounts:' . $user_info['id'], null, 720); |
|
| 3038 | + cache_put_data('labelCounts:'.$user_info['id'], null, 720); |
|
| 3039 | 3039 | } |
| 3040 | 3040 | |
| 3041 | 3041 | /** |
@@ -3087,7 +3087,7 @@ discard block |
||
| 3087 | 3087 | SET is_read = is_read | 1 |
| 3088 | 3088 | WHERE id_member = {int:id_member} |
| 3089 | 3089 | AND NOT (is_read & 1 >= 1)' . ($personal_messages !== null ? ' |
| 3090 | - AND id_pm IN ({array_int:personal_messages})' : '') . $in_inbox, |
|
| 3090 | + AND id_pm IN ({array_int:personal_messages})' : '').$in_inbox, |
|
| 3091 | 3091 | array( |
| 3092 | 3092 | 'personal_messages' => $personal_messages, |
| 3093 | 3093 | 'id_member' => $owner, |
@@ -3155,7 +3155,7 @@ discard block |
||
| 3155 | 3155 | $smcFunc['db_free_result']($result); |
| 3156 | 3156 | |
| 3157 | 3157 | // Need to store all this. |
| 3158 | - cache_put_data('labelCounts:' . $owner, $context['labels'], 720); |
|
| 3158 | + cache_put_data('labelCounts:'.$owner, $context['labels'], 720); |
|
| 3159 | 3159 | updateMemberData($owner, array('unread_messages' => $total_unread)); |
| 3160 | 3160 | |
| 3161 | 3161 | // If it was for the current member, reflect this in the $user_info array too. |
@@ -3173,7 +3173,7 @@ discard block |
||
| 3173 | 3173 | |
| 3174 | 3174 | // Build the link tree elements... |
| 3175 | 3175 | $context['linktree'][] = array( |
| 3176 | - 'url' => $scripturl . '?action=pm;sa=manlabels', |
|
| 3176 | + 'url' => $scripturl.'?action=pm;sa=manlabels', |
|
| 3177 | 3177 | 'name' => $txt['pm_manage_labels'] |
| 3178 | 3178 | ); |
| 3179 | 3179 | |
@@ -3398,7 +3398,7 @@ discard block |
||
| 3398 | 3398 | } |
| 3399 | 3399 | |
| 3400 | 3400 | // Make sure we're not caching this! |
| 3401 | - cache_put_data('labelCounts:' . $user_info['id'], null, 720); |
|
| 3401 | + cache_put_data('labelCounts:'.$user_info['id'], null, 720); |
|
| 3402 | 3402 | |
| 3403 | 3403 | // To make the changes appear right away, redirect. |
| 3404 | 3404 | redirectexit('action=pm;sa=manlabels'); |
@@ -3419,11 +3419,11 @@ discard block |
||
| 3419 | 3419 | global $scripturl, $profile_vars, $cur_profile, $user_profile; |
| 3420 | 3420 | |
| 3421 | 3421 | // Need this for the display. |
| 3422 | - require_once($sourcedir . '/Profile.php'); |
|
| 3423 | - require_once($sourcedir . '/Profile-Modify.php'); |
|
| 3422 | + require_once($sourcedir.'/Profile.php'); |
|
| 3423 | + require_once($sourcedir.'/Profile-Modify.php'); |
|
| 3424 | 3424 | |
| 3425 | 3425 | // We want them to submit back to here. |
| 3426 | - $context['profile_custom_submit_url'] = $scripturl . '?action=pm;sa=settings;save'; |
|
| 3426 | + $context['profile_custom_submit_url'] = $scripturl.'?action=pm;sa=settings;save'; |
|
| 3427 | 3427 | |
| 3428 | 3428 | loadMemberData($user_info['id'], false, 'profile'); |
| 3429 | 3429 | $cur_profile = $user_profile[$user_info['id']]; |
@@ -3448,7 +3448,7 @@ discard block |
||
| 3448 | 3448 | |
| 3449 | 3449 | // Add our position to the linktree. |
| 3450 | 3450 | $context['linktree'][] = array( |
| 3451 | - 'url' => $scripturl . '?action=pm;sa=settings', |
|
| 3451 | + 'url' => $scripturl.'?action=pm;sa=settings', |
|
| 3452 | 3452 | 'name' => $txt['pm_settings'] |
| 3453 | 3453 | ); |
| 3454 | 3454 | |
@@ -3554,7 +3554,7 @@ discard block |
||
| 3554 | 3554 | $smcFunc['db_free_result']($request); |
| 3555 | 3555 | |
| 3556 | 3556 | // Remove the line breaks... |
| 3557 | - $body = preg_replace('~<br ?/?' . '>~i', "\n", $body); |
|
| 3557 | + $body = preg_replace('~<br ?/?'.'>~i', "\n", $body); |
|
| 3558 | 3558 | |
| 3559 | 3559 | // Get any other recipients of the email. |
| 3560 | 3560 | $request = $smcFunc['db_query']('', ' |
@@ -3576,7 +3576,7 @@ discard block |
||
| 3576 | 3576 | if ($row['bcc']) |
| 3577 | 3577 | $hidden_recipients++; |
| 3578 | 3578 | else |
| 3579 | - $recipients[] = '[url=' . $scripturl . '?action=profile;u=' . $row['id_member_to'] . ']' . $row['to_name'] . '[/url]'; |
|
| 3579 | + $recipients[] = '[url='.$scripturl.'?action=profile;u='.$row['id_member_to'].']'.$row['to_name'].'[/url]'; |
|
| 3580 | 3580 | } |
| 3581 | 3581 | $smcFunc['db_free_result']($request); |
| 3582 | 3582 | |
@@ -3588,7 +3588,7 @@ discard block |
||
| 3588 | 3588 | SELECT id_member, real_name, lngfile |
| 3589 | 3589 | FROM {db_prefix}members |
| 3590 | 3590 | WHERE (id_group = {int:admin_id} OR FIND_IN_SET({int:admin_id}, additional_groups) != 0) |
| 3591 | - ' . (empty($_POST['id_admin']) ? '' : 'AND id_member = {int:specific_admin}') . ' |
|
| 3591 | + ' . (empty($_POST['id_admin']) ? '' : 'AND id_member = {int:specific_admin}').' |
|
| 3592 | 3592 | ORDER BY lngfile', |
| 3593 | 3593 | array( |
| 3594 | 3594 | 'admin_id' => 1, |
@@ -3616,14 +3616,14 @@ discard block |
||
| 3616 | 3616 | |
| 3617 | 3617 | // Make the body. |
| 3618 | 3618 | $report_body = str_replace(array('{REPORTER}', '{SENDER}'), array(un_htmlspecialchars($user_info['name']), $memberFromName), $txt['pm_report_pm_user_sent']); |
| 3619 | - $report_body .= "\n" . '[b]' . $_POST['reason'] . '[/b]' . "\n\n"; |
|
| 3619 | + $report_body .= "\n".'[b]'.$_POST['reason'].'[/b]'."\n\n"; |
|
| 3620 | 3620 | if (!empty($recipients)) |
| 3621 | - $report_body .= $txt['pm_report_pm_other_recipients'] . ' ' . implode(', ', $recipients) . "\n\n"; |
|
| 3622 | - $report_body .= $txt['pm_report_pm_unedited_below'] . "\n" . '[quote author=' . (empty($memberFromID) ? '"' . $memberFromName . '"' : $memberFromName . ' link=action=profile;u=' . $memberFromID . ' date=' . $time) . ']' . "\n" . un_htmlspecialchars($body) . '[/quote]'; |
|
| 3621 | + $report_body .= $txt['pm_report_pm_other_recipients'].' '.implode(', ', $recipients)."\n\n"; |
|
| 3622 | + $report_body .= $txt['pm_report_pm_unedited_below']."\n".'[quote author='.(empty($memberFromID) ? '"'.$memberFromName.'"' : $memberFromName.' link=action=profile;u='.$memberFromID.' date='.$time).']'."\n".un_htmlspecialchars($body).'[/quote]'; |
|
| 3623 | 3623 | |
| 3624 | 3624 | // Plonk it in the array ;) |
| 3625 | 3625 | $messagesToSend[$cur_language] = array( |
| 3626 | - 'subject' => ($smcFunc['strpos']($subject, $txt['pm_report_pm_subject']) === false ? $txt['pm_report_pm_subject'] : '') . un_htmlspecialchars($subject), |
|
| 3626 | + 'subject' => ($smcFunc['strpos']($subject, $txt['pm_report_pm_subject']) === false ? $txt['pm_report_pm_subject'] : '').un_htmlspecialchars($subject), |
|
| 3627 | 3627 | 'body' => $report_body, |
| 3628 | 3628 | 'recipients' => array( |
| 3629 | 3629 | 'to' => array(), |
@@ -3659,7 +3659,7 @@ discard block |
||
| 3659 | 3659 | |
| 3660 | 3660 | // The link tree - gotta have this :o |
| 3661 | 3661 | $context['linktree'][] = array( |
| 3662 | - 'url' => $scripturl . '?action=pm;sa=manrules', |
|
| 3662 | + 'url' => $scripturl.'?action=pm;sa=manrules', |
|
| 3663 | 3663 | 'name' => $txt['pm_manage_rules'] |
| 3664 | 3664 | ); |
| 3665 | 3665 | |
@@ -3219,7 +3219,7 @@ discard block |
||
| 3219 | 3219 | // Deleting an existing label? |
| 3220 | 3220 | elseif (isset($_POST['delete'], $_POST['delete_label'])) |
| 3221 | 3221 | { |
| 3222 | - foreach ($_POST['delete_label'] AS $label => $dummy) |
|
| 3222 | + foreach ($_POST['delete_label'] as $label => $dummy) |
|
| 3223 | 3223 | { |
| 3224 | 3224 | unset($the_labels[$label]); |
| 3225 | 3225 | $labels_to_remove[] = $label; |
@@ -3260,7 +3260,7 @@ discard block |
||
| 3260 | 3260 | if (!empty($labels_to_add)) |
| 3261 | 3261 | { |
| 3262 | 3262 | $inserts = array(); |
| 3263 | - foreach ($labels_to_add AS $label) |
|
| 3263 | + foreach ($labels_to_add as $label) |
|
| 3264 | 3264 | $inserts[] = array($user_info['id'], $label); |
| 3265 | 3265 | |
| 3266 | 3266 | $smcFunc['db_insert']('', '{db_prefix}pm_labels', array('id_member' => 'int', 'name' => 'string-30'), $inserts, array()); |
@@ -3269,7 +3269,7 @@ discard block |
||
| 3269 | 3269 | // Update existing labels as needed |
| 3270 | 3270 | if (!empty($label_upates)) |
| 3271 | 3271 | { |
| 3272 | - foreach ($label_updates AS $id => $name) |
|
| 3272 | + foreach ($label_updates as $id => $name) |
|
| 3273 | 3273 | { |
| 3274 | 3274 | $smcFunc['db_query']('', ' |
| 3275 | 3275 | UPDATE {db_prefix}labels |