@@ -5,9 +5,9 @@ |
||
5 | 5 | $maildomain = 'opencaching.de'; |
6 | 6 | } |
7 | 7 | |
8 | -$mailfrom = 'noreply@' . $maildomain; |
|
8 | +$mailfrom = 'noreply@'.$maildomain; |
|
9 | 9 | |
10 | 10 | $debug = false; |
11 | 11 | $debug_mailto = '[email protected]'; |
12 | 12 | |
13 | -$watchpid = $rootpath . 'cache/watch.pid'; |
|
13 | +$watchpid = $rootpath.'cache/watch.pid'; |
@@ -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 | } |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | if ($mailadr != '') { |
209 | 209 | if (is_existent_maildomain(getToMailDomain($mailadr))) { |
210 | 210 | $language = $rUser['language'] ? $rUser['language'] : $opt['template']['default']['locale']; |
211 | - $mailsubject = '[' . $maildomain . '] ' . $translate->t( |
|
211 | + $mailsubject = '['.$maildomain.'] '.$translate->t( |
|
212 | 212 | 'Your watchlist of', |
213 | 213 | '', |
214 | 214 | basename(__FILE__), |
@@ -216,11 +216,11 @@ discard block |
||
216 | 216 | '', |
217 | 217 | 1, |
218 | 218 | $language |
219 | - ) . ' ' . date($opt['locale'][$language]['format']['phpdate']); |
|
219 | + ).' '.date($opt['locale'][$language]['format']['phpdate']); |
|
220 | 220 | mb_send_mail($mailadr, $mailsubject, $mailbody, $email_headers); |
221 | 221 | |
222 | 222 | // logentry($module, $eventid, $userid, $objectid1, $objectid2, $logtext, $details) |
223 | - logentry('watchlist', 2, $rUser['user_id'], 0, 0, 'Sending mail to ' . $mailadr, []); |
|
223 | + logentry('watchlist', 2, $rUser['user_id'], 0, 0, 'Sending mail to '.$mailadr, []); |
|
224 | 224 | } |
225 | 225 | } |
226 | 226 | |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | |
320 | 320 | $logtext = html2plaintext($rLog['text'], $rLog['text_html'] == 0, EMAIL_LINEWRAP); |
321 | 321 | |
322 | - $language = sqlValue("SELECT `language` FROM `user` WHERE `user_id`='" . sql_escape($user_id) . "'", null); |
|
322 | + $language = sqlValue("SELECT `language` FROM `user` WHERE `user_id`='".sql_escape($user_id)."'", null); |
|
323 | 323 | if (!$language) { |
324 | 324 | $language = $opt['template']['default']['locale']; |
325 | 325 | } |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | $dateformat = $opt['locale'][$language]['format']['phpdatetime']; |
330 | 330 | } |
331 | 331 | |
332 | - $watchtext = '{date} ' . $translate->t( |
|
332 | + $watchtext = '{date} '.$translate->t( |
|
333 | 333 | '{user} has logged your cache "{cachename}":', |
334 | 334 | '', |
335 | 335 | basename(__FILE__), |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | '', |
338 | 338 | 1, |
339 | 339 | $language |
340 | - ) . ' {action}{maintenance_flags}' . "\n" . '{shortlink_url}{wp_oc}' . "\n\n" . '{text}' . "\n\n\n\n"; |
|
340 | + ).' {action}{maintenance_flags}'."\n".'{shortlink_url}{wp_oc}'."\n\n".'{text}'."\n\n\n\n"; |
|
341 | 341 | |
342 | 342 | $watchtext = mb_ereg_replace('{date}', date($dateformat, strtotime($rLog['logdate'])), $watchtext); |
343 | 343 | $watchtext = mb_ereg_replace('{wp_oc}', $rLog['wp_oc'], $watchtext); |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | $watchtext = mb_ereg_replace('{action}', get_logtype_name($rLog['type'], $language), $watchtext); |
348 | 348 | $watchtext = insert_maintenance_flags($rLog, $language, $watchtext); |
349 | 349 | |
350 | - $domain = sqlValue("SELECT `domain` FROM `user` WHERE `user_id`='" . sql_escape($user_id) . "'", null); |
|
350 | + $domain = sqlValue("SELECT `domain` FROM `user` WHERE `user_id`='".sql_escape($user_id)."'", null); |
|
351 | 351 | $urls = get_site_urls($domain); |
352 | 352 | if ($urls['shortlink_url']) { |
353 | 353 | $watchtext = mb_ereg_replace("{shortlink_url}", $urls['shortlink_url'], $watchtext); |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | |
402 | 402 | $logtext = html2plaintext($rLog['text'], $rLog['text_html'] == 0, EMAIL_LINEWRAP); |
403 | 403 | |
404 | - $language = sqlValue("SELECT `language` FROM `user` WHERE `user_id`='" . sql_escape($user_id) . "'", null); |
|
404 | + $language = sqlValue("SELECT `language` FROM `user` WHERE `user_id`='".sql_escape($user_id)."'", null); |
|
405 | 405 | if (!$language) { |
406 | 406 | $language = $opt['template']['default']['locale']; |
407 | 407 | } |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | $dateformat = $opt['locale'][$language]['format']['phpdatetime']; |
412 | 412 | } |
413 | 413 | |
414 | - $watchtext = '{date} ' . $translate->t( |
|
414 | + $watchtext = '{date} '.$translate->t( |
|
415 | 415 | '{user} has logged the cache "{cachename}":', |
416 | 416 | '', |
417 | 417 | basename(__FILE__), |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | '', |
420 | 420 | 1, |
421 | 421 | $language |
422 | - ) . ' {action}{maintenance_flags}' . "\n" . '{shortlink_url}{wp_oc}' . "\n{cachelists}\n" . '{text}' . "\n\n\n\n"; |
|
422 | + ).' {action}{maintenance_flags}'."\n".'{shortlink_url}{wp_oc}'."\n{cachelists}\n".'{text}'."\n\n\n\n"; |
|
423 | 423 | |
424 | 424 | $watchtext = mb_ereg_replace('{date}', date($dateformat, strtotime($rLog['logdate'])), $watchtext); |
425 | 425 | $watchtext = mb_ereg_replace('{wp_oc}', $rLog['wp_oc'], $watchtext); |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | '', |
452 | 452 | 1, |
453 | 453 | $language |
454 | - ) . ' ' . $cachelist_names[0] . "\n"; |
|
454 | + ).' '.$cachelist_names[0]."\n"; |
|
455 | 455 | break; |
456 | 456 | default: |
457 | 457 | $cachelists = $translate->t( |
@@ -462,11 +462,11 @@ discard block |
||
462 | 462 | '', |
463 | 463 | 1, |
464 | 464 | $language |
465 | - ) . ' ' . implode(', ', $cachelist_names) . "\n"; |
|
465 | + ).' '.implode(', ', $cachelist_names)."\n"; |
|
466 | 466 | } |
467 | 467 | $watchtext = mb_ereg_replace('{cachelists}', $cachelists, $watchtext); |
468 | 468 | |
469 | - $domain = sqlValue("SELECT `domain` FROM `user` WHERE `user_id`='" . sql_escape($user_id) . "'", null); |
|
469 | + $domain = sqlValue("SELECT `domain` FROM `user` WHERE `user_id`='".sql_escape($user_id)."'", null); |
|
470 | 470 | $urls = get_site_urls($domain); |
471 | 471 | if ($urls['shortlink_url']) { |
472 | 472 | $watchtext = mb_ereg_replace("{shortlink_url}", $urls['shortlink_url'], $watchtext); |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | } |
558 | 558 | |
559 | 559 | if (file_exists($PidFile)) { |
560 | - echo "Error: Pidfile (" . $PidFile . ") already present at " . __FILE__ . ":" . __LINE__ . "!\n"; |
|
560 | + echo "Error: Pidfile (".$PidFile.") already present at ".__FILE__.":".__LINE__."!\n"; |
|
561 | 561 | |
562 | 562 | return false; |
563 | 563 | } else { |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | |
568 | 568 | return true; |
569 | 569 | } else { |
570 | - echo "can't create Pidfile $PidFile at " . __FILE__ . ":" . __LINE__ . "!\n"; |
|
570 | + echo "can't create Pidfile $PidFile at ".__FILE__.":".__LINE__."!\n"; |
|
571 | 571 | |
572 | 572 | return false; |
573 | 573 | } |
@@ -583,7 +583,7 @@ discard block |
||
583 | 583 | $pid_daemon = fgets($pidfile, 20); |
584 | 584 | fclose($pidfile); |
585 | 585 | |
586 | - $pid_daemon = (int) $pid_daemon; |
|
586 | + $pid_daemon = (int)$pid_daemon; |
|
587 | 587 | |
588 | 588 | // process running? |
589 | 589 | if (posix_kill($pid_daemon, 0)) { |
@@ -592,7 +592,7 @@ discard block |
||
592 | 592 | false; |
593 | 593 | } else { |
594 | 594 | // no, remove pid_file |
595 | - echo "process not running, removing old pid_file (" . $PidFile . ")\n"; |
|
595 | + echo "process not running, removing old pid_file (".$PidFile.")\n"; |
|
596 | 596 | unlink($PidFile); |
597 | 597 | |
598 | 598 | return true; |
@@ -614,10 +614,10 @@ discard block |
||
614 | 614 | unlink($PidFile); |
615 | 615 | } |
616 | 616 | } else { |
617 | - echo "Error: can't delete own pidfile (" . $PidFile . ") at " . __FILE__ . ":" . __LINE__ . "!\n"; |
|
617 | + echo "Error: can't delete own pidfile (".$PidFile.") at ".__FILE__.":".__LINE__."!\n"; |
|
618 | 618 | } |
619 | 619 | |
620 | 620 | if ($message) { |
621 | - echo $message . "\n"; |
|
621 | + echo $message."\n"; |
|
622 | 622 | } |
623 | 623 | } |
@@ -10,9 +10,9 @@ discard block |
||
10 | 10 | |
11 | 11 | header('Content-type: text/html; charset=utf-8'); |
12 | 12 | |
13 | -$rootpath = __DIR__ . '/../../'; |
|
14 | -require_once $rootpath . 'lib/common.inc.php'; |
|
15 | -require_once $rootpath . 'lib/eventhandler.inc.php'; |
|
13 | +$rootpath = __DIR__.'/../../'; |
|
14 | +require_once $rootpath.'lib/common.inc.php'; |
|
15 | +require_once $rootpath.'lib/eventhandler.inc.php'; |
|
16 | 16 | |
17 | 17 | $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : ''; |
18 | 18 | |
@@ -54,15 +54,15 @@ discard block |
||
54 | 54 | echo 'Besitzer geändert'; |
55 | 55 | |
56 | 56 | // logentry($module, $eventid, $userid, $objectid1, $objectid2, $logtext, $details) |
57 | - logentry('approving', 4, 0, $cacheid, 0, 'Owner changed ' . $cacheid, ''); |
|
57 | + logentry('approving', 4, 0, $cacheid, 0, 'Owner changed '.$cacheid, ''); |
|
58 | 58 | |
59 | 59 | exit; |
60 | 60 | } elseif ($action == 'showcache') { |
61 | 61 | $wp = isset($_REQUEST['waypoint']) ? $_REQUEST['waypoint'] : 0; |
62 | 62 | $newusername = isset($_REQUEST['newusername']) ? $_REQUEST['newusername'] : 0; |
63 | 63 | |
64 | - $cacheid = sqlValue("SELECT cache_id FROM caches WHERE wp_oc='" . sql_escape($wp) . "'", 0); |
|
65 | - $userid = sqlValue("SELECT user_id FROM user WHERE username='" . sql_escape($newusername) . "'", ''); |
|
64 | + $cacheid = sqlValue("SELECT cache_id FROM caches WHERE wp_oc='".sql_escape($wp)."'", 0); |
|
65 | + $userid = sqlValue("SELECT user_id FROM user WHERE username='".sql_escape($newusername)."'", ''); |
|
66 | 66 | |
67 | 67 | if ($cacheid == 0) { |
68 | 68 | die('Cache nicht gefunden!'); |
@@ -5,8 +5,8 @@ discard block |
||
5 | 5 | * Unicode Reminder メモ |
6 | 6 | ***************************************************************************/ |
7 | 7 | |
8 | -require __DIR__ . '/lib2/web.inc.php'; |
|
9 | -require __DIR__ . '/lib2/logic/oconly81.inc.php'; |
|
8 | +require __DIR__.'/lib2/web.inc.php'; |
|
9 | +require __DIR__.'/lib2/logic/oconly81.inc.php'; |
|
10 | 10 | |
11 | 11 | $showall = (@$_REQUEST['showall'] == 1); |
12 | 12 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | INNER JOIN &oconly81 ON &oconly81.`user_id`=`user`.`user_id` |
47 | 47 | GROUP BY `user`.`user_id` |
48 | 48 | ORDER BY `count` DESC, `username` ASC " . |
49 | - ($showall ? "" : "LIMIT " . sql_escape($opt['logic']['oconly81']['default_maxusers'] + 1)) |
|
49 | + ($showall ? "" : "LIMIT ".sql_escape($opt['logic']['oconly81']['default_maxusers'] + 1)) |
|
50 | 50 | ); |
51 | 51 | |
52 | 52 | $tpl->assign_rs('users', $rs); |
@@ -55,10 +55,10 @@ discard block |
||
55 | 55 | * - wtf is "expert mode"? |
56 | 56 | ****************************************************************************/ |
57 | 57 | |
58 | -require __DIR__ . '/lib2/web.inc.php'; |
|
59 | -require __DIR__ . '/lib2/logic/data-license.inc.php'; |
|
60 | -require __DIR__ . '/lib2/search/search.inc.php'; |
|
61 | -require __DIR__ . '/templates2/' . $opt['template']['style'] . '/search.tpl.inc.php'; |
|
58 | +require __DIR__.'/lib2/web.inc.php'; |
|
59 | +require __DIR__.'/lib2/logic/data-license.inc.php'; |
|
60 | +require __DIR__.'/lib2/search/search.inc.php'; |
|
61 | +require __DIR__.'/templates2/'.$opt['template']['style'].'/search.tpl.inc.php'; |
|
62 | 62 | |
63 | 63 | |
64 | 64 | //========================================================= |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | } |
129 | 129 | } |
130 | 130 | |
131 | -$queryid += 0; // safety measure: force $queryid to be numeric |
|
131 | +$queryid += 0; // safety measure: force $queryid to be numeric |
|
132 | 132 | |
133 | 133 | |
134 | 134 | //========================================================= |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | if (sql_num_rows($query_rs) == 0) { |
150 | 150 | // can happen if logged out after query was created (fix for RT #3915) |
151 | 151 | $queryid = 0; |
152 | - goto newquery; // goto needs PHP 5.3 |
|
152 | + goto newquery; // goto needs PHP 5.3 |
|
153 | 153 | /* |
154 | 154 | $tpl->error($error_query_not_found); |
155 | 155 | */ |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | } |
186 | 186 | |
187 | 187 | // get findername from finderid |
188 | - $options['finderid'] = isset($options['finderid']) ? $options['finderid'] + 0 : 0; // Ocprop |
|
188 | + $options['finderid'] = isset($options['finderid']) ? $options['finderid'] + 0 : 0; // Ocprop |
|
189 | 189 | if (isset($options['finder']) && $options['finderid'] > 0) { |
190 | 190 | $rs_name = sql("SELECT `username` FROM `user` WHERE `user_id`='&1'", $options['finderid']); |
191 | 191 | if (sql_num_rows($rs_name) == 1) { |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | } |
198 | 198 | |
199 | 199 | // get ownername from ownerid |
200 | - $options['ownerid'] = isset($options['ownerid']) ? $options['ownerid'] + 0 : 0; // Ocprop |
|
200 | + $options['ownerid'] = isset($options['ownerid']) ? $options['ownerid'] + 0 : 0; // Ocprop |
|
201 | 201 | if (isset($options['owner']) && $options['ownerid'] > 0) { |
202 | 202 | $rs_name = sql("SELECT `username` FROM `user` WHERE `user_id`='&1'", $options['ownerid']); |
203 | 203 | if (sql_num_rows($rs_name) == 1) { |
@@ -226,10 +226,10 @@ discard block |
||
226 | 226 | } |
227 | 227 | |
228 | 228 | // get the search options parameters and store them in the queries table (to view "the next page") |
229 | - $options['f_userowner'] = isset($_REQUEST['f_userowner']) ? $_REQUEST['f_userowner'] : 0; // Ocprop |
|
230 | - $options['f_userfound'] = isset($_REQUEST['f_userfound']) ? $_REQUEST['f_userfound'] : 0; // Ocprop |
|
229 | + $options['f_userowner'] = isset($_REQUEST['f_userowner']) ? $_REQUEST['f_userowner'] : 0; // Ocprop |
|
230 | + $options['f_userfound'] = isset($_REQUEST['f_userfound']) ? $_REQUEST['f_userfound'] : 0; // Ocprop |
|
231 | 231 | $options['f_disabled'] = isset($_REQUEST['f_disabled']) ? $_REQUEST['f_disabled'] : 0; |
232 | - $options['f_inactive'] = isset($_REQUEST['f_inactive']) ? $_REQUEST['f_inactive'] : 1; // Ocprop |
|
232 | + $options['f_inactive'] = isset($_REQUEST['f_inactive']) ? $_REQUEST['f_inactive'] : 1; // Ocprop |
|
233 | 233 | // f_inactive formerly was used for both, archived and disabled caches. |
234 | 234 | // After adding the separate f_disabled option, it is used only for archived |
235 | 235 | // caches, but keeps its name for compatibility with existing stored or |
@@ -237,15 +237,15 @@ discard block |
||
237 | 237 | $options['f_ignored'] = isset($_REQUEST['f_ignored']) ? $_REQUEST['f_ignored'] : 1; |
238 | 238 | $options['f_otherPlatforms'] = isset($_REQUEST['f_otherPlatforms']) ? $_REQUEST['f_otherPlatforms'] : 0; |
239 | 239 | $options['f_geokrets'] = isset($_REQUEST['f_geokrets']) ? $_REQUEST['f_geokrets'] : 0; |
240 | - $options['expert'] = isset($_REQUEST['expert']) ? $_REQUEST['expert'] : 0; // Ocprop: 0 |
|
240 | + $options['expert'] = isset($_REQUEST['expert']) ? $_REQUEST['expert'] : 0; // Ocprop: 0 |
|
241 | 241 | $options['showresult'] = isset($_REQUEST['showresult']) ? $_REQUEST['showresult'] : 0; |
242 | - $options['output'] = isset($_REQUEST['output']) ? $_REQUEST['output'] : 'HTML'; // Ocprop: HTML |
|
242 | + $options['output'] = isset($_REQUEST['output']) ? $_REQUEST['output'] : 'HTML'; // Ocprop: HTML |
|
243 | 243 | $options['bbox'] = isset($_REQUEST['bbox']) ? $_REQUEST['bbox'] : false; |
244 | 244 | |
245 | 245 | if (isset($_REQUEST['cache_attribs'])) { |
246 | 246 | if ($_REQUEST['cache_attribs'] != '') { |
247 | 247 | $aAttribs = mb_split(';', $_REQUEST['cache_attribs']); |
248 | - for ($i = 0; $i < count($aAttribs); $i ++) { |
|
248 | + for ($i = 0; $i < count($aAttribs); $i++) { |
|
249 | 249 | $options['cache_attribs'][$aAttribs[$i] + 0] = $aAttribs[$i] + 0; |
250 | 250 | } |
251 | 251 | unset($aAttribs); |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | if (isset($_REQUEST['cache_attribs_not'])) { |
260 | 260 | if ($_REQUEST['cache_attribs_not'] != '') { |
261 | 261 | $aAttribs = mb_split(';', $_REQUEST['cache_attribs_not']); |
262 | - for ($i = 0; $i < count($aAttribs); $i ++) { |
|
262 | + for ($i = 0; $i < count($aAttribs); $i++) { |
|
263 | 263 | $options['cache_attribs_not'][$aAttribs[$i] + 0] = $aAttribs[$i] + 0; |
264 | 264 | } |
265 | 265 | unset($aAttribs); |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | |
298 | 298 | $options['finderid'] = isset($_REQUEST['finderid']) ? $_REQUEST['finderid'] : 0; |
299 | 299 | $options['finder'] = isset($_REQUEST['finder']) ? stripslashes($_REQUEST['finder']) : ''; |
300 | - $options['logtype'] = isset($_REQUEST['logtype']) ? $_REQUEST['logtype'] : '1,7'; // Ocprop |
|
300 | + $options['logtype'] = isset($_REQUEST['logtype']) ? $_REQUEST['logtype'] : '1,7'; // Ocprop |
|
301 | 301 | } elseif (isset($_REQUEST['searchbyortplz'])) { |
302 | 302 | $onlydigits = is_numeric($_REQUEST['ortplz']); |
303 | 303 | if ($onlydigits == true) { |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | if (!$list->allowView($password)) { |
364 | 364 | $tpl->redirect("cachelists.php"); |
365 | 365 | } |
366 | - $options['cachelist'] = cachelist::getListById($options['listid']); // null for invalid ID |
|
366 | + $options['cachelist'] = cachelist::getListById($options['listid']); // null for invalid ID |
|
367 | 367 | $options['cachelist_pw'] = $password; |
368 | 368 | } elseif (isset($_REQUEST['searchall'])) { |
369 | 369 | if (!$login->logged_in() && |
@@ -538,17 +538,17 @@ discard block |
||
538 | 538 | if ($options['searchtype'] == 'byname') { |
539 | 539 | $sql_select[] = '`caches`.`cache_id` `cache_id`'; |
540 | 540 | $sql_from = '`caches`'; |
541 | - $sql_where[] = '`caches`.`name` LIKE \'%' . sql_escape($options['cachename']) . '%\''; |
|
541 | + $sql_where[] = '`caches`.`name` LIKE \'%'.sql_escape($options['cachename']).'%\''; |
|
542 | 542 | } elseif ($options['searchtype'] == 'byowner') { |
543 | 543 | if ($options['ownerid'] != 0) { |
544 | 544 | $sql_select[] = '`caches`.`cache_id` `cache_id`'; |
545 | 545 | $sql_from = '`caches`'; |
546 | - $sql_where[] = '`user_id`=\'' . sql_escape($options['ownerid']) . '\''; |
|
546 | + $sql_where[] = '`user_id`=\''.sql_escape($options['ownerid']).'\''; |
|
547 | 547 | } else { |
548 | 548 | $sql_select[] = '`caches`.`cache_id` `cache_id`'; |
549 | 549 | $sql_from = '`caches`'; |
550 | 550 | $sql_innerjoin[] = '`user` ON `caches`.`user_id`=`user`.`user_id`'; |
551 | - $sql_where[] = '`user`.`username`=\'' . sql_escape($options['owner']) . '\''; |
|
551 | + $sql_where[] = '`user`.`username`=\''.sql_escape($options['owner']).'\''; |
|
552 | 552 | } |
553 | 553 | } elseif (($options['searchtype'] == 'byplz') || ($options['searchtype'] == 'byort')) { |
554 | 554 | $locid = $options['locid']; |
@@ -563,7 +563,7 @@ discard block |
||
563 | 563 | $sql = |
564 | 564 | "SELECT `loc_id` |
565 | 565 | FROM `geodb_textdata` |
566 | - WHERE `text_type`=500300000 AND `text_val`='" . sql_escape($plz) . "'"; |
|
566 | + WHERE `text_type`=500300000 AND `text_val`='" . sql_escape($plz)."'"; |
|
567 | 567 | $rs = sql($sql); |
568 | 568 | if (sql_num_rows($rs) == 0) { |
569 | 569 | sql_free_result($rs); |
@@ -638,9 +638,9 @@ discard block |
||
638 | 638 | if ($sqlhashes != '') { |
639 | 639 | $sqlhashes .= ' OR '; |
640 | 640 | } |
641 | - $sqlhashes .= '`gns_search`.`simplehash`=' . sprintf("%u", crc32($searchstring)); |
|
641 | + $sqlhashes .= '`gns_search`.`simplehash`='.sprintf("%u", crc32($searchstring)); |
|
642 | 642 | |
643 | - $wordscount ++; |
|
643 | + $wordscount++; |
|
644 | 644 | } |
645 | 645 | } |
646 | 646 | |
@@ -922,7 +922,7 @@ discard block |
||
922 | 922 | // needs distinct because there can be multiple matching logs per cache |
923 | 923 | $sql_from = '`caches`'; |
924 | 924 | $sql_innerjoin[] = '`cache_logs` ON `caches`.`cache_id`=`cache_logs`.`cache_id`'; |
925 | - $sql_where[] = '`cache_logs`.`user_id`=\'' . sql_escape($finder_id) . '\''; |
|
925 | + $sql_where[] = '`cache_logs`.`user_id`=\''.sql_escape($finder_id).'\''; |
|
926 | 926 | |
927 | 927 | if ($options['logtype'] != '0') { // 0 = all types |
928 | 928 | $ids = explode(',', $options['logtype']); |
@@ -933,18 +933,18 @@ discard block |
||
933 | 933 | } |
934 | 934 | $idNumbers .= ($id + 0); |
935 | 935 | } |
936 | - $sql_where[] = '`cache_logs`.`type` IN (' . $idNumbers . ')'; |
|
936 | + $sql_where[] = '`cache_logs`.`type` IN ('.$idNumbers.')'; |
|
937 | 937 | } |
938 | 938 | } elseif ($options['searchtype'] == 'bycacheid') { |
939 | 939 | $sql_select[] = '`caches`.`cache_id` `cache_id`'; |
940 | 940 | $sql_from = '`caches`'; |
941 | - $sql_where[] = '`caches`.`cache_id`=\'' . sql_escape($options['cacheid']) . '\''; |
|
941 | + $sql_where[] = '`caches`.`cache_id`=\''.sql_escape($options['cacheid']).'\''; |
|
942 | 942 | } elseif ($options['searchtype'] == 'bywp') { |
943 | 943 | $sql_select[] = '`caches`.`cache_id` `cache_id`'; |
944 | 944 | $sql_from = '`caches`'; |
945 | - $sql_where[] = '`caches`.`wp_oc`=\'' . sql_escape($options['wp']) . '\''; |
|
945 | + $sql_where[] = '`caches`.`wp_oc`=\''.sql_escape($options['wp']).'\''; |
|
946 | 946 | } elseif ($options['searchtype'] == 'byfulltext') { |
947 | - require_once $opt['rootpath'] . 'lib2/search/ftsearch.inc.php'; |
|
947 | + require_once $opt['rootpath'].'lib2/search/ftsearch.inc.php'; |
|
948 | 948 | |
949 | 949 | $fulltext = $options['fulltext']; |
950 | 950 | $hashes = ftsearch_hash($fulltext); |
@@ -982,27 +982,27 @@ discard block |
||
982 | 982 | $n = 1; |
983 | 983 | foreach ($hashes as $k => $h) { |
984 | 984 | if ($n > 1) { |
985 | - $sql_innerjoin[] = '`search_index` AS `s' . $n . '` ON `s' . ($n - 1) . '`.`cache_id`=`s' . $n . '`.`cache_id`'; |
|
985 | + $sql_innerjoin[] = '`search_index` AS `s'.$n.'` ON `s'.($n - 1).'`.`cache_id`=`s'.$n.'`.`cache_id`'; |
|
986 | 986 | } else { |
987 | 987 | $sql_innerjoin[] = '`search_index` AS `s1` ON `s1`.`cache_id`=`caches`.`cache_id`'; |
988 | 988 | } |
989 | 989 | |
990 | - $sql_where[] = '`s' . $n . '`.`hash`=\'' . sql_escape($h) . '\''; |
|
991 | - $sql_where[] = '`s' . $n . '`.`object_type` IN (' . implode(',', $ft_types) . ')'; |
|
990 | + $sql_where[] = '`s'.$n.'`.`hash`=\''.sql_escape($h).'\''; |
|
991 | + $sql_where[] = '`s'.$n.'`.`object_type` IN ('.implode(',', $ft_types).')'; |
|
992 | 992 | |
993 | - $n ++; |
|
993 | + $n++; |
|
994 | 994 | } |
995 | 995 | |
996 | 996 | $sqlFilter = |
997 | - 'SELECT DISTINCT ' . implode(',', $sql_select) . |
|
998 | - ' FROM ' . $sql_from . |
|
999 | - ' INNER JOIN ' . implode(' INNER JOIN ', $sql_innerjoin) . |
|
1000 | - ' WHERE ' . implode(' AND ', $sql_where); |
|
997 | + 'SELECT DISTINCT '.implode(',', $sql_select). |
|
998 | + ' FROM '.$sql_from. |
|
999 | + ' INNER JOIN '.implode(' INNER JOIN ', $sql_innerjoin). |
|
1000 | + ' WHERE '.implode(' AND ', $sql_where); |
|
1001 | 1001 | |
1002 | 1002 | sql_drop_temp_table_slave('tmpFTCaches'); |
1003 | 1003 | sql_temp_table_slave('tmpFTCaches'); |
1004 | 1004 | sql_slave( |
1005 | - "CREATE TEMPORARY TABLE &tmpFTCaches (`cache_id` int (11) PRIMARY KEY) " . $sqlFilter |
|
1005 | + "CREATE TEMPORARY TABLE &tmpFTCaches (`cache_id` int (11) PRIMARY KEY) ".$sqlFilter |
|
1006 | 1006 | ); |
1007 | 1007 | |
1008 | 1008 | $sql_select = []; |
@@ -1026,7 +1026,7 @@ discard block |
||
1026 | 1026 | SELECT `cache_id` |
1027 | 1027 | FROM `cache_list_items` |
1028 | 1028 | LEFT JOIN `cache_lists` ON `cache_lists`.`id`=`cache_list_items`.`cache_list_id` |
1029 | - WHERE `cache_list_id`='" . sql_escape($options['listid']) . "'"; |
|
1029 | + WHERE `cache_list_id`='" . sql_escape($options['listid'])."'"; |
|
1030 | 1030 | sql_slave($cachesFilter); |
1031 | 1031 | sql_slave('ALTER TABLE &result_caches ADD PRIMARY KEY (`cache_id`)'); |
1032 | 1032 | |
@@ -1054,7 +1054,7 @@ discard block |
||
1054 | 1054 | $options['f_userowner'] = '0'; |
1055 | 1055 | } // Ocprop |
1056 | 1056 | if ($options['f_userowner'] != 0) { |
1057 | - $sql_where[] = '`caches`.`user_id`!=\'' . $login->userid . '\''; |
|
1057 | + $sql_where[] = '`caches`.`user_id`!=\''.$login->userid.'\''; |
|
1058 | 1058 | } |
1059 | 1059 | |
1060 | 1060 | if (!isset($options['f_userfound'])) { |
@@ -1066,7 +1066,7 @@ discard block |
||
1066 | 1066 | (SELECT `cache_logs`.`cache_id` |
1067 | 1067 | FROM `cache_logs` |
1068 | 1068 | WHERE |
1069 | - `cache_logs`.`user_id`='" . sql_escape($login->userid) . "' |
|
1069 | + `cache_logs`.`user_id`='" . sql_escape($login->userid)."' |
|
1070 | 1070 | AND `cache_logs`.`type` IN (1, 7))"; |
1071 | 1071 | } |
1072 | 1072 | if (!isset($options['f_inactive'])) { |
@@ -1093,14 +1093,14 @@ discard block |
||
1093 | 1093 | if ($options['f_ignored'] != 0) { |
1094 | 1094 | // only use this filter, if it is realy needed - this enables better caching in map2.php with ignored-filter |
1095 | 1095 | if (sql_value_slave( |
1096 | - "SELECT COUNT(*) FROM `cache_ignore` WHERE `user_id`='" . sql_escape($login->userid) . "'", |
|
1096 | + "SELECT COUNT(*) FROM `cache_ignore` WHERE `user_id`='".sql_escape($login->userid)."'", |
|
1097 | 1097 | 0 |
1098 | 1098 | ) > 0) { |
1099 | 1099 | $sql_where[] = |
1100 | 1100 | "`caches`.`cache_id` NOT IN |
1101 | 1101 | (SELECT `cache_ignore`.`cache_id` |
1102 | 1102 | FROM `cache_ignore` |
1103 | - WHERE `cache_ignore`.`user_id`='" . sql_escape($login->userid) . "')"; |
|
1103 | + WHERE `cache_ignore`.`user_id`='" . sql_escape($login->userid)."')"; |
|
1104 | 1104 | } |
1105 | 1105 | } |
1106 | 1106 | } |
@@ -1122,7 +1122,7 @@ discard block |
||
1122 | 1122 | $options['country'] = ''; |
1123 | 1123 | } |
1124 | 1124 | if ($options['country'] != '') { |
1125 | - $sql_where[] = '`caches`.`country`=\'' . sql_escape($options['country']) . '\''; |
|
1125 | + $sql_where[] = '`caches`.`country`=\''.sql_escape($options['country']).'\''; |
|
1126 | 1126 | } |
1127 | 1127 | |
1128 | 1128 | if (!isset($options['language'])) { |
@@ -1134,7 +1134,7 @@ discard block |
||
1134 | 1134 | $sql_where[] = '`cache_desc`.`language`=\'' . sql_escape($options['language']) . '\''; |
1135 | 1135 | */ |
1136 | 1136 | // optimized query: |
1137 | - $sql_where[] = 'INSTR(`caches`.`desc_languages`,\'' . sql_escape($options['language']) . '\')'; |
|
1137 | + $sql_where[] = 'INSTR(`caches`.`desc_languages`,\''.sql_escape($options['language']).'\')'; |
|
1138 | 1138 | } |
1139 | 1139 | |
1140 | 1140 | if (!isset($options['adm2'])) { |
@@ -1142,50 +1142,50 @@ discard block |
||
1142 | 1142 | } |
1143 | 1143 | if ($options['adm2'] != '') { |
1144 | 1144 | $sql_innerjoin[] = '`cache_location` ON `cache_location`.`cache_id`=`caches`.`cache_id`'; |
1145 | - $sql_where[] = '`cache_location`.`code2`=\'' . sql_escape($options['adm2']) . '\''; |
|
1145 | + $sql_where[] = '`cache_location`.`code2`=\''.sql_escape($options['adm2']).'\''; |
|
1146 | 1146 | } |
1147 | 1147 | |
1148 | 1148 | if ($options['cachetype'] != '') { |
1149 | 1149 | $types = explode(';', $options['cachetype']); |
1150 | 1150 | if (count($types) < sql_value_slave("SELECT COUNT(*) FROM `cache_type`", 0)) { |
1151 | - for ($i = 0; $i < count($types); $i ++) { |
|
1152 | - $types[$i] = "'" . sql_escape($types[$i]) . "'"; |
|
1151 | + for ($i = 0; $i < count($types); $i++) { |
|
1152 | + $types[$i] = "'".sql_escape($types[$i])."'"; |
|
1153 | 1153 | } |
1154 | - $sql_where[] = '`caches`.`type` IN (' . implode(',', $types) . ')'; |
|
1154 | + $sql_where[] = '`caches`.`type` IN ('.implode(',', $types).')'; |
|
1155 | 1155 | } |
1156 | 1156 | } |
1157 | 1157 | |
1158 | 1158 | if ($options['cachesize'] != '') { |
1159 | 1159 | $sizes = explode(';', $options['cachesize']); |
1160 | 1160 | if (count($sizes) < sql_value_slave("SELECT COUNT(*) FROM `cache_size`", 0)) { |
1161 | - for ($i = 0; $i < count($sizes); $i ++) { |
|
1162 | - $sizes[$i] = "'" . sql_escape($sizes[$i]) . "'"; |
|
1161 | + for ($i = 0; $i < count($sizes); $i++) { |
|
1162 | + $sizes[$i] = "'".sql_escape($sizes[$i])."'"; |
|
1163 | 1163 | } |
1164 | - $sql_where[] = '`caches`.`size` IN (' . implode(',', $sizes) . ')'; |
|
1164 | + $sql_where[] = '`caches`.`size` IN ('.implode(',', $sizes).')'; |
|
1165 | 1165 | } |
1166 | 1166 | } |
1167 | 1167 | |
1168 | 1168 | if ($options['difficultymin'] != 0) { |
1169 | - $sql_where[] = '`caches`.`difficulty`>=\'' . sql_escape($options['difficultymin']) . '\''; |
|
1169 | + $sql_where[] = '`caches`.`difficulty`>=\''.sql_escape($options['difficultymin']).'\''; |
|
1170 | 1170 | } |
1171 | 1171 | if ($options['difficultymax'] != 0) { |
1172 | - $sql_where[] = '`caches`.`difficulty`<=\'' . sql_escape($options['difficultymax']) . '\''; |
|
1172 | + $sql_where[] = '`caches`.`difficulty`<=\''.sql_escape($options['difficultymax']).'\''; |
|
1173 | 1173 | } |
1174 | 1174 | if ($options['terrainmin'] != 0) { |
1175 | - $sql_where[] = '`caches`.`terrain`>=\'' . sql_escape($options['terrainmin']) . '\''; |
|
1175 | + $sql_where[] = '`caches`.`terrain`>=\''.sql_escape($options['terrainmin']).'\''; |
|
1176 | 1176 | } |
1177 | 1177 | if ($options['terrainmax'] != 0) { |
1178 | - $sql_where[] = '`caches`.`terrain`<=\'' . sql_escape($options['terrainmax']) . '\''; |
|
1178 | + $sql_where[] = '`caches`.`terrain`<=\''.sql_escape($options['terrainmax']).'\''; |
|
1179 | 1179 | } |
1180 | 1180 | if ($options['recommendationmin'] > 0) { |
1181 | 1181 | $sql_innerjoin[] = '`stat_caches` ON `caches`.`cache_id`=`stat_caches`.`cache_id`'; |
1182 | - $sql_where[] = '`stat_caches`.`toprating`>=\'' . sql_escape($options['recommendationmin']) . '\''; |
|
1182 | + $sql_where[] = '`stat_caches`.`toprating`>=\''.sql_escape($options['recommendationmin']).'\''; |
|
1183 | 1183 | } |
1184 | 1184 | |
1185 | 1185 | if (isset($options['cache_attribs']) && count($options['cache_attribs']) > 0) { |
1186 | 1186 | foreach ($options['cache_attribs'] as $attr) { |
1187 | - $sql_innerjoin[] = '`caches_attributes` AS `a' . ($attr + 0) . '` ON `a' . ($attr + 0) . '`.`cache_id`=`caches`.`cache_id`'; |
|
1188 | - $sql_where[] = '`a' . ($attr + 0) . '`.`attrib_id`=' . ($attr + 0); |
|
1187 | + $sql_innerjoin[] = '`caches_attributes` AS `a'.($attr + 0).'` ON `a'.($attr + 0).'`.`cache_id`=`caches`.`cache_id`'; |
|
1188 | + $sql_where[] = '`a'.($attr + 0).'`.`attrib_id`='.($attr + 0); |
|
1189 | 1189 | } |
1190 | 1190 | } |
1191 | 1191 | |
@@ -1197,7 +1197,7 @@ discard block |
||
1197 | 1197 | FROM `caches_attributes` |
1198 | 1198 | WHERE |
1199 | 1199 | `caches_attributes`.`cache_id`=`caches`.`cache_id` |
1200 | - AND `caches_attributes`.`attrib_id`='" . sql_escape($attr + 0) . "' |
|
1200 | + AND `caches_attributes`.`attrib_id`='" . sql_escape($attr + 0)."' |
|
1201 | 1201 | )"; |
1202 | 1202 | } |
1203 | 1203 | } |
@@ -1206,7 +1206,7 @@ discard block |
||
1206 | 1206 | // bbox=<lon_from>,<lat_from>,<lon_to>,<lat_to> |
1207 | 1207 | $coords = explode(',', $options['bbox']); |
1208 | 1208 | if (count($coords) == 4) { |
1209 | - $sql_where[] = '`caches`.`longitude`>=' . ($coords[0] + 0) . ' AND `caches`.`latitude`>=' . ($coords[1] + 0) . ' AND `caches`.`longitude`<=' . ($coords[2] + 0) . ' AND `caches`.`latitude`<=' . ($coords[3] + 0); |
|
1209 | + $sql_where[] = '`caches`.`longitude`>='.($coords[0] + 0).' AND `caches`.`latitude`>='.($coords[1] + 0).' AND `caches`.`longitude`<='.($coords[2] + 0).' AND `caches`.`latitude`<='.($coords[3] + 0); |
|
1210 | 1210 | } |
1211 | 1211 | } |
1212 | 1212 | |
@@ -1215,23 +1215,23 @@ discard block |
||
1215 | 1215 | $sql_where[] = |
1216 | 1216 | '(`cache_status`.`allow_user_view`=1 OR `caches`.`user_id`=' |
1217 | 1217 | . sql_escape($login->userid) |
1218 | - . ' OR (`caches`.`status`<>5 AND ' . ($login->hasAdminPriv(ADMIN_USER) ? '1' : '0') . '))'; |
|
1218 | + . ' OR (`caches`.`status`<>5 AND '.($login->hasAdminPriv(ADMIN_USER) ? '1' : '0').'))'; |
|
1219 | 1219 | } else { |
1220 | 1220 | $sql_where[] = '`cache_status`.`allow_user_view`=1'; |
1221 | 1221 | } |
1222 | 1222 | |
1223 | 1223 | //do the search |
1224 | - $innerjoin = sizeof($sql_innerjoin) ? ' INNER JOIN ' . implode(' INNER JOIN ', $sql_innerjoin) : ''; |
|
1225 | - $leftjoin = sizeof($sql_leftjoin) ? ' LEFT JOIN ' . implode(' LEFT JOIN ', $sql_leftjoin) : ''; |
|
1226 | - $group = sizeof($sql_group) ? ' GROUP BY ' . implode(', ', $sql_group) : ''; |
|
1227 | - $having = sizeof($sql_having) ? ' HAVING ' . implode(' AND ', $sql_having) : ''; |
|
1228 | - |
|
1229 | - $sqlFilter = 'SELECT ' . implode(',', $sql_select) . |
|
1230 | - ' FROM ' . $sql_from . |
|
1231 | - $innerjoin . |
|
1232 | - $leftjoin . |
|
1233 | - ' WHERE ' . implode(' AND ', $sql_where) . |
|
1234 | - $group . |
|
1224 | + $innerjoin = sizeof($sql_innerjoin) ? ' INNER JOIN '.implode(' INNER JOIN ', $sql_innerjoin) : ''; |
|
1225 | + $leftjoin = sizeof($sql_leftjoin) ? ' LEFT JOIN '.implode(' LEFT JOIN ', $sql_leftjoin) : ''; |
|
1226 | + $group = sizeof($sql_group) ? ' GROUP BY '.implode(', ', $sql_group) : ''; |
|
1227 | + $having = sizeof($sql_having) ? ' HAVING '.implode(' AND ', $sql_having) : ''; |
|
1228 | + |
|
1229 | + $sqlFilter = 'SELECT '.implode(',', $sql_select). |
|
1230 | + ' FROM '.$sql_from. |
|
1231 | + $innerjoin. |
|
1232 | + $leftjoin. |
|
1233 | + ' WHERE '.implode(' AND ', $sql_where). |
|
1234 | + $group. |
|
1235 | 1235 | $having; |
1236 | 1236 | |
1237 | 1237 | // echo "DEBUG ".$sqlFilter." DEBUG<br>"; |
@@ -1243,7 +1243,7 @@ discard block |
||
1243 | 1243 | // X6. load output module and output-dependent options |
1244 | 1244 | //================================================================= |
1245 | 1245 | |
1246 | - $output_module = mb_strtolower($options['output']); // Ocprop: HTML, gpx |
|
1246 | + $output_module = mb_strtolower($options['output']); // Ocprop: HTML, gpx |
|
1247 | 1247 | |
1248 | 1248 | $map2_bounds = ($output_module == 'map2bounds'); |
1249 | 1249 | if ($map2_bounds) { |
@@ -1252,7 +1252,7 @@ discard block |
||
1252 | 1252 | |
1253 | 1253 | if ($map2_bounds && $options['queryid'] == 0) { |
1254 | 1254 | $tpl->error('map2bounds requires queryid'); |
1255 | - } elseif (!file_exists($opt['rootpath'] . 'lib2/search/search.' . $output_module . '.inc.php')) { |
|
1255 | + } elseif (!file_exists($opt['rootpath'].'lib2/search/search.'.$output_module.'.inc.php')) { |
|
1256 | 1256 | $tpl->error($outputformat_notexist); |
1257 | 1257 | } |
1258 | 1258 | |
@@ -1278,7 +1278,7 @@ discard block |
||
1278 | 1278 | // (map2 module will execute and exit; it will use the variables |
1279 | 1279 | // $cachesFilter, $sqlFilter and $map2_bounds and $options['queryid'].) |
1280 | 1280 | |
1281 | - require $opt['rootpath'] . 'lib2/search/search.' . $output_module . '.inc.php'; |
|
1281 | + require $opt['rootpath'].'lib2/search/search.'.$output_module.'.inc.php'; |
|
1282 | 1282 | |
1283 | 1283 | if (!isset($search_output_file_download)) { |
1284 | 1284 | die("search_output_file_download flag not set for '$output_module' search"); |
@@ -1303,7 +1303,7 @@ discard block |
||
1303 | 1303 | $lat_rad * 180 / 3.14159, |
1304 | 1304 | 0, |
1305 | 1305 | $multiplier[$distance_unit] |
1306 | - ) . ' `distance`, '; |
|
1306 | + ).' `distance`, '; |
|
1307 | 1307 | } else { |
1308 | 1308 | if (!$login->logged_in()) { |
1309 | 1309 | $sql .= 'NULL distance, '; |
@@ -1326,7 +1326,7 @@ discard block |
||
1326 | 1326 | $record_coords['latitude'], |
1327 | 1327 | 0, |
1328 | 1328 | $multiplier[$distance_unit] |
1329 | - ) . ' `distance`, '; |
|
1329 | + ).' `distance`, '; |
|
1330 | 1330 | } |
1331 | 1331 | sql_free_result($rs_coords); |
1332 | 1332 | } |
@@ -1336,7 +1336,7 @@ discard block |
||
1336 | 1336 | $sAddFields .= ', MAX(`cache_logs`.`date`) AS `lastLog`'; |
1337 | 1337 | $sAddJoin .= ' LEFT JOIN `cache_logs` ON `caches`.`cache_id`=`cache_logs`.`cache_id`'; |
1338 | 1338 | if ($options['sort'] == 'bymylastlog') { |
1339 | - $sAddJoin .= ' AND `cache_logs`.`user_id`=' . sql_escape($login->userid); |
|
1339 | + $sAddJoin .= ' AND `cache_logs`.`user_id`='.sql_escape($login->userid); |
|
1340 | 1340 | } |
1341 | 1341 | $sGroupBy .= ' GROUP BY `caches`.`cache_id`'; |
1342 | 1342 | } |
@@ -1352,8 +1352,8 @@ discard block |
||
1352 | 1352 | . ' FROM `caches` |
1353 | 1353 | LEFT JOIN `stat_caches` ON `caches`.`cache_id`=`stat_caches`.`cache_id`' . |
1354 | 1354 | $sAddJoin |
1355 | - . ' WHERE `caches`.`cache_id` IN (' . $sqlFilter . ')' . |
|
1356 | - $sAddWhere . ' ' . |
|
1355 | + . ' WHERE `caches`.`cache_id` IN ('.$sqlFilter.')'. |
|
1356 | + $sAddWhere.' '. |
|
1357 | 1357 | $sGroupBy; |
1358 | 1358 | $sortby = $options['sort']; |
1359 | 1359 | |
@@ -1418,7 +1418,7 @@ discard block |
||
1418 | 1418 | $count = 500; |
1419 | 1419 | } |
1420 | 1420 | |
1421 | - $sqlLimit = ' LIMIT ' . $startat . ', ' . $count; |
|
1421 | + $sqlLimit = ' LIMIT '.$startat.', '.$count; |
|
1422 | 1422 | |
1423 | 1423 | if ($search_output_file_download) { |
1424 | 1424 | //=================================================================== |
@@ -1429,7 +1429,7 @@ discard block |
||
1429 | 1429 | // for the case something went wrong and it was not propery cleaned up |
1430 | 1430 | |
1431 | 1431 | sql_temp_table_slave('searchtmp'); |
1432 | - sql_slave("CREATE TEMPORARY TABLE &searchtmp SELECT " . $sql . $sqlLimit); |
|
1432 | + sql_slave("CREATE TEMPORARY TABLE &searchtmp SELECT ".$sql.$sqlLimit); |
|
1433 | 1433 | |
1434 | 1434 | $count = sql_value_slave("SELECT COUNT(*) FROM &searchtmp", 0); |
1435 | 1435 | if ($count == 1) { |
@@ -1441,7 +1441,7 @@ discard block |
||
1441 | 1441 | '?' |
1442 | 1442 | ); |
1443 | 1443 | } else { |
1444 | - $sFilebasename = 'ocde' . $options['queryid']; |
|
1444 | + $sFilebasename = 'ocde'.$options['queryid']; |
|
1445 | 1445 | } |
1446 | 1446 | |
1447 | 1447 | $bUseZip = ($count > $zip_threshold) || |
@@ -1452,11 +1452,11 @@ discard block |
||
1452 | 1452 | |
1453 | 1453 | if (!$db['debug']) { |
1454 | 1454 | if ($bUseZip) { |
1455 | - header('Content-type: ' . $content_type_zipped); |
|
1456 | - header('Content-disposition: attachment; filename="' . $sFilebasename . '.zip"'); |
|
1455 | + header('Content-type: '.$content_type_zipped); |
|
1456 | + header('Content-disposition: attachment; filename="'.$sFilebasename.'.zip"'); |
|
1457 | 1457 | } else { |
1458 | - header('Content-type: ' . $content_type_plain); |
|
1459 | - header('Content-disposition: attachment; filename="' . $sFilebasename . '.' . $output_module . '"'); |
|
1458 | + header('Content-type: '.$content_type_plain); |
|
1459 | + header('Content-disposition: attachment; filename="'.$sFilebasename.'.'.$output_module.'"'); |
|
1460 | 1460 | } |
1461 | 1461 | } |
1462 | 1462 | |
@@ -1489,9 +1489,9 @@ discard block |
||
1489 | 1489 | // output zip file |
1490 | 1490 | if ($bUseZip && !$db['debug']) { |
1491 | 1491 | if ($add_to_zipfile) { |
1492 | - $phpzip->add_data($sFilebasename . '.' . $output_module, $content); |
|
1492 | + $phpzip->add_data($sFilebasename.'.'.$output_module, $content); |
|
1493 | 1493 | } |
1494 | - echo $phpzip->save($sFilebasename . '.zip', 'r'); |
|
1494 | + echo $phpzip->save($sFilebasename.'.zip', 'r'); |
|
1495 | 1495 | } |
1496 | 1496 | } else { |
1497 | 1497 | //=================================================================== |
@@ -1565,14 +1565,14 @@ discard block |
||
1565 | 1565 | $cachesFilter = |
1566 | 1566 | "CREATE TEMPORARY TABLE &result_caches ENGINE=MEMORY |
1567 | 1567 | SELECT |
1568 | - (" . geomath::getSqlDistanceFormula($lon, $lat, $distance, $multiplier[$distance_unit]) . ") `distance`, |
|
1568 | + (" . geomath::getSqlDistanceFormula($lon, $lat, $distance, $multiplier[$distance_unit]).") `distance`, |
|
1569 | 1569 | `caches`.`cache_id` `cache_id` |
1570 | 1570 | FROM `caches` FORCE INDEX (`latitude`) |
1571 | 1571 | WHERE |
1572 | - `longitude` > " . ($lon - $max_lon_diff) . " |
|
1573 | - AND `longitude` < " . ($lon + $max_lon_diff) . " |
|
1574 | - AND `latitude` > " . ($lat - $max_lat_diff) . " |
|
1575 | - AND `latitude` < " . ($lat + $max_lat_diff) . " |
|
1572 | + `longitude` > " . ($lon - $max_lon_diff)." |
|
1573 | + AND `longitude` < " . ($lon + $max_lon_diff)." |
|
1574 | + AND `latitude` > " . ($lat - $max_lat_diff)." |
|
1575 | + AND `latitude` < " . ($lat + $max_lat_diff)." |
|
1576 | 1576 | HAVING `distance` < " . ($distance + 0); |
1577 | 1577 | sql_slave($cachesFilter); |
1578 | 1578 | sql_slave("ALTER TABLE &result_caches ADD PRIMARY KEY ( `cache_id` )"); |
@@ -1687,7 +1687,7 @@ discard block |
||
1687 | 1687 | $rs = sql( |
1688 | 1688 | "SELECT `latitude`, `longitude` |
1689 | 1689 | FROM `user` |
1690 | - WHERE `user_id`='" . sql_escape($login->userid) . "'" |
|
1690 | + WHERE `user_id`='" . sql_escape($login->userid)."'" |
|
1691 | 1691 | ); |
1692 | 1692 | $record = sql_fetch_array($rs); |
1693 | 1693 | $lon = $record['longitude']; |
@@ -1785,9 +1785,9 @@ discard block |
||
1785 | 1785 | } |
1786 | 1786 | $tpl->assign('ortplz', $ortplz); |
1787 | 1787 | if ($options['searchtype'] == 'byplz') { |
1788 | - $dByOrtPlzChecked = ($options['searchtype'] == 'byplz'); // Ocprop |
|
1788 | + $dByOrtPlzChecked = ($options['searchtype'] == 'byplz'); // Ocprop |
|
1789 | 1789 | } elseif ($options['searchtype'] == 'byort') { |
1790 | - $dByOrtPlzChecked = ($options['searchtype'] == 'byort'); // Ocprop |
|
1790 | + $dByOrtPlzChecked = ($options['searchtype'] == 'byort'); // Ocprop |
|
1791 | 1791 | } else { |
1792 | 1792 | $dByOrtPlzChecked = false; |
1793 | 1793 | } |
@@ -1856,8 +1856,8 @@ discard block |
||
1856 | 1856 | $rCachetype['checked'] = |
1857 | 1857 | ($options['cachetype'] == '') |
1858 | 1858 | || (strpos( |
1859 | - ';' . $options['cachetype'] . ';', |
|
1860 | - ';' . $rCachetype['id'] . ';' |
|
1859 | + ';'.$options['cachetype'].';', |
|
1860 | + ';'.$rCachetype['id'].';' |
|
1861 | 1861 | ) !== false); |
1862 | 1862 | $rCachetype['unchecked'] = !$rCachetype['checked']; |
1863 | 1863 | } |
@@ -1870,8 +1870,8 @@ discard block |
||
1870 | 1870 | while ($r = sql_fetch_assoc($rs)) { |
1871 | 1871 | $cachesizes[$r['id']]['checked'] = |
1872 | 1872 | (strpos( |
1873 | - ';' . $options['cachesize'] . ';', |
|
1874 | - ';' . $r['id'] . ';' |
|
1873 | + ';'.$options['cachesize'].';', |
|
1874 | + ';'.$r['id'].';' |
|
1875 | 1875 | ) !== false) |
1876 | 1876 | || ($options['cachesize'] == ''); |
1877 | 1877 | } |
@@ -2022,7 +2022,7 @@ discard block |
||
2022 | 2022 | $line = mb_ereg_replace('{color}', $rAttrGroup['color'], $line); |
2023 | 2023 | |
2024 | 2024 | $group_line .= $line; |
2025 | - $nLineAttrCount2 ++; |
|
2025 | + $nLineAttrCount2++; |
|
2026 | 2026 | } |
2027 | 2027 | sql_free_result($rs); |
2028 | 2028 | |
@@ -2133,7 +2133,7 @@ discard block |
||
2133 | 2133 | $line = mb_ereg_replace('{color}', $rAttrGroup['color'], $line); |
2134 | 2134 | |
2135 | 2135 | $group_line .= $line; |
2136 | - $nLineAttrCount1 ++; |
|
2136 | + $nLineAttrCount1++; |
|
2137 | 2137 | } |
2138 | 2138 | sql_free_result($rs); |
2139 | 2139 | |
@@ -2255,7 +2255,7 @@ discard block |
||
2255 | 2255 | $pnew = ''; |
2256 | 2256 | foreach ($param as $p) { |
2257 | 2257 | if ($pnew != '') { |
2258 | - $pnew .= ';' . $p; |
|
2258 | + $pnew .= ';'.$p; |
|
2259 | 2259 | } else { |
2260 | 2260 | $pnew .= $p; |
2261 | 2261 | } |
@@ -2265,9 +2265,9 @@ discard block |
||
2265 | 2265 | } |
2266 | 2266 | |
2267 | 2267 | if ($urlparamString != '') { |
2268 | - $urlparamString .= '&' . $name . '=' . urlencode($param); |
|
2268 | + $urlparamString .= '&'.$name.'='.urlencode($param); |
|
2269 | 2269 | } else { |
2270 | - $urlparamString = $name . '=' . urlencode($param); |
|
2270 | + $urlparamString = $name.'='.urlencode($param); |
|
2271 | 2271 | } |
2272 | 2272 | } |
2273 | 2273 | $urlparamString .= ''; |
@@ -2278,13 +2278,13 @@ discard block |
||
2278 | 2278 | |
2279 | 2279 | function outputUniidSelectionForm($uniSql, $options) |
2280 | 2280 | { |
2281 | - global $tpl; // settings |
|
2281 | + global $tpl; // settings |
|
2282 | 2282 | global $locline, $secondlocationname; |
2283 | 2283 | |
2284 | 2284 | $urlparamString = prepareLocSelectionForm($options); |
2285 | 2285 | |
2286 | 2286 | sql_temp_table_slave('uniids'); |
2287 | - sql_slave("CREATE TEMPORARY TABLE &uniids ENGINE=MEMORY " . $uniSql); |
|
2287 | + sql_slave("CREATE TEMPORARY TABLE &uniids ENGINE=MEMORY ".$uniSql); |
|
2288 | 2288 | sql_slave("ALTER TABLE &uniids ADD PRIMARY KEY (`uni_id`)"); |
2289 | 2289 | |
2290 | 2290 | // locidsite |
@@ -2297,7 +2297,7 @@ discard block |
||
2297 | 2297 | $tpl->assign('resultscount', $count); |
2298 | 2298 | |
2299 | 2299 | // create page browser |
2300 | - $pager = new pager('search.php?' . $urlparamString . '&locidsite={offset}'); |
|
2300 | + $pager = new pager('search.php?'.$urlparamString.'&locidsite={offset}'); |
|
2301 | 2301 | $pager->make_from_offset($locidsite, ceil($count / 20), 1); |
2302 | 2302 | |
2303 | 2303 | // create locations list |
@@ -2317,7 +2317,7 @@ discard block |
||
2317 | 2317 | FROM `gns_locations`, &uniids |
2318 | 2318 | WHERE &uniids.`uni_id`=`gns_locations`.`uni` |
2319 | 2319 | ORDER BY `gns_locations`.`full_name` ASC |
2320 | - LIMIT " . ($locidsite * 20) . ", 20" |
|
2320 | + LIMIT " . ($locidsite * 20).", 20" |
|
2321 | 2321 | ); |
2322 | 2322 | |
2323 | 2323 | $nr = $locidsite * 20 + 1; |
@@ -2354,7 +2354,7 @@ discard block |
||
2354 | 2354 | $thislocation = mb_ereg_replace('{parentlocations}', $locString, $thislocation); |
2355 | 2355 | |
2356 | 2356 | // koordinaten ermitteln |
2357 | - $coordString = help_latToDegreeStr($r['lat']) . ' ' . help_lonToDegreeStr($r['lon']); |
|
2357 | + $coordString = help_latToDegreeStr($r['lat']).' '.help_lonToDegreeStr($r['lon']); |
|
2358 | 2358 | $thislocation = mb_ereg_replace('{coords}', htmlspecialchars($coordString, ENT_COMPAT, 'UTF-8'), $thislocation); |
2359 | 2359 | |
2360 | 2360 | if ($r['olduni'] != 0) { |
@@ -2384,12 +2384,12 @@ discard block |
||
2384 | 2384 | htmlspecialchars($r['full_name'], ENT_COMPAT, 'UTF-8'), |
2385 | 2385 | $thislocation |
2386 | 2386 | ); |
2387 | - $thislocation = mb_ereg_replace('{urlparams}', $urlparamString . '&locid={locid}', $thislocation); |
|
2387 | + $thislocation = mb_ereg_replace('{urlparams}', $urlparamString.'&locid={locid}', $thislocation); |
|
2388 | 2388 | $thislocation = mb_ereg_replace('{locid}', urlencode($r['uni_id']), $thislocation); |
2389 | 2389 | $thislocation = mb_ereg_replace('{nr}', $nr, $thislocation); |
2390 | 2390 | |
2391 | - $nr ++; |
|
2392 | - $locations .= $thislocation . "\n"; |
|
2391 | + $nr++; |
|
2392 | + $locations .= $thislocation."\n"; |
|
2393 | 2393 | } |
2394 | 2394 | sql_free_result($rs); |
2395 | 2395 | sql_drop_temp_table_slave('uniids'); |
@@ -2406,12 +2406,12 @@ discard block |
||
2406 | 2406 | global $tpl; |
2407 | 2407 | global $locline, $bgcolor1, $bgcolor2; |
2408 | 2408 | |
2409 | - require_once __DIR__ . '/lib2/logic/geodb.inc.php'; |
|
2409 | + require_once __DIR__.'/lib2/logic/geodb.inc.php'; |
|
2410 | 2410 | |
2411 | - $urlparamString = prepareLocSelectionForm($options) . '&locid={locid}'; |
|
2411 | + $urlparamString = prepareLocSelectionForm($options).'&locid={locid}'; |
|
2412 | 2412 | |
2413 | 2413 | sql_temp_table_slave('locids'); |
2414 | - sql_slave("CREATE TEMPORARY TABLE &locids ENGINE=MEMORY " . $locSql); |
|
2414 | + sql_slave("CREATE TEMPORARY TABLE &locids ENGINE=MEMORY ".$locSql); |
|
2415 | 2415 | sql_slave("ALTER TABLE &locids ADD PRIMARY KEY (`loc_id`)"); |
2416 | 2416 | |
2417 | 2417 | $rs = sql_slave( |
@@ -2439,12 +2439,12 @@ discard block |
||
2439 | 2439 | |
2440 | 2440 | $rb = GeoDb::regierungsbezirkFromLocid($r['loc_id']); |
2441 | 2441 | if ($rb != '') { |
2442 | - $locString .= ' > ' . htmlspecialchars($rb, ENT_COMPAT, 'UTF-8'); |
|
2442 | + $locString .= ' > '.htmlspecialchars($rb, ENT_COMPAT, 'UTF-8'); |
|
2443 | 2443 | } |
2444 | 2444 | |
2445 | 2445 | $lk = GeoDb::landkreisFromLocid($r['loc_id']); |
2446 | 2446 | if ($lk != '') { |
2447 | - $locString .= ' > ' . htmlspecialchars($lk, ENT_COMPAT, 'UTF-8'); |
|
2447 | + $locString .= ' > '.htmlspecialchars($lk, ENT_COMPAT, 'UTF-8'); |
|
2448 | 2448 | } |
2449 | 2449 | |
2450 | 2450 | $thislocation = mb_ereg_replace('{parentlocations}', $locString, $thislocation); |
@@ -2459,9 +2459,9 @@ discard block |
||
2459 | 2459 | $r['loc_id'] |
2460 | 2460 | ); |
2461 | 2461 | if ($rCoords = sql_fetch_array($rsCoords)) { |
2462 | - $coordString = help_latToDegreeStr($rCoords['lat']) . ' ' . help_lonToDegreeStr($rCoords['lon']); |
|
2462 | + $coordString = help_latToDegreeStr($rCoords['lat']).' '.help_lonToDegreeStr($rCoords['lon']); |
|
2463 | 2463 | } else { |
2464 | - $coordString = '[' . $no_location_coords . ']'; |
|
2464 | + $coordString = '['.$no_location_coords.']'; |
|
2465 | 2465 | } |
2466 | 2466 | |
2467 | 2467 | $thislocation = mb_ereg_replace('{coords}', htmlspecialchars($coordString, ENT_COMPAT, 'UTF-8'), $thislocation); |
@@ -2481,8 +2481,8 @@ discard block |
||
2481 | 2481 | $thislocation = mb_ereg_replace('{bgcolor}', $bgcolor2, $thislocation); |
2482 | 2482 | } |
2483 | 2483 | |
2484 | - $nr ++; |
|
2485 | - $locations .= $thislocation . "\n"; |
|
2484 | + $nr++; |
|
2485 | + $locations .= $thislocation."\n"; |
|
2486 | 2486 | } |
2487 | 2487 | |
2488 | 2488 | $tpl->assign('locations', $locations); |
@@ -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 | $sUserCountry = $login->getUserCountry(); |
11 | 11 | |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | |
18 | 18 | $tpl->caching = true; |
19 | 19 | $tpl->cache_lifetime = 300; |
20 | -$tpl->cache_id = $sUserCountry . '|' . $opt['page']['protocol']; |
|
20 | +$tpl->cache_id = $sUserCountry.'|'.$opt['page']['protocol']; |
|
21 | 21 | |
22 | 22 | if (!$tpl->is_cached()) { |
23 | 23 | // welcome message |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | } |
117 | 117 | |
118 | 118 | // build static maps url by inserting api key |
119 | - $url = $opt['page']['protocol'] . strstr($opt['logic']['minimapurl'], '://'); |
|
119 | + $url = $opt['page']['protocol'].strstr($opt['logic']['minimapurl'], '://'); |
|
120 | 120 | $url = mb_ereg_replace('{gmkey}', $gmkey, $url); |
121 | 121 | |
122 | 122 | // put into template |
@@ -5,9 +5,9 @@ discard block |
||
5 | 5 | * Unicode Reminder メモ |
6 | 6 | ***************************************************************************/ |
7 | 7 | |
8 | -$opt['rootpath'] = __DIR__ . '/../../'; |
|
9 | -require_once $opt['rootpath'] . 'lib2/web.inc.php'; |
|
10 | -require_once $opt['rootpath'] . 'lib2/logic/cache.class.php'; |
|
8 | +$opt['rootpath'] = __DIR__.'/../../'; |
|
9 | +require_once $opt['rootpath'].'lib2/web.inc.php'; |
|
10 | +require_once $opt['rootpath'].'lib2/logic/cache.class.php'; |
|
11 | 11 | |
12 | 12 | header('Content-type: text/html; charset=utf-8'); |
13 | 13 | |
@@ -35,14 +35,14 @@ discard block |
||
35 | 35 | } else { |
36 | 36 | echo $cache->getCacheId(); |
37 | 37 | echo ';'; |
38 | - echo '"' . mb_ereg_replace('"', '\"', $cache->getName()) . '"'; |
|
38 | + echo '"'.mb_ereg_replace('"', '\"', $cache->getName()).'"'; |
|
39 | 39 | echo ';'; |
40 | - echo '"' . mb_ereg_replace('"', '\"', $cache->getUsername()) . '"'; |
|
40 | + echo '"'.mb_ereg_replace('"', '\"', $cache->getUsername()).'"'; |
|
41 | 41 | echo ';'; |
42 | - echo '"' . mb_ereg_replace('"', '\"', $cache->getWPOC()) . '"'; |
|
42 | + echo '"'.mb_ereg_replace('"', '\"', $cache->getWPOC()).'"'; |
|
43 | 43 | echo ';'; |
44 | - echo '"' . mb_ereg_replace('"', '\"', $cache->getWPGC()) . '"'; |
|
44 | + echo '"'.mb_ereg_replace('"', '\"', $cache->getWPGC()).'"'; |
|
45 | 45 | echo ';'; |
46 | - echo '""'; // obsolete Navicache WP |
|
46 | + echo '""'; // obsolete Navicache WP |
|
47 | 47 | } |
48 | 48 | } |
@@ -16,12 +16,12 @@ discard block |
||
16 | 16 | } |
17 | 17 | |
18 | 18 | $opt['rootpath'] = '../'; |
19 | -require_once __DIR__ . '/../lib/common.inc.php'; |
|
20 | -require_once __DIR__ . '/../lib2/charset.inc.php'; |
|
21 | -require_once __DIR__ . '/../lib2/const.inc.php'; |
|
22 | -require_once __DIR__ . '/../lib2/logic/data-license.inc.php'; |
|
23 | -require_once __DIR__ . '/../lib2/logic/npas.inc.php'; |
|
24 | -require_once __DIR__ .' /../lib2/logic/geomath.class.php'; |
|
19 | +require_once __DIR__.'/../lib/common.inc.php'; |
|
20 | +require_once __DIR__.'/../lib2/charset.inc.php'; |
|
21 | +require_once __DIR__.'/../lib2/const.inc.php'; |
|
22 | +require_once __DIR__.'/../lib2/logic/data-license.inc.php'; |
|
23 | +require_once __DIR__.'/../lib2/logic/npas.inc.php'; |
|
24 | +require_once __DIR__.' /../lib2/logic/geomath.class.php'; |
|
25 | 25 | |
26 | 26 | if ($error == true) { |
27 | 27 | echo 'Unable to connect to database'; |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | sql('DELETE FROM `xmlsession_data` WHERE `session_id`=&1', $r['id']); |
106 | 106 | |
107 | 107 | // delete files |
108 | - $path = $zip_basedir . 'ocxml11/' . $r['id']; |
|
108 | + $path = $zip_basedir.'ocxml11/'.$r['id']; |
|
109 | 109 | if (is_dir($path)) { |
110 | 110 | unlinkrecursiv($path); |
111 | 111 | } |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | if (isset($_REQUEST['country'])) { |
193 | 193 | $country = $_REQUEST['country']; |
194 | 194 | |
195 | - if (sqlValue('SELECT COUNT(*) FROM `countries` WHERE `short`=\'' . sql_escape($country) . '\'', 0) != 1) { |
|
195 | + if (sqlValue('SELECT COUNT(*) FROM `countries` WHERE `short`=\''.sql_escape($country).'\'', 0) != 1) { |
|
196 | 196 | die('Unknown country'); |
197 | 197 | } |
198 | 198 | |
@@ -237,13 +237,13 @@ discard block |
||
237 | 237 | $selection['type'] = 3; |
238 | 238 | if (isset($_REQUEST['wp'])) { |
239 | 239 | $selection['cacheid'] = sqlValue( |
240 | - "SELECT `cache_id` FROM `caches` WHERE `wp_oc`='" . sql_escape($_REQUEST['wp']) . "'", |
|
240 | + "SELECT `cache_id` FROM `caches` WHERE `wp_oc`='".sql_escape($_REQUEST['wp'])."'", |
|
241 | 241 | 0 |
242 | 242 | ); |
243 | 243 | } else { |
244 | 244 | if (isset($_REQUEST['uuid'])) { |
245 | 245 | $selection['cacheid'] = sqlValue( |
246 | - "SELECT `cache_id` FROM `caches` WHERE `uuid`='" . sql_escape($_REQUEST['uuid']) . "'", |
|
246 | + "SELECT `cache_id` FROM `caches` WHERE `uuid`='".sql_escape($_REQUEST['uuid'])."'", |
|
247 | 247 | 0 |
248 | 248 | ); |
249 | 249 | } else { |
@@ -302,23 +302,23 @@ discard block |
||
302 | 302 | $xmloutput = ''; |
303 | 303 | if ($bXmlDecl == '1') { |
304 | 304 | if ($sCharset == 'iso-8859-1') { |
305 | - $xmloutput .= '<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>' . "\n"; |
|
305 | + $xmloutput .= '<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>'."\n"; |
|
306 | 306 | } else { |
307 | 307 | if ($sCharset == 'utf-8') { |
308 | - $xmloutput .= '<?xml version="1.0" encoding="utf-8" standalone="yes" ?>' . "\n"; |
|
308 | + $xmloutput .= '<?xml version="1.0" encoding="utf-8" standalone="yes" ?>'."\n"; |
|
309 | 309 | } |
310 | 310 | } |
311 | 311 | } |
312 | 312 | if ($bOcXmlTag == '1') { |
313 | - $xmloutput .= '<ocxmlsession>' . "\n"; |
|
313 | + $xmloutput .= '<ocxmlsession>'."\n"; |
|
314 | 314 | } |
315 | - $xmloutput .= ' <sessionid>' . $sessionid . '</sessionid>' . "\n"; |
|
316 | - $xmloutput .= ' <records user="' . $recordcount['users'] . |
|
317 | - '" cache="' . $recordcount['caches'] . |
|
318 | - '" cachedesc="' . $recordcount['cachedescs'] . |
|
319 | - '" cachelog="' . $recordcount['cachelogs'] . |
|
320 | - '" picture="' . $recordcount['pictures'] . |
|
321 | - '" removeobject="' . $recordcount['removedobjects'] . '" />' . "\n"; |
|
315 | + $xmloutput .= ' <sessionid>'.$sessionid.'</sessionid>'."\n"; |
|
316 | + $xmloutput .= ' <records user="'.$recordcount['users']. |
|
317 | + '" cache="'.$recordcount['caches']. |
|
318 | + '" cachedesc="'.$recordcount['cachedescs']. |
|
319 | + '" cachelog="'.$recordcount['cachelogs']. |
|
320 | + '" picture="'.$recordcount['pictures']. |
|
321 | + '" removeobject="'.$recordcount['removedobjects'].'" />'."\n"; |
|
322 | 322 | if ($bOcXmlTag == '1') { |
323 | 323 | $xmloutput .= '</ocxmlsession>'; |
324 | 324 | } |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | |
388 | 388 | $logtypes = []; |
389 | 389 | $rs = sql('SELECT `id`, `de` FROM log_types'); |
390 | - for ($i = 0; $i < mysql_num_rows($rs); $i ++) { |
|
390 | + for ($i = 0; $i < mysql_num_rows($rs); $i++) { |
|
391 | 391 | $r = sql_fetch_array($rs); |
392 | 392 | $logtypes[$r['id']] = $r['de']; |
393 | 393 | } |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | |
396 | 396 | $cachetypes = []; |
397 | 397 | $rs = sql('SELECT `id`, `short`, `de` FROM cache_type'); |
398 | - for ($i = 0; $i < mysql_num_rows($rs); $i ++) { |
|
398 | + for ($i = 0; $i < mysql_num_rows($rs); $i++) { |
|
399 | 399 | $r = sql_fetch_array($rs); |
400 | 400 | $cachetypes[$r['id']]['de'] = $r['de']; |
401 | 401 | $cachetypes[$r['id']]['short'] = $r['short']; |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | |
405 | 405 | $cachestatus = []; |
406 | 406 | $rs = sql('SELECT `id`, `de` FROM cache_status'); |
407 | - for ($i = 0; $i < mysql_num_rows($rs); $i ++) { |
|
407 | + for ($i = 0; $i < mysql_num_rows($rs); $i++) { |
|
408 | 408 | $r = sql_fetch_array($rs); |
409 | 409 | $cachestatus[$r['id']]['de'] = $r['de']; |
410 | 410 | } |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | |
413 | 413 | $counties = []; |
414 | 414 | $rs = sql('SELECT `short`, `de` FROM countries'); |
415 | - for ($i = 0; $i < mysql_num_rows($rs); $i ++) { |
|
415 | + for ($i = 0; $i < mysql_num_rows($rs); $i++) { |
|
416 | 416 | $r = sql_fetch_array($rs); |
417 | 417 | $counties[$r['short']]['de'] = $r['de']; |
418 | 418 | } |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | |
421 | 421 | $cachesizes = []; |
422 | 422 | $rs = sql('SELECT `id`, `de` FROM cache_size'); |
423 | - for ($i = 0; $i < mysql_num_rows($rs); $i ++) { |
|
423 | + for ($i = 0; $i < mysql_num_rows($rs); $i++) { |
|
424 | 424 | $r = sql_fetch_array($rs); |
425 | 425 | $cachesizes[$r['id']]['de'] = $r['de']; |
426 | 426 | } |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | |
429 | 429 | $languages = []; |
430 | 430 | $rs = sql('SELECT `short`, `de` FROM languages'); |
431 | - for ($i = 0; $i < mysql_num_rows($rs); $i ++) { |
|
431 | + for ($i = 0; $i < mysql_num_rows($rs); $i++) { |
|
432 | 432 | $r = sql_fetch_array($rs); |
433 | 433 | $languages[$r['short']]['de'] = $r['de']; |
434 | 434 | } |
@@ -439,32 +439,32 @@ discard block |
||
439 | 439 | $objecttypes['3'] = 'cachedesc'; |
440 | 440 | $objecttypes['1'] = 'cachelog'; |
441 | 441 | $objecttypes['6'] = 'picture'; |
442 | - $objecttypes['8'] = 'cachelist'; // not implemented yet |
|
442 | + $objecttypes['8'] = 'cachelist'; // not implemented yet |
|
443 | 443 | |
444 | 444 | /* end now a few dynamically loaded constants */ |
445 | 445 | |
446 | 446 | // temporäre Datei erstellen |
447 | - if (!is_dir($zip_basedir . 'ocxml11/' . $sessionid)) { |
|
448 | - mkdir($zip_basedir . 'ocxml11/' . $sessionid); |
|
447 | + if (!is_dir($zip_basedir.'ocxml11/'.$sessionid)) { |
|
448 | + mkdir($zip_basedir.'ocxml11/'.$sessionid); |
|
449 | 449 | } |
450 | 450 | |
451 | 451 | $fileid = 1; |
452 | 452 | while (file_exists( |
453 | - $zip_basedir . 'ocxml11/' . $sessionid . '/' . $sessionid . '-' . $filenr . '-' . $fileid . '.xml' |
|
453 | + $zip_basedir.'ocxml11/'.$sessionid.'/'.$sessionid.'-'.$filenr.'-'.$fileid.'.xml' |
|
454 | 454 | )) { |
455 | - $fileid ++; |
|
455 | + $fileid++; |
|
456 | 456 | } |
457 | 457 | |
458 | - $xmlfilename = $zip_basedir . 'ocxml11/' . $sessionid . '/' . $sessionid . '-' . $filenr . '-' . $fileid . '.xml'; |
|
458 | + $xmlfilename = $zip_basedir.'ocxml11/'.$sessionid.'/'.$sessionid.'-'.$filenr.'-'.$fileid.'.xml'; |
|
459 | 459 | |
460 | 460 | $f = fopen($xmlfilename, 'w'); |
461 | 461 | |
462 | 462 | if ($bXmlDecl == '1') { |
463 | 463 | if ($sCharset == 'iso-8859-1') { |
464 | - fwrite($f, '<?xml version="1.0" encoding="iso-8859-1" standalone="no" ?>' . "\n"); |
|
464 | + fwrite($f, '<?xml version="1.0" encoding="iso-8859-1" standalone="no" ?>'."\n"); |
|
465 | 465 | } else { |
466 | 466 | if ($sCharset == 'utf-8') { |
467 | - fwrite($f, '<?xml version="1.0" encoding="UTF-8" standalone="no" ?>' . "\n"); |
|
467 | + fwrite($f, '<?xml version="1.0" encoding="UTF-8" standalone="no" ?>'."\n"); |
|
468 | 468 | } |
469 | 469 | } |
470 | 470 | } |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | if ($bDocType == '1') { |
473 | 473 | fwrite( |
474 | 474 | $f, |
475 | - '<!DOCTYPE oc11xml PUBLIC "-//Opencaching Network//DTD OCXml V 1.' . ($ocxmlversion % 10) . '//EN" "http://www.opencaching.de/xml/ocxml' . $ocxmlversion . '.dtd">' . "\n" |
|
475 | + '<!DOCTYPE oc11xml PUBLIC "-//Opencaching Network//DTD OCXml V 1.'.($ocxmlversion % 10).'//EN" "http://www.opencaching.de/xml/ocxml'.$ocxmlversion.'.dtd">'."\n" |
|
476 | 476 | ); |
477 | 477 | } |
478 | 478 | if ($bOcXmlTag == '1') { |
@@ -480,30 +480,30 @@ discard block |
||
480 | 480 | $r = sql_fetch_array($rs); |
481 | 481 | fwrite( |
482 | 482 | $f, |
483 | - '<oc11xml version="1.' . ($ocxmlversion % 10) . '" date="' . date( |
|
483 | + '<oc11xml version="1.'.($ocxmlversion % 10).'" date="'.date( |
|
484 | 484 | $sDateformat, |
485 | 485 | strtotime($r['date_created']) |
486 | - ) . '" since="' . date($sDateformat, strtotime($r['modified_since'])) . '">' . "\n" |
|
486 | + ).'" since="'.date($sDateformat, strtotime($r['modified_since'])).'">'."\n" |
|
487 | 487 | ); |
488 | 488 | mysql_free_result($rs); |
489 | 489 | } |
490 | 490 | |
491 | 491 | if ($bAttrlist == '1') { |
492 | 492 | $rs = sql("SELECT SQL_BUFFER_RESULT `id`, `name`, `icon_large`, `icon_no`, `icon_undef` FROM `cache_attrib`"); |
493 | - fwrite($f, $t1 . '<attrlist>' . "\n"); |
|
493 | + fwrite($f, $t1.'<attrlist>'."\n"); |
|
494 | 494 | while ($r = sql_fetch_assoc($rs)) { |
495 | 495 | fwrite( |
496 | 496 | $f, |
497 | - $t2 . '<attr id="' . $r['id'] . '" icon_large="' . xmlentities( |
|
498 | - $opt['page']['default_absolute_url'] . $r['icon_large'] |
|
499 | - ) . '" icon_no="' . xmlentities( |
|
500 | - $opt['page']['default_absolute_url'] . $r['icon_no'] |
|
501 | - ) . '" icon_undef="' . xmlentities( |
|
502 | - $opt['page']['default_absolute_url'] . $r['icon_undef'] |
|
503 | - ) . '">' . xmlcdata($r['name']) . '</attr>' . "\n" |
|
497 | + $t2.'<attr id="'.$r['id'].'" icon_large="'.xmlentities( |
|
498 | + $opt['page']['default_absolute_url'].$r['icon_large'] |
|
499 | + ).'" icon_no="'.xmlentities( |
|
500 | + $opt['page']['default_absolute_url'].$r['icon_no'] |
|
501 | + ).'" icon_undef="'.xmlentities( |
|
502 | + $opt['page']['default_absolute_url'].$r['icon_undef'] |
|
503 | + ).'">'.xmlcdata($r['name']).'</attr>'."\n" |
|
504 | 504 | ); |
505 | 505 | } |
506 | - fwrite($f, $t1 . '</attrlist>' . "\n"); |
|
506 | + fwrite($f, $t1.'</attrlist>'."\n"); |
|
507 | 507 | sql_free_result($rs); |
508 | 508 | } |
509 | 509 | |
@@ -511,18 +511,18 @@ discard block |
||
511 | 511 | 'SELECT SQL_BUFFER_RESULT `user`.`user_id` `id`, `user`.`node` `node`, `user`.`uuid` `uuid`, `user`.`username` `username`, `user`.`pmr_flag` `pmr_flag`, `user`.`date_created` `date_created`, `user`.`last_modified` `last_modified` FROM `tmpxml_users`, `user` WHERE `tmpxml_users`.`id`=`user`.`user_id`' |
512 | 512 | ); |
513 | 513 | while ($r = sql_fetch_array($rs)) { |
514 | - fwrite($f, $t1 . '<user>' . "\n"); |
|
514 | + fwrite($f, $t1.'<user>'."\n"); |
|
515 | 515 | |
516 | - fwrite($f, $t2 . '<id id="' . $r['id'] . '" node="' . $r['node'] . '">' . $r['uuid'] . '</id>' . "\n"); |
|
517 | - fwrite($f, $t2 . '<username>' . xmlcdata($r['username']) . '</username>' . "\n"); |
|
518 | - fwrite($f, $t2 . '<pmr>' . (($r['pmr_flag'] == 0) ? '0' : '1') . '</pmr>' . "\n"); |
|
519 | - fwrite($f, $t2 . '<datecreated>' . date($sDateformat, strtotime($r['date_created'])) . '</datecreated>' . "\n"); |
|
516 | + fwrite($f, $t2.'<id id="'.$r['id'].'" node="'.$r['node'].'">'.$r['uuid'].'</id>'."\n"); |
|
517 | + fwrite($f, $t2.'<username>'.xmlcdata($r['username']).'</username>'."\n"); |
|
518 | + fwrite($f, $t2.'<pmr>'.(($r['pmr_flag'] == 0) ? '0' : '1').'</pmr>'."\n"); |
|
519 | + fwrite($f, $t2.'<datecreated>'.date($sDateformat, strtotime($r['date_created'])).'</datecreated>'."\n"); |
|
520 | 520 | fwrite( |
521 | 521 | $f, |
522 | - $t2 . '<lastmodified>' . date($sDateformat, strtotime($r['last_modified'])) . '</lastmodified>' . "\n" |
|
522 | + $t2.'<lastmodified>'.date($sDateformat, strtotime($r['last_modified'])).'</lastmodified>'."\n" |
|
523 | 523 | ); |
524 | 524 | |
525 | - fwrite($f, $t1 . '</user>' . "\n"); |
|
525 | + fwrite($f, $t1.'</user>'."\n"); |
|
526 | 526 | } |
527 | 527 | mysql_free_result($rs); |
528 | 528 | |
@@ -551,8 +551,8 @@ discard block |
||
551 | 551 | } // return as micro in old interface version |
552 | 552 | |
553 | 553 | if ($ocxmlversion >= 15) { |
554 | - $statusflags = ' needs_maintenance="' . $r['needs_maintenance'] . '" listing_outdated="' . $r['listing_outdated'] . '"'; |
|
555 | - $gccom2 = ' gccom2="' . xmlentities($r['wp_gc_maintained']) . '"'; |
|
554 | + $statusflags = ' needs_maintenance="'.$r['needs_maintenance'].'" listing_outdated="'.$r['listing_outdated'].'"'; |
|
555 | + $gccom2 = ' gccom2="'.xmlentities($r['wp_gc_maintained']).'"'; |
|
556 | 556 | $nccom = ''; |
557 | 557 | } else { |
558 | 558 | $statusflags = ''; |
@@ -560,74 +560,74 @@ discard block |
||
560 | 560 | $nccom = ' nccom=""'; |
561 | 561 | } |
562 | 562 | |
563 | - fwrite($f, $t1 . '<cache>' . "\n"); |
|
563 | + fwrite($f, $t1.'<cache>'."\n"); |
|
564 | 564 | |
565 | - fwrite($f, $t2 . '<id id="' . $r['id'] . '" node="' . $r['node'] . '">' . $r['uuid'] . '</id>' . "\n"); |
|
565 | + fwrite($f, $t2.'<id id="'.$r['id'].'" node="'.$r['node'].'">'.$r['uuid'].'</id>'."\n"); |
|
566 | 566 | fwrite( |
567 | 567 | $f, |
568 | - $t2 . '<userid id="' . $r['user_id'] . '" uuid="' . $r['useruuid'] . '">' . xmlcdata( |
|
568 | + $t2.'<userid id="'.$r['user_id'].'" uuid="'.$r['useruuid'].'">'.xmlcdata( |
|
569 | 569 | $r['username'] |
570 | - ) . '</userid>' . "\n" |
|
570 | + ).'</userid>'."\n" |
|
571 | 571 | ); |
572 | - fwrite($f, $t2 . '<name>' . xmlcdata(($bAllowView ? $r['name'] : '')) . '</name>' . "\n"); |
|
572 | + fwrite($f, $t2.'<name>'.xmlcdata(($bAllowView ? $r['name'] : '')).'</name>'."\n"); |
|
573 | 573 | fwrite( |
574 | 574 | $f, |
575 | - $t2 . '<longitude>' . sprintf('%01.5f', ($bAllowView ? $r['longitude'] : 0)) . '</longitude>' . "\n" |
|
575 | + $t2.'<longitude>'.sprintf('%01.5f', ($bAllowView ? $r['longitude'] : 0)).'</longitude>'."\n" |
|
576 | 576 | ); |
577 | - fwrite($f, $t2 . '<latitude>' . sprintf('%01.5f', ($bAllowView ? $r['latitude'] : 0)) . '</latitude>' . "\n"); |
|
577 | + fwrite($f, $t2.'<latitude>'.sprintf('%01.5f', ($bAllowView ? $r['latitude'] : 0)).'</latitude>'."\n"); |
|
578 | 578 | fwrite( |
579 | 579 | $f, |
580 | - $t2 . '<type id="' . $r['type'] . '" short="' . xmlentities( |
|
580 | + $t2.'<type id="'.$r['type'].'" short="'.xmlentities( |
|
581 | 581 | $cachetypes[$r['type']]['short'] |
582 | - ) . '">' . xmlcdata($cachetypes[$r['type']]['de']) . '</type>' . "\n" |
|
582 | + ).'">'.xmlcdata($cachetypes[$r['type']]['de']).'</type>'."\n" |
|
583 | 583 | ); |
584 | 584 | fwrite( |
585 | 585 | $f, |
586 | - $t2 . '<status id="' . $r['status'] . '"' . $statusflags . '>' . xmlcdata( |
|
586 | + $t2.'<status id="'.$r['status'].'"'.$statusflags.'>'.xmlcdata( |
|
587 | 587 | $cachestatus[$r['status']]['de'] |
588 | - ) . '</status>' . "\n" |
|
588 | + ).'</status>'."\n" |
|
589 | 589 | ); |
590 | 590 | fwrite( |
591 | 591 | $f, |
592 | - $t2 . '<country id="' . $r['country'] . '">' . xmlcdata( |
|
592 | + $t2.'<country id="'.$r['country'].'">'.xmlcdata( |
|
593 | 593 | $counties[$r['country']]['de'] |
594 | - ) . '</country>' . "\n" |
|
594 | + ).'</country>'."\n" |
|
595 | 595 | ); |
596 | - fwrite($f, $t2 . '<size id="' . $r['size'] . '">' . xmlcdata($cachesizes[$r['size']]['de']) . '</size>' . "\n"); |
|
597 | - fwrite($f, $t2 . '<desclanguages>' . $r['desclanguages'] . '</desclanguages>' . "\n"); |
|
598 | - fwrite($f, $t2 . '<difficulty>' . sprintf('%01.1f', $r['difficulty'] / 2) . '</difficulty>' . "\n"); |
|
599 | - fwrite($f, $t2 . '<terrain>' . sprintf('%01.1f', $r['terrain'] / 2) . '</terrain>' . "\n"); |
|
600 | - fwrite($f, $t2 . '<rating waylength="' . $r['way_length'] . '" needtime="' . $r['search_time'] . '" />' . "\n"); |
|
596 | + fwrite($f, $t2.'<size id="'.$r['size'].'">'.xmlcdata($cachesizes[$r['size']]['de']).'</size>'."\n"); |
|
597 | + fwrite($f, $t2.'<desclanguages>'.$r['desclanguages'].'</desclanguages>'."\n"); |
|
598 | + fwrite($f, $t2.'<difficulty>'.sprintf('%01.1f', $r['difficulty'] / 2).'</difficulty>'."\n"); |
|
599 | + fwrite($f, $t2.'<terrain>'.sprintf('%01.1f', $r['terrain'] / 2).'</terrain>'."\n"); |
|
600 | + fwrite($f, $t2.'<rating waylength="'.$r['way_length'].'" needtime="'.$r['search_time'].'" />'."\n"); |
|
601 | 601 | fwrite( |
602 | 602 | $f, |
603 | - $t2 . '<waypoints oc="' . xmlentities($r['wp_oc']) . '" gccom="' . xmlentities( |
|
603 | + $t2.'<waypoints oc="'.xmlentities($r['wp_oc']).'" gccom="'.xmlentities( |
|
604 | 604 | $r['wp_gc'] |
605 | - ) . '"' . $gccom2 . $nccom . ' />' . "\n" |
|
605 | + ).'"'.$gccom2.$nccom.' />'."\n" |
|
606 | 606 | ); |
607 | - fwrite($f, $t2 . '<datehidden>' . date($sDateformat, strtotime($r['date_hidden'])) . '</datehidden>' . "\n"); |
|
607 | + fwrite($f, $t2.'<datehidden>'.date($sDateformat, strtotime($r['date_hidden'])).'</datehidden>'."\n"); |
|
608 | 608 | if ($ocxmlversion >= 12) { |
609 | - $pd = ' ispublishdate="' . $r['is_publishdate'] . '"'; |
|
609 | + $pd = ' ispublishdate="'.$r['is_publishdate'].'"'; |
|
610 | 610 | } else { |
611 | 611 | $pd = ""; |
612 | 612 | } |
613 | 613 | fwrite( |
614 | 614 | $f, |
615 | - $t2 . '<datecreated' . $pd . '>' . date( |
|
615 | + $t2.'<datecreated'.$pd.'>'.date( |
|
616 | 616 | $sDateformat, |
617 | 617 | strtotime($r['date_created']) |
618 | - ) . '</datecreated>' . "\n" |
|
618 | + ).'</datecreated>'."\n" |
|
619 | 619 | ); |
620 | 620 | fwrite( |
621 | 621 | $f, |
622 | - $t2 . '<lastmodified>' . date($sDateformat, strtotime($r['last_modified'])) . '</lastmodified>' . "\n" |
|
622 | + $t2.'<lastmodified>'.date($sDateformat, strtotime($r['last_modified'])).'</lastmodified>'."\n" |
|
623 | 623 | ); |
624 | 624 | if ($ocxmlversion >= 14) { |
625 | 625 | fwrite( |
626 | 626 | $f, |
627 | - $t2 . '<listing_lastmodified>' . date( |
|
627 | + $t2.'<listing_lastmodified>'.date( |
|
628 | 628 | $sDateformat, |
629 | 629 | strtotime($r['listing_last_modified']) |
630 | - ) . '</listing_lastmodified>' . "\n" |
|
630 | + ).'</listing_lastmodified>'."\n" |
|
631 | 631 | ); |
632 | 632 | } |
633 | 633 | |
@@ -638,16 +638,16 @@ discard block |
||
638 | 638 | WHERE `caches_attributes`.`cache_id`='&1'", |
639 | 639 | $r['id'] |
640 | 640 | ); |
641 | - fwrite($f, $t2 . '<attributes>' . "\n"); |
|
641 | + fwrite($f, $t2.'<attributes>'."\n"); |
|
642 | 642 | while ($rAttribute = sql_fetch_assoc($rsAttributes)) { |
643 | 643 | fwrite( |
644 | 644 | $f, |
645 | - $t3 . '<attribute id="' . ($rAttribute['id'] + 0) . '">' . xmlcdata( |
|
645 | + $t3.'<attribute id="'.($rAttribute['id'] + 0).'">'.xmlcdata( |
|
646 | 646 | $rAttribute['name'] |
647 | - ) . '</attribute>' . "\n" |
|
647 | + ).'</attribute>'."\n" |
|
648 | 648 | ); |
649 | 649 | } |
650 | - fwrite($f, $t2 . '</attributes>' . "\n"); |
|
650 | + fwrite($f, $t2.'</attributes>'."\n"); |
|
651 | 651 | sql_free_result($rsAttributes); |
652 | 652 | |
653 | 653 | if ($ocxmlversion >= 13) { |
@@ -662,23 +662,23 @@ discard block |
||
662 | 662 | ORDER BY `coordinates`.`id` ASC", |
663 | 663 | $r['id'] |
664 | 664 | ); |
665 | - fwrite($f, $t2 . '<wpts>' . "\n"); |
|
665 | + fwrite($f, $t2.'<wpts>'."\n"); |
|
666 | 666 | while ($rWaypoint = sql_fetch_assoc($rsWaypoints)) { |
667 | 667 | fwrite( |
668 | 668 | $f, |
669 | - $t3 . '<wpt id="' . ($rWaypoint['id'] + 0) . '" type="' . ($rWaypoint['type'] + 0) . '" typename="' . xmlentities( |
|
669 | + $t3.'<wpt id="'.($rWaypoint['id'] + 0).'" type="'.($rWaypoint['type'] + 0).'" typename="'.xmlentities( |
|
670 | 670 | $rWaypoint['type_name'] |
671 | - ) . '" longitude="' . sprintf('%01.5f', $rWaypoint['longitude']) . '" latitude="' . sprintf( |
|
671 | + ).'" longitude="'.sprintf('%01.5f', $rWaypoint['longitude']).'" latitude="'.sprintf( |
|
672 | 672 | '%01.5f', |
673 | 673 | $rWaypoint['latitude'] |
674 | - ) . '">' . xmlcdata($rWaypoint['description']) . '</wpt>' . "\n" |
|
674 | + ).'">'.xmlcdata($rWaypoint['description']).'</wpt>'."\n" |
|
675 | 675 | ); |
676 | 676 | } |
677 | - fwrite($f, $t2 . '</wpts>' . "\n"); |
|
677 | + fwrite($f, $t2.'</wpts>'."\n"); |
|
678 | 678 | sql_free_result($rsWaypoints); |
679 | 679 | } |
680 | 680 | |
681 | - fwrite($f, $t1 . '</cache>' . "\n"); |
|
681 | + fwrite($f, $t1.'</cache>'."\n"); |
|
682 | 682 | } |
683 | 683 | mysql_free_result($rs); |
684 | 684 | |
@@ -698,18 +698,18 @@ discard block |
||
698 | 698 | while ($r = sql_fetch_array($rs)) { |
699 | 699 | $bAllowView = ($r['allow_user_view'] == 1); |
700 | 700 | |
701 | - fwrite($f, $t1 . '<cachedesc>' . "\n"); |
|
701 | + fwrite($f, $t1.'<cachedesc>'."\n"); |
|
702 | 702 | |
703 | - fwrite($f, $t2 . '<id id="' . $r['id'] . '" node="' . $r['node'] . '">' . $r['uuid'] . '</id>' . "\n"); |
|
704 | - fwrite($f, $t2 . '<cacheid id="' . $r['cache_id'] . '">' . $r['cacheuuid'] . '</cacheid>' . "\n"); |
|
703 | + fwrite($f, $t2.'<id id="'.$r['id'].'" node="'.$r['node'].'">'.$r['uuid'].'</id>'."\n"); |
|
704 | + fwrite($f, $t2.'<cacheid id="'.$r['cache_id'].'">'.$r['cacheuuid'].'</cacheid>'."\n"); |
|
705 | 705 | |
706 | 706 | fwrite( |
707 | 707 | $f, |
708 | - $t2 . '<language id="' . $r['language'] . '">' . xmlcdata( |
|
708 | + $t2.'<language id="'.$r['language'].'">'.xmlcdata( |
|
709 | 709 | $languages[$r['language']]['de'] |
710 | - ) . '</language>' . "\n" |
|
710 | + ).'</language>'."\n" |
|
711 | 711 | ); |
712 | - fwrite($f, $t2 . '<shortdesc>' . xmlcdata(($bAllowView ? $r['short_desc'] : '')) . '</shortdesc>' . "\n"); |
|
712 | + fwrite($f, $t2.'<shortdesc>'.xmlcdata(($bAllowView ? $r['short_desc'] : '')).'</shortdesc>'."\n"); |
|
713 | 713 | |
714 | 714 | $desc = $r['desc']; |
715 | 715 | if ($r['desc_html'] == 0) { |
@@ -728,10 +728,10 @@ discard block |
||
728 | 728 | true |
729 | 729 | ); |
730 | 730 | if ($bLicense) { |
731 | - fwrite($f, $t2 . '<license>' . xmlcdata($disclaimer) . '</license>' . "\n"); |
|
731 | + fwrite($f, $t2.'<license>'.xmlcdata($disclaimer).'</license>'."\n"); |
|
732 | 732 | } else { |
733 | 733 | if ($disclaimer != "") { |
734 | - $desc .= "<p><em>" . $disclaimer . "</em></p>"; |
|
734 | + $desc .= "<p><em>".$disclaimer."</em></p>"; |
|
735 | 735 | } |
736 | 736 | } |
737 | 737 | |
@@ -739,21 +739,21 @@ discard block |
||
739 | 739 | |
740 | 740 | fwrite( |
741 | 741 | $f, |
742 | - $t2 . '<desc html="' . (($r['desc_html'] == 1) ? '1' : '0') . '">' . xmlcdata( |
|
742 | + $t2.'<desc html="'.(($r['desc_html'] == 1) ? '1' : '0').'">'.xmlcdata( |
|
743 | 743 | ($bAllowView ? $desc : '') |
744 | - ) . '</desc>' . "\n" |
|
744 | + ).'</desc>'."\n" |
|
745 | 745 | ); |
746 | 746 | |
747 | 747 | $r['hint'] = mb_ereg_replace('<br />', '', $r['hint']); |
748 | 748 | $r['hint'] = html_entity_decode($r['hint'], ENT_COMPAT, 'UTF-8'); |
749 | 749 | |
750 | - fwrite($f, $t2 . '<hint>' . xmlcdata(($bAllowView ? $r['hint'] : '')) . '</hint>' . "\n"); |
|
750 | + fwrite($f, $t2.'<hint>'.xmlcdata(($bAllowView ? $r['hint'] : '')).'</hint>'."\n"); |
|
751 | 751 | fwrite( |
752 | 752 | $f, |
753 | - $t2 . '<lastmodified>' . date($sDateformat, strtotime($r['last_modified'])) . '</lastmodified>' . "\n" |
|
753 | + $t2.'<lastmodified>'.date($sDateformat, strtotime($r['last_modified'])).'</lastmodified>'."\n" |
|
754 | 754 | ); |
755 | 755 | |
756 | - fwrite($f, $t1 . '</cachedesc>' . "\n"); |
|
756 | + fwrite($f, $t1.'</cachedesc>'."\n"); |
|
757 | 757 | } |
758 | 758 | mysql_free_result($rs); |
759 | 759 | |
@@ -794,7 +794,7 @@ discard block |
||
794 | 794 | } |
795 | 795 | |
796 | 796 | if ($ocxmlversion >= 13) { |
797 | - $teamcomment = ' teamcomment="' . $r['oc_team_comment'] . '"'; |
|
797 | + $teamcomment = ' teamcomment="'.$r['oc_team_comment'].'"'; |
|
798 | 798 | } else { |
799 | 799 | $teamcomment = ''; |
800 | 800 | if ($r['type'] > 8) { |
@@ -803,51 +803,51 @@ discard block |
||
803 | 803 | } |
804 | 804 | |
805 | 805 | if ($ocxmlversion >= 15) { |
806 | - $statusflags = ' needs_maintenance="' . $r['needs_maintenance'] . '" listing_outdated="' . $r['listing_outdated'] . '"'; |
|
806 | + $statusflags = ' needs_maintenance="'.$r['needs_maintenance'].'" listing_outdated="'.$r['listing_outdated'].'"'; |
|
807 | 807 | } else { |
808 | 808 | $statusflags = ''; |
809 | 809 | } |
810 | 810 | |
811 | - fwrite($f, $t1 . '<cachelog>' . "\n"); |
|
812 | - fwrite($f, $t2 . '<id id="' . $r['id'] . '" node="' . $r['node'] . '">' . $r['uuid'] . '</id>' . "\n"); |
|
813 | - fwrite($f, $t2 . '<cacheid id="' . $r['cache_id'] . '">' . $r['cacheuuid'] . '</cacheid>' . "\n"); |
|
811 | + fwrite($f, $t1.'<cachelog>'."\n"); |
|
812 | + fwrite($f, $t2.'<id id="'.$r['id'].'" node="'.$r['node'].'">'.$r['uuid'].'</id>'."\n"); |
|
813 | + fwrite($f, $t2.'<cacheid id="'.$r['cache_id'].'">'.$r['cacheuuid'].'</cacheid>'."\n"); |
|
814 | 814 | fwrite( |
815 | 815 | $f, |
816 | - $t2 . '<userid id="' . $r['user_id'] . '" uuid="' . $r['useruuid'] . '">' . xmlcdata( |
|
816 | + $t2.'<userid id="'.$r['user_id'].'" uuid="'.$r['useruuid'].'">'.xmlcdata( |
|
817 | 817 | $r['username'] |
818 | - ) . '</userid>' . "\n" |
|
818 | + ).'</userid>'."\n" |
|
819 | 819 | ); |
820 | 820 | fwrite( |
821 | 821 | $f, |
822 | - $t2 . '<logtype id="' . $r['type'] . '" recommended="' . $r['recommended'] . '"' . $teamcomment . $statusflags . '>' . xmlcdata( |
|
822 | + $t2.'<logtype id="'.$r['type'].'" recommended="'.$r['recommended'].'"'.$teamcomment.$statusflags.'>'.xmlcdata( |
|
823 | 823 | $logtypes[$r['type']] |
824 | - ) . '</logtype>' . "\n" |
|
824 | + ).'</logtype>'."\n" |
|
825 | 825 | ); |
826 | 826 | fwrite( |
827 | 827 | $f, |
828 | - $t2 . '<date>' . date( |
|
828 | + $t2.'<date>'.date( |
|
829 | 829 | $ocxmlversion >= 13 ? $sDateformat : $sDateshort, |
830 | 830 | strtotime($r['date']) |
831 | - ) . '</date>' . "\n" |
|
831 | + ).'</date>'."\n" |
|
832 | 832 | ); |
833 | 833 | fwrite( |
834 | 834 | $f, |
835 | - $t2 . '<text html="' . $r['text_html'] . '">' . xmlcdata( |
|
835 | + $t2.'<text html="'.$r['text_html'].'">'.xmlcdata( |
|
836 | 836 | ($bAllowView ? $r['text'] : '') |
837 | - ) . '</text>' . "\n" |
|
837 | + ).'</text>'."\n" |
|
838 | 838 | ); |
839 | - fwrite($f, $t2 . '<datecreated>' . date($sDateformat, strtotime($r['date_created'])) . '</datecreated>' . "\n"); |
|
839 | + fwrite($f, $t2.'<datecreated>'.date($sDateformat, strtotime($r['date_created'])).'</datecreated>'."\n"); |
|
840 | 840 | fwrite( |
841 | 841 | $f, |
842 | - $t2 . '<lastmodified>' . date($sDateformat, strtotime($r['last_modified'])) . '</lastmodified>' . "\n" |
|
842 | + $t2.'<lastmodified>'.date($sDateformat, strtotime($r['last_modified'])).'</lastmodified>'."\n" |
|
843 | 843 | ); |
844 | 844 | if ($ocxmlversion >= 14) { |
845 | 845 | fwrite( |
846 | 846 | $f, |
847 | - $t2 . '<log_lastmodified>' . date( |
|
847 | + $t2.'<log_lastmodified>'.date( |
|
848 | 848 | $sDateformat, |
849 | 849 | strtotime($r['log_last_modified']) |
850 | - ) . '</log_lastmodified>' . "\n" |
|
850 | + ).'</log_lastmodified>'."\n" |
|
851 | 851 | ); |
852 | 852 | } |
853 | 853 | |
@@ -862,10 +862,10 @@ discard block |
||
862 | 862 | false, |
863 | 863 | true |
864 | 864 | ); |
865 | - fwrite($f, $t2 . '<license>' . xmlcdata($disclaimer) . '</license>' . "\n"); |
|
865 | + fwrite($f, $t2.'<license>'.xmlcdata($disclaimer).'</license>'."\n"); |
|
866 | 866 | } |
867 | 867 | |
868 | - fwrite($f, $t1 . '</cachelog>' . "\n"); |
|
868 | + fwrite($f, $t1.'</cachelog>'."\n"); |
|
869 | 869 | } |
870 | 870 | mysql_free_result($rs); |
871 | 871 | |
@@ -895,30 +895,30 @@ discard block |
||
895 | 895 | while ($r = sql_fetch_array($rs)) { |
896 | 896 | $bAllowView = ($r['auv'] == 1); |
897 | 897 | |
898 | - fwrite($f, $t1 . '<picture>' . "\n"); |
|
899 | - fwrite($f, $t2 . '<id id="' . $r['id'] . '" node="' . $r['node'] . '">' . $r['uuid'] . '</id>' . "\n"); |
|
900 | - fwrite($f, $t2 . '<url>' . xmlcdata(($bAllowView ? $r['url'] : '')) . '</url>' . "\n"); |
|
901 | - fwrite($f, $t2 . '<title>' . xmlcdata(($bAllowView ? $r['title'] : '')) . '</title>' . "\n"); |
|
898 | + fwrite($f, $t1.'<picture>'."\n"); |
|
899 | + fwrite($f, $t2.'<id id="'.$r['id'].'" node="'.$r['node'].'">'.$r['uuid'].'</id>'."\n"); |
|
900 | + fwrite($f, $t2.'<url>'.xmlcdata(($bAllowView ? $r['url'] : '')).'</url>'."\n"); |
|
901 | + fwrite($f, $t2.'<title>'.xmlcdata(($bAllowView ? $r['title'] : '')).'</title>'."\n"); |
|
902 | 902 | fwrite( |
903 | 903 | $f, |
904 | - $t2 . '<object id="' . $r['object_id'] . '" type="' . $r['object_type'] . '" typename="' . xmlentities( |
|
904 | + $t2.'<object id="'.$r['object_id'].'" type="'.$r['object_type'].'" typename="'.xmlentities( |
|
905 | 905 | $objecttypes[$r['object_type']] |
906 | - ) . '">' . object_id2uuid($r['object_id'], $r['object_type']) . '</object>' . "\n" |
|
906 | + ).'">'.object_id2uuid($r['object_id'], $r['object_type']).'</object>'."\n" |
|
907 | 907 | ); |
908 | 908 | if ($ocxmlversion >= 13) { |
909 | 909 | fwrite( |
910 | 910 | $f, |
911 | - $t2 . '<picattr spoiler="' . $r['spoiler'] . '" display="' . $r['display'] . '" preview="' . $r['mappreview'] . '" />' . "\n" |
|
911 | + $t2.'<picattr spoiler="'.$r['spoiler'].'" display="'.$r['display'].'" preview="'.$r['mappreview'].'" />'."\n" |
|
912 | 912 | ); |
913 | 913 | } else { |
914 | - fwrite($f, $t2 . '<attributes spoiler="' . $r['spoiler'] . '" display="' . $r['display'] . '" />' . "\n"); |
|
914 | + fwrite($f, $t2.'<attributes spoiler="'.$r['spoiler'].'" display="'.$r['display'].'" />'."\n"); |
|
915 | 915 | } |
916 | - fwrite($f, $t2 . '<datecreated>' . date($sDateformat, strtotime($r['date_created'])) . '</datecreated>' . "\n"); |
|
916 | + fwrite($f, $t2.'<datecreated>'.date($sDateformat, strtotime($r['date_created'])).'</datecreated>'."\n"); |
|
917 | 917 | fwrite( |
918 | 918 | $f, |
919 | - $t2 . '<lastmodified>' . date($sDateformat, strtotime($r['last_modified'])) . '</lastmodified>' . "\n" |
|
919 | + $t2.'<lastmodified>'.date($sDateformat, strtotime($r['last_modified'])).'</lastmodified>'."\n" |
|
920 | 920 | ); |
921 | - fwrite($f, $t2 . '<position>' . $r['seq'] . '</position>' . "\n"); |
|
921 | + fwrite($f, $t2.'<position>'.$r['seq'].'</position>'."\n"); |
|
922 | 922 | |
923 | 923 | if ($bLicense) { |
924 | 924 | $lang = ($sLanguage != "" ? $sLanguage : $r['language']); |
@@ -931,10 +931,10 @@ discard block |
||
931 | 931 | false, |
932 | 932 | true |
933 | 933 | ); |
934 | - fwrite($f, $t2 . '<license>' . xmlcdata($disclaimer) . '</license>' . "\n"); |
|
934 | + fwrite($f, $t2.'<license>'.xmlcdata($disclaimer).'</license>'."\n"); |
|
935 | 935 | } |
936 | 936 | |
937 | - fwrite($f, $t1 . '</picture>' . "\n"); |
|
937 | + fwrite($f, $t1.'</picture>'."\n"); |
|
938 | 938 | } |
939 | 939 | mysql_free_result($rs); |
940 | 940 | |
@@ -944,31 +944,31 @@ discard block |
||
944 | 944 | FROM `tmpxml_removedobjects`, `removed_objects` WHERE `removed_objects`.`id`=`tmpxml_removedobjects`.`id`' |
945 | 945 | ); |
946 | 946 | while ($r = sql_fetch_array($rs)) { |
947 | - fwrite($f, $t1 . '<removedobject>' . "\n"); |
|
948 | - fwrite($f, $t2 . '<id id="' . $r['id'] . '" node="' . $r['node'] . '" />' . "\n"); |
|
947 | + fwrite($f, $t1.'<removedobject>'."\n"); |
|
948 | + fwrite($f, $t2.'<id id="'.$r['id'].'" node="'.$r['node'].'" />'."\n"); |
|
949 | 949 | fwrite( |
950 | 950 | $f, |
951 | - $t2 . '<object id="' . $r['localid'] . '" type="' . $r['type'] . '" typename="' . xmlentities( |
|
951 | + $t2.'<object id="'.$r['localid'].'" type="'.$r['type'].'" typename="'.xmlentities( |
|
952 | 952 | $objecttypes[$r['type']] |
953 | - ) . '">' . $r['uuid'] . '</object>' . "\n" |
|
953 | + ).'">'.$r['uuid'].'</object>'."\n" |
|
954 | 954 | ); |
955 | - fwrite($f, $t2 . '<removeddate>' . date($sDateformat, strtotime($r['removed_date'])) . '</removeddate>' . "\n"); |
|
956 | - fwrite($f, $t1 . '</removedobject>' . "\n"); |
|
955 | + fwrite($f, $t2.'<removeddate>'.date($sDateformat, strtotime($r['removed_date'])).'</removeddate>'."\n"); |
|
956 | + fwrite($f, $t1.'</removedobject>'."\n"); |
|
957 | 957 | } |
958 | 958 | mysql_free_result($rs); |
959 | 959 | |
960 | 960 | if ($bOcXmlTag == '1') { |
961 | - fwrite($f, '</oc11xml>' . "\n"); |
|
961 | + fwrite($f, '</oc11xml>'."\n"); |
|
962 | 962 | } |
963 | 963 | |
964 | 964 | fclose($f); |
965 | 965 | |
966 | - $rel_xmlfile = 'ocxml11/' . $sessionid . '/' . $sessionid . '-' . $filenr . '-' . $fileid . '.xml'; |
|
967 | - $rel_zipfile = 'ocxml11/' . $sessionid . '/' . $sessionid . '-' . $filenr . '-' . $fileid; |
|
966 | + $rel_xmlfile = 'ocxml11/'.$sessionid.'/'.$sessionid.'-'.$filenr.'-'.$fileid.'.xml'; |
|
967 | + $rel_zipfile = 'ocxml11/'.$sessionid.'/'.$sessionid.'-'.$filenr.'-'.$fileid; |
|
968 | 968 | |
969 | 969 | // zippen und url-redirect |
970 | 970 | if ($ziptype == '0') { |
971 | - tpl_redirect($zip_wwwdir . $rel_xmlfile); |
|
971 | + tpl_redirect($zip_wwwdir.$rel_xmlfile); |
|
972 | 972 | exit; |
973 | 973 | } else { |
974 | 974 | if ($ziptype == 'zip') { |
@@ -986,17 +986,17 @@ discard block |
||
986 | 986 | } |
987 | 987 | } |
988 | 988 | |
989 | - $call = $safemode_zip . ' --type=' . escapeshellcmd($ziptype) . ' --src=' . escapeshellcmd( |
|
989 | + $call = $safemode_zip.' --type='.escapeshellcmd($ziptype).' --src='.escapeshellcmd( |
|
990 | 990 | $rel_xmlfile |
991 | - ) . ' --dst=' . escapeshellcmd($rel_zipfile); |
|
991 | + ).' --dst='.escapeshellcmd($rel_zipfile); |
|
992 | 992 | system($call); |
993 | 993 | |
994 | 994 | // datei vorhanden? |
995 | - if (!file_exists($zip_basedir . $rel_zipfile)) { |
|
995 | + if (!file_exists($zip_basedir.$rel_zipfile)) { |
|
996 | 996 | die('all ok, but zip failed - internal server error'); |
997 | 997 | } |
998 | 998 | |
999 | - tpl_redirect($zip_wwwdir . $rel_zipfile); |
|
999 | + tpl_redirect($zip_wwwdir.$rel_zipfile); |
|
1000 | 1000 | |
1001 | 1001 | exit; |
1002 | 1002 | } |
@@ -1048,7 +1048,7 @@ discard block |
||
1048 | 1048 | } |
1049 | 1049 | sql( |
1050 | 1050 | "INSERT INTO xmlsession_data (`session_id`, `object_type`, `object_id`) |
1051 | - SELECT &1, 2, `cache_id` FROM `caches` WHERE " . $wherefield . " >= '&2' AND `status`!=5", |
|
1051 | + SELECT &1, 2, `cache_id` FROM `caches` WHERE " . $wherefield." >= '&2' AND `status`!=5", |
|
1052 | 1052 | $sessionid, |
1053 | 1053 | $sModifiedSince |
1054 | 1054 | ); |
@@ -1137,31 +1137,31 @@ discard block |
||
1137 | 1137 | 'longitude', |
1138 | 1138 | 'latitude', |
1139 | 1139 | 'cache_coordinates' |
1140 | - ) . ' `distance` '; |
|
1140 | + ).' `distance` '; |
|
1141 | 1141 | $sql .= 'FROM `caches`, `cache_coordinates` WHERE '; |
1142 | 1142 | $sql .= '`cache_coordinates`.`cache_id`=`caches`.`cache_id`'; |
1143 | 1143 | $sql .= ' AND `caches`.`status`!=5'; |
1144 | - $sql .= ' AND `cache_coordinates`.`latitude` > ' . geomath::getMinLat( |
|
1144 | + $sql .= ' AND `cache_coordinates`.`latitude` > '.geomath::getMinLat( |
|
1145 | 1145 | $selection['lon'], |
1146 | 1146 | $selection['lat'], |
1147 | 1147 | $selection['distance'] |
1148 | 1148 | ); |
1149 | - $sql .= ' AND `cache_coordinates`.`latitude` < ' . geomath::getMaxLat( |
|
1149 | + $sql .= ' AND `cache_coordinates`.`latitude` < '.geomath::getMaxLat( |
|
1150 | 1150 | $selection['lon'], |
1151 | 1151 | $selection['lat'], |
1152 | 1152 | $selection['distance'] |
1153 | 1153 | ); |
1154 | - $sql .= ' AND `cache_coordinates`.`longitude` >' . geomath::getMinLon( |
|
1154 | + $sql .= ' AND `cache_coordinates`.`longitude` >'.geomath::getMinLon( |
|
1155 | 1155 | $selection['lon'], |
1156 | 1156 | $selection['lat'], |
1157 | 1157 | $selection['distance'] |
1158 | 1158 | ); |
1159 | - $sql .= ' AND `cache_coordinates`.`longitude` < ' . geomath::getMaxLon( |
|
1159 | + $sql .= ' AND `cache_coordinates`.`longitude` < '.geomath::getMaxLon( |
|
1160 | 1160 | $selection['lon'], |
1161 | 1161 | $selection['lat'], |
1162 | 1162 | $selection['distance'] |
1163 | 1163 | ); |
1164 | - $sql .= ' HAVING `distance` < ' . ($selection['distance'] + 0); |
|
1164 | + $sql .= ' HAVING `distance` < '.($selection['distance'] + 0); |
|
1165 | 1165 | |
1166 | 1166 | sql($sql); |
1167 | 1167 | } else { |
@@ -1300,7 +1300,7 @@ discard block |
||
1300 | 1300 | // echo $startat . ' ' . $endat . '<br><br>'; |
1301 | 1301 | // echo '<table>'; |
1302 | 1302 | // echo '<tr><td>sql-start</td><td>sql-count</td><td>count</td><td>begin</td><td>end</td></tr>'; |
1303 | - for ($i = 0; $i < 6; $i ++) { |
|
1303 | + for ($i = 0; $i < 6; $i++) { |
|
1304 | 1304 | if (($startat >= $recordnr[$i]) && ($startat + 500 < $recordnr[$i + 1])) { |
1305 | 1305 | if ($recordnr[$i + 1] - $startat > 500) { |
1306 | 1306 | $limits[$i] = ['start' => $startat - $recordnr[$i], 'count' => 500]; |
@@ -1403,7 +1403,7 @@ discard block |
||
1403 | 1403 | $str = output_convert($str); |
1404 | 1404 | $str = mb_ereg_replace(']]>', ']] >', $str); |
1405 | 1405 | |
1406 | - return '<![CDATA[' . filterevilchars($str) . ']]>'; |
|
1406 | + return '<![CDATA['.filterevilchars($str).']]>'; |
|
1407 | 1407 | } else { |
1408 | 1408 | return xmlentities($str); |
1409 | 1409 | } |
@@ -1422,7 +1422,7 @@ discard block |
||
1422 | 1422 | $from[4] = '\''; |
1423 | 1423 | $to[4] = '''; |
1424 | 1424 | |
1425 | - for ($i = 0; $i <= 4; $i ++) { |
|
1425 | + for ($i = 0; $i <= 4; $i++) { |
|
1426 | 1426 | $str = mb_ereg_replace($from[$i], $to[$i], $str); |
1427 | 1427 | } |
1428 | 1428 | |
@@ -1501,13 +1501,13 @@ discard block |
||
1501 | 1501 | |
1502 | 1502 | $hDir = opendir($path); |
1503 | 1503 | if ($hDir === false) { |
1504 | - ++ $notunlinked; |
|
1504 | + ++$notunlinked; |
|
1505 | 1505 | } else { |
1506 | 1506 | while (false !== ($file = readdir($hDir))) { |
1507 | 1507 | if (($file != '.') && ($file != '..')) { |
1508 | - if (is_dir($path . $file)) { |
|
1509 | - if (unlinkrecursiv($path . $file . '/') == false) { |
|
1510 | - $notunlinked ++; |
|
1508 | + if (is_dir($path.$file)) { |
|
1509 | + if (unlinkrecursiv($path.$file.'/') == false) { |
|
1510 | + $notunlinked++; |
|
1511 | 1511 | } |
1512 | 1512 | } else { |
1513 | 1513 | if ((mb_substr($file, - 4) == '.zip') || |
@@ -1515,9 +1515,9 @@ discard block |
||
1515 | 1515 | (mb_substr($file, - 4) == '.bz2') || |
1516 | 1516 | (mb_substr($file, - 4) == '.xml') |
1517 | 1517 | ) { |
1518 | - @unlink($path . $file); |
|
1518 | + @unlink($path.$file); |
|
1519 | 1519 | } else { |
1520 | - $notunlinked ++; |
|
1520 | + $notunlinked++; |
|
1521 | 1521 | } |
1522 | 1522 | } |
1523 | 1523 | } |
@@ -13,12 +13,12 @@ discard block |
||
13 | 13 | * Unicode Reminder メモ |
14 | 14 | *****************************************************************************/ |
15 | 15 | |
16 | -require_once __DIR__ . '/lib/consts.inc.php'; |
|
16 | +require_once __DIR__.'/lib/consts.inc.php'; |
|
17 | 17 | $opt['gui'] = GUI_HTML; |
18 | -require_once __DIR__ . '/lib/common.inc.php'; |
|
19 | -require_once __DIR__ . '/lib2/logic/logtypes.inc.php'; |
|
20 | -require_once __DIR__ . '/lib/recommendation.inc.php'; |
|
21 | -require_once __DIR__ . '/lib2/edithelper.inc.php'; |
|
18 | +require_once __DIR__.'/lib/common.inc.php'; |
|
19 | +require_once __DIR__.'/lib2/logic/logtypes.inc.php'; |
|
20 | +require_once __DIR__.'/lib/recommendation.inc.php'; |
|
21 | +require_once __DIR__.'/lib2/edithelper.inc.php'; |
|
22 | 22 | |
23 | 23 | //Preprocessing |
24 | 24 | if ($error == false) { |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | tpl_set_var('username', ''); |
35 | 35 | tpl_set_var('message_start', ''); |
36 | 36 | tpl_set_var('message_end', ''); |
37 | - tpl_set_var('target', 'editlog.php?logid=' . urlencode($log_id)); |
|
37 | + tpl_set_var('target', 'editlog.php?logid='.urlencode($log_id)); |
|
38 | 38 | tpl_set_var('message', $login_required); |
39 | 39 | tpl_set_var('helplink', helppagelink('login')); |
40 | 40 | } else { |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | if (($log_record !== false && (($log_record['status'] != 6) || ($log_record['cache_user_id'] == $login->userid && $log_record['user_id'] == $login->userid)) && |
73 | 73 | $log_record['status'] != 7) || $useradmin |
74 | 74 | ) { |
75 | - require $stylepath . '/editlog.inc.php'; |
|
76 | - require $stylepath . '/rating.inc.php'; |
|
75 | + require $stylepath.'/editlog.inc.php'; |
|
76 | + require $stylepath.'/rating.inc.php'; |
|
77 | 77 | |
78 | 78 | if ($log_record['node'] != $oc_nodeid) { |
79 | 79 | tpl_errorMsg('editlog', $error_wrong_node); |
@@ -133,9 +133,9 @@ discard block |
||
133 | 133 | |
134 | 134 | // check if user has exceeded his top 10% limit |
135 | 135 | $is_top = sqlValue( |
136 | - "SELECT COUNT(`cache_id`) FROM `cache_rating` WHERE `user_id`='" . sql_escape( |
|
136 | + "SELECT COUNT(`cache_id`) FROM `cache_rating` WHERE `user_id`='".sql_escape( |
|
137 | 137 | $usr['userid'] |
138 | - ) . "' AND `cache_id`='" . sql_escape($log_record['cache_id']) . "'", |
|
138 | + )."' AND `cache_id`='".sql_escape($log_record['cache_id'])."'", |
|
139 | 139 | 0 |
140 | 140 | ); |
141 | 141 | $user_founds = sqlValue( |
@@ -144,11 +144,11 @@ discard block |
||
144 | 144 | LEFT JOIN `stat_user` ON `user`.`user_id`=`stat_user`.`user_id` |
145 | 145 | WHERE `user`.`user_id`='" . sql_escape( |
146 | 146 | $usr['userid'] |
147 | - ) . "'", |
|
147 | + )."'", |
|
148 | 148 | 0 |
149 | 149 | ); |
150 | 150 | $user_tops = sqlValue( |
151 | - "SELECT COUNT(`user_id`) FROM `cache_rating` WHERE `user_id`='" . sql_escape($usr['userid']) . "'", |
|
151 | + "SELECT COUNT(`user_id`) FROM `cache_rating` WHERE `user_id`='".sql_escape($usr['userid'])."'", |
|
152 | 152 | 0 |
153 | 153 | ); |
154 | 154 | |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | $rating_msg = mb_ereg_replace( |
157 | 157 | '{chk_sel}', |
158 | 158 | ($is_top ? 'checked' : ''), |
159 | - $rating_allowed . '<br />' . $rating_stat |
|
159 | + $rating_allowed.'<br />'.$rating_stat |
|
160 | 160 | ); |
161 | 161 | $rating_msg = mb_ereg_replace('{max}', floor($user_founds * rating_percentage / 100), $rating_msg); |
162 | 162 | $rating_msg = mb_ereg_replace('{curr}', $user_tops, $rating_msg); |
@@ -169,14 +169,14 @@ discard block |
||
169 | 169 | } |
170 | 170 | |
171 | 171 | if ($user_tops) { |
172 | - $rating_msg .= '<br />' . $rating_maywithdraw; |
|
172 | + $rating_msg .= '<br />'.$rating_maywithdraw; |
|
173 | 173 | } |
174 | 174 | } |
175 | 175 | |
176 | 176 | tpl_set_var('rating_message', mb_ereg_replace('{rating_msg}', $rating_msg, $rating_tpl)); |
177 | 177 | |
178 | 178 | if (isset($_POST['descMode'])) { |
179 | - $descMode = $_POST['descMode'] + 0; // Ocprop: 2 |
|
179 | + $descMode = $_POST['descMode'] + 0; // Ocprop: 2 |
|
180 | 180 | if (($descMode < 1) || ($descMode > 3)) { |
181 | 181 | $descMode = 3; |
182 | 182 | } |
@@ -325,14 +325,14 @@ discard block |
||
325 | 325 | if (is_latest_log($log_record['cache_id'], $log_record['log_id'])) { |
326 | 326 | $newstatus = sqlValue( |
327 | 327 | "SELECT `cache_status` FROM `log_types` |
328 | - WHERE `id`='" . sql_escape($log_type) . "'", |
|
328 | + WHERE `id`='" . sql_escape($log_type)."'", |
|
329 | 329 | false |
330 | 330 | ); |
331 | 331 | if ($newstatus && $newstatus != $log_record['status']) { |
332 | 332 | sql("SET @STATUS_CHANGE_USER_ID='&1'", $login->userid); |
333 | 333 | sql( |
334 | - "UPDATE `caches` SET `status`='" . sql_escape($newstatus) . "' |
|
335 | - WHERE `cache_id`='" . sql_escape($log_record['cache_id']) . "'" |
|
334 | + "UPDATE `caches` SET `status`='".sql_escape($newstatus)."' |
|
335 | + WHERE `cache_id`='" . sql_escape($log_record['cache_id'])."'" |
|
336 | 336 | ); |
337 | 337 | } |
338 | 338 | } |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | //update user-stat if type changed |
341 | 341 | if ($log_record['logtype'] != $log_type) { |
342 | 342 | //call eventhandler |
343 | - require_once $opt['rootpath'] . 'lib/eventhandler.inc.php'; |
|
343 | + require_once $opt['rootpath'].'lib/eventhandler.inc.php'; |
|
344 | 344 | event_change_log_type($log_record['cache_id'], $usr['userid'] + 0); |
345 | 345 | } |
346 | 346 | |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | |
382 | 382 | //display cache page |
383 | 383 | tpl_redirect( |
384 | - 'viewcache.php?cacheid=' . urlencode($log_record['cache_id']) . '&log=A#log' . urlencode( |
|
384 | + 'viewcache.php?cacheid='.urlencode($log_record['cache_id']).'&log=A#log'.urlencode( |
|
385 | 385 | $log_id |
386 | 386 | ) |
387 | 387 | ); |
@@ -403,9 +403,9 @@ discard block |
||
403 | 403 | $logtypeoptions = ''; |
404 | 404 | foreach ($allowed_logtypes as $logtype) { |
405 | 405 | $selected = ($log_record['logtype'] == $logtype ? ' selected="selected"' : ''); |
406 | - $logtypeoptions .= '<option value="' . $logtype . '"' . $selected . '>'; |
|
406 | + $logtypeoptions .= '<option value="'.$logtype.'"'.$selected.'>'; |
|
407 | 407 | $logtypeoptions .= htmlspecialchars($logtype_names[$logtype], ENT_COMPAT, 'UTF-8'); |
408 | - $logtypeoptions .= '</option>' . "\n"; |
|
408 | + $logtypeoptions .= '</option>'."\n"; |
|
409 | 409 | } |
410 | 410 | $disable_typechange = $disable_statuschange && $log_record['is_status_log']; |
411 | 411 | tpl_set_var('type_edit_disabled', $disable_typechange ? $type_edit_disabled : ''); |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | tpl_set_var('logminute', htmlspecialchars($log_time_minute, ENT_COMPAT, 'UTF-8')); |
435 | 435 | tpl_set_var('cachename', htmlspecialchars($cache_name, ENT_COMPAT, 'UTF-8')); |
436 | 436 | tpl_set_var('cacheid', $log_record['cache_id']); |
437 | - tpl_set_var('reset', $reset); // obsolete |
|
437 | + tpl_set_var('reset', $reset); // obsolete |
|
438 | 438 | tpl_set_var('submit', $submit); |
439 | 439 | tpl_set_var('logid', $log_id); |
440 | 440 | tpl_set_var('date_message', !$date_ok ? $date_message : ''); |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | // Text / normal HTML / HTML editor |
449 | 449 | tpl_set_var('use_tinymce', (($descMode == 3) ? 1 : 0)); |
450 | 450 | |
451 | - $headers = tpl_get_var('htmlheaders') . "\n"; |
|
451 | + $headers = tpl_get_var('htmlheaders')."\n"; |
|
452 | 452 | if ($descMode == 1) { |
453 | 453 | tpl_set_var('descMode', 1); |
454 | 454 | } else { |
@@ -456,15 +456,15 @@ discard block |
||
456 | 456 | tpl_set_var('descMode', 2); |
457 | 457 | } else { |
458 | 458 | // TinyMCE |
459 | - $headers .= '<script language="javascript" type="text/javascript" src="resource2/tinymce/tiny_mce_gzip.js"></script>' . "\n"; |
|
460 | - $headers .= '<script language="javascript" type="text/javascript" src="resource2/tinymce/config/log.js.php?logid=0&lang=' . |
|
459 | + $headers .= '<script language="javascript" type="text/javascript" src="resource2/tinymce/tiny_mce_gzip.js"></script>'."\n"; |
|
460 | + $headers .= '<script language="javascript" type="text/javascript" src="resource2/tinymce/config/log.js.php?logid=0&lang='. |
|
461 | 461 | strtolower( |
462 | 462 | $locale |
463 | - ) . '"></script>' . "\n"; |
|
463 | + ).'"></script>'."\n"; |
|
464 | 464 | tpl_set_var('descMode', 3); |
465 | 465 | } |
466 | 466 | } |
467 | - $headers .= '<script language="javascript" type="text/javascript" src="' . editorJsPath() . '"></script>' . "\n"; |
|
467 | + $headers .= '<script language="javascript" type="text/javascript" src="'.editorJsPath().'"></script>'."\n"; |
|
468 | 468 | tpl_set_var('htmlheaders', $headers); |
469 | 469 | |
470 | 470 | if ($use_log_pw == true && $log_pw != '') { |
@@ -485,12 +485,12 @@ discard block |
||
485 | 485 | $tmp_smiley = $smiley_link; |
486 | 486 | $tmp_smiley = mb_ereg_replace('{smiley_image}', $smiley['image'][$i], $tmp_smiley); |
487 | 487 | $tmp_smiley = mb_ereg_replace('{smiley_symbol}', $smiley['text'][$i], $tmp_smiley); |
488 | - $smilies = $smilies . ' ' . |
|
488 | + $smilies = $smilies.' '. |
|
489 | 489 | mb_ereg_replace( |
490 | 490 | '{smiley_file}', |
491 | 491 | $smiley['file'][$i], |
492 | 492 | $tmp_smiley |
493 | - ) . ' '; |
|
493 | + ).' '; |
|
494 | 494 | } |
495 | 495 | } |
496 | 496 | tpl_set_var('smileypath', $opt['template']['smiley']); |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | $lastest_log_id = sqlValue( |
518 | 518 | " |
519 | 519 | SELECT `id` FROM `cache_logs` |
520 | - WHERE `cache_id`='" . sql_escape($cache_id) . "' |
|
520 | + WHERE `cache_id`='" . sql_escape($cache_id)."' |
|
521 | 521 | ORDER BY `order_date` DESC, `date_created` DESC, `id` DESC |
522 | 522 | LIMIT 1", |
523 | 523 | 0, |