Completed
Push — master ( 182b8c...09455a )
by Thomas
07:02
created
htdocs/util/attributes/list.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@  discard block
 block discarded – undo
7 7
 
8 8
 header('Content-type: text/html; charset=utf-8');
9 9
 
10
-$rootpath = __DIR__ . '/../../';
11
-require_once $rootpath . 'lib/common.inc.php';
10
+$rootpath = __DIR__.'/../../';
11
+require_once $rootpath.'lib/common.inc.php';
12 12
 
13 13
 ?>
14 14
 <html>
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     AND ISNULL(`caches_attributes`.`cache_id`) ORDER BY `caches`.`wp_oc`'
42 42
 );
43 43
 while ($rCache = sql_fetch_assoc($rsCaches)) {
44
-    echo '<a href="javascript:select(\'' . $rCache['wp_oc'] . '\')">' . $rCache['wp_oc'] . '<br />';
44
+    echo '<a href="javascript:select(\''.$rCache['wp_oc'].'\')">'.$rCache['wp_oc'].'<br />';
45 45
 }
46 46
 mysql_free_result($rsCaches);
47 47
 ?>
Please login to merge, or discard this patch.
htdocs/util/google-earth/caches.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,4 +5,4 @@
 block discarded – undo
5 5
  *  Unicode Reminder メモ
6 6
  ***************************************************************************/
7 7
 
8
-require_once __DIR__ . '/../../util2/google-earth/caches.php';
8
+require_once __DIR__.'/../../util2/google-earth/caches.php';
Please login to merge, or discard this patch.
htdocs/util/notification/settings-dist.inc.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@
 block discarded – undo
9 9
     $maildomain = 'opencaching.de';
10 10
 }
11 11
 
12
-$mailfrom = 'noreply@' . $maildomain;
12
+$mailfrom = 'noreply@'.$maildomain;
13 13
 
14 14
 $debug = false;
15 15
 $debug_mailto = '[email protected]';
16 16
 
17
-$notifypid = $rootpath . 'cache/notify.pid';
17
+$notifypid = $rootpath.'cache/notify.pid';
Please login to merge, or discard this patch.
htdocs/util/notification/run_notify.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -10,15 +10,15 @@  discard block
 block discarded – undo
10 10
  ***************************************************************************/
11 11
 
12 12
 // needs absolute rootpath because called as cronjob
13
-$rootpath = __DIR__ . '/../../';
13
+$rootpath = __DIR__.'/../../';
14 14
 
15
-require_once $rootpath . 'lib/clicompatbase.inc.php';
16
-require_once $rootpath . 'lib2/translate.class.php';
17
-require_once __DIR__ . '/settings.inc.php';
18
-require_once $rootpath . 'lib/consts.inc.php';
19
-require_once $rootpath . 'lib2/ProcessSync.class.php';
20
-require_once $rootpath . 'lib/logic.inc.php';
21
-require_once $rootpath . 'lib2/logic/geomath.class.php';
15
+require_once $rootpath.'lib/clicompatbase.inc.php';
16
+require_once $rootpath.'lib2/translate.class.php';
17
+require_once __DIR__.'/settings.inc.php';
18
+require_once $rootpath.'lib/consts.inc.php';
19
+require_once $rootpath.'lib2/ProcessSync.class.php';
20
+require_once $rootpath.'lib/logic.inc.php';
21
+require_once $rootpath.'lib2/logic/geomath.class.php';
22 22
 
23 23
 if (!cronjobs_enabled()) {
24 24
     exit;
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     switch ($notify['type']) {
87 87
         case notify_new_cache: // Type: new cache
88 88
             $mailbody = fetch_email_template('notify_newcache', $notify['recp_lang'], $notify['recp_domain']);
89
-            $mailsubject = '[' . $maildomain . '] ' .
89
+            $mailsubject = '['.$maildomain.'] '.
90 90
                 $translate->t(
91 91
                     $notify['oconly'] ? 'New OConly cache:' : 'New cache:',
92 92
                     '',
@@ -95,13 +95,13 @@  discard block
 block discarded – undo
95 95
                     '',
96 96
                     1,
97 97
                     $notify['recp_lang']
98
-                ) .
99
-                ' ' . $notify['cachename'];
98
+                ).
99
+                ' '.$notify['cachename'];
100 100
             break;
101 101
 
102 102
         case notify_new_oconly: // Type: new OConly flag
103 103
             $mailbody = fetch_email_template('notify_newoconly', $notify['recp_lang'], $notify['recp_domain']);
104
-            $mailsubject = '[' . $maildomain . '] ' .
104
+            $mailsubject = '['.$maildomain.'] '.
105 105
                 $translate->t(
106 106
                     'Cache was marked as OConly:',
107 107
                     '',
@@ -110,8 +110,8 @@  discard block
 block discarded – undo
110 110
                     '',
111 111
                     1,
112 112
                     $notify['recp_lang']
113
-                ) .
114
-                ' ' . $notify['cachename'];
113
+                ).
114
+                ' '.$notify['cachename'];
115 115
             break;
116 116
 
117 117
         default:
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
         );
176 176
 
177 177
         /* begin send out everything that has to be sent */
178
-        $email_headers = 'From: "' . $mailfrom . '" <' . $mailfrom . '>';
178
+        $email_headers = 'From: "'.$mailfrom.'" <'.$mailfrom.'>';
179 179
 
180 180
         // send email
181 181
         if ($debug == true) {
@@ -188,11 +188,11 @@  discard block
 block discarded – undo
188 188
             mb_send_mail($mailadr, $mailsubject, $mailbody, $email_headers);
189 189
         }
190 190
     } else {
191
-        echo "Unknown notification type: " . $notify['type'] . "<br />";
191
+        echo "Unknown notification type: ".$notify['type']."<br />";
192 192
     }
193 193
 
194 194
     // logentry($module, $eventid, $userid, $objectid1, $objectid2, $logtext, $details)
195
-    logentry('notify_newcache', 8, $notify['recid'], $notify['cache_id'], 0, 'Sending mail to ' . $mailadr, []);
195
+    logentry('notify_newcache', 8, $notify['recid'], $notify['cache_id'], 0, 'Sending mail to '.$mailadr, []);
196 196
 
197 197
     return 0;
198 198
 }
Please login to merge, or discard this patch.
htdocs/util/watchlist/settings-dist.inc.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,9 +5,9 @@
 block discarded – undo
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';
Please login to merge, or discard this patch.
htdocs/util/watchlist/runwatch.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -12,13 +12,13 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
htdocs/util/change_owner/cache.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -10,9 +10,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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!');
Please login to merge, or discard this patch.
htdocs/oconly81.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,8 +5,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
htdocs/search.php 1 patch
Spacing   +123 added lines, -123 removed lines patch added patch discarded remove patch
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
2439 2439
 
2440 2440
         $rb = GeoDb::regierungsbezirkFromLocid($r['loc_id']);
2441 2441
         if ($rb != '') {
2442
-            $locString .= ' &gt; ' . htmlspecialchars($rb, ENT_COMPAT, 'UTF-8');
2442
+            $locString .= ' &gt; '.htmlspecialchars($rb, ENT_COMPAT, 'UTF-8');
2443 2443
         }
2444 2444
 
2445 2445
         $lk = GeoDb::landkreisFromLocid($r['loc_id']);
2446 2446
         if ($lk != '') {
2447
-            $locString .= ' &gt; ' . htmlspecialchars($lk, ENT_COMPAT, 'UTF-8');
2447
+            $locString .= ' &gt; '.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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.