@@ -24,9 +24,9 @@ discard block |
||
| 24 | 24 | if (isset($_REQUEST['SESSION']) && $_REQUEST['SESSION'] != '') { |
| 25 | 25 | $this->init_session(); |
| 26 | 26 | } |
| 27 | - } elseif (isset($_COOKIE[$opt['session']['cookiename'] . 'data'])) { |
|
| 27 | + } elseif (isset($_COOKIE[$opt['session']['cookiename'].'data'])) { |
|
| 28 | 28 | //get the cookievars-array |
| 29 | - $decoded = base64_decode($_COOKIE[$opt['session']['cookiename'] . 'data']); |
|
| 29 | + $decoded = base64_decode($_COOKIE[$opt['session']['cookiename'].'data']); |
|
| 30 | 30 | |
| 31 | 31 | if ($decoded !== false) { |
| 32 | 32 | $this->values = @unserialize($decoded); |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | if ($opt['session']['check_referer']) { |
| 53 | 53 | if (isset($_SERVER['REFERER'])) { |
| 54 | - if (strtolower(substr('http' + strstr($_SERVER['REFERER'], '://'), 0, strlen($opt['page']['absolute_http_url']))) != strtolower($opt['page']['absolute_http_url'])) { |
|
| 54 | + if (strtolower(substr('http' +strstr($_SERVER['REFERER'], '://'), 0, strlen($opt['page']['absolute_http_url']))) != strtolower($opt['page']['absolute_http_url'])) { |
|
| 55 | 55 | $this->createNewSession(); |
| 56 | 56 | } |
| 57 | 57 | } |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | if ($this->changed == true) { |
| 169 | 169 | if (count($this->values) == 0) { |
| 170 | 170 | setcookie( |
| 171 | - $opt['session']['cookiename'] . 'data', |
|
| 171 | + $opt['session']['cookiename'].'data', |
|
| 172 | 172 | false, |
| 173 | 173 | time() + 31536000, |
| 174 | 174 | $opt['session']['path'], |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | ); |
| 178 | 178 | } else { |
| 179 | 179 | setcookie( |
| 180 | - $opt['session']['cookiename'] . 'data', |
|
| 180 | + $opt['session']['cookiename'].'data', |
|
| 181 | 181 | base64_encode(serialize($this->values)), |
| 182 | 182 | time() + 31536000, |
| 183 | 183 | $opt['session']['path'], |
@@ -32,20 +32,20 @@ discard block |
||
| 32 | 32 | return; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - if (!is_dir($opt['rootpath'] . 'cache2/translate/' . $language_lower)) { |
|
| 36 | - mkdir($opt['rootpath'] . 'cache2/translate/' . $language_lower); |
|
| 35 | + if (!is_dir($opt['rootpath'].'cache2/translate/'.$language_lower)) { |
|
| 36 | + mkdir($opt['rootpath'].'cache2/translate/'.$language_lower); |
|
| 37 | 37 | } |
| 38 | - if (!is_dir($opt['rootpath'] . 'cache2/translate/' . $language_lower . '/LC_MESSAGES')) { |
|
| 39 | - mkdir($opt['rootpath'] . 'cache2/translate/' . $language_lower . '/LC_MESSAGES'); |
|
| 38 | + if (!is_dir($opt['rootpath'].'cache2/translate/'.$language_lower.'/LC_MESSAGES')) { |
|
| 39 | + mkdir($opt['rootpath'].'cache2/translate/'.$language_lower.'/LC_MESSAGES'); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - $f = fopen($opt['rootpath'] . 'cache2/translate/' . $language_lower . '/LC_MESSAGES/messages.po', 'w'); |
|
| 42 | + $f = fopen($opt['rootpath'].'cache2/translate/'.$language_lower.'/LC_MESSAGES/messages.po', 'w'); |
|
| 43 | 43 | |
| 44 | - fwrite($f, 'msgid ""' . "\n"); |
|
| 45 | - fwrite($f, 'msgstr ""' . "\n"); |
|
| 46 | - fwrite($f, '"MIME-Version: 1.0\n"' . "\n"); |
|
| 47 | - fwrite($f, '"Content-Type: text/plain; charset=UTF-8\n"' . "\n"); |
|
| 48 | - fwrite($f, '"Content-Transfer-Encoding: 8bit\n"' . "\n"); |
|
| 44 | + fwrite($f, 'msgid ""'."\n"); |
|
| 45 | + fwrite($f, 'msgstr ""'."\n"); |
|
| 46 | + fwrite($f, '"MIME-Version: 1.0\n"'."\n"); |
|
| 47 | + fwrite($f, '"Content-Type: text/plain; charset=UTF-8\n"'."\n"); |
|
| 48 | + fwrite($f, '"Content-Transfer-Encoding: 8bit\n"'."\n"); |
|
| 49 | 49 | fwrite($f, "\n"); |
| 50 | 50 | |
| 51 | 51 | // English texts in sys_trans_text are more up-to-date than the original translation |
@@ -66,10 +66,10 @@ discard block |
||
| 66 | 66 | ); |
| 67 | 67 | |
| 68 | 68 | $variables = array(); |
| 69 | - $this->loadNodeTextFile($variables, $opt['logic']['node']['id'] . '.txt', $language_lower); |
|
| 69 | + $this->loadNodeTextFile($variables, $opt['logic']['node']['id'].'.txt', $language_lower); |
|
| 70 | 70 | $this->loadNodeTextFile( |
| 71 | 71 | $variables, |
| 72 | - $opt['logic']['node']['id'] . '-' . $language_lower . '.txt', |
|
| 72 | + $opt['logic']['node']['id'].'-'.$language_lower.'.txt', |
|
| 73 | 73 | $language_lower |
| 74 | 74 | ); |
| 75 | 75 | |
@@ -78,8 +78,8 @@ discard block |
||
| 78 | 78 | if ($trans !== null && $trans != $r['text']) { |
| 79 | 79 | $trans = $this->substitueVariables($variables, $language_lower, $trans); |
| 80 | 80 | |
| 81 | - fwrite($f, 'msgid "' . $this->escape_text($r['text']) . '"' . "\n"); |
|
| 82 | - fwrite($f, 'msgstr "' . $this->escape_text($trans) . '"' . "\n"); |
|
| 81 | + fwrite($f, 'msgid "'.$this->escape_text($r['text']).'"'."\n"); |
|
| 82 | + fwrite($f, 'msgstr "'.$this->escape_text($trans).'"'."\n"); |
|
| 83 | 83 | fwrite($f, "\n"); |
| 84 | 84 | } |
| 85 | 85 | } |
@@ -89,10 +89,10 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | try { |
| 91 | 91 | exec( |
| 92 | - 'msgfmt -o ' . escapeshellcmd( |
|
| 93 | - $opt['rootpath'] . 'cache2/translate/' . $language_lower . '/LC_MESSAGES/messages.mo' |
|
| 94 | - ) . ' ' . escapeshellcmd( |
|
| 95 | - $opt['rootpath'] . 'cache2/translate/' . $language_lower . '/LC_MESSAGES/messages.po' |
|
| 92 | + 'msgfmt -o '.escapeshellcmd( |
|
| 93 | + $opt['rootpath'].'cache2/translate/'.$language_lower.'/LC_MESSAGES/messages.mo' |
|
| 94 | + ).' '.escapeshellcmd( |
|
| 95 | + $opt['rootpath'].'cache2/translate/'.$language_lower.'/LC_MESSAGES/messages.po' |
|
| 96 | 96 | ) |
| 97 | 97 | ); |
| 98 | 98 | } catch (Exception $e) { |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | sqlf( |
| 190 | 190 | "INSERT IGNORE INTO `sys_trans_ref` (`trans_id`, `resource_name`, `line`) VALUES ('&1', '&2', 0)", |
| 191 | 191 | $lastId, |
| 192 | - 'table:' . $table . ';field=' . $fname |
|
| 192 | + 'table:'.$table.';field='.$fname |
|
| 193 | 193 | ); |
| 194 | 194 | } |
| 195 | 195 | sql_free_result($rs); |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | // generic load |
| 212 | 212 | global $opt; |
| 213 | 213 | |
| 214 | - $filename = $opt['rootpath'] . '/config2/nodetext/' . $file; |
|
| 214 | + $filename = $opt['rootpath'].'/config2/nodetext/'.$file; |
|
| 215 | 215 | if (file_exists($filename)) { |
| 216 | 216 | $fhandle = fopen($filename, 'r'); |
| 217 | 217 | |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | * TODO: accept-language des Browser auswerten |
| 11 | 11 | ***************************************************************************/ |
| 12 | 12 | |
| 13 | -require_once __DIR__ . '/../vendor/autoload.php'; |
|
| 13 | +require_once __DIR__.'/../vendor/autoload.php'; |
|
| 14 | 14 | |
| 15 | 15 | function __autoload($class_name) |
| 16 | 16 | { |
@@ -20,8 +20,8 @@ discard block |
||
| 20 | 20 | return; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - $file1 = $opt['rootpath'] . 'lib2/' . $class_name . '.class.php'; |
|
| 24 | - $file2 = $opt['rootpath'] . 'lib2/logic/' . $class_name . '.class.php'; |
|
| 23 | + $file1 = $opt['rootpath'].'lib2/'.$class_name.'.class.php'; |
|
| 24 | + $file2 = $opt['rootpath'].'lib2/logic/'.$class_name.'.class.php'; |
|
| 25 | 25 | if (file_exists($file1)) { |
| 26 | 26 | require_once $file1; |
| 27 | 27 | } elseif (file_exists($file2)) { |
@@ -43,9 +43,9 @@ discard block |
||
| 43 | 43 | mb_regex_encoding('UTF-8'); |
| 44 | 44 | |
| 45 | 45 | // set options |
| 46 | -require_once $opt['rootpath'] . 'config2/settings-dist.inc.php'; |
|
| 47 | -require_once $opt['rootpath'] . 'config2/settings.inc.php'; |
|
| 48 | -require_once $opt['rootpath'] . 'config2/verify-settings.inc.php'; |
|
| 46 | +require_once $opt['rootpath'].'config2/settings-dist.inc.php'; |
|
| 47 | +require_once $opt['rootpath'].'config2/settings.inc.php'; |
|
| 48 | +require_once $opt['rootpath'].'config2/verify-settings.inc.php'; |
|
| 49 | 49 | |
| 50 | 50 | foreach ($opt['page']['banned_user_agents'] as $ua) { |
| 51 | 51 | if (strpos($useragent, $ua) !== false) { |
@@ -69,10 +69,10 @@ discard block |
||
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | -require_once $opt['rootpath'] . 'lib2/errorhandler.inc.php'; |
|
| 72 | +require_once $opt['rootpath'].'lib2/errorhandler.inc.php'; |
|
| 73 | 73 | configure_php(); |
| 74 | 74 | |
| 75 | -require $opt['rootpath'] . 'lib2/cookie.class.php'; |
|
| 75 | +require $opt['rootpath'].'lib2/cookie.class.php'; |
|
| 76 | 76 | normalize_settings(); |
| 77 | 77 | set_language(); |
| 78 | 78 | set_usercountry(); |
@@ -85,30 +85,30 @@ discard block |
||
| 85 | 85 | $opt['template']['style'] = $opt['template']['default']['style']; |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | - if (!is_dir($opt['rootpath'] . 'templates2/' . $opt['template']['style'])) { |
|
| 88 | + if (!is_dir($opt['rootpath'].'templates2/'.$opt['template']['style'])) { |
|
| 89 | 89 | $opt['template']['style'] = $opt['template']['default']['style']; |
| 90 | 90 | } |
| 91 | 91 | } else { |
| 92 | 92 | $opt['template']['style'] = $opt['template']['default']['style']; |
| 93 | 93 | } |
| 94 | -$opt['stylepath'] = $opt['rootpath'] . 'templates2/' . $opt['template']['style'] . '/'; |
|
| 94 | +$opt['stylepath'] = $opt['rootpath'].'templates2/'.$opt['template']['style'].'/'; |
|
| 95 | 95 | |
| 96 | 96 | check_useragent(); |
| 97 | 97 | |
| 98 | 98 | /* setup smarty |
| 99 | 99 | * |
| 100 | 100 | */ |
| 101 | -require $opt['rootpath'] . 'lib2/OcSmarty.class.php'; |
|
| 101 | +require $opt['rootpath'].'lib2/OcSmarty.class.php'; |
|
| 102 | 102 | $tpl = new OcSmarty(); |
| 103 | 103 | |
| 104 | 104 | // include all we need |
| 105 | -require_once $opt['rootpath'] . 'lib2/logic/const.inc.php'; |
|
| 106 | -require_once $opt['rootpath'] . 'lib2/error.inc.php'; |
|
| 107 | -require_once $opt['rootpath'] . 'lib2/util.inc.php'; |
|
| 108 | -require_once $opt['rootpath'] . 'lib2/db.inc.php'; |
|
| 109 | -require_once $opt['rootpath'] . 'lib2/login.class.php'; |
|
| 110 | -require_once $opt['rootpath'] . 'lib2/menu.class.php'; |
|
| 111 | -require_once $opt['rootpath'] . 'lib2/logic/labels.inc.php'; |
|
| 105 | +require_once $opt['rootpath'].'lib2/logic/const.inc.php'; |
|
| 106 | +require_once $opt['rootpath'].'lib2/error.inc.php'; |
|
| 107 | +require_once $opt['rootpath'].'lib2/util.inc.php'; |
|
| 108 | +require_once $opt['rootpath'].'lib2/db.inc.php'; |
|
| 109 | +require_once $opt['rootpath'].'lib2/login.class.php'; |
|
| 110 | +require_once $opt['rootpath'].'lib2/menu.class.php'; |
|
| 111 | +require_once $opt['rootpath'].'lib2/logic/labels.inc.php'; |
|
| 112 | 112 | // require_once $opt['rootpath'] . 'lib2/throttle.inc.php'; |
| 113 | 113 | |
| 114 | 114 | // apply post configuration |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $login->userid > 0 && |
| 124 | 124 | sql_value("SELECT `email_problems` FROM `user` WHERE `user_id`='&1'", 0, $login->userid) != 0 |
| 125 | 125 | ) { |
| 126 | - header("Location: verifyemail.php?page=" . basename($_SERVER['REQUEST_URI'])); |
|
| 126 | + header("Location: verifyemail.php?page=".basename($_SERVER['REQUEST_URI'])); |
|
| 127 | 127 | exit; |
| 128 | 128 | } |
| 129 | 129 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | if (isset($opt['logic']['cachemaps']['wmsurl']) && strstr($opt['logic']['cachemaps']['wmsurl'], '://')) { |
| 151 | - $opt['logic']['cachemaps']['wmsurl'] = $opt['page']['protocol'] . strstr( |
|
| 151 | + $opt['logic']['cachemaps']['wmsurl'] = $opt['page']['protocol'].strstr( |
|
| 152 | 152 | $opt['logic']['cachemaps']['wmsurl'], |
| 153 | 153 | '://' |
| 154 | 154 | ); |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | $cookie->set('locale', $opt['template']['locale'], $opt['template']['default']['locale']); |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | - bindtextdomain('messages', $opt['rootpath'] . 'cache2/translate'); |
|
| 239 | + bindtextdomain('messages', $opt['rootpath'].'cache2/translate'); |
|
| 240 | 240 | set_php_locale(); |
| 241 | 241 | textdomain('messages'); |
| 242 | 242 | } |
@@ -277,13 +277,13 @@ discard block |
||
| 277 | 277 | if (strtolower(substr($url, 0, strlen($opt['page']['absolute_http_url']))) == $opt['page']['absolute_http_url'] |
| 278 | 278 | && $opt['page']['https']['active'] |
| 279 | 279 | ) { |
| 280 | - return 'https' . strstr($url, '://'); |
|
| 280 | + return 'https'.strstr($url, '://'); |
|
| 281 | 281 | } elseif (strtolower( |
| 282 | 282 | substr($url, 0, strlen($opt['page']['absolute_https_url'])) |
| 283 | 283 | ) == $opt['page']['absolute_https_url'] |
| 284 | 284 | && !$opt['page']['https']['active'] |
| 285 | 285 | ) { |
| 286 | - return 'http' . strstr($url, '://'); |
|
| 286 | + return 'http'.strstr($url, '://'); |
|
| 287 | 287 | } else { |
| 288 | 288 | return $url; |
| 289 | 289 | } |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | * add/remove etc. is executed instantly |
| 9 | 9 | ***************************************************************************/ |
| 10 | 10 | |
| 11 | -require_once __DIR__ . '/const.inc.php'; |
|
| 11 | +require_once __DIR__.'/const.inc.php'; |
|
| 12 | 12 | |
| 13 | 13 | class picture |
| 14 | 14 | { |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | $sExtension = mb_strtolower(substr($sFilename, strrpos($sFilename, '.') + 1)); |
| 97 | 97 | |
| 98 | - if (strpos(';' . $opt['logic']['pictures']['extensions'] . ';', ';' . $sExtension . ';') !== false) { |
|
| 98 | + if (strpos(';'.$opt['logic']['pictures']['extensions'].';', ';'.$sExtension.';') !== false) { |
|
| 99 | 99 | return true; |
| 100 | 100 | } else { |
| 101 | 101 | return false; |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | |
| 119 | 119 | $sUUID = $this->getUUID(); |
| 120 | 120 | |
| 121 | - $this->setUrl($opt['logic']['pictures']['url'] . $sUUID . '.' . $sExtension); |
|
| 121 | + $this->setUrl($opt['logic']['pictures']['url'].$sUUID.'.'.$sExtension); |
|
| 122 | 122 | //$this->setThumbUrl($opt['logic']['pictures']['thumb_url'] . substr($sUUID, 0, 1) . '/' . substr($sUUID, 1, 1) . '/' . $sUUID . '.' . $sExtension); |
| 123 | 123 | |
| 124 | 124 | $this->bFilenamesSet = true; |
@@ -158,8 +158,8 @@ discard block |
||
| 158 | 158 | $archive = true; |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | - sql("SET @archive_picop=" . ($archive ? "TRUE" : "FALSE")); |
|
| 162 | - sql_slave("SET @archive_picop=" . ($archive ? "TRUE" : "FALSE")); |
|
| 161 | + sql("SET @archive_picop=".($archive ? "TRUE" : "FALSE")); |
|
| 162 | + sql_slave("SET @archive_picop=".($archive ? "TRUE" : "FALSE")); |
|
| 163 | 163 | |
| 164 | 164 | sql("SET @original_picid='&1'", $original_id); |
| 165 | 165 | sql_slave("SET @original_picid='&1'", $original_id); |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | $url = $this->getUrl(); |
| 272 | 272 | $fna = mb_split('\\/', $url); |
| 273 | 273 | |
| 274 | - return $opt['logic']['pictures']['dir'] . end($fna); |
|
| 274 | + return $opt['logic']['pictures']['dir'].end($fna); |
|
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | public function getThumbFilename() |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | $dir1 = mb_strtoupper(mb_substr($filename, 0, 1)); |
| 290 | 290 | $dir2 = mb_strtoupper(mb_substr($filename, 1, 1)); |
| 291 | 291 | |
| 292 | - return $opt['logic']['pictures']['thumb_dir'] . $dir1 . '/' . $dir2 . '/' . $filename; |
|
| 292 | + return $opt['logic']['pictures']['thumb_dir'].$dir1.'/'.$dir2.'/'.$filename; |
|
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | public function getLogId() |
@@ -435,9 +435,9 @@ discard block |
||
| 435 | 435 | return false; |
| 436 | 436 | } else { |
| 437 | 437 | // restore picture file |
| 438 | - $this->setUrl($original_url); // set the url, so that we can |
|
| 439 | - $filename = $this->getFilename(); // .. retreive the file path+name |
|
| 440 | - $this->setFilenames($filename); // now set url(s) from the new uuid |
|
| 438 | + $this->setUrl($original_url); // set the url, so that we can |
|
| 439 | + $filename = $this->getFilename(); // .. retreive the file path+name |
|
| 440 | + $this->setFilenames($filename); // now set url(s) from the new uuid |
|
| 441 | 441 | try { |
| 442 | 442 | rename($this->deleted_filename($filename), $this->getFilename()); |
| 443 | 443 | } catch (Exception $e) { |
@@ -514,7 +514,7 @@ discard block |
||
| 514 | 514 | $fna[count($fna) - 2] = 'deleted'; |
| 515 | 515 | $dp = ""; |
| 516 | 516 | foreach ($fna as $fp) { |
| 517 | - $dp .= "/" . $fp; |
|
| 517 | + $dp .= "/".$fp; |
|
| 518 | 518 | } |
| 519 | 519 | |
| 520 | 520 | return substr($dp, 1); |
@@ -538,13 +538,13 @@ discard block |
||
| 538 | 538 | public function getPageLink() |
| 539 | 539 | { |
| 540 | 540 | if ($this->getObjectType() == OBJECT_CACHELOG) { |
| 541 | - $pl = 'viewcache.php?cacheid=' . urlencode($this->getCacheId()); |
|
| 541 | + $pl = 'viewcache.php?cacheid='.urlencode($this->getCacheId()); |
|
| 542 | 542 | if (!$this->isVisibleOnCachePage()) { |
| 543 | 543 | $pl .= "&log=A"; |
| 544 | 544 | } |
| 545 | - $pl .= "#log" . urlencode($this->getLogId()); |
|
| 545 | + $pl .= "#log".urlencode($this->getLogId()); |
|
| 546 | 546 | } elseif ($this->getObjectType() == OBJECT_CACHE) { |
| 547 | - $pl = 'editcache.php?cacheid=' . urlencode($this->getCacheId()) . '#pictures'; |
|
| 547 | + $pl = 'editcache.php?cacheid='.urlencode($this->getCacheId()).'#pictures'; |
|
| 548 | 548 | } else { |
| 549 | 549 | $pl = false; |
| 550 | 550 | } |
@@ -75,7 +75,8 @@ |
||
| 75 | 75 | |
| 76 | 76 | // $pw may not contain one of $addwords[] |
| 77 | 77 | foreach ($wordlist as $v) { |
| 78 | - if (mb_stripos($pw_lc, $v) !== false) {// mb_stripos needs PHP 5.2 |
|
| 78 | + if (mb_stripos($pw_lc, $v) !== false) { |
|
| 79 | +// mb_stripos needs PHP 5.2 |
|
| 79 | 80 | return false; |
| 80 | 81 | } |
| 81 | 82 | } |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | $errmsg = ""; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - require __DIR__ . '/../html/error.php'; |
|
| 42 | + require __DIR__.'/../html/error.php'; |
|
| 43 | 43 | exit; |
| 44 | 44 | } |
| 45 | 45 | } |
@@ -67,8 +67,8 @@ discard block |
||
| 67 | 67 | ) { |
| 68 | 68 | $error_handled = true; |
| 69 | 69 | |
| 70 | - $error = "(" . $error['type'] . ") " . $error['message'] . |
|
| 71 | - " at line " . $error['line'] . " of " . $error['file']; |
|
| 70 | + $error = "(".$error['type'].") ".$error['message']. |
|
| 71 | + " at line ".$error['line']." of ".$error['file']; |
|
| 72 | 72 | php_errormail($error); |
| 73 | 73 | |
| 74 | 74 | $errtitle = "PHP-Fehler"; |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $errmsg = $error; |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - require __DIR__ . '/../html/error.php'; |
|
| 80 | + require __DIR__.'/../html/error.php'; |
|
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | global $opt, $sql_errormail, $absolute_server_URI; |
| 95 | 95 | |
| 96 | 96 | $sendMail = true; |
| 97 | - $subject = '[' . $opt['page']['domain'] . '] PHP error'; |
|
| 97 | + $subject = '['.$opt['page']['domain'].'] PHP error'; |
|
| 98 | 98 | |
| 99 | 99 | if (isset($opt['db']['error']['mail']) && $opt['db']['error']['mail'] != '') { |
| 100 | 100 | $sendMail = mb_send_mail($opt['db']['error']['mail'], $subject, $errmsg); |
@@ -114,10 +114,10 @@ discard block |
||
| 114 | 114 | function admin_errormail($to, $errortype, $message, $headers) |
| 115 | 115 | { |
| 116 | 116 | global $opt; |
| 117 | - $errorlog_dir = $opt['rootpath'] . 'var/errorlog'; |
|
| 118 | - $errorlog_path = $errorlog_dir . "/errorlog-" . date("Y-m-d"); |
|
| 117 | + $errorlog_dir = $opt['rootpath'].'var/errorlog'; |
|
| 118 | + $errorlog_path = $errorlog_dir."/errorlog-".date("Y-m-d"); |
|
| 119 | 119 | |
| 120 | - $error_mail_limit = 32768; // send max 32 KB = ca. 5-20 errors per day/logfile |
|
| 120 | + $error_mail_limit = 32768; // send max 32 KB = ca. 5-20 errors per day/logfile |
|
| 121 | 121 | |
| 122 | 122 | // All errors which may happen here are ignored, to avoid error recursions. |
| 123 | 123 | |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | @mkdir($errorlog_dir); |
| 126 | 126 | } |
| 127 | 127 | $old_logsize = @filesize($errorlog_path) + 0; |
| 128 | - $msg = date("Y-m-d H:i:s.u") . " " . $errortype . "\n" . $message . "\n" . |
|
| 128 | + $msg = date("Y-m-d H:i:s.u")." ".$errortype."\n".$message."\n". |
|
| 129 | 129 | "-------------------------------------------------------------------------\n\n"; |
| 130 | 130 | try { |
| 131 | 131 | error_log( |
@@ -143,9 +143,9 @@ discard block |
||
| 143 | 143 | if ($old_logsize < $error_mail_limit && $new_logsize >= $error_mail_limit) { |
| 144 | 144 | mb_send_mail( |
| 145 | 145 | $to, |
| 146 | - "too many " . $errortype, |
|
| 147 | - "Errors/Warnings are recorded in " . $errorlog_path . ".\n" . |
|
| 148 | - "Email Reporting is DISABLED for today now. Please check the logfile\n" . |
|
| 146 | + "too many ".$errortype, |
|
| 147 | + "Errors/Warnings are recorded in ".$errorlog_path.".\n". |
|
| 148 | + "Email Reporting is DISABLED for today now. Please check the logfile\n". |
|
| 149 | 149 | "and RENAME or delete it when done, so that logging is re-enabled.", |
| 150 | 150 | $headers |
| 151 | 151 | ); |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | * $dblink |
| 21 | 21 | ****************************************************************************/ |
| 22 | 22 | |
| 23 | -require_once __DIR__ . '/../vendor/autoload.php'; |
|
| 23 | +require_once __DIR__.'/../vendor/autoload.php'; |
|
| 24 | 24 | |
| 25 | 25 | global $interface_output, $dblink_slave; |
| 26 | 26 | if (!isset($interface_output)) { |
@@ -49,9 +49,9 @@ discard block |
||
| 49 | 49 | define('regex_statpic_text', '^[a-zA-Z0-9\.\-_ @äüöÄÜÖß=)(\/\\\&*\$+~#!§%;,-?:\[\]{}¹²³\'\"`\|µ°]{0,29}$'); |
| 50 | 50 | |
| 51 | 51 | //load default webserver-settings and common includes |
| 52 | -require_once $opt['rootpath'] . 'lib/consts.inc.php'; |
|
| 53 | -require_once $opt['rootpath'] . 'lib/settings.inc.php'; |
|
| 54 | -require_once $opt['rootpath'] . 'lib2/errorhandler.inc.php'; |
|
| 52 | +require_once $opt['rootpath'].'lib/consts.inc.php'; |
|
| 53 | +require_once $opt['rootpath'].'lib/settings.inc.php'; |
|
| 54 | +require_once $opt['rootpath'].'lib2/errorhandler.inc.php'; |
|
| 55 | 55 | |
| 56 | 56 | // check for banned UAs |
| 57 | 57 | $useragent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ""; |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | // prepare EMail-From |
| 77 | -$emailheaders = 'From: "' . $emailaddr . '" <' . $emailaddr . '>'; |
|
| 77 | +$emailheaders = 'From: "'.$emailaddr.'" <'.$emailaddr.'>'; |
|
| 78 | 78 | |
| 79 | 79 | function logentry($module, $eventid, $userid, $objectid1, $objectid2, $logtext, $details) |
| 80 | 80 | { |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | |
| 114 | 114 | while ($nCurPos < mb_strlen($str)) { |
| 115 | 115 | $nNextSep = mb_strlen($str); |
| 116 | - for ($nSepPos = 0; $nSepPos < mb_strlen($sep); $nSepPos ++) { |
|
| 116 | + for ($nSepPos = 0; $nSepPos < mb_strlen($sep); $nSepPos++) { |
|
| 117 | 117 | $nThisPos = mb_strpos($str, mb_substr($sep, $nSepPos, 1), $nCurPos); |
| 118 | 118 | if ($nThisPos !== false) { |
| 119 | 119 | if ($nNextSep > $nThisPos) { |
@@ -189,12 +189,12 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | function getSysConfig($name, $default) |
| 191 | 191 | { |
| 192 | - return sqlValue('SELECT `value` FROM `sysconfig` WHERE `name`=\'' . sql_escape($name) . '\'', $default); |
|
| 192 | + return sqlValue('SELECT `value` FROM `sysconfig` WHERE `name`=\''.sql_escape($name).'\'', $default); |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | function setSysConfig($name, $value) |
| 196 | 196 | { |
| 197 | - if (sqlValue('SELECT COUNT(*) FROM sysconfig WHERE name=\'' . sql_escape($name) . '\'', 0) == 1) { |
|
| 197 | + if (sqlValue('SELECT COUNT(*) FROM sysconfig WHERE name=\''.sql_escape($name).'\'', 0) == 1) { |
|
| 198 | 198 | sql( |
| 199 | 199 | "UPDATE `sysconfig` SET `value`='&1' WHERE `name`='&2' LIMIT 1", |
| 200 | 200 | $value, |
@@ -294,10 +294,10 @@ discard block |
||
| 294 | 294 | // muss dieses & ersetzt werden, oder ist es escaped? |
| 295 | 295 | $escapesCount = 0; |
| 296 | 296 | while ((($nextarg - $escapesCount - 1) > 0) && (mb_substr($sql, $nextarg - $escapesCount - 1, 1) == '\\')) { |
| 297 | - $escapesCount ++; |
|
| 297 | + $escapesCount++; |
|
| 298 | 298 | } |
| 299 | 299 | if (($escapesCount % 2) == 1) { |
| 300 | - $nextarg ++; |
|
| 300 | + $nextarg++; |
|
| 301 | 301 | } else { |
| 302 | 302 | $nextchar = mb_substr($sql, $nextarg + 1, 1); |
| 303 | 303 | if (is_numeric($nextchar)) { |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | while (mb_ereg_match('^[0-9]{1}', $nextchar) == 1) { |
| 309 | 309 | $arg .= $nextchar; |
| 310 | 310 | |
| 311 | - $arglength ++; |
|
| 311 | + $arglength++; |
|
| 312 | 312 | $nextchar = mb_substr($sql, $nextarg + $arglength + 1, 1); |
| 313 | 313 | } |
| 314 | 314 | |
@@ -349,13 +349,13 @@ discard block |
||
| 349 | 349 | // Anführungszeichen weg machen und NULL einsetzen |
| 350 | 350 | $filtered_sql = mb_substr($filtered_sql, 0, mb_strlen($filtered_sql) - 1); |
| 351 | 351 | $filtered_sql .= 'NULL'; |
| 352 | - $sqlpos ++; |
|
| 352 | + $sqlpos++; |
|
| 353 | 353 | } else { |
| 354 | 354 | $filtered_sql .= 'NULL'; |
| 355 | 355 | } |
| 356 | 356 | } |
| 357 | 357 | |
| 358 | - $sqlpos ++; |
|
| 358 | + $sqlpos++; |
|
| 359 | 359 | } else { |
| 360 | 360 | $arglength = 0; |
| 361 | 361 | $arg = ''; |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | while (mb_ereg_match('^[a-zA-Z0-9]{1}', $nextchar) == 1) { |
| 365 | 365 | $arg .= $nextchar; |
| 366 | 366 | |
| 367 | - $arglength ++; |
|
| 367 | + $arglength++; |
|
| 368 | 368 | $nextchar = mb_substr($sql, $nextarg + $arglength + 1, 1); |
| 369 | 369 | } |
| 370 | 370 | |
@@ -396,12 +396,12 @@ discard block |
||
| 396 | 396 | $nextarg - $escapesCount - 1, |
| 397 | 397 | 1 |
| 398 | 398 | ) == '\\')) { |
| 399 | - $escapesCount ++; |
|
| 399 | + $escapesCount++; |
|
| 400 | 400 | } |
| 401 | 401 | if (($escapesCount % 2) == 0) { |
| 402 | 402 | // \& ersetzen durch & |
| 403 | - $filtered_sql = mb_substr($filtered_sql, 0, $nextarg) . '&' . mb_substr($filtered_sql, $nextarg + 2); |
|
| 404 | - $nextarg --; |
|
| 403 | + $filtered_sql = mb_substr($filtered_sql, 0, $nextarg).'&'.mb_substr($filtered_sql, $nextarg + 2); |
|
| 404 | + $nextarg--; |
|
| 405 | 405 | } |
| 406 | 406 | |
| 407 | 407 | $nextarg = mb_strpos($filtered_sql, '\&', $nextarg + 2); |
@@ -418,14 +418,14 @@ discard block |
||
| 418 | 418 | */ |
| 419 | 419 | |
| 420 | 420 | if (isset($sql_debug) && ($sql_debug == true)) { |
| 421 | - require_once $opt['rootpath'] . 'lib/sqldebugger.inc.php'; |
|
| 421 | + require_once $opt['rootpath'].'lib/sqldebugger.inc.php'; |
|
| 422 | 422 | $result = sqldbg_execute($filtered_sql, $bSlave); |
| 423 | 423 | if ($result === false) { |
| 424 | 424 | sql_error(); |
| 425 | 425 | } |
| 426 | 426 | } else { |
| 427 | 427 | // Zeitmessung für die Ausführung |
| 428 | - require_once $opt['rootpath'] . 'lib/bench.inc.php'; |
|
| 428 | + require_once $opt['rootpath'].'lib/bench.inc.php'; |
|
| 429 | 429 | $cSqlExecution = new Cbench; |
| 430 | 430 | $cSqlExecution->start(); |
| 431 | 431 | |
@@ -437,8 +437,8 @@ discard block |
||
| 437 | 437 | $cSqlExecution->stop(); |
| 438 | 438 | |
| 439 | 439 | if ($sql_warntime > 0 && $cSqlExecution->diff() > $sql_warntime) { |
| 440 | - $ua = isset($_SERVER['HTTP_USER_AGENT']) ? "\r\n" . $_SERVER['HTTP_USER_AGENT'] : ""; |
|
| 441 | - sql_warn("execution took " . $cSqlExecution->diff() . " seconds" . $ua); |
|
| 440 | + $ua = isset($_SERVER['HTTP_USER_AGENT']) ? "\r\n".$_SERVER['HTTP_USER_AGENT'] : ""; |
|
| 441 | + sql_warn("execution took ".$cSqlExecution->diff()." seconds".$ua); |
|
| 442 | 442 | } |
| 443 | 443 | } |
| 444 | 444 | |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | global $db_error; |
| 474 | 474 | |
| 475 | 475 | $db_error += 1; |
| 476 | - $msql_error = mysql_errno() . ": " . mysql_error(); |
|
| 476 | + $msql_error = mysql_errno().": ".mysql_error(); |
|
| 477 | 477 | if ($db_error > 1) { |
| 478 | 478 | $msql_error .= "\n(** error recursion **)"; |
| 479 | 479 | } |
@@ -484,13 +484,13 @@ discard block |
||
| 484 | 484 | $email_content .= "\n--------------------\n"; |
| 485 | 485 | $email_content .= print_r(debug_backtrace(), true); |
| 486 | 486 | if (admin_errormail($sql_errormail, 'sql_error', $email_content, $emailheaders)) { |
| 487 | - mb_send_mail($sql_errormail, 'sql_error: ' . $absolute_server_URI, $email_content, $emailheaders); |
|
| 487 | + mb_send_mail($sql_errormail, 'sql_error: '.$absolute_server_URI, $email_content, $emailheaders); |
|
| 488 | 488 | } |
| 489 | 489 | } |
| 490 | 490 | |
| 491 | 491 | if ($interface_output == 'html') { |
| 492 | 492 | // display errorpage |
| 493 | - $errmsg = $dberrormsg . ($debug_page ? "<br />" . $msql_error : ""); |
|
| 493 | + $errmsg = $dberrormsg.($debug_page ? "<br />".$msql_error : ""); |
|
| 494 | 494 | if ($db_error <= 1) { |
| 495 | 495 | tpl_errorMsg('sql_error', $errmsg); |
| 496 | 496 | } else { |
@@ -504,12 +504,12 @@ discard block |
||
| 504 | 504 | exit; |
| 505 | 505 | } elseif ($interface_output == 'plain') { |
| 506 | 506 | echo "\n"; |
| 507 | - echo 'sql_error' . "\n"; |
|
| 507 | + echo 'sql_error'."\n"; |
|
| 508 | 508 | if ($debug_page) { |
| 509 | - echo $msql_error . "\n"; |
|
| 509 | + echo $msql_error."\n"; |
|
| 510 | 510 | } |
| 511 | - echo '---------' . "\n"; |
|
| 512 | - echo print_r(debug_backtrace(), true) . "\n"; |
|
| 511 | + echo '---------'."\n"; |
|
| 512 | + echo print_r(debug_backtrace(), true)."\n"; |
|
| 513 | 513 | exit; |
| 514 | 514 | } |
| 515 | 515 | |
@@ -527,7 +527,7 @@ discard block |
||
| 527 | 527 | $email_content .= print_r(debug_backtrace(), true); |
| 528 | 528 | |
| 529 | 529 | if (admin_errormail($sql_errormail, 'sql_warn', $email_content, $emailheaders)) { |
| 530 | - $sendMail = @mb_send_mail($sql_errormail, 'sql_warn: ' . $absolute_server_URI, $email_content, $emailheaders); |
|
| 530 | + $sendMail = @mb_send_mail($sql_errormail, 'sql_warn: '.$absolute_server_URI, $email_content, $emailheaders); |
|
| 531 | 531 | if ($sendMail === false) { |
| 532 | 532 | throw new \RuntimeException('the E-Mail can not be send.'); |
| 533 | 533 | } |
@@ -630,7 +630,7 @@ discard block |
||
| 630 | 630 | } |
| 631 | 631 | |
| 632 | 632 | if ($dblink != false) { |
| 633 | - mysql_query("SET NAMES '" . mysql_real_escape_string($opt['charset']['mysql'], $dblink) . "'", $dblink); |
|
| 633 | + mysql_query("SET NAMES '".mysql_real_escape_string($opt['charset']['mysql'], $dblink)."'", $dblink); |
|
| 634 | 634 | |
| 635 | 635 | //database connection established ... set the used database |
| 636 | 636 | if (@mysql_select_db($dbname, $dblink) == false) { |
@@ -666,7 +666,7 @@ discard block |
||
| 666 | 666 | $nMaxTimeDiff = $opt['db']['slave']['max_behind']; |
| 667 | 667 | if ($usr !== false) { |
| 668 | 668 | $nMaxTimeDiff = sqlValue( |
| 669 | - "SELECT TIMESTAMP(NOW())-TIMESTAMP(`datExclude`) FROM `sys_repl_exclude` WHERE `user_id`='" . ($usr['userid'] + 0) . "'", |
|
| 669 | + "SELECT TIMESTAMP(NOW())-TIMESTAMP(`datExclude`) FROM `sys_repl_exclude` WHERE `user_id`='".($usr['userid'] + 0)."'", |
|
| 670 | 670 | $opt['db']['slave']['max_behind'] |
| 671 | 671 | ); |
| 672 | 672 | if ($nMaxTimeDiff > $opt['db']['slave']['max_behind']) { |
@@ -675,7 +675,7 @@ discard block |
||
| 675 | 675 | } |
| 676 | 676 | |
| 677 | 677 | $id = sqlValue( |
| 678 | - "SELECT `id`, `weight`*RAND() AS `w` FROM `sys_repl_slaves` WHERE `active`=1 AND `online`=1 AND (TIMESTAMP(NOW())-TIMESTAMP(`last_check`)+`time_diff`<'" . ($nMaxTimeDiff + 0) . "') ORDER BY `w` DESC LIMIT 1", |
|
| 678 | + "SELECT `id`, `weight`*RAND() AS `w` FROM `sys_repl_slaves` WHERE `active`=1 AND `online`=1 AND (TIMESTAMP(NOW())-TIMESTAMP(`last_check`)+`time_diff`<'".($nMaxTimeDiff + 0)."') ORDER BY `w` DESC LIMIT 1", |
|
| 679 | 679 | - 1 |
| 680 | 680 | ); |
| 681 | 681 | |
@@ -747,9 +747,9 @@ discard block |
||
| 747 | 747 | $protocol = 'http'; |
| 748 | 748 | } |
| 749 | 749 | |
| 750 | - $site_url = $protocol . strstr($opt['domain'][$domain]['url'], '://'); |
|
| 750 | + $site_url = $protocol.strstr($opt['domain'][$domain]['url'], '://'); |
|
| 751 | 751 | if (isset($opt['domain'][$domain]['shortlink_domain']) && $opt['domain'][$domain]['shortlink_domain']) { |
| 752 | - $shortlink_url = $protocol . '://' . $opt['domain'][$domain]['shortlink_domain'] . '/'; |
|
| 752 | + $shortlink_url = $protocol.'://'.$opt['domain'][$domain]['shortlink_domain'].'/'; |
|
| 753 | 753 | } else { |
| 754 | 754 | $shortlink_url = false; |
| 755 | 755 | } |
@@ -769,10 +769,10 @@ discard block |
||
| 769 | 769 | $language = $opt['template']['default']['locale']; |
| 770 | 770 | } |
| 771 | 771 | $language = strtolower($language); |
| 772 | - if (!file_exists($rootpath . '/lang/de/ocstyle/email/' . $language . '/' . $filename . '.email')) { |
|
| 772 | + if (!file_exists($rootpath.'/lang/de/ocstyle/email/'.$language.'/'.$filename.'.email')) { |
|
| 773 | 773 | $language = 'en'; |
| 774 | 774 | } |
| 775 | - $mailtext = read_file($rootpath . '/lang/de/ocstyle/email/' . $language . '/' . $filename . '.email'); |
|
| 775 | + $mailtext = read_file($rootpath.'/lang/de/ocstyle/email/'.$language.'/'.$filename.'.email'); |
|
| 776 | 776 | |
| 777 | 777 | $urls = get_site_urls($domain); |
| 778 | 778 | $mailtext = mb_ereg_replace("{site_url}", $urls['site_url'], $mailtext); |
@@ -35,19 +35,19 @@ discard block |
||
| 35 | 35 | if (!isset($rootpath)) { |
| 36 | 36 | $rootpath = './'; |
| 37 | 37 | } |
| 38 | -require_once $rootpath . 'lib/clicompatbase.inc.php'; |
|
| 38 | +require_once $rootpath.'lib/clicompatbase.inc.php'; |
|
| 39 | 39 | |
| 40 | 40 | // enforce http or https? |
| 41 | 41 | if (isset($opt['gui']) && $opt['gui'] == GUI_HTML) { |
| 42 | 42 | if ($opt['page']['https']['mode'] == HTTPS_DISABLED) { |
| 43 | 43 | if ($opt['page']['https']['active']) { |
| 44 | - header('Location: http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']); |
|
| 44 | + header('Location: http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']); |
|
| 45 | 45 | } |
| 46 | 46 | $opt['page']['force_https_login'] = false; |
| 47 | 47 | } else { |
| 48 | 48 | if ($opt['page']['https']['mode'] == HTTPS_ENFORCED) { |
| 49 | 49 | if (!$opt['page']['https']['active']) { |
| 50 | - header('Location: https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']); |
|
| 50 | + header('Location: https://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']); |
|
| 51 | 51 | } |
| 52 | 52 | $opt['page']['force_https_login'] = true; |
| 53 | 53 | } |
@@ -58,12 +58,12 @@ discard block |
||
| 58 | 58 | load_domain_settings(); |
| 59 | 59 | |
| 60 | 60 | // load HTML specific includes |
| 61 | -require_once $rootpath . 'lib/cookie.class.php'; |
|
| 61 | +require_once $rootpath.'lib/cookie.class.php'; |
|
| 62 | 62 | |
| 63 | 63 | //site in service? |
| 64 | 64 | if ($site_in_service == false) { |
| 65 | 65 | header('Content-type: text/html; charset=utf-8'); |
| 66 | - $page_content = read_file($rootpath . 'html/outofservice.tpl.php'); |
|
| 66 | + $page_content = read_file($rootpath.'html/outofservice.tpl.php'); |
|
| 67 | 67 | die($page_content); |
| 68 | 68 | } |
| 69 | 69 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | //are there files for this language? |
| 87 | -if (!file_exists($rootpath . 'lang/' . $lang . '/')) { |
|
| 87 | +if (!file_exists($rootpath.'lang/'.$lang.'/')) { |
|
| 88 | 88 | die('Critical Error: The specified language does not exist!'); |
| 89 | 89 | } |
| 90 | 90 | |
@@ -97,22 +97,22 @@ discard block |
||
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | //does the style exist? |
| 100 | -if (!file_exists($rootpath . 'lang/' . $lang . '/' . $style . '/')) { |
|
| 100 | +if (!file_exists($rootpath.'lang/'.$lang.'/'.$style.'/')) { |
|
| 101 | 101 | $style = 'ocstyle'; |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | -if (!file_exists($rootpath . 'lang/' . $lang . '/' . $style . '/')) { |
|
| 104 | +if (!file_exists($rootpath.'lang/'.$lang.'/'.$style.'/')) { |
|
| 105 | 105 | die('Critical Error: The specified style does not exist!'); |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | //set up the language path |
| 109 | 109 | if (!isset($langpath)) { |
| 110 | - $langpath = $rootpath . 'lang/' . $lang; |
|
| 110 | + $langpath = $rootpath.'lang/'.$lang; |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | //set up the style path |
| 114 | 114 | if (!isset($stylepath)) { |
| 115 | - $stylepath = $langpath . '/' . $style; |
|
| 115 | + $stylepath = $langpath.'/'.$style; |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | //load gettext translation |
@@ -121,14 +121,14 @@ discard block |
||
| 121 | 121 | //open a databse connection |
| 122 | 122 | db_connect(); |
| 123 | 123 | |
| 124 | -require $opt['rootpath'] . 'lib/auth.inc.php'; |
|
| 125 | -require_once $opt['rootpath'] . 'lib2/translate.class.php'; |
|
| 124 | +require $opt['rootpath'].'lib/auth.inc.php'; |
|
| 125 | +require_once $opt['rootpath'].'lib2/translate.class.php'; |
|
| 126 | 126 | |
| 127 | 127 | //load language specific strings |
| 128 | -require_once $langpath . '/expressions.inc.php'; |
|
| 128 | +require_once $langpath.'/expressions.inc.php'; |
|
| 129 | 129 | |
| 130 | 130 | //set up the defaults for the main template |
| 131 | -require_once $stylepath . '/varset.inc.php'; |
|
| 131 | +require_once $stylepath.'/varset.inc.php'; |
|
| 132 | 132 | |
| 133 | 133 | if ($dblink === false) { |
| 134 | 134 | //error while connecting to the database |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | tpl_set_var('loginbox', $sLoggedOut); |
| 157 | 157 | tpl_set_var( |
| 158 | 158 | 'login_url', |
| 159 | - ($opt['page']['https']['force_login'] ? $opt['page']['absolute_https_url'] : '') . 'login.php' |
|
| 159 | + ($opt['page']['https']['force_login'] ? $opt['page']['absolute_https_url'] : '').'login.php' |
|
| 160 | 160 | ); |
| 161 | 161 | } else { |
| 162 | 162 | //user logged in |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | $ocpropping = isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], "Ocprop/") !== false; |
| 171 | 171 | |
| 172 | 172 | // zeitmessung |
| 173 | -require_once $rootpath . 'lib/bench.inc.php'; |
|
| 173 | +require_once $rootpath.'lib/bench.inc.php'; |
|
| 174 | 174 | $bScriptExecution = new Cbench; |
| 175 | 175 | $bScriptExecution->start(); |
| 176 | 176 | |
@@ -334,12 +334,12 @@ discard block |
||
| 334 | 334 | // country dropdown |
| 335 | 335 | global $tpl_usercountries; |
| 336 | 336 | |
| 337 | - tpl_set_var('screen_css_time', filemtime($opt['rootpath'] . "resource2/" . $style . "/css/style_screen.css")); |
|
| 337 | + tpl_set_var('screen_css_time', filemtime($opt['rootpath']."resource2/".$style."/css/style_screen.css")); |
|
| 338 | 338 | tpl_set_var( |
| 339 | 339 | 'screen_msie_css_time', |
| 340 | - filemtime($opt['rootpath'] . "resource2/" . $style . "/css/style_screen_msie.css") |
|
| 340 | + filemtime($opt['rootpath']."resource2/".$style."/css/style_screen_msie.css") |
|
| 341 | 341 | ); |
| 342 | - tpl_set_var('print_css_time', filemtime($opt['rootpath'] . "resource2/" . $style . "/css/style_print.css")); |
|
| 342 | + tpl_set_var('print_css_time', filemtime($opt['rootpath']."resource2/".$style."/css/style_print.css")); |
|
| 343 | 343 | |
| 344 | 344 | if (isset($bScriptExecution)) { |
| 345 | 345 | $bScriptExecution->Stop(); |
@@ -376,8 +376,8 @@ discard block |
||
| 376 | 376 | $ltext = mb_ereg_replace('%1', $lurl, $ltext); |
| 377 | 377 | $ltext = mb_ereg_replace('{site}', $opt['page']['sitename'], $ltext); |
| 378 | 378 | |
| 379 | - $ld = '<p class="sidebar-maintitle">' . $translate->t('Datalicense', '', '', 0) . '</p>' . |
|
| 380 | - '<div style="margin:20px 0 16px 0; width:100%; text-align:center;">' . $ltext . '</div>'; |
|
| 379 | + $ld = '<p class="sidebar-maintitle">'.$translate->t('Datalicense', '', '', 0).'</p>'. |
|
| 380 | + '<div style="margin:20px 0 16px 0; width:100%; text-align:center;">'.$ltext.'</div>'; |
|
| 381 | 381 | tpl_set_var('license_disclaimer', $ld); |
| 382 | 382 | } else { |
| 383 | 383 | tpl_set_var('license_disclaimer', ''); |
@@ -425,25 +425,25 @@ discard block |
||
| 425 | 425 | sql_free_result($rsUserCountries); |
| 426 | 426 | |
| 427 | 427 | //include language specific expressions, so that they are available in the template code |
| 428 | - include $langpath . '/expressions.inc.php'; |
|
| 428 | + include $langpath.'/expressions.inc.php'; |
|
| 429 | 429 | |
| 430 | 430 | //load main template |
| 431 | 431 | tpl_set_var('backgroundimage', '<div id="bg1"> </div><div id="bg2"> </div>'); |
| 432 | 432 | tpl_set_var('bodystyle', ''); |
| 433 | 433 | |
| 434 | 434 | if (isset($_REQUEST['print']) && $_REQUEST['print'] == 'y') { |
| 435 | - $sCode = read_file($stylepath . '/main_print.tpl.php'); |
|
| 435 | + $sCode = read_file($stylepath.'/main_print.tpl.php'); |
|
| 436 | 436 | } else { |
| 437 | 437 | if (isset($_REQUEST['popup']) && $_REQUEST['popup'] == 'y') { |
| 438 | - $sCode = read_file($stylepath . '/popup.tpl.php'); |
|
| 438 | + $sCode = read_file($stylepath.'/popup.tpl.php'); |
|
| 439 | 439 | } else { |
| 440 | - $sCode = read_file($stylepath . '/main.tpl.php'); |
|
| 440 | + $sCode = read_file($stylepath.'/main.tpl.php'); |
|
| 441 | 441 | } |
| 442 | 442 | } |
| 443 | - $sCode = '?>' . $sCode; |
|
| 443 | + $sCode = '?>'.$sCode; |
|
| 444 | 444 | |
| 445 | 445 | //does template exist? |
| 446 | - if (!file_exists($stylepath . '/' . $tplname . '.tpl.php')) { |
|
| 446 | + if (!file_exists($stylepath.'/'.$tplname.'.tpl.php')) { |
|
| 447 | 447 | //set up the error template |
| 448 | 448 | $error = true; |
| 449 | 449 | tpl_set_var('error_msg', htmlspecialchars($error_pagenotexist, ENT_COMPAT, 'UTF-8')); |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | } |
| 453 | 453 | |
| 454 | 454 | //read the template |
| 455 | - $sTemplate = read_file($stylepath . '/' . $tplname . '.tpl.php'); |
|
| 455 | + $sTemplate = read_file($stylepath.'/'.$tplname.'.tpl.php'); |
|
| 456 | 456 | $sCode = mb_ereg_replace('{template}', $sTemplate, $sCode); |
| 457 | 457 | |
| 458 | 458 | //process translations |
@@ -492,7 +492,7 @@ discard block |
||
| 492 | 492 | // Date in the past |
| 493 | 493 | header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); |
| 494 | 494 | // always modified |
| 495 | - header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); |
|
| 495 | + header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); |
|
| 496 | 496 | } |
| 497 | 497 | |
| 498 | 498 | //redirect to another site to display, i.e. to view a cache after logging |
@@ -504,9 +504,9 @@ discard block |
||
| 504 | 504 | http_write_no_cache(); |
| 505 | 505 | |
| 506 | 506 | if (!preg_match('/^https?:/i', $page)) { |
| 507 | - header("Location: " . $absolute_server_URI . $page); |
|
| 507 | + header("Location: ".$absolute_server_URI.$page); |
|
| 508 | 508 | } else { |
| 509 | - header("Location: " . $page); |
|
| 509 | + header("Location: ".$page); |
|
| 510 | 510 | } |
| 511 | 511 | |
| 512 | 512 | exit; |
@@ -522,17 +522,17 @@ discard block |
||
| 522 | 522 | if (is_array($vars)) { |
| 523 | 523 | foreach ($vars as $varname => $varvalue) { |
| 524 | 524 | if ($no_eval_vars[$varname] == false) { |
| 525 | - $str = mb_ereg_replace('{' . $varname . '}', $varvalue, $str); |
|
| 525 | + $str = mb_ereg_replace('{'.$varname.'}', $varvalue, $str); |
|
| 526 | 526 | } else { |
| 527 | - $replave_var_name = 'tpl_replace_var_' . $varname; |
|
| 527 | + $replave_var_name = 'tpl_replace_var_'.$varname; |
|
| 528 | 528 | |
| 529 | 529 | global $$replave_var_name; |
| 530 | 530 | $$replave_var_name = $varvalue; |
| 531 | 531 | |
| 532 | 532 | //replace using php-echo |
| 533 | 533 | $str = mb_ereg_replace( |
| 534 | - '{' . $varname . '}', |
|
| 535 | - '<?php global $' . $replave_var_name . '; echo $tpl_replace_var_' . $varname . '; ?>', |
|
| 534 | + '{'.$varname.'}', |
|
| 535 | + '<?php global $'.$replave_var_name.'; echo $tpl_replace_var_'.$varname.'; ?>', |
|
| 536 | 536 | $str |
| 537 | 537 | ); |
| 538 | 538 | } |
@@ -565,7 +565,7 @@ discard block |
||
| 565 | 565 | } |
| 566 | 566 | $opt['template']['locale'] = $locale; |
| 567 | 567 | |
| 568 | - bindtextdomain('messages', $rootpath . '/cache2/translate'); |
|
| 568 | + bindtextdomain('messages', $rootpath.'/cache2/translate'); |
|
| 569 | 569 | set_php_locale(); |
| 570 | 570 | textdomain('messages'); |
| 571 | 571 | } |
@@ -603,7 +603,7 @@ discard block |
||
| 603 | 603 | $sResultCode = ''; |
| 604 | 604 | $nCurrentPos = 0; |
| 605 | 605 | while ($nCurrentPos < mb_strlen($sCode)) { |
| 606 | - $nStartOf = mb_strpos($sCode, '{' . 't}', $nCurrentPos); |
|
| 606 | + $nStartOf = mb_strpos($sCode, '{'.'t}', $nCurrentPos); |
|
| 607 | 607 | if ($nStartOf === false) { |
| 608 | 608 | $sResultCode .= mb_substr($sCode, $nCurrentPos, mb_strlen($sCode) - $nCurrentPos); |
| 609 | 609 | $nCurrentPos = mb_strlen($sCode); |
@@ -633,8 +633,8 @@ discard block |
||
| 633 | 633 | |
| 634 | 634 | $str = $translate->t($str, '', basename(__FILE__), __LINE__); |
| 635 | 635 | $args = func_get_args(); |
| 636 | - for ($nIndex = count($args) - 1; $nIndex > 0; $nIndex --) { |
|
| 637 | - $str = str_replace('%' . $nIndex, $args[$nIndex], $str); |
|
| 636 | + for ($nIndex = count($args) - 1; $nIndex > 0; $nIndex--) { |
|
| 637 | + $str = str_replace('%'.$nIndex, $args[$nIndex], $str); |
|
| 638 | 638 | } |
| 639 | 639 | |
| 640 | 640 | return $str; |
@@ -666,7 +666,7 @@ discard block |
||
| 666 | 666 | |
| 667 | 667 | // user specified a country? |
| 668 | 668 | if (isset($usr) && ($usr !== false)) { |
| 669 | - $sCountry = sqlValue("SELECT `country` FROM `user` WHERE `user_id`='" . ($usr['userid'] + 0) . "'", null); |
|
| 669 | + $sCountry = sqlValue("SELECT `country` FROM `user` WHERE `user_id`='".($usr['userid'] + 0)."'", null); |
|
| 670 | 670 | if ($sCountry != null) { |
| 671 | 671 | return $sCountry; |
| 672 | 672 | } |
@@ -732,14 +732,14 @@ discard block |
||
| 732 | 732 | mysql_free_result($rs); |
| 733 | 733 | |
| 734 | 734 | $imgtitle = $translate->t('Instructions', '', basename(__FILE__), __LINE__); |
| 735 | - $imgtitle = "alt='" . $imgtitle . "' title='" . $imgtitle . "'"; |
|
| 735 | + $imgtitle = "alt='".$imgtitle."' title='".$imgtitle."'"; |
|
| 736 | 736 | |
| 737 | 737 | if (substr($helppage, 0, 1) == "!") { |
| 738 | - return "<a class='nooutline' href='" . substr($helppage, 1) . "' " . $imgtitle . " target='_blank'>"; |
|
| 738 | + return "<a class='nooutline' href='".substr($helppage, 1)."' ".$imgtitle." target='_blank'>"; |
|
| 739 | 739 | } else { |
| 740 | 740 | if ($helppage != "" && isset($opt['locale'][$help_locale]['helpwiki'])) { |
| 741 | - return "<a class='nooutline' href='" . $opt['locale'][$help_locale]['helpwiki'] . |
|
| 742 | - str_replace(' ', '_', $helppage) . "' " . $imgtitle . " target='_blank'>"; |
|
| 741 | + return "<a class='nooutline' href='".$opt['locale'][$help_locale]['helpwiki']. |
|
| 742 | + str_replace(' ', '_', $helppage)."' ".$imgtitle." target='_blank'>"; |
|
| 743 | 743 | } |
| 744 | 744 | } |
| 745 | 745 | |