@@ -12,13 +12,13 @@ discard block |
||
12 | 12 | ***************************************************************************/ |
13 | 13 | |
14 | 14 | // needs absolute rootpath because called as cronjob |
15 | -$rootpath = __DIR__ . '/../../'; |
|
16 | -require_once $rootpath . 'lib/clicompatbase.inc.php'; |
|
17 | -require_once $rootpath . 'lib2/translate.class.php'; |
|
18 | -require_once __DIR__ . '/settings.inc.php'; |
|
19 | -require_once $rootpath . 'lib/consts.inc.php'; |
|
20 | -require_once $rootpath . 'lib/logic.inc.php'; |
|
21 | -require_once $rootpath . 'lib2/edithelper.inc.php'; |
|
15 | +$rootpath = __DIR__.'/../../'; |
|
16 | +require_once $rootpath.'lib/clicompatbase.inc.php'; |
|
17 | +require_once $rootpath.'lib2/translate.class.php'; |
|
18 | +require_once __DIR__.'/settings.inc.php'; |
|
19 | +require_once $rootpath.'lib/consts.inc.php'; |
|
20 | +require_once $rootpath.'lib/logic.inc.php'; |
|
21 | +require_once $rootpath.'lib2/edithelper.inc.php'; |
|
22 | 22 | |
23 | 23 | if (!cronjobs_enabled()) { |
24 | 24 | exit; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | WHERE cache_logs.cache_id=caches.cache_id |
52 | 52 | AND cache_logs.owner_notified=0" |
53 | 53 | ); |
54 | -for ($i = 0; $i < mysql_num_rows($rsNewLogs); $i ++) { |
|
54 | +for ($i = 0; $i < mysql_num_rows($rsNewLogs); $i++) { |
|
55 | 55 | $rNewLog = sql_fetch_array($rsNewLogs); |
56 | 56 | |
57 | 57 | $rsNotified = sql( |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | // See http://forum.opencaching.de/index.php?topic=3123.0 on AOL. |
103 | 103 | if (sqlValue( |
104 | 104 | "SELECT `email_problems` = 0 OR DATEDIFF(NOW(),`last_email_problem`) > 1+DATEDIFF(`last_email_problem`,`first_email_problem`) |
105 | - FROM `user` WHERE `user_id`='" . sql_escape($rcw['user_id']) . "'", |
|
105 | + FROM `user` WHERE `user_id`='" . sql_escape($rcw['user_id'])."'", |
|
106 | 106 | 1 |
107 | 107 | )) { |
108 | 108 | process_log_watch($rcw['user_id'], $rcw['log_id']); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | /* begin send out everything that has to be sent */ |
117 | 117 | |
118 | -$email_headers = 'From: "' . $mailfrom . '" <' . $mailfrom . '>'; |
|
118 | +$email_headers = 'From: "'.$mailfrom.'" <'.$mailfrom.'>'; |
|
119 | 119 | |
120 | 120 | $rsUsers = sql( |
121 | 121 | "SELECT |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | WHERE `user`.`watchmail_nextmail`<NOW()", |
135 | 135 | $opt['template']['default']['locale'] |
136 | 136 | ); |
137 | -for ($i = 0; $i < mysql_num_rows($rsUsers); $i ++) { |
|
137 | +for ($i = 0; $i < mysql_num_rows($rsUsers); $i++) { |
|
138 | 138 | $rUser = sql_fetch_array($rsUsers); |
139 | 139 | |
140 | 140 | if ($rUser['watchmail_nextmail'] != '0000-00-00 00:00:00') { |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | ); |
159 | 159 | if (mysql_num_rows($rsWatchesOwner) > 0) { |
160 | 160 | $logtexts = ''; |
161 | - for ($j = 0; $j < mysql_num_rows($rsWatchesOwner); $j ++) { |
|
161 | + for ($j = 0; $j < mysql_num_rows($rsWatchesOwner); $j++) { |
|
162 | 162 | $rWatch = sql_fetch_array($rsWatchesOwner); |
163 | 163 | $logtexts .= $rWatch['watchtext']; |
164 | 164 | } |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | ); |
184 | 184 | if (mysql_num_rows($rsWatchesLog) > 0) { |
185 | 185 | $logtexts = ''; |
186 | - for ($j = 0; $j < mysql_num_rows($rsWatchesLog); $j ++) { |
|
186 | + for ($j = 0; $j < mysql_num_rows($rsWatchesLog); $j++) { |
|
187 | 187 | $rWatch = sql_fetch_array($rsWatchesLog); |
188 | 188 | $logtexts .= $rWatch['watchtext']; |
189 | 189 | } |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | if (is_existent_maildomain(getToMailDomain($mailadr))) { |
210 | 210 | $language = $rUser['language'] ? $rUser['language'] : $opt['template']['default']['locale']; |
211 | 211 | $mailsubject = |
212 | - '[' . $maildomain . '] ' . $translate->t( |
|
212 | + '['.$maildomain.'] '.$translate->t( |
|
213 | 213 | 'Your watchlist of', |
214 | 214 | '', |
215 | 215 | basename(__FILE__), |
@@ -217,11 +217,11 @@ discard block |
||
217 | 217 | '', |
218 | 218 | 1, |
219 | 219 | $language |
220 | - ) . ' ' . date($opt['locale'][$language]['format']['phpdate']); |
|
220 | + ).' '.date($opt['locale'][$language]['format']['phpdate']); |
|
221 | 221 | mb_send_mail($mailadr, $mailsubject, $mailbody, $email_headers); |
222 | 222 | |
223 | 223 | // logentry($module, $eventid, $userid, $objectid1, $objectid2, $logtext, $details) |
224 | - logentry('watchlist', 2, $rUser['user_id'], 0, 0, 'Sending mail to ' . $mailadr, []); |
|
224 | + logentry('watchlist', 2, $rUser['user_id'], 0, 0, 'Sending mail to '.$mailadr, []); |
|
225 | 225 | } |
226 | 226 | } |
227 | 227 | |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | |
321 | 321 | $logtext = html2plaintext($rLog['text'], $rLog['text_html'] == 0, EMAIL_LINEWRAP); |
322 | 322 | |
323 | - $language = sqlValue("SELECT `language` FROM `user` WHERE `user_id`='" . sql_escape($user_id) . "'", null); |
|
323 | + $language = sqlValue("SELECT `language` FROM `user` WHERE `user_id`='".sql_escape($user_id)."'", null); |
|
324 | 324 | if (!$language) { |
325 | 325 | $language = $opt['template']['default']['locale']; |
326 | 326 | } |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | } |
332 | 332 | |
333 | 333 | $watchtext = |
334 | - '{date} ' . $translate->t( |
|
334 | + '{date} '.$translate->t( |
|
335 | 335 | '{user} has logged your cache "{cachename}":', |
336 | 336 | '', |
337 | 337 | basename(__FILE__), |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | '', |
340 | 340 | 1, |
341 | 341 | $language |
342 | - ) . ' {action}{maintenance_flags}' . "\n" . '{shortlink_url}{wp_oc}' . "\n\n" . '{text}' . "\n\n\n\n"; |
|
342 | + ).' {action}{maintenance_flags}'."\n".'{shortlink_url}{wp_oc}'."\n\n".'{text}'."\n\n\n\n"; |
|
343 | 343 | |
344 | 344 | $watchtext = mb_ereg_replace('{date}', date($dateformat, strtotime($rLog['logdate'])), $watchtext); |
345 | 345 | $watchtext = mb_ereg_replace('{wp_oc}', $rLog['wp_oc'], $watchtext); |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | $watchtext = mb_ereg_replace('{action}', get_logtype_name($rLog['type'], $language), $watchtext); |
350 | 350 | $watchtext = insert_maintenance_flags($rLog, $language, $watchtext); |
351 | 351 | |
352 | - $domain = sqlValue("SELECT `domain` FROM `user` WHERE `user_id`='" . sql_escape($user_id) . "'", null); |
|
352 | + $domain = sqlValue("SELECT `domain` FROM `user` WHERE `user_id`='".sql_escape($user_id)."'", null); |
|
353 | 353 | $urls = get_site_urls($domain); |
354 | 354 | if ($urls['shortlink_url']) { |
355 | 355 | $watchtext = mb_ereg_replace("{shortlink_url}", $urls['shortlink_url'], $watchtext); |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | |
404 | 404 | $logtext = html2plaintext($rLog['text'], $rLog['text_html'] == 0, EMAIL_LINEWRAP); |
405 | 405 | |
406 | - $language = sqlValue("SELECT `language` FROM `user` WHERE `user_id`='" . sql_escape($user_id) . "'", null); |
|
406 | + $language = sqlValue("SELECT `language` FROM `user` WHERE `user_id`='".sql_escape($user_id)."'", null); |
|
407 | 407 | if (!$language) { |
408 | 408 | $language = $opt['template']['default']['locale']; |
409 | 409 | } |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | } |
415 | 415 | |
416 | 416 | $watchtext = |
417 | - '{date} ' . $translate->t( |
|
417 | + '{date} '.$translate->t( |
|
418 | 418 | '{user} has logged the cache "{cachename}":', |
419 | 419 | '', |
420 | 420 | basename(__FILE__), |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | '', |
423 | 423 | 1, |
424 | 424 | $language |
425 | - ) . ' {action}{maintenance_flags}' . "\n" . '{shortlink_url}{wp_oc}' . "\n{cachelists}\n" . '{text}' . "\n\n\n\n"; |
|
425 | + ).' {action}{maintenance_flags}'."\n".'{shortlink_url}{wp_oc}'."\n{cachelists}\n".'{text}'."\n\n\n\n"; |
|
426 | 426 | |
427 | 427 | $watchtext = mb_ereg_replace('{date}', date($dateformat, strtotime($rLog['logdate'])), $watchtext); |
428 | 428 | $watchtext = mb_ereg_replace('{wp_oc}', $rLog['wp_oc'], $watchtext); |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | '', |
456 | 456 | 1, |
457 | 457 | $language |
458 | - ) . ' ' . $cachelist_names[0] . "\n"; |
|
458 | + ).' '.$cachelist_names[0]."\n"; |
|
459 | 459 | break; |
460 | 460 | default: |
461 | 461 | $cachelists = |
@@ -467,11 +467,11 @@ discard block |
||
467 | 467 | '', |
468 | 468 | 1, |
469 | 469 | $language |
470 | - ) . ' ' . implode(', ', $cachelist_names) . "\n"; |
|
470 | + ).' '.implode(', ', $cachelist_names)."\n"; |
|
471 | 471 | } |
472 | 472 | $watchtext = mb_ereg_replace('{cachelists}', $cachelists, $watchtext); |
473 | 473 | |
474 | - $domain = sqlValue("SELECT `domain` FROM `user` WHERE `user_id`='" . sql_escape($user_id) . "'", null); |
|
474 | + $domain = sqlValue("SELECT `domain` FROM `user` WHERE `user_id`='".sql_escape($user_id)."'", null); |
|
475 | 475 | $urls = get_site_urls($domain); |
476 | 476 | if ($urls['shortlink_url']) { |
477 | 477 | $watchtext = mb_ereg_replace("{shortlink_url}", $urls['shortlink_url'], $watchtext); |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | } |
563 | 563 | |
564 | 564 | if (file_exists($PidFile)) { |
565 | - echo "Error: Pidfile (" . $PidFile . ") already present at " . __FILE__ . ":" . __LINE__ . "!\n"; |
|
565 | + echo "Error: Pidfile (".$PidFile.") already present at ".__FILE__.":".__LINE__."!\n"; |
|
566 | 566 | |
567 | 567 | return false; |
568 | 568 | } else { |
@@ -572,7 +572,7 @@ discard block |
||
572 | 572 | |
573 | 573 | return true; |
574 | 574 | } else { |
575 | - echo "can't create Pidfile $PidFile at " . __FILE__ . ":" . __LINE__ . "!\n"; |
|
575 | + echo "can't create Pidfile $PidFile at ".__FILE__.":".__LINE__."!\n"; |
|
576 | 576 | |
577 | 577 | return false; |
578 | 578 | } |
@@ -588,7 +588,7 @@ discard block |
||
588 | 588 | $pid_daemon = fgets($pidfile, 20); |
589 | 589 | fclose($pidfile); |
590 | 590 | |
591 | - $pid_daemon = (int) $pid_daemon; |
|
591 | + $pid_daemon = (int)$pid_daemon; |
|
592 | 592 | |
593 | 593 | // process running? |
594 | 594 | if (posix_kill($pid_daemon, 0)) { |
@@ -597,7 +597,7 @@ discard block |
||
597 | 597 | false; |
598 | 598 | } else { |
599 | 599 | // no, remove pid_file |
600 | - echo "process not running, removing old pid_file (" . $PidFile . ")\n"; |
|
600 | + echo "process not running, removing old pid_file (".$PidFile.")\n"; |
|
601 | 601 | unlink($PidFile); |
602 | 602 | |
603 | 603 | return true; |
@@ -619,10 +619,10 @@ discard block |
||
619 | 619 | unlink($PidFile); |
620 | 620 | } |
621 | 621 | } else { |
622 | - echo "Error: can't delete own pidfile (" . $PidFile . ") at " . __FILE__ . ":" . __LINE__ . "!\n"; |
|
622 | + echo "Error: can't delete own pidfile (".$PidFile.") at ".__FILE__.":".__LINE__."!\n"; |
|
623 | 623 | } |
624 | 624 | |
625 | 625 | if ($message) { |
626 | - echo $message . "\n"; |
|
626 | + echo $message."\n"; |
|
627 | 627 | } |
628 | 628 | } |
@@ -22,13 +22,13 @@ discard block |
||
22 | 22 | tpl_set_var('loginbox', ' '); |
23 | 23 | tpl_set_var( |
24 | 24 | 'functionsbox', |
25 | - '<a href="index.php?page=suche">' . t('Search') . '</a> | <a href="index.php?page=sitemap">' . t('Sitemap') . '</a>' |
|
25 | + '<a href="index.php?page=suche">'.t('Search').'</a> | <a href="index.php?page=sitemap">'.t('Sitemap').'</a>' |
|
26 | 26 | ); |
27 | 27 | tpl_set_var('runtime', ''); |
28 | 28 | |
29 | 29 | //set up main template specific string |
30 | 30 | $sLoggedOut = |
31 | - '<form action="' . ($opt['page']['https']['force_login'] ? $opt['page']['absolute_https_url'] : '') . 'login.php" method="post" enctype="application/x-www-form-urlencoded" name="login" dir="ltr" style="display: inline;"><b>' |
|
31 | + '<form action="'.($opt['page']['https']['force_login'] ? $opt['page']['absolute_https_url'] : '').'login.php" method="post" enctype="application/x-www-form-urlencoded" name="login" dir="ltr" style="display: inline;"><b>' |
|
32 | 32 | . t('User:') |
33 | 33 | . '</b> <input name="email" size="10" type="text" class="textboxes" value="" /> <b>' |
34 | 34 | . t('Password:') |
@@ -43,14 +43,14 @@ discard block |
||
43 | 43 | . '</a></b>'; |
44 | 44 | |
45 | 45 | // target in Loginbox setzen |
46 | -$target = basename($_SERVER['PHP_SELF']) . '?'; |
|
46 | +$target = basename($_SERVER['PHP_SELF']).'?'; |
|
47 | 47 | |
48 | 48 | // REQUEST-Variablen durchlaufen und an target anhaengen |
49 | 49 | $allowed = ['cacheid', 'userid', 'logid', 'desclang', 'descid']; |
50 | 50 | reset($_REQUEST); |
51 | 51 | while (list ($varname, $varvalue) = each($_REQUEST)) { |
52 | 52 | if (in_array($varname, $allowed)) { |
53 | - $target .= $varname . '=' . $varvalue . '&'; |
|
53 | + $target .= $varname.'='.$varvalue.'&'; |
|
54 | 54 | } |
55 | 55 | } |
56 | 56 | if (mb_substr($target, - 1) == '?' || mb_substr($target, - 1) == '&') { |
@@ -76,10 +76,10 @@ discard block |
||
76 | 76 | '<tr><td class="spacer" colspan="2"></td></tr> |
77 | 77 | <tr> |
78 | 78 | <td class="help" colspan="2"> |
79 | - <img src="lang/de/ocstyle/images/misc/hint.gif" border="0" width="15" height="11" alt="' . t('Notice') . '" title="' . t('Notice') . '" /> |
|
79 | + <img src="lang/de/ocstyle/images/misc/hint.gif" border="0" width="15" height="11" alt="' . t('Notice').'" title="'.t('Notice').'" /> |
|
80 | 80 | ' . t('Your HTML code will be changed again by a special filter. This is necessary to avoid dangerous HTML-tags, |
81 | 81 | such as <script>. A list of allowed HTML tags, you can find |
82 | - <a href="articles.php?page=htmltags">here</a>') . ' |
|
82 | + <a href="articles.php?page=htmltags">here</a>').' |
|
83 | 83 | </td> |
84 | 84 | </tr> |
85 | 85 | '; |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * Unicode Reminder メモ |
6 | 6 | ***************************************************************************/ |
7 | 7 | |
8 | -require __DIR__ . '/lib2/web.inc.php'; |
|
8 | +require __DIR__.'/lib2/web.inc.php'; |
|
9 | 9 | |
10 | 10 | $login->verify(); |
11 | 11 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $login->hasAdminPriv(ADMIN_USER) ? 1 : 0 |
40 | 40 | ) == 0) { |
41 | 41 | if ($debug == 1) { |
42 | - die('Debug: line ' . __LINE__); |
|
42 | + die('Debug: line '.__LINE__); |
|
43 | 43 | } else { |
44 | 44 | $tpl->redirect(thumbpath('extern', 1)); |
45 | 45 | } |
@@ -57,14 +57,14 @@ discard block |
||
57 | 57 | $login->hasAdminPriv(ADMIN_USER) ? 1 : 0 |
58 | 58 | ) == 0) { |
59 | 59 | if ($debug == 1) { |
60 | - die('Debug: line ' . __LINE__); |
|
60 | + die('Debug: line '.__LINE__); |
|
61 | 61 | } else { |
62 | 62 | $tpl->redirect(thumbpath('extern', 2)); |
63 | 63 | } |
64 | 64 | } |
65 | 65 | } else { |
66 | 66 | if ($debug == 1) { |
67 | - die('Debug: line ' . __LINE__); |
|
67 | + die('Debug: line '.__LINE__); |
|
68 | 68 | } else { |
69 | 69 | $tpl->redirect(thumbpath('intern', $default_object_type)); |
70 | 70 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | if ($r['local'] == 0) { |
74 | 74 | if ($debug == 1) { |
75 | - die('Debug: line ' . __LINE__); |
|
75 | + die('Debug: line '.__LINE__); |
|
76 | 76 | } else { |
77 | 77 | $tpl->redirect(thumbpath('extern', $r['object_type'])); |
78 | 78 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | if (($r['spoiler'] == 1) && ($showspoiler != 1)) { |
82 | 82 | if ($debug == 1) { |
83 | - die('Debug: line ' . __LINE__); |
|
83 | + die('Debug: line '.__LINE__); |
|
84 | 84 | } else { |
85 | 85 | $tpl->redirect(thumbpath('spoiler', $r['object_type'])); |
86 | 86 | } |
@@ -89,9 +89,9 @@ discard block |
||
89 | 89 | $imgurl = $r['url']; |
90 | 90 | $urlparts = mb_split('/', $imgurl); |
91 | 91 | |
92 | - if (!file_exists($opt['logic']['pictures']['dir'] . '/' . $urlparts[count($urlparts) - 1])) { |
|
92 | + if (!file_exists($opt['logic']['pictures']['dir'].'/'.$urlparts[count($urlparts) - 1])) { |
|
93 | 93 | if ($debug == 1) { |
94 | - die('Debug: line ' . __LINE__); |
|
94 | + die('Debug: line '.__LINE__); |
|
95 | 95 | } else { |
96 | 96 | $tpl->redirect(thumbpath('intern', $r['object_type'])); |
97 | 97 | } |
@@ -104,11 +104,11 @@ discard block |
||
104 | 104 | } |
105 | 105 | |
106 | 106 | if (!file_exists( |
107 | - $opt['logic']['pictures']['thumb_dir'] . '/' . mb_substr( |
|
107 | + $opt['logic']['pictures']['thumb_dir'].'/'.mb_substr( |
|
108 | 108 | $urlparts[count($urlparts) - 1], |
109 | 109 | 0, |
110 | 110 | 1 |
111 | - ) . '/' . mb_substr($urlparts[count($urlparts) - 1], 1, 1) . '/' . $urlparts[count($urlparts) - 1] |
|
111 | + ).'/'.mb_substr($urlparts[count($urlparts) - 1], 1, 1).'/'.$urlparts[count($urlparts) - 1] |
|
112 | 112 | ) |
113 | 113 | ) { |
114 | 114 | $bGenerate = true; |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | if ($bGenerate) { |
118 | 118 | if ($r['unknown_format'] == 1) { |
119 | 119 | if ($debug == 1) { |
120 | - die('Debug: line ' . __LINE__); |
|
120 | + die('Debug: line '.__LINE__); |
|
121 | 121 | } else { |
122 | 122 | $tpl->redirect(thumbpath('format', $r['object_type'])); |
123 | 123 | } |
@@ -128,11 +128,11 @@ discard block |
||
128 | 128 | $filenameparts = mb_split('\\.', $filename); |
129 | 129 | $extension = mb_strtolower($filenameparts[count($filenameparts) - 1]); |
130 | 130 | |
131 | - if (mb_strpos(';' . $opt['logic']['pictures']['extensions'] . ';', ';' . $extension . ';') === false) { |
|
131 | + if (mb_strpos(';'.$opt['logic']['pictures']['extensions'].';', ';'.$extension.';') === false) { |
|
132 | 132 | sql("UPDATE `pictures` SET `unknown_format`=1 WHERE `uuid`='&1'", $r['uuid']); |
133 | 133 | |
134 | 134 | if ($debug == 1) { |
135 | - die('Debug: line ' . __LINE__); |
|
135 | + die('Debug: line '.__LINE__); |
|
136 | 136 | } else { |
137 | 137 | $tpl->redirect(thumbpath('format', $r['object_type'])); |
138 | 138 | } |
@@ -143,20 +143,20 @@ discard block |
||
143 | 143 | } |
144 | 144 | switch ($extension) { |
145 | 145 | case 'jpg': |
146 | - $im = imagecreatefromjpeg($opt['logic']['pictures']['dir'] . '/' . $filename); |
|
146 | + $im = imagecreatefromjpeg($opt['logic']['pictures']['dir'].'/'.$filename); |
|
147 | 147 | break; |
148 | 148 | |
149 | 149 | case 'gif': |
150 | - $im = imagecreatefromgif($opt['logic']['pictures']['dir'] . '/' . $filename); |
|
150 | + $im = imagecreatefromgif($opt['logic']['pictures']['dir'].'/'.$filename); |
|
151 | 151 | break; |
152 | 152 | |
153 | 153 | case 'png': |
154 | - $im = imagecreatefrompng($opt['logic']['pictures']['dir'] . '/' . $filename); |
|
154 | + $im = imagecreatefrompng($opt['logic']['pictures']['dir'].'/'.$filename); |
|
155 | 155 | break; |
156 | 156 | |
157 | 157 | case 'bmp': |
158 | - require $opt['rootpath'] . 'lib2/imagebmp.inc.php'; |
|
159 | - $im = imagecreatefrombmp($opt['logic']['pictures']['dir'] . '/' . $filename); |
|
158 | + require $opt['rootpath'].'lib2/imagebmp.inc.php'; |
|
159 | + $im = imagecreatefrombmp($opt['logic']['pictures']['dir'].'/'.$filename); |
|
160 | 160 | break; |
161 | 161 | } |
162 | 162 | |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | sql("UPDATE `pictures` SET `unknown_format`=1 WHERE `uuid`='&1'", $r['uuid']); |
165 | 165 | |
166 | 166 | if ($debug == 1) { |
167 | - die('Debug: line ' . __LINE__); |
|
167 | + die('Debug: line '.__LINE__); |
|
168 | 168 | } else { |
169 | 169 | $tpl->redirect(thumbpath('format', $r['object_type'])); |
170 | 170 | } |
@@ -201,15 +201,15 @@ discard block |
||
201 | 201 | imagecopyresampled($thumbimage, $im, 0, 0, 0, 0, $thumbwidth, $thumbheight, $imwidth, $imheight); |
202 | 202 | |
203 | 203 | // Create directory |
204 | - if (!file_exists($opt['logic']['pictures']['thumb_dir'] . '/' . mb_substr($filename, 0, 1))) { |
|
205 | - mkdir($opt['logic']['pictures']['thumb_dir'] . '/' . mb_substr($filename, 0, 1)); |
|
204 | + if (!file_exists($opt['logic']['pictures']['thumb_dir'].'/'.mb_substr($filename, 0, 1))) { |
|
205 | + mkdir($opt['logic']['pictures']['thumb_dir'].'/'.mb_substr($filename, 0, 1)); |
|
206 | 206 | } |
207 | 207 | if (!file_exists( |
208 | - $opt['logic']['pictures']['thumb_dir'] . '/' . mb_substr($filename, 0, 1) . '/' . mb_substr($filename, 1, 1) |
|
208 | + $opt['logic']['pictures']['thumb_dir'].'/'.mb_substr($filename, 0, 1).'/'.mb_substr($filename, 1, 1) |
|
209 | 209 | ) |
210 | 210 | ) { |
211 | 211 | mkdir( |
212 | - $opt['logic']['pictures']['thumb_dir'] . '/' . mb_substr($filename, 0, 1) . '/' . mb_substr( |
|
212 | + $opt['logic']['pictures']['thumb_dir'].'/'.mb_substr($filename, 0, 1).'/'.mb_substr( |
|
213 | 213 | $filename, |
214 | 214 | 1, |
215 | 215 | 1 |
@@ -218,48 +218,48 @@ discard block |
||
218 | 218 | } |
219 | 219 | |
220 | 220 | $savedir = |
221 | - $opt['logic']['pictures']['thumb_dir'] . '/' |
|
222 | - . mb_substr($filename, 0, 1) . '/' |
|
221 | + $opt['logic']['pictures']['thumb_dir'].'/' |
|
222 | + . mb_substr($filename, 0, 1).'/' |
|
223 | 223 | . mb_substr($filename, 1, 1); |
224 | 224 | |
225 | 225 | switch ($extension) { |
226 | 226 | case 'jpg': |
227 | - imagejpeg($thumbimage, $savedir . '/' . $filename); |
|
227 | + imagejpeg($thumbimage, $savedir.'/'.$filename); |
|
228 | 228 | break; |
229 | 229 | |
230 | 230 | case 'gif': |
231 | - imagegif($thumbimage, $savedir . '/' . $filename); |
|
231 | + imagegif($thumbimage, $savedir.'/'.$filename); |
|
232 | 232 | break; |
233 | 233 | |
234 | 234 | case 'png': |
235 | - imagepng($thumbimage, $savedir . '/' . $filename); |
|
235 | + imagepng($thumbimage, $savedir.'/'.$filename); |
|
236 | 236 | break; |
237 | 237 | |
238 | 238 | case 'bmp': |
239 | - imagebmp($thumbimage, $savedir . '/' . $filename); |
|
239 | + imagebmp($thumbimage, $savedir.'/'.$filename); |
|
240 | 240 | break; |
241 | 241 | } |
242 | 242 | |
243 | 243 | sql( |
244 | 244 | "UPDATE `pictures` SET `thumb_last_generated`=NOW(), `thumb_url`='&1' WHERE `uuid`='&2'", |
245 | - $opt['logic']['pictures']['thumb_url'] . '/' . mb_substr($filename, 0, 1) . '/' . mb_substr( |
|
245 | + $opt['logic']['pictures']['thumb_url'].'/'.mb_substr($filename, 0, 1).'/'.mb_substr( |
|
246 | 246 | $filename, |
247 | 247 | 1, |
248 | 248 | 1 |
249 | - ) . '/' . $filename, |
|
249 | + ).'/'.$filename, |
|
250 | 250 | $r['uuid'] |
251 | 251 | ); |
252 | 252 | |
253 | 253 | if ($debug == 1) { |
254 | - die($opt['logic']['pictures']['thumb_url'] . '/' . $filename); |
|
254 | + die($opt['logic']['pictures']['thumb_url'].'/'.$filename); |
|
255 | 255 | } else { |
256 | 256 | $tpl->redirect( |
257 | 257 | use_current_protocol( |
258 | - $opt['logic']['pictures']['thumb_url'] . '/' . mb_substr($filename, 0, 1) . '/' . mb_substr( |
|
258 | + $opt['logic']['pictures']['thumb_url'].'/'.mb_substr($filename, 0, 1).'/'.mb_substr( |
|
259 | 259 | $filename, |
260 | 260 | 1, |
261 | 261 | 1 |
262 | - ) . '/' . $filename |
|
262 | + ).'/'.$filename |
|
263 | 263 | ) |
264 | 264 | ); |
265 | 265 | } |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | } |
273 | 273 | } else { |
274 | 274 | if ($debug == 1) { |
275 | - die('Debug: line ' . __LINE__); |
|
275 | + die('Debug: line '.__LINE__); |
|
276 | 276 | } else { |
277 | 277 | $tpl->redirect(thumbpath('404', $default_object_type)); |
278 | 278 | } |
@@ -287,18 +287,18 @@ discard block |
||
287 | 287 | || ($object_type != 1 && $object_type != 2) |
288 | 288 | ) { |
289 | 289 | if ($debug == 1) { |
290 | - die('Debug: line ' . __LINE__); |
|
290 | + die('Debug: line '.__LINE__); |
|
291 | 291 | } else { |
292 | 292 | $name = 'intern'; |
293 | 293 | $object_type = $default_object_type; |
294 | 294 | } |
295 | 295 | } |
296 | 296 | |
297 | - $imgdir = 'resource2/' . $opt['template']['style'] . '/images/thumb/'; |
|
298 | - $filename = 'thumb' . $name . '_' . $object_type . '.gif'; |
|
299 | - $thumbpath = $imgdir . strtolower($opt['template']['locale']) . '/' . $filename; |
|
297 | + $imgdir = 'resource2/'.$opt['template']['style'].'/images/thumb/'; |
|
298 | + $filename = 'thumb'.$name.'_'.$object_type.'.gif'; |
|
299 | + $thumbpath = $imgdir.strtolower($opt['template']['locale']).'/'.$filename; |
|
300 | 300 | if (!file_exists($thumbpath)) { |
301 | - $thumbpath = $imgdir . 'en/' . $filename; |
|
301 | + $thumbpath = $imgdir.'en/'.$filename; |
|
302 | 302 | } |
303 | 303 | |
304 | 304 | return $thumbpath; |
@@ -11,16 +11,16 @@ discard block |
||
11 | 11 | * |
12 | 12 | ***************************************************************************/ |
13 | 13 | |
14 | -$opt['rootpath'] = __DIR__ . '/../../'; |
|
15 | -require $opt['rootpath'] . 'lib2/cli.inc.php'; |
|
14 | +$opt['rootpath'] = __DIR__.'/../../'; |
|
15 | +require $opt['rootpath'].'lib2/cli.inc.php'; |
|
16 | 16 | |
17 | 17 | // test for user who runs the cronjob |
18 | 18 | $processUser = posix_getpwuid(posix_geteuid()); |
19 | 19 | if ($processUser['name'] != $opt['cron']['username']) { |
20 | 20 | die( |
21 | - "ERROR: runcron must be run by '" . $opt['cron']['username'] |
|
22 | - . "' but was called by '" . $processUser['name'] . "'\n" . |
|
23 | - "Try something like 'sudo -u " . $opt['cron']['username'] . " php runcron.php'.\n" |
|
21 | + "ERROR: runcron must be run by '".$opt['cron']['username'] |
|
22 | + . "' but was called by '".$processUser['name']."'\n". |
|
23 | + "Try something like 'sudo -u ".$opt['cron']['username']." php runcron.php'.\n" |
|
24 | 24 | ); |
25 | 25 | } |
26 | 26 | |
@@ -35,13 +35,13 @@ discard block |
||
35 | 35 | } |
36 | 36 | } |
37 | 37 | |
38 | - $modules_dir = $opt['rootpath'] . 'util2/cron/modules/'; |
|
38 | + $modules_dir = $opt['rootpath'].'util2/cron/modules/'; |
|
39 | 39 | $param = count($argv) > 1 ? $argv[1] : ''; |
40 | 40 | |
41 | 41 | if ($param != '' && substr($param, 0, 1) != '-' && !strstr('/', $param)) { |
42 | 42 | // run one job manually for debugging purpose |
43 | 43 | $ignore_interval = true; |
44 | - require $modules_dir . $argv[1] . '.class.php'; |
|
44 | + require $modules_dir.$argv[1].'.class.php'; |
|
45 | 45 | } else { |
46 | 46 | if (cronjobs_enabled()) { |
47 | 47 | $ignore_interval = false; |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | while (false !== ($file = readdir($hDir))) { |
50 | 50 | if (substr($file, -10) == '.class.php') { |
51 | 51 | if ($param == '--show') { |
52 | - echo 'running ' . $file . "\n"; |
|
52 | + echo 'running '.$file."\n"; |
|
53 | 53 | } |
54 | - require $modules_dir . $file; |
|
54 | + require $modules_dir.$file; |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | } |
@@ -51,9 +51,9 @@ |
||
51 | 51 | $picture = $instances[$n]['pic']; |
52 | 52 | echo |
53 | 53 | 'deleting duplicate picture ' |
54 | - . $picture->getPictureId() . ' ("' . $picture->getTitle() . '")' |
|
55 | - . ' from log ' . $rDuplicatePic['object_id'] |
|
56 | - . ' of cache ' . $instances[$n]['cache_id'] . "\n"; |
|
54 | + . $picture->getPictureId().' ("'.$picture->getTitle().'")' |
|
55 | + . ' from log '.$rDuplicatePic['object_id'] |
|
56 | + . ' of cache '.$instances[$n]['cache_id']."\n"; |
|
57 | 57 | $picture->delete(false); |
58 | 58 | $instances[$n]['filesize'] = false; |
59 | 59 | break; |
@@ -10,8 +10,8 @@ discard block |
||
10 | 10 | ***************************************************************************/ |
11 | 11 | |
12 | 12 | $opt['rootpath'] = '../../'; |
13 | -require_once $opt['rootpath'] . 'lib2/cli.inc.php'; |
|
14 | -require_once $opt['rootpath'] . 'lib2/search/search.inc.php'; |
|
13 | +require_once $opt['rootpath'].'lib2/cli.inc.php'; |
|
14 | +require_once $opt['rootpath'].'lib2/search/search.inc.php'; |
|
15 | 15 | |
16 | 16 | |
17 | 17 | $rsLocations = sql("SELECT `uni`, `lat`, `lon`, `rc`, `cc1`, `adm1` FROM `gns_locations` WHERE `dsg` LIKE 'PPL%'"); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | // den nächsgelegenen Ort in den geodb ermitteln |
25 | 25 | $sql = |
26 | - "SELECT " . |
|
26 | + "SELECT ". |
|
27 | 27 | geomath::getSqlDistanceFormula( |
28 | 28 | $rLocations['lon'], |
29 | 29 | $rLocations['lat'], |
@@ -32,12 +32,12 @@ discard block |
||
32 | 32 | 'lon', |
33 | 33 | 'lat', |
34 | 34 | 'geodb_coordinates' |
35 | - ) . " `distance`, |
|
35 | + )." `distance`, |
|
36 | 36 | `geodb_coordinates`.`loc_id` `loc_id` |
37 | 37 | FROM `geodb_coordinates` |
38 | 38 | WHERE |
39 | - `lon` > '" . sql_escape($minlon) . "' AND `lon` < '" . sql_escape($maxlon) . "' AND |
|
40 | - `lat` > '" . sql_escape($minlat) . "' AND `lat` < '" . sql_escape($maxlat) . "' |
|
39 | + `lon` > '" . sql_escape($minlon)."' AND `lon` < '".sql_escape($maxlon)."' AND |
|
40 | + `lat` > '" . sql_escape($minlat)."' AND `lat` < '".sql_escape($maxlat)."' |
|
41 | 41 | HAVING `distance` < 10 |
42 | 42 | ORDER BY `distance` ASC |
43 | 43 | LIMIT 1"; |
@@ -132,8 +132,8 @@ discard block |
||
132 | 132 | |
133 | 133 | */ |
134 | 134 | |
135 | -require __DIR__ . '/lib2/web.inc.php'; |
|
136 | -require_once __DIR__ . '/lib2/logic/labels.inc.php'; |
|
135 | +require __DIR__.'/lib2/web.inc.php'; |
|
136 | +require_once __DIR__.'/lib2/logic/labels.inc.php'; |
|
137 | 137 | |
138 | 138 | $tpl->name = 'restorecaches'; |
139 | 139 | $tpl->menuitem = MNU_ADMIN_RESTORE; |
@@ -308,12 +308,12 @@ discard block |
||
308 | 308 | |
309 | 309 | function get_archive_data($caches) |
310 | 310 | { |
311 | - $cachelist = "(" . implode(",", $caches) . ")"; |
|
311 | + $cachelist = "(".implode(",", $caches).")"; |
|
312 | 312 | $data = array(); |
313 | 313 | $admins = array(); |
314 | 314 | |
315 | 315 | // make waypoint index |
316 | - $rs = sql("SELECT `cache_id`, `wp_oc` FROM `caches` WHERE `cache_id` IN " . $cachelist); |
|
316 | + $rs = sql("SELECT `cache_id`, `wp_oc` FROM `caches` WHERE `cache_id` IN ".$cachelist); |
|
317 | 317 | while ($r = sql_fetch_assoc($rs)) { |
318 | 318 | $wp_oc[$r['cache_id']] = $r['wp_oc']; |
319 | 319 | } |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | `latitude`, |
329 | 329 | `restored_by` |
330 | 330 | FROM `cache_coordinates` |
331 | - WHERE `cache_id` IN " . $cachelist . " |
|
331 | + WHERE `cache_id` IN " . $cachelist." |
|
332 | 332 | ORDER BY `date_created` ASC" |
333 | 333 | ); |
334 | 334 | // order is relevant, because multiple changes per day possible |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | while ($r = sql_fetch_assoc($rs)) { |
337 | 337 | $coord = new coordinate($r['latitude'], $r['longitude']); |
338 | 338 | $coord = $coord->getDecimalMinutes(); |
339 | - $coord = $coord['lat'] . " " . $coord['lon']; |
|
339 | + $coord = $coord['lat']." ".$coord['lon']; |
|
340 | 340 | if (isset($lastcoord[$r['cache_id']]) && $coord != $lastcoord[$r['cache_id']]) { |
341 | 341 | // the database contains lots of old coord records with unchanged coords, wtf? |
342 | 342 | append_data($data, $admins, $wp_oc, $r, "coord", $lastcoord[$r['cache_id']], $coord); |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | // cache country |
349 | 349 | $rs = sql("SELECT `cache_id`, LEFT(`date_created`,10) AS `date_modified`, `country`, `restored_by` |
350 | 350 | FROM `cache_countries` |
351 | - WHERE `cache_id` IN " . $cachelist . " |
|
351 | + WHERE `cache_id` IN " . $cachelist." |
|
352 | 352 | ORDER BY `date_created` ASC"); |
353 | 353 | // order is relevant, because multiple changes per day possible |
354 | 354 | $lastcountry = array(); |
@@ -364,17 +364,17 @@ discard block |
||
364 | 364 | // all other cache data |
365 | 365 | // first the current data ... |
366 | 366 | $nextcd = array(); |
367 | - $rs = sql("SELECT * FROM `caches` WHERE `cache_id` IN " . $cachelist); |
|
367 | + $rs = sql("SELECT * FROM `caches` WHERE `cache_id` IN ".$cachelist); |
|
368 | 368 | while ($r = sql_fetch_assoc($rs)) { |
369 | 369 | $nextcd[$r['wp_oc']] = $r; |
370 | - $user_id = $r['user_id']; // is used later for logs |
|
370 | + $user_id = $r['user_id']; // is used later for logs |
|
371 | 371 | } |
372 | 372 | sql_free_result($rs); |
373 | 373 | |
374 | 374 | // .. and then the changes |
375 | 375 | $rs = sql( |
376 | 376 | "SELECT * FROM `caches_modified` |
377 | - WHERE `cache_id` IN " . $cachelist . " |
|
377 | + WHERE `cache_id` IN " . $cachelist." |
|
378 | 378 | ORDER BY `date_modified` DESC" |
379 | 379 | ); |
380 | 380 | while ($r = sql_fetch_assoc($rs)) { |
@@ -417,8 +417,8 @@ discard block |
||
417 | 417 | $wp_oc, |
418 | 418 | $r, |
419 | 419 | "time", |
420 | - $r['search_time'] . ' h', |
|
421 | - $nextcd[$wp]['search_time'] . ' h' |
|
420 | + $r['search_time'].' h', |
|
421 | + $nextcd[$wp]['search_time'].' h' |
|
422 | 422 | ); |
423 | 423 | } |
424 | 424 | if ($r['way_length'] != $nextcd[$wp]['way_length']) { |
@@ -428,8 +428,8 @@ discard block |
||
428 | 428 | $wp_oc, |
429 | 429 | $r, |
430 | 430 | "way", |
431 | - $r['way_length'] . ' km', |
|
432 | - $nextcd[$wp]['way_length'] . ' km' |
|
431 | + $r['way_length'].' km', |
|
432 | + $nextcd[$wp]['way_length'].' km' |
|
433 | 433 | ); |
434 | 434 | } |
435 | 435 | if ($r['wp_gc'] != $nextcd[$wp]['wp_gc']) { |
@@ -465,9 +465,9 @@ discard block |
||
465 | 465 | // attributes |
466 | 466 | $rs = sql( |
467 | 467 | "SELECT * FROM `caches_attributes_modified` |
468 | - WHERE `cache_id` IN " . $cachelist . " /* OConly attrib is shown, but not restorable */ |
|
468 | + WHERE `cache_id` IN " . $cachelist." /* OConly attrib is shown, but not restorable */ |
|
469 | 469 | ORDER BY `date_modified` ASC" |
470 | - ); // order doesn't matter as long it is date only |
|
470 | + ); // order doesn't matter as long it is date only |
|
471 | 471 | while ($r = sql_fetch_assoc($rs)) { |
472 | 472 | append_data( |
473 | 473 | $data, |
@@ -475,7 +475,7 @@ discard block |
||
475 | 475 | $wp_oc, |
476 | 476 | $r, |
477 | 477 | "attrib", |
478 | - ($r['was_set'] ? "-" : "+") . labels::getLabelValue('cache_attrib', $r['attrib_id']), |
|
478 | + ($r['was_set'] ? "-" : "+").labels::getLabelValue('cache_attrib', $r['attrib_id']), |
|
479 | 479 | '' |
480 | 480 | ); |
481 | 481 | } |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | LENGTH(`short_desc`) AS `sdl`, |
514 | 514 | `restored_by` |
515 | 515 | FROM `cache_desc_modified` |
516 | - WHERE `cache_id` IN " . $cachelist . " |
|
516 | + WHERE `cache_id` IN " . $cachelist." |
|
517 | 517 | ORDER BY `date_modified` DESC" |
518 | 518 | ); |
519 | 519 | // order doesn't matter as long only one change per day is recorded |
@@ -535,9 +535,9 @@ discard block |
||
535 | 535 | $admins, |
536 | 536 | $wp_oc, |
537 | 537 | $r, |
538 | - "desc(" . $r['language'] . ")", |
|
538 | + "desc(".$r['language'].")", |
|
539 | 539 | $r['dl'] + 0, |
540 | - ($next['dl'] + 0) . ' bytes' |
|
540 | + ($next['dl'] + 0).' bytes' |
|
541 | 541 | ); |
542 | 542 | } |
543 | 543 | if ($r['hl'] + 0 != $next['hl'] + 0) { |
@@ -546,9 +546,9 @@ discard block |
||
546 | 546 | $admins, |
547 | 547 | $wp_oc, |
548 | 548 | $r, |
549 | - "hint(" . $r['language'] . ")", |
|
549 | + "hint(".$r['language'].")", |
|
550 | 550 | $r['hl'] + 0, |
551 | - ($next['hl'] + 0) . ' bytes' |
|
551 | + ($next['hl'] + 0).' bytes' |
|
552 | 552 | ); |
553 | 553 | } |
554 | 554 | if ($r['sdl'] + 0 != $next['sdl'] + 0) { |
@@ -557,9 +557,9 @@ discard block |
||
557 | 557 | $admins, |
558 | 558 | $wp_oc, |
559 | 559 | $r, |
560 | - "shortdesc(" . $r['language'] . ")", |
|
560 | + "shortdesc(".$r['language'].")", |
|
561 | 561 | $r['sdl'] + 0, |
562 | - ($next['sdl'] + 0) . ' bytes' |
|
562 | + ($next['sdl'] + 0).' bytes' |
|
563 | 563 | ); |
564 | 564 | } |
565 | 565 | |
@@ -582,7 +582,7 @@ discard block |
||
582 | 582 | (SELECT 1 AS `op`, `deletion_date` AS `date_modified`, `cache_id`, |
583 | 583 | `user_id`, `type`, `date`, `restored_by` |
584 | 584 | FROM `cache_logs_archived` |
585 | - WHERE `cache_id` IN " . $cachelist . "AND `deleted_by`='&1' AND `user_id`<>'&1' |
|
585 | + WHERE `cache_id` IN " . $cachelist."AND `deleted_by`='&1' AND `user_id`<>'&1' |
|
586 | 586 | UNION |
587 | 587 | SELECT 2 AS `op`, `date_modified`, `cache_id`, |
588 | 588 | (SELECT `user_id` FROM `cache_logs_archived` WHERE `id`=`original_id`), |
@@ -590,7 +590,7 @@ discard block |
||
590 | 590 | (SELECT `date` FROM `cache_logs_archived` WHERE `id`=`original_id`), |
591 | 591 | `restored_by` |
592 | 592 | FROM `cache_logs_restored` |
593 | - WHERE `cache_id` IN " . $cachelist . ") `logs` |
|
593 | + WHERE `cache_id` IN " . $cachelist.") `logs` |
|
594 | 594 | INNER JOIN `user` ON `user`.`user_id`=`logs`.`user_id` |
595 | 595 | ORDER BY `logs`.`date_modified` ASC", |
596 | 596 | // order may not be exact when redoing reverts, because delete and insert |
@@ -604,7 +604,7 @@ discard block |
||
604 | 604 | $wp_oc, |
605 | 605 | $r, |
606 | 606 | $r["op"] == 1 ? "dellog" : "restorelog", |
607 | - "<a href='viewprofile.php?userid=" . $r['user_id'] . "' target='_blank'>" . $r['username'] . "</a>/" . $r['date'], |
|
607 | + "<a href='viewprofile.php?userid=".$r['user_id']."' target='_blank'>".$r['username']."</a>/".$r['date'], |
|
608 | 608 | '' |
609 | 609 | ); |
610 | 610 | } |
@@ -620,10 +620,10 @@ discard block |
||
620 | 620 | |
621 | 621 | $piccacheid = "IF(`object_type`=2, `object_id`, IF(`object_type`=1, IFNULL((SELECT `cache_id` FROM `cache_logs` WHERE `id`=`object_id`),(SELECT `cache_id` FROM `cache_logs_archived` WHERE `id`=`object_id`)), 0))"; |
622 | 622 | $rs = sql( |
623 | - "SELECT *, " . $piccacheid . "AS `cache_id` FROM `pictures_modified` |
|
624 | - WHERE " . $piccacheid . " IN " . $cachelist . " |
|
623 | + "SELECT *, ".$piccacheid."AS `cache_id` FROM `pictures_modified` |
|
624 | + WHERE " . $piccacheid." IN ".$cachelist." |
|
625 | 625 | ORDER BY `date_modified` ASC" |
626 | - ); // order is relevant for the case of restore-reverts |
|
626 | + ); // order is relevant for the case of restore-reverts |
|
627 | 627 | while ($r = sql_fetch_assoc($rs)) { |
628 | 628 | $r['date_modified'] = substr($r['date_modified'], 0, 10); |
629 | 629 | switch ($r['operation']) { |
@@ -645,14 +645,14 @@ discard block |
||
645 | 645 | $picchange .= "-cache"; |
646 | 646 | break; |
647 | 647 | } |
648 | - append_data($data, $admins, $wp_oc, $r, $picchange . "pic", $r['title'], ''); |
|
648 | + append_data($data, $admins, $wp_oc, $r, $picchange."pic", $r['title'], ''); |
|
649 | 649 | } |
650 | 650 | sql_free_result($rs); |
651 | 651 | |
652 | 652 | // admins |
653 | 653 | foreach ($admins as $adate => $adata) { |
654 | 654 | foreach ($adata as $awp => $alist) { |
655 | - $data[$adate][$awp] .= "<br /><strong class='adminrestore'>admins:</strong> " . implode(',', $alist); |
|
655 | + $data[$adate][$awp] .= "<br /><strong class='adminrestore'>admins:</strong> ".implode(',', $alist); |
|
656 | 656 | } |
657 | 657 | } |
658 | 658 | |
@@ -701,9 +701,9 @@ discard block |
||
701 | 701 | } else { |
702 | 702 | $text .= " class='userchange'"; |
703 | 703 | } |
704 | - $text .= ">$field</strong>: $oldvalue" . ($newvalue != "" ? " → $newvalue" : ""); |
|
704 | + $text .= ">$field</strong>: $oldvalue".($newvalue != "" ? " → $newvalue" : ""); |
|
705 | 705 | if (isset($data[$mdate][$wp])) { |
706 | - $data[$mdate][$wp] .= ", " . $text; |
|
706 | + $data[$mdate][$wp] .= ", ".$text; |
|
707 | 707 | } else { |
708 | 708 | $data[$mdate][$wp] = $text; |
709 | 709 | } |
@@ -716,8 +716,8 @@ discard block |
||
716 | 716 | $admins[$mdate][$wp] = []; |
717 | 717 | } |
718 | 718 | $admins[$mdate][$wp][$r['restored_by'] + 0] |
719 | - = "<a href='viewprofile.php?userid=" . $r['restored_by'] . "' target='_blank'>" . |
|
720 | - sql_value("SELECT `username` FROM `user` WHERE `user_id`='&1'", "", $r['restored_by']) . |
|
719 | + = "<a href='viewprofile.php?userid=".$r['restored_by']."' target='_blank'>". |
|
720 | + sql_value("SELECT `username` FROM `user` WHERE `user_id`='&1'", "", $r['restored_by']). |
|
721 | 721 | "</a>"; |
722 | 722 | } |
723 | 723 | } |
@@ -727,7 +727,7 @@ discard block |
||
727 | 727 | { |
728 | 728 | global $opt, $login; |
729 | 729 | |
730 | - sql("SET @restoredby='&1'", $login->userid); // is evaluated by trigger functions |
|
730 | + sql("SET @restoredby='&1'", $login->userid); // is evaluated by trigger functions |
|
731 | 731 | sql_slave("SET @restoredby='&1'", $login->userid); |
732 | 732 | |
733 | 733 | $restored = array(); |
@@ -837,12 +837,12 @@ discard block |
||
837 | 837 | if ($setfields != "") { |
838 | 838 | $setfields .= ","; |
839 | 839 | } |
840 | - $setfields .= "`$field`='" . sql_escape($r[$field]) . "'"; |
|
840 | + $setfields .= "`$field`='".sql_escape($r[$field])."'"; |
|
841 | 841 | $restored[$wp][$field] = true; |
842 | 842 | } |
843 | 843 | } |
844 | 844 | if ($setfields != "" && !$simulate) { |
845 | - sql("UPDATE `caches` SET " . $setfields . " WHERE `cache_id`='&1'", $cacheid); |
|
845 | + sql("UPDATE `caches` SET ".$setfields." WHERE `cache_id`='&1'", $cacheid); |
|
846 | 846 | } |
847 | 847 | } |
848 | 848 | sql_free_result($rs); |
@@ -1019,7 +1019,7 @@ discard block |
||
1019 | 1019 | // id, uuid, date_created and last_modified are set automatically; |
1020 | 1020 | // picture will be updated automatically on picture-restore |
1021 | 1021 | $log = new cachelog(); |
1022 | - $log->setNode($r['node']); // cachelog class currently does not initialize node field |
|
1022 | + $log->setNode($r['node']); // cachelog class currently does not initialize node field |
|
1023 | 1023 | $log->setCacheId($r['cache_id']); |
1024 | 1024 | $log->setUserId($r['user_id']); |
1025 | 1025 | $log->setType($r['type'], true); |
@@ -1071,7 +1071,7 @@ discard block |
||
1071 | 1071 | } // not already processed |
1072 | 1072 | |
1073 | 1073 | if ($error != "") { |
1074 | - $restored[$wp]['internal error - could not $error log ' + $r['id'] + "/" + $logid]; |
|
1074 | + $restored[$wp]['internal error - could not $error log ' +$r['id'] + "/" +$logid]; |
|
1075 | 1075 | } |
1076 | 1076 | if ($logs_restored) { |
1077 | 1077 | $restored[$wp]['logs'] = true; |
@@ -1203,7 +1203,7 @@ discard block |
||
1203 | 1203 | } // not already processed |
1204 | 1204 | |
1205 | 1205 | if ($error != "") { |
1206 | - $restored[$wp]['internal error - could not $error picture ' . $r['id'] + "/" + $picid] = true; |
|
1206 | + $restored[$wp]['internal error - could not $error picture '.$r['id'] + "/" +$picid] = true; |
|
1207 | 1207 | } |
1208 | 1208 | if ($pics_restored) { |
1209 | 1209 | $restored[$wp]['pictures'] = true; |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * Unicode Reminder メモ |
10 | 10 | ****************************************************************************/ |
11 | 11 | |
12 | -require_once $opt['rootpath'] . 'lib/bench.inc.php'; |
|
12 | +require_once $opt['rootpath'].'lib/bench.inc.php'; |
|
13 | 13 | |
14 | 14 | $sqldbg_cmdNo = 0; |
15 | 15 | $sqldbg_sumTimes = 0; |
@@ -155,9 +155,9 @@ discard block |
||
155 | 155 | global $sqldbg_cmdNo; |
156 | 156 | global $sqldbg_sumTimes; |
157 | 157 | |
158 | - $sqldbg_cmdNo ++; |
|
158 | + $sqldbg_cmdNo++; |
|
159 | 159 | |
160 | - echo '<p class="sqlno"><span class="white">/*</span> SQL command ' . $sqldbg_cmdNo . ' '; |
|
160 | + echo '<p class="sqlno"><span class="white">/*</span> SQL command '.$sqldbg_cmdNo.' '; |
|
161 | 161 | if ($bSlave) { |
162 | 162 | echo '<span class="slave_title">(slave)</span>'; |
163 | 163 | } |
@@ -224,19 +224,19 @@ discard block |
||
224 | 224 | $bFirstLine = true; |
225 | 225 | $nLine = 0; |
226 | 226 | $rs = mysql_query($sqlexplain, $dblink); |
227 | - echo '<div class="selrows">Number of selected rows: ' . mysql_num_rows($rs) . '</div>'; |
|
227 | + echo '<div class="selrows">Number of selected rows: '.mysql_num_rows($rs).'</div>'; |
|
228 | 228 | |
229 | 229 | echo '<table class="firstresultrow" border="1">'; |
230 | 230 | |
231 | 231 | while ($r = sql_fetch_assoc($rs)) { |
232 | 232 | $usebr = true; |
233 | - $nLine ++; |
|
233 | + $nLine++; |
|
234 | 234 | if ($bFirstLine == true) { |
235 | - echo '<tr>' . "\n"; |
|
235 | + echo '<tr>'."\n"; |
|
236 | 236 | foreach ($r as $field => $value) { |
237 | - echo '<th>' . htmlspecialchars($field, ENT_COMPAT, 'UTF-8') . '</th>' . "\n"; |
|
237 | + echo '<th>'.htmlspecialchars($field, ENT_COMPAT, 'UTF-8').'</th>'."\n"; |
|
238 | 238 | } |
239 | - echo '</tr>' . "\n"; |
|
239 | + echo '</tr>'."\n"; |
|
240 | 240 | } |
241 | 241 | |
242 | 242 | if ($bFirstLine) { |
@@ -246,9 +246,9 @@ discard block |
||
246 | 246 | } |
247 | 247 | |
248 | 248 | foreach ($r as $value) { |
249 | - echo '<td>' . htmlspecialchars(($value != null) ? $value : 'NULL', ENT_COMPAT, 'UTF-8') . '</td>'; |
|
249 | + echo '<td>'.htmlspecialchars(($value != null) ? $value : 'NULL', ENT_COMPAT, 'UTF-8').'</td>'; |
|
250 | 250 | } |
251 | - echo '</tr>' . "\n"; |
|
251 | + echo '</tr>'."\n"; |
|
252 | 252 | |
253 | 253 | if ($nLine == 25) { |
254 | 254 | break; |
@@ -261,27 +261,27 @@ discard block |
||
261 | 261 | echo '<table class="explain" border="1">'; |
262 | 262 | |
263 | 263 | $bFirstLine = true; |
264 | - $rs = mysql_query('EXPLAIN EXTENDED ' . $sqlexplain); |
|
264 | + $rs = mysql_query('EXPLAIN EXTENDED '.$sqlexplain); |
|
265 | 265 | while ($r = sql_fetch_assoc($rs)) { |
266 | 266 | if ($bFirstLine == true) { |
267 | 267 | echo '<tr>'; |
268 | 268 | foreach ($r as $field => $value) { |
269 | - echo '<th>' . htmlspecialchars($field, ENT_COMPAT, 'UTF-8') . '</th>'; |
|
269 | + echo '<th>'.htmlspecialchars($field, ENT_COMPAT, 'UTF-8').'</th>'; |
|
270 | 270 | } |
271 | - echo '</tr>' . "\n"; |
|
271 | + echo '</tr>'."\n"; |
|
272 | 272 | |
273 | 273 | $bFirstLine = false; |
274 | 274 | } |
275 | 275 | |
276 | 276 | echo '<tr>'; |
277 | 277 | foreach ($r as $value) { |
278 | - echo '<td>' . htmlspecialchars( |
|
278 | + echo '<td>'.htmlspecialchars( |
|
279 | 279 | ($value != null) ? mb_ereg_replace('\*/', '* /', $value) : 'NULL', |
280 | 280 | ENT_COMPAT, |
281 | 281 | 'UTF-8' |
282 | - ) . '</td>'; |
|
282 | + ).'</td>'; |
|
283 | 283 | } |
284 | - echo '</tr>' . "\n"; |
|
284 | + echo '</tr>'."\n"; |
|
285 | 285 | } |
286 | 286 | echo '</table>'; |
287 | 287 | $usebr = true; |
@@ -303,14 +303,14 @@ discard block |
||
303 | 303 | echo '<table>'; |
304 | 304 | $rs = mysql_query('SHOW WARNINGS', $dblink); |
305 | 305 | while ($r = sql_fetch_assoc($rs)) { |
306 | - echo '<tr><td>' . htmlspecialchars($r['Message'], ENT_COMPAT, 'UTF-8') . '</td></tr>'; |
|
306 | + echo '<tr><td>'.htmlspecialchars($r['Message'], ENT_COMPAT, 'UTF-8').'</td></tr>'; |
|
307 | 307 | } |
308 | 308 | echo '</table>'; |
309 | 309 | echo '</div>'; |
310 | 310 | } |
311 | 311 | |
312 | - echo '<div class="runtime">Runtime: ' . sprintf('%01.5f', $bSqlExecution->Diff()) . ' sek.</div>'; |
|
313 | - echo '<div class="affectedrows">Number of affected rows: ' . mysql_affected_rows($dblink) . '</div>'; |
|
312 | + echo '<div class="runtime">Runtime: '.sprintf('%01.5f', $bSqlExecution->Diff()).' sek.</div>'; |
|
313 | + echo '<div class="affectedrows">Number of affected rows: '.mysql_affected_rows($dblink).'</div>'; |
|
314 | 314 | |
315 | 315 | echo '<div class="white">*/</div></div>'; |
316 | 316 | |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | global $sqldbg_sumTimes; |
323 | 323 | |
324 | 324 | echo '<span class="white">/*</span><div class="allruntime"><hr>'; |
325 | - echo 'Runtime sum: ' . sprintf('%01.5f', $sqldbg_sumTimes) . ' sek.<span class="white">*/</span></div>'; |
|
325 | + echo 'Runtime sum: '.sprintf('%01.5f', $sqldbg_sumTimes).' sek.<span class="white">*/</span></div>'; |
|
326 | 326 | |
327 | 327 | echo '</body></html>'; |
328 | 328 | exit; |
@@ -347,13 +347,13 @@ discard block |
||
347 | 347 | return ''; |
348 | 348 | } |
349 | 349 | |
350 | - return 'SELECT * ' . mb_substr($sql, $start); |
|
350 | + return 'SELECT * '.mb_substr($sql, $start); |
|
351 | 351 | } |
352 | 352 | |
353 | 353 | function sqldbg_insert_nocache($sql) |
354 | 354 | { |
355 | 355 | if (mb_strtoupper(mb_substr($sql, 0, 7)) == 'SELECT ') { |
356 | - $sql = 'SELECT SQL_NO_CACHE ' . mb_substr($sql, 7); |
|
356 | + $sql = 'SELECT SQL_NO_CACHE '.mb_substr($sql, 7); |
|
357 | 357 | } |
358 | 358 | |
359 | 359 | return $sql; |
@@ -9,10 +9,10 @@ discard block |
||
9 | 9 | * Unicode Reminder メモ |
10 | 10 | ***************************************************************************/ |
11 | 11 | |
12 | -require_once __DIR__ . '/lib/consts.inc.php'; |
|
12 | +require_once __DIR__.'/lib/consts.inc.php'; |
|
13 | 13 | $opt['gui'] = GUI_HTML; |
14 | -require_once __DIR__ . '/lib/common.inc.php'; |
|
15 | -require_once __DIR__ . '/lib2/edithelper.inc.php'; |
|
14 | +require_once __DIR__.'/lib/common.inc.php'; |
|
15 | +require_once __DIR__.'/lib2/edithelper.inc.php'; |
|
16 | 16 | |
17 | 17 | $no_tpl_build = false; |
18 | 18 | |
@@ -33,10 +33,10 @@ discard block |
||
33 | 33 | |
34 | 34 | //set here the template to process |
35 | 35 | $tplname = 'newcache'; |
36 | - require_once $stylepath . '/' . $tplname . '.inc.php'; |
|
36 | + require_once $stylepath.'/'.$tplname.'.inc.php'; |
|
37 | 37 | |
38 | 38 | //set template replacements |
39 | - tpl_set_var('reset', $reset); // obsolete |
|
39 | + tpl_set_var('reset', $reset); // obsolete |
|
40 | 40 | tpl_set_var('submit', $submit); |
41 | 41 | tpl_set_var('general_message', ''); |
42 | 42 | tpl_set_var('hidden_since_message', ''); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | tpl_set_var('diff_message', ''); |
54 | 54 | tpl_set_var('safari_message', ''); |
55 | 55 | |
56 | - $sel_type = isset($_POST['type']) ? $_POST['type'] : 0; // Ocprop |
|
56 | + $sel_type = isset($_POST['type']) ? $_POST['type'] : 0; // Ocprop |
|
57 | 57 | if (!isset($_POST['size'])) { |
58 | 58 | if ($sel_type == 4 || $sel_type == 5) { |
59 | 59 | $sel_size = 7; |
@@ -61,15 +61,15 @@ discard block |
||
61 | 61 | $sel_size = - 1; |
62 | 62 | } |
63 | 63 | } else { |
64 | - $sel_size = isset($_POST['size']) ? $_POST['size'] : - 1; // Ocprop |
|
64 | + $sel_size = isset($_POST['size']) ? $_POST['size'] : - 1; // Ocprop |
|
65 | 65 | } |
66 | 66 | $sel_lang = isset($_POST['desc_lang']) ? $_POST['desc_lang'] : $default_lang; |
67 | - $sel_country = isset($_POST['country']) ? $_POST['country'] : getUserCountry(); // Ocprop |
|
67 | + $sel_country = isset($_POST['country']) ? $_POST['country'] : getUserCountry(); // Ocprop |
|
68 | 68 | $show_all_countries = isset($_POST['show_all_countries']) ? $_POST['show_all_countries'] : 0; |
69 | 69 | $show_all_langs = isset($_POST['show_all_langs']) ? $_POST['show_all_langs'] : 0; |
70 | 70 | |
71 | 71 | //coords |
72 | - $lonEW = isset($_POST['lonEW']) ? $_POST['lonEW'] : $default_EW; // Ocprop |
|
72 | + $lonEW = isset($_POST['lonEW']) ? $_POST['lonEW'] : $default_EW; // Ocprop |
|
73 | 73 | if ($lonEW == 'E') { |
74 | 74 | tpl_set_var('lonEsel', ' selected="selected"'); |
75 | 75 | tpl_set_var('lonWsel', ''); |
@@ -77,13 +77,13 @@ discard block |
||
77 | 77 | tpl_set_var('lonEsel', ''); |
78 | 78 | tpl_set_var('lonWsel', ' selected="selected"'); |
79 | 79 | } |
80 | - $lon_h = isset($_POST['lon_h']) ? $_POST['lon_h'] : '0'; // Ocprop |
|
80 | + $lon_h = isset($_POST['lon_h']) ? $_POST['lon_h'] : '0'; // Ocprop |
|
81 | 81 | tpl_set_var('lon_h', htmlspecialchars($lon_h, ENT_COMPAT, 'UTF-8')); |
82 | 82 | |
83 | - $lon_min = isset($_POST['lon_min']) ? $_POST['lon_min'] : '00.000'; // Ocprop |
|
83 | + $lon_min = isset($_POST['lon_min']) ? $_POST['lon_min'] : '00.000'; // Ocprop |
|
84 | 84 | tpl_set_var('lon_min', htmlspecialchars($lon_min, ENT_COMPAT, 'UTF-8')); |
85 | 85 | |
86 | - $latNS = isset($_POST['latNS']) ? $_POST['latNS'] : $default_NS; // Ocprop |
|
86 | + $latNS = isset($_POST['latNS']) ? $_POST['latNS'] : $default_NS; // Ocprop |
|
87 | 87 | if ($latNS == 'N') { |
88 | 88 | tpl_set_var('latNsel', ' selected="selected"'); |
89 | 89 | tpl_set_var('latSsel', ''); |
@@ -91,14 +91,14 @@ discard block |
||
91 | 91 | tpl_set_var('latNsel', ''); |
92 | 92 | tpl_set_var('latSsel', ' selected="selected"'); |
93 | 93 | } |
94 | - $lat_h = isset($_POST['lat_h']) ? $_POST['lat_h'] : '0'; // Ocprop |
|
94 | + $lat_h = isset($_POST['lat_h']) ? $_POST['lat_h'] : '0'; // Ocprop |
|
95 | 95 | tpl_set_var('lat_h', htmlspecialchars($lat_h, ENT_COMPAT, 'UTF-8')); |
96 | 96 | |
97 | - $lat_min = isset($_POST['lat_min']) ? $_POST['lat_min'] : '00.000'; // Ocprop |
|
97 | + $lat_min = isset($_POST['lat_min']) ? $_POST['lat_min'] : '00.000'; // Ocprop |
|
98 | 98 | tpl_set_var('lat_min', htmlspecialchars($lat_min, ENT_COMPAT, 'UTF-8')); |
99 | 99 | |
100 | 100 | //name |
101 | - $name = isset($_POST['name']) ? trim($_POST['name']) : ''; // Ocprop |
|
101 | + $name = isset($_POST['name']) ? trim($_POST['name']) : ''; // Ocprop |
|
102 | 102 | tpl_set_var('name', htmlspecialchars($name, ENT_COMPAT, 'UTF-8')); |
103 | 103 | |
104 | 104 | //shortdesc |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $oldDescMode = $descMode; |
121 | 121 | } |
122 | 122 | } else { |
123 | - if (sqlValue("SELECT `no_htmledit_flag` FROM `user` WHERE `user_id`='" . sql_escape($usr['userid']) . "'", 1) == 1) { |
|
123 | + if (sqlValue("SELECT `no_htmledit_flag` FROM `user` WHERE `user_id`='".sql_escape($usr['userid'])."'", 1) == 1) { |
|
124 | 124 | $descMode = 1; |
125 | 125 | } else { |
126 | 126 | $descMode = 3; |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | |
131 | 131 | // fuer alte Versionen von OCProp |
132 | 132 | if (isset($_POST['submit']) && !isset($_POST['version2'])) { |
133 | - $descMode = (isset($_POST['desc_html']) && ($_POST['desc_html'] == 1)) ? 2 : 1; // Ocprop |
|
133 | + $descMode = (isset($_POST['desc_html']) && ($_POST['desc_html'] == 1)) ? 2 : 1; // Ocprop |
|
134 | 134 | $_POST['submitform'] = $_POST['submit']; |
135 | 135 | |
136 | 136 | $short_desc = iconv("ISO-8859-1", "UTF-8", $short_desc); |
@@ -152,13 +152,13 @@ discard block |
||
152 | 152 | |
153 | 153 | tpl_set_var('desc', htmlspecialchars($desc, ENT_COMPAT, 'UTF-8')); |
154 | 154 | |
155 | - $headers = tpl_get_var('htmlheaders') . "\n"; |
|
155 | + $headers = tpl_get_var('htmlheaders')."\n"; |
|
156 | 156 | if ($descMode == 3) { |
157 | 157 | // TinyMCE |
158 | - $headers .= '<script language="javascript" type="text/javascript" src="resource2/tinymce/tiny_mce_gzip.js"></script>' . "\n"; |
|
159 | - $headers .= '<script language="javascript" type="text/javascript" src="resource2/tinymce/config/desc.js.php?cacheid=0&lang=' . strtolower($locale) . '"></script>' . "\n"; |
|
158 | + $headers .= '<script language="javascript" type="text/javascript" src="resource2/tinymce/tiny_mce_gzip.js"></script>'."\n"; |
|
159 | + $headers .= '<script language="javascript" type="text/javascript" src="resource2/tinymce/config/desc.js.php?cacheid=0&lang='.strtolower($locale).'"></script>'."\n"; |
|
160 | 160 | } |
161 | - $headers .= '<script language="javascript" type="text/javascript" src="' . editorJsPath() . '"></script>' . "\n"; |
|
161 | + $headers .= '<script language="javascript" type="text/javascript" src="'.editorJsPath().'"></script>'."\n"; |
|
162 | 162 | tpl_set_var('htmlheaders', $headers); |
163 | 163 | |
164 | 164 | //effort |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | $st_hours = floor($search_time); |
183 | 183 | $st_minutes = sprintf('%02.0F', ($search_time - $st_hours) * 60); |
184 | 184 | |
185 | - tpl_set_var('search_time', $st_hours . ':' . $st_minutes); |
|
185 | + tpl_set_var('search_time', $st_hours.':'.$st_minutes); |
|
186 | 186 | tpl_set_var('way_length', $way_length); |
187 | 187 | |
188 | 188 | |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | } |
197 | 197 | |
198 | 198 | //tos |
199 | - $tos = isset($_POST['TOS']) ? 1 : 0; // Ocprop |
|
199 | + $tos = isset($_POST['TOS']) ? 1 : 0; // Ocprop |
|
200 | 200 | if ($tos == 1) { |
201 | 201 | tpl_set_var('toschecked', ' checked="checked"'); |
202 | 202 | } else { |
@@ -204,9 +204,9 @@ discard block |
||
204 | 204 | } |
205 | 205 | |
206 | 206 | //hidden_since |
207 | - $hidden_day = isset($_POST['hidden_day']) ? $_POST['hidden_day'] : date('d'); // Ocprop |
|
208 | - $hidden_month = isset($_POST['hidden_month']) ? $_POST['hidden_month'] : date('m'); // Ocprop |
|
209 | - $hidden_year = isset($_POST['hidden_year']) ? $_POST['hidden_year'] : date('Y'); // Ocprop |
|
207 | + $hidden_day = isset($_POST['hidden_day']) ? $_POST['hidden_day'] : date('d'); // Ocprop |
|
208 | + $hidden_month = isset($_POST['hidden_month']) ? $_POST['hidden_month'] : date('m'); // Ocprop |
|
209 | + $hidden_year = isset($_POST['hidden_year']) ? $_POST['hidden_year'] : date('Y'); // Ocprop |
|
210 | 210 | tpl_set_var('hidden_day', htmlspecialchars($hidden_day, ENT_COMPAT, 'UTF-8')); |
211 | 211 | tpl_set_var('hidden_month', htmlspecialchars($hidden_month, ENT_COMPAT, 'UTF-8')); |
212 | 212 | tpl_set_var('hidden_year', htmlspecialchars($hidden_year, ENT_COMPAT, 'UTF-8')); |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | tpl_set_var('publish_later_checked', ''); |
224 | 224 | tpl_set_var('publish_notnow_checked', ''); |
225 | 225 | |
226 | - $publish = isset($_POST['publish']) ? $_POST['publish'] : 'now2'; // Ocprop |
|
226 | + $publish = isset($_POST['publish']) ? $_POST['publish'] : 'now2'; // Ocprop |
|
227 | 227 | if ($publish == 'now2') { |
228 | 228 | tpl_set_var('publish_now_checked', 'checked'); |
229 | 229 | } elseif ($publish == 'later') { |
@@ -237,11 +237,11 @@ discard block |
||
237 | 237 | // fill activate hours |
238 | 238 | $activate_hour = isset($_POST['activate_hour']) ? $_POST['activate_hour'] + 0 : date('H') + 0; |
239 | 239 | $activation_hours = ''; |
240 | - for ($i = 0; $i <= 23; $i ++) { |
|
240 | + for ($i = 0; $i <= 23; $i++) { |
|
241 | 241 | if ($activate_hour == $i) { |
242 | - $activation_hours .= '<option value="' . $i . '" selected="selected">' . $i . '</option>'; |
|
242 | + $activation_hours .= '<option value="'.$i.'" selected="selected">'.$i.'</option>'; |
|
243 | 243 | } else { |
244 | - $activation_hours .= '<option value="' . $i . '">' . $i . '</option>'; |
|
244 | + $activation_hours .= '<option value="'.$i.'">'.$i.'</option>'; |
|
245 | 245 | } |
246 | 246 | $activation_hours .= "\n"; |
247 | 247 | } |
@@ -253,30 +253,30 @@ discard block |
||
253 | 253 | |
254 | 254 | // gc- and nc-waypoints |
255 | 255 | // fix #4356: gc waypoints are frequently copy&pasted with leading spaces |
256 | - $wp_gc = isset($_POST['wp_gc']) ? strtoupper(trim($_POST['wp_gc'])) : ''; // Ocprop |
|
256 | + $wp_gc = isset($_POST['wp_gc']) ? strtoupper(trim($_POST['wp_gc'])) : ''; // Ocprop |
|
257 | 257 | tpl_set_var('wp_gc', htmlspecialchars($wp_gc, ENT_COMPAT, 'UTF-8')); |
258 | 258 | |
259 | 259 | //difficulty |
260 | - $difficulty = isset($_POST['difficulty']) ? $_POST['difficulty'] : 1; // Ocprop |
|
261 | - $difficulty_options = '<option value="1">' . $sel_message . '</option>'; |
|
262 | - for ($i = 2; $i <= 10; $i ++) { |
|
260 | + $difficulty = isset($_POST['difficulty']) ? $_POST['difficulty'] : 1; // Ocprop |
|
261 | + $difficulty_options = '<option value="1">'.$sel_message.'</option>'; |
|
262 | + for ($i = 2; $i <= 10; $i++) { |
|
263 | 263 | if ($difficulty == $i) { |
264 | - $difficulty_options .= '<option value="' . $i . '" selected="selected">' . $i / 2 . '</option>'; |
|
264 | + $difficulty_options .= '<option value="'.$i.'" selected="selected">'.$i / 2.'</option>'; |
|
265 | 265 | } else { |
266 | - $difficulty_options .= '<option value="' . $i . '">' . $i / 2 . '</option>'; |
|
266 | + $difficulty_options .= '<option value="'.$i.'">'.$i / 2.'</option>'; |
|
267 | 267 | } |
268 | 268 | $difficulty_options .= "\n"; |
269 | 269 | } |
270 | 270 | tpl_set_var('difficulty_options', $difficulty_options); |
271 | 271 | |
272 | 272 | //terrain |
273 | - $terrain = isset($_POST['terrain']) ? $_POST['terrain'] : 1; // Ocprop |
|
274 | - $terrain_options = '<option value="1">' . $sel_message . '</option>'; |
|
275 | - for ($i = 2; $i <= 10; $i ++) { |
|
273 | + $terrain = isset($_POST['terrain']) ? $_POST['terrain'] : 1; // Ocprop |
|
274 | + $terrain_options = '<option value="1">'.$sel_message.'</option>'; |
|
275 | + for ($i = 2; $i <= 10; $i++) { |
|
276 | 276 | if ($terrain == $i) { |
277 | - $terrain_options .= '<option value="' . $i . '" selected="selected">' . $i / 2 . '</option>'; |
|
277 | + $terrain_options .= '<option value="'.$i.'" selected="selected">'.$i / 2.'</option>'; |
|
278 | 278 | } else { |
279 | - $terrain_options .= '<option value="' . $i . '">' . $i / 2 . '</option>'; |
|
279 | + $terrain_options .= '<option value="'.$i.'">'.$i / 2.'</option>'; |
|
280 | 280 | } |
281 | 281 | $terrain_options .= "\n"; |
282 | 282 | } |
@@ -284,34 +284,34 @@ discard block |
||
284 | 284 | |
285 | 285 | //sizeoptions |
286 | 286 | $sSelected = ($sel_size == - 1) ? ' selected="selected"' : ''; |
287 | - $sizes = '<option value="-1"' . $sSelected . '>' . htmlspecialchars(t('Please select!'), ENT_COMPAT, 'UTF-8') . '</option>'; |
|
287 | + $sizes = '<option value="-1"'.$sSelected.'>'.htmlspecialchars(t('Please select!'), ENT_COMPAT, 'UTF-8').'</option>'; |
|
288 | 288 | $rsSizes = sql( |
289 | 289 | "SELECT `cache_size`.`id`, IFNULL(`sys_trans_text`.`text`, `cache_size`.`name`) AS `name` |
290 | 290 | FROM `cache_size` |
291 | 291 | LEFT JOIN `sys_trans` ON `cache_size`.`trans_id`=`sys_trans`.`id` |
292 | 292 | LEFT JOIN `sys_trans_text` ON `sys_trans`.`id`=`sys_trans_text`.`trans_id` AND |
293 | - `sys_trans_text`.`lang`='" . sql_escape($locale) . "' |
|
293 | + `sys_trans_text`.`lang`='" . sql_escape($locale)."' |
|
294 | 294 | ORDER BY `cache_size`.`ordinal` ASC" |
295 | 295 | ); |
296 | 296 | while ($rSize = sql_fetch_assoc($rsSizes)) { |
297 | 297 | $sSelected = ($rSize['id'] == $sel_size) ? ' selected="selected"' : ''; |
298 | - $sizes .= '<option value="' . $rSize['id'] . '"' . $sSelected . '>' . htmlspecialchars($rSize['name'], ENT_COMPAT, 'UTF-8') . '</option>'; |
|
298 | + $sizes .= '<option value="'.$rSize['id'].'"'.$sSelected.'>'.htmlspecialchars($rSize['name'], ENT_COMPAT, 'UTF-8').'</option>'; |
|
299 | 299 | } |
300 | 300 | sql_free_result($rsSizes); |
301 | 301 | tpl_set_var('sizeoptions', $sizes); |
302 | 302 | |
303 | 303 | //typeoptions |
304 | 304 | $sSelected = ($sel_type == - 1) ? ' selected="selected"' : ''; |
305 | - $types = '<option value="-1"' . $sSelected . '>' . htmlspecialchars(t('Please select!'), ENT_COMPAT, 'UTF-8') . '</option>'; |
|
305 | + $types = '<option value="-1"'.$sSelected.'>'.htmlspecialchars(t('Please select!'), ENT_COMPAT, 'UTF-8').'</option>'; |
|
306 | 306 | $rsTypes = sql("SELECT `cache_type`.`id`, IFNULL(`sys_trans_text`.`text`, `cache_type`.`en`) AS `name` |
307 | 307 | FROM `cache_type` |
308 | 308 | LEFT JOIN `sys_trans` ON `cache_type`.`trans_id`=`sys_trans`.`id` |
309 | 309 | LEFT JOIN `sys_trans_text` ON `sys_trans`.`id`=`sys_trans_text`.`trans_id` AND |
310 | - `sys_trans_text`.`lang`='" . sql_escape($locale) . "' |
|
310 | + `sys_trans_text`.`lang`='" . sql_escape($locale)."' |
|
311 | 311 | ORDER BY `cache_type`.`ordinal` ASC"); |
312 | 312 | while ($rType = sql_fetch_assoc($rsTypes)) { |
313 | 313 | $sSelected = ($rType['id'] == $sel_type) ? ' selected="selected"' : ''; |
314 | - $types .= '<option value="' . $rType['id'] . '"' . $sSelected . '>' . htmlspecialchars($rType['name'], ENT_COMPAT, 'UTF-8') . '</option>'; |
|
314 | + $types .= '<option value="'.$rType['id'].'"'.$sSelected.'>'.htmlspecialchars($rType['name'], ENT_COMPAT, 'UTF-8').'</option>'; |
|
315 | 315 | } |
316 | 316 | sql_free_result($rsTypes); |
317 | 317 | tpl_set_var('typeoptions', $types); |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | tpl_set_var('show_all_langs', '0'); |
343 | 343 | tpl_set_var( |
344 | 344 | 'show_all_langs_submit', |
345 | - '<input type="submit" name="show_all_langs_submit" value="' . $show_all . '"/>' |
|
345 | + '<input type="submit" name="show_all_langs_submit" value="'.$show_all.'"/>' |
|
346 | 346 | ); |
347 | 347 | |
348 | 348 | $rs = sql( |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | |
377 | 377 | while ($record = sql_fetch_assoc($rs)) { |
378 | 378 | $sSelected = ($record['short'] == $sel_lang) ? ' selected="selected"' : ''; |
379 | - $langsoptions .= '<option value="' . htmlspecialchars($record['short'], ENT_COMPAT, 'UTF-8') . '"' . $sSelected . '>' . htmlspecialchars($record['name'], ENT_COMPAT, 'UTF-8') . '</option>' . "\n"; |
|
379 | + $langsoptions .= '<option value="'.htmlspecialchars($record['short'], ENT_COMPAT, 'UTF-8').'"'.$sSelected.'>'.htmlspecialchars($record['name'], ENT_COMPAT, 'UTF-8').'</option>'."\n"; |
|
380 | 380 | } |
381 | 381 | |
382 | 382 | tpl_set_var('langoptions', $langsoptions); |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | |
400 | 400 | if ($show_all_countries == 0) { |
401 | 401 | tpl_set_var('show_all_countries', '0'); |
402 | - tpl_set_var('show_all_countries_submit', '<input type="submit" id="showallcountries" class="formbutton" name="show_all_countries_submit" value="' . $show_all . '" onclick="submitbutton(\'showallcountries\')" />'); |
|
402 | + tpl_set_var('show_all_countries_submit', '<input type="submit" id="showallcountries" class="formbutton" name="show_all_countries_submit" value="'.$show_all.'" onclick="submitbutton(\'showallcountries\')" />'); |
|
403 | 403 | |
404 | 404 | $rs = sql( |
405 | 405 | "SELECT `countries`.`short`, IFNULL(`sys_trans_text`.`text`, `countries`.`name`) AS `name` |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | // build the "country" dropdown list, preselect $sel_country |
435 | 435 | while ($record = sql_fetch_array($rs)) { |
436 | 436 | $sSelected = ($record['short'] == $sel_country) ? ' selected="selected"' : ''; |
437 | - $countriesoptions .= '<option value="' . htmlspecialchars($record['short'], ENT_COMPAT, 'UTF-8') . '"' . $sSelected . '>' . htmlspecialchars($record['name'], ENT_COMPAT, 'UTF-8') . '</option>' . "\n"; |
|
437 | + $countriesoptions .= '<option value="'.htmlspecialchars($record['short'], ENT_COMPAT, 'UTF-8').'"'.$sSelected.'>'.htmlspecialchars($record['name'], ENT_COMPAT, 'UTF-8').'</option>'."\n"; |
|
438 | 438 | } |
439 | 439 | sql_free_result($rs); |
440 | 440 | |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | LEFT JOIN `sys_trans_text` AS `ttdesc` |
489 | 489 | ON `tdesc`.`id`=`ttdesc`.`trans_id` |
490 | 490 | AND `ttdesc`.`lang`='&1' |
491 | - WHERE `cache_attrib`.`group_id`=" . ($rAttrGroup['id'] + 0) . " |
|
491 | + WHERE `cache_attrib`.`group_id`=" . ($rAttrGroup['id'] + 0)." |
|
492 | 492 | AND NOT IFNULL(`cache_attrib`.`hidden`, 0)=1 |
493 | 493 | AND `cache_attrib`.`selectable`!=0 |
494 | 494 | ORDER BY `cache_attrib`.`group_id`, `cache_attrib`.`id`", |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | $line = mb_ereg_replace('{name}', escape_javascript($record['name']), $line); |
509 | 509 | $line = mb_ereg_replace('{color}', $rAttrGroup['color'], $line); |
510 | 510 | $group_line .= $line; |
511 | - $nLineAttrCount ++; |
|
511 | + $nLineAttrCount++; |
|
512 | 512 | |
513 | 513 | $line = $cache_attrib_js; |
514 | 514 | $line = mb_ereg_replace('{id}', $record['id'], $line); |
@@ -673,8 +673,8 @@ discard block |
||
673 | 673 | "SELECT MIN(wp_oc) |
674 | 674 | FROM `caches` |
675 | 675 | WHERE `status`=1 |
676 | - AND ROUND(`longitude`,6)=ROUND('" . sql_escape($longitude) . "',6) |
|
677 | - AND ROUND(`latitude`,6)=ROUND('" . sql_escape($latitude) . "',6)", |
|
676 | + AND ROUND(`longitude`,6)=ROUND('" . sql_escape($longitude)."',6) |
|
677 | + AND ROUND(`latitude`,6)=ROUND('" . sql_escape($latitude)."',6)", |
|
678 | 678 | null |
679 | 679 | ); |
680 | 680 | if ($duplicate_wpoc) { |
@@ -813,7 +813,7 @@ discard block |
||
813 | 813 | } elseif ($publish == 'later') { |
814 | 814 | $sel_status = 5; |
815 | 815 | $activation_date = |
816 | - "'" . date( |
|
816 | + "'".date( |
|
817 | 817 | 'Y-m-d H:i:s', |
818 | 818 | mktime( |
819 | 819 | $activate_hour, |
@@ -823,7 +823,7 @@ discard block |
||
823 | 823 | $activate_day, |
824 | 824 | $activate_year |
825 | 825 | ) |
826 | - ) . "'"; |
|
826 | + )."'"; |
|
827 | 827 | } elseif ($publish == 'notnow') { |
828 | 828 | $sel_status = 5; |
829 | 829 | $activation_date = 'NULL'; |
@@ -903,7 +903,7 @@ discard block |
||
903 | 903 | ); |
904 | 904 | |
905 | 905 | // insert cache-attributes |
906 | - for ($i = 0; $i < count($cache_attribs); $i ++) { |
|
906 | + for ($i = 0; $i < count($cache_attribs); $i++) { |
|
907 | 907 | if (($cache_attribs[$i] + 0) > 0) { |
908 | 908 | sql( |
909 | 909 | "INSERT INTO `caches_attributes` (`cache_id`, `attrib_id`) VALUES ('&1', '&2')", |
@@ -916,14 +916,14 @@ discard block |
||
916 | 916 | // only if cache is published NOW or activate_date is in the past |
917 | 917 | if ($publish == 'now2' || ($publish == 'later' && mktime($activate_hour, 0, 0, $activate_month, $activate_day, $activate_year) <= $today)) { |
918 | 918 | //do event handling |
919 | - include_once(__DIR__ . '/lib/eventhandler.inc.php'); |
|
919 | + include_once(__DIR__.'/lib/eventhandler.inc.php'); |
|
920 | 920 | |
921 | 921 | event_notify_new_cache($cache_id + 0); |
922 | 922 | event_new_cache($usr['userid'] + 0); |
923 | 923 | } |
924 | 924 | |
925 | 925 | // redirection |
926 | - tpl_redirect('viewcache.php?cacheid=' . urlencode($cache_id)); |
|
926 | + tpl_redirect('viewcache.php?cacheid='.urlencode($cache_id)); |
|
927 | 927 | } else { |
928 | 928 | tpl_set_var('general_message', $error_general); |
929 | 929 | } |