Completed
Push — master ( c2d7ad...3f78da )
by Thomas
07:29
created
htdocs/lib2/translate_filescan.class.php 2 patches
Doc Comments   +8 added lines patch added patch discarded remove patch
@@ -76,6 +76,10 @@  discard block
 block discarded – undo
76 76
         }
77 77
     }
78 78
 
79
+    /**
80
+     * @param string $sCode
81
+     * @param integer $nStartSearch
82
+     */
79 83
     public function findEndOfPHPString($sCode, $nStartSearch)
80 84
     {
81 85
         $nEnd = 0;
@@ -116,6 +120,10 @@  discard block
 block discarded – undo
116 120
     }
117 121
 
118 122
     // TODO: performance ... scan once at __construct and store line positions
123
+
124
+    /**
125
+     * @param integer $nPos
126
+     */
119 127
     public function findLineOfPos($nPos)
120 128
     {
121 129
         $nLine = 1;
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
 
35 35
     public function scanTranslateFunctionCalls()
36 36
     {
37
-        $nNextPos = strpos($this->msContent, "t" . "('");
38
-        $nNext_ = strpos($this->msContent, "_" . "('");
37
+        $nNextPos = strpos($this->msContent, "t"."('");
38
+        $nNext_ = strpos($this->msContent, "_"."('");
39 39
         if ($nNext_ !== false && ($nNextPos === false || $nNext_ < $nNextPos)) {
40 40
             $nNextPos = $nNext_;
41 41
         }
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
                 );
69 69
             }
70 70
 
71
-            $nNext_ = strpos($this->msContent, "_" . "('", $nNextPos + 1);
72
-            $nNextPos = strpos($this->msContent, "t" . "('", $nNextPos + 1);
71
+            $nNext_ = strpos($this->msContent, "_"."('", $nNextPos + 1);
72
+            $nNextPos = strpos($this->msContent, "t"."('", $nNextPos + 1);
73 73
             if ($nNext_ !== false && ($nNextPos === false || $nNext_ < $nNextPos)) {
74 74
                 $nNextPos = $nNext_;
75 75
             }
@@ -92,11 +92,11 @@  discard block
 block discarded – undo
92 92
 
93 93
     public function scanTranslationPlaceholders()
94 94
     {
95
-        $nNextPos = strpos($this->msContent, '{' . 't');
95
+        $nNextPos = strpos($this->msContent, '{'.'t');
96 96
         while ($nNextPos !== false) {
97 97
             // check for match
98
-            if ((substr($this->msContent, $nNextPos, 3) == '{' . 't}') ||
99
-                (substr($this->msContent, $nNextPos, 3) == '{' . 't ')
98
+            if ((substr($this->msContent, $nNextPos, 3) == '{'.'t}') ||
99
+                (substr($this->msContent, $nNextPos, 3) == '{'.'t ')
100 100
             ) {
101 101
                 $nStart = strpos($this->msContent, '}', $nNextPos);
102 102
                 $nEnd = strpos($this->msContent, '{/t}', $nNextPos);
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
                 );
112 112
             }
113 113
 
114
-            $nNextPos = strpos($this->msContent, '{' . 't', $nNextPos + 1);
114
+            $nNextPos = strpos($this->msContent, '{'.'t', $nNextPos + 1);
115 115
         }
116 116
     }
117 117
 
@@ -120,9 +120,9 @@  discard block
 block discarded – undo
120 120
     {
121 121
         $nLine = 1;
122 122
 
123
-        for ($n = 0; $n < $nPos; $n ++) {
123
+        for ($n = 0; $n < $nPos; $n++) {
124 124
             if (substr($this->msContent, $n, 1) == "\n") {
125
-                $nLine ++;
125
+                $nLine++;
126 126
             }
127 127
         }
128 128
 
Please login to merge, or discard this patch.
htdocs/lib2/util.inc.php 2 patches
Doc Comments   +13 added lines patch added patch discarded remove patch
@@ -246,11 +246,21 @@  discard block
 block discarded – undo
246 246
     return $ret;
247 247
 }
248 248
 
249
+/**
250
+ * @param string $name
251
+ * @param string $default
252
+ *
253
+ * @return string
254
+ */
249 255
 function getSysConfig($name, $default)
250 256
 {
251 257
     return sql_value("SELECT `value` FROM `sysconfig` WHERE `name`='&1'", $default, $name);
252 258
 }
253 259
 
260
+/**
261
+ * @param string $name
262
+ * @param string $value
263
+ */
254 264
 function setSysConfig($name, $value)
255 265
 {
256 266
     sql(
@@ -333,6 +343,9 @@  discard block
 block discarded – undo
333 343
 }
334 344
 
335 345
 
346
+/**
347
+ * @return string
348
+ */
336 349
 function escape_javascript($text)
337 350
 {
338 351
     return str_replace('\'', '\\\'', str_replace('"', '&quot;', $text));
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 
230 230
     while ($nCurPos < mb_strlen($str)) {
231 231
         $nNextSep = mb_strlen($str);
232
-        for ($nSepPos = 0; $nSepPos < mb_strlen($sep); $nSepPos ++) {
232
+        for ($nSepPos = 0; $nSepPos < mb_strlen($sep); $nSepPos++) {
233 233
             $nThisPos = mb_strpos($str, mb_substr($sep, $nSepPos, 1), $nCurPos);
234 234
             if ($nThisPos !== false) {
235 235
                 if ($nNextSep > $nThisPos) {
@@ -308,9 +308,9 @@  discard block
 block discarded – undo
308 308
         $retval = 'E ';
309 309
     }
310 310
 
311
-    $retval = $retval . sprintf("%03d", floor($lon)) . '° ';
311
+    $retval = $retval.sprintf("%03d", floor($lon)).'° ';
312 312
     $lon = $lon - floor($lon);
313
-    $retval = $retval . sprintf("%06.3f", round($lon * 60, 3)) . '\'';
313
+    $retval = $retval.sprintf("%06.3f", round($lon * 60, 3)).'\'';
314 314
 
315 315
     return $retval;
316 316
 }
@@ -325,9 +325,9 @@  discard block
 block discarded – undo
325 325
         $retval = 'N ';
326 326
     }
327 327
 
328
-    $retval = $retval . sprintf("%02d", floor($lat)) . '° ';
328
+    $retval = $retval.sprintf("%02d", floor($lat)).'° ';
329 329
     $lat = $lat - floor($lat);
330
-    $retval = $retval . sprintf("%06.3f", round($lat * 60, 3)) . '\'';
330
+    $retval = $retval.sprintf("%06.3f", round($lat * 60, 3)).'\'';
331 331
 
332 332
     return $retval;
333 333
 }
Please login to merge, or discard this patch.
htdocs/mydetails.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -128,6 +128,9 @@
 block discarded – undo
128 128
 }
129 129
 
130 130
 
131
+/**
132
+ * @param boolean $include_editor
133
+ */
131 134
 function assignFromDB($userid, $include_editor)
132 135
 {
133 136
     global $tpl, $opt, $smilies, $_REQUEST;
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 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_once __DIR__ . '/lib2/edithelper.inc.php';
8
+require __DIR__.'/lib2/web.inc.php';
9
+require_once __DIR__.'/lib2/edithelper.inc.php';
10 10
 
11 11
 $tpl->name = 'mydetails';
12 12
 $tpl->menuitem = MNU_MYPROFILE_DETAILS;
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
 
52 52
         while ($record = sql_fetch_array($rs)) {
53 53
             $id = $record['id'];
54
-            $vis = isset($_REQUEST['chk' . $id]) ? $_REQUEST['chk' . $id] + 0 : 0;
55
-            $value = isset($_REQUEST['inp' . $id]) ? $_REQUEST['inp' . $id] : '';
54
+            $vis = isset($_REQUEST['chk'.$id]) ? $_REQUEST['chk'.$id] + 0 : 0;
55
+            $value = isset($_REQUEST['inp'.$id]) ? $_REQUEST['inp'.$id] : '';
56 56
             if ($vis != 1) {
57 57
                 $vis = 0;
58 58
             }
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
                 $bErrorlen = true;
64 64
             } else {
65 65
                 if (!$useroptions->setOptValue($id, $value)) {
66
-                    $error .= $useroptions->getOptName($id) . ', ';
66
+                    $error .= $useroptions->getOptName($id).', ';
67 67
                     $bError = true;
68 68
                 }
69 69
             }
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
         }
173 173
         if ($descMode == 3) {
174 174
             $tpl->add_header_javascript('resource2/tinymce/tiny_mce_gzip.js');
175
-            $tpl->add_header_javascript('resource2/tinymce/config/user.js.php?lang=' . strtolower($opt['template']['locale']));
175
+            $tpl->add_header_javascript('resource2/tinymce/config/user.js.php?lang='.strtolower($opt['template']['locale']));
176 176
         }
177 177
         $tpl->add_header_javascript(editorJsPath());
178 178
         $tpl->assign('descMode', $descMode);
Please login to merge, or discard this patch.
htdocs/myprofile.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -182,6 +182,9 @@
 block discarded – undo
182 182
     $tpl->display();
183 183
 }
184 184
 
185
+/**
186
+ * @param user $user
187
+ */
185 188
 function assignFromUser($user)
186 189
 {
187 190
     global $tpl;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
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
 $tpl->name = 'myprofile';
11 11
 $tpl->menuitem = MNU_MYPROFILE_DATA;
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 
20 20
 if ($login->userid == 0) {
21 21
     if ($action == 'change' || $action == 'changeemail') {
22
-        $tpl->redirect('login.php?target=' . urlencode('myprofile.php?action=change'));
22
+        $tpl->redirect('login.php?target='.urlencode('myprofile.php?action=change'));
23 23
     } else {
24 24
         $tpl->redirect('login.php?target=myprofile.php');
25 25
     }
Please login to merge, or discard this patch.
htdocs/restorecaches.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -675,7 +675,7 @@
 block discarded – undo
675 675
  * @param $admins
676 676
  * @param $wp_oc
677 677
  * @param $r
678
- * @param $field
678
+ * @param string $field
679 679
  * @param $oldvalue
680 680
  * @param $newvalue
681 681
  */
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1011,7 +1011,7 @@
 block discarded – undo
1011 1011
                             }
1012 1012
                             $logs_restored = true;
1013 1013
                         }
1014
-                       // if it was not already restored by a later restore operation ...
1014
+                        // if it was not already restored by a later restore operation ...
1015 1015
                     } elseif (sql_value("SELECT `id` FROM `cache_logs` WHERE `id`='&1'", 0, $revert_logid) == 0) {
1016 1016
                         // id, uuid, date_created and last_modified are set automatically;
1017 1017
                         // picture will be updated automatically on picture-restore
Please login to merge, or discard this patch.
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -757,7 +757,8 @@  discard block
 block discarded – undo
757 757
                 $cacheid,
758 758
                 $rdate
759 759
             );
760
-            if ($r = sql_fetch_assoc($rs)) { // should always be true ...
760
+            if ($r = sql_fetch_assoc($rs)) {
761
+// should always be true ...
761 762
                 if (!$simulate) {
762 763
                     sql(
763 764
                         "UPDATE `caches` SET `latitude`='&1', `longitude`='&2' WHERE `cache_id`='&3'",
@@ -790,7 +791,8 @@  discard block
 block discarded – undo
790 791
                 $cacheid,
791 792
                 $rdate
792 793
             );
793
-            if ($r = sql_fetch_assoc($rs)) { // should always be true ...
794
+            if ($r = sql_fetch_assoc($rs)) {
795
+// should always be true ...
794 796
                 if (!$simulate) {
795 797
                     sql(
796 798
                         "UPDATE `caches` SET `country`='&1'  WHERE `cache_id`='&2'",
@@ -827,7 +829,8 @@  discard block
 block discarded – undo
827 829
             'wp_nc' => 'waypoints'
828 830
         ];
829 831
 
830
-        if ($r = sql_fetch_assoc($rs)) {// can be false
832
+        if ($r = sql_fetch_assoc($rs)) {
833
+// can be false
831 834
             $setfields = "";
832 835
             foreach ($fields as $field => $ropt) {
833 836
                 if (in_array($ropt, $roptions) && $r[$field] != $cache[$field]) {
@@ -896,13 +899,15 @@  discard block
 block discarded – undo
896 899
 
897 900
             while ($r = sql_fetch_assoc($rs)) {
898 901
                 if (!$simulate) {
899
-                    if ($r['desc'] === null) { // was newly created -> delete
902
+                    if ($r['desc'] === null) {
903
+// was newly created -> delete
900 904
                         sql(
901 905
                             "DELETE FROM `cache_desc` WHERE `cache_id`='&1' AND `language`='&2'",
902 906
                             $cacheid,
903 907
                             $r['language']
904 908
                         );
905
-                    } else {// id, uuid, date_created and last_modified are set automatically
909
+                    } else {
910
+// id, uuid, date_created and last_modified are set automatically
906 911
                         sql(
907 912
                             "INSERT INTO `cache_desc`
908 913
                             (`node`, `cache_id`, `language`, `desc`, `desc_html`, `desc_htmledit`, `hint`, `short_desc`)
Please login to merge, or discard this patch.
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -132,8 +132,8 @@  discard block
 block discarded – undo
132 132
 
133 133
 */
134 134
 
135
-require __DIR__ . '/lib2/web.inc.php';
136
-require_once __DIR__ . '/lib2/logic/labels.inc.php';
135
+require __DIR__.'/lib2/web.inc.php';
136
+require_once __DIR__.'/lib2/logic/labels.inc.php';
137 137
 
138 138
 $tpl->name = 'restorecaches';
139 139
 $tpl->menuitem = MNU_ADMIN_RESTORE;
@@ -308,12 +308,12 @@  discard block
 block discarded – undo
308 308
 
309 309
 function get_archive_data($caches)
310 310
 {
311
-    $cachelist = "(" . implode(",", $caches) . ")";
311
+    $cachelist = "(".implode(",", $caches).")";
312 312
     $data = array();
313 313
     $admins = array();
314 314
 
315 315
     // make waypoint index
316
-    $rs = sql("SELECT `cache_id`, `wp_oc` FROM `caches` WHERE `cache_id` IN " . $cachelist);
316
+    $rs = sql("SELECT `cache_id`, `wp_oc` FROM `caches` WHERE `cache_id` IN ".$cachelist);
317 317
     while ($r = sql_fetch_assoc($rs)) {
318 318
         $wp_oc[$r['cache_id']] = $r['wp_oc'];
319 319
     }
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
             `latitude`,
329 329
             `restored_by`
330 330
         FROM `cache_coordinates`
331
-        WHERE `cache_id` IN " . $cachelist . "
331
+        WHERE `cache_id` IN " . $cachelist."
332 332
         ORDER BY `date_created` ASC"
333 333
     );
334 334
     // order is relevant, because multiple changes per day possible
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
     while ($r = sql_fetch_assoc($rs)) {
337 337
         $coord = new coordinate($r['latitude'], $r['longitude']);
338 338
         $coord = $coord->getDecimalMinutes();
339
-        $coord = $coord['lat'] . " " . $coord['lon'];
339
+        $coord = $coord['lat']." ".$coord['lon'];
340 340
         if (isset($lastcoord[$r['cache_id']]) && $coord != $lastcoord[$r['cache_id']]) {
341 341
             // the database contains lots of old coord records with unchanged coords, wtf?
342 342
             append_data($data, $admins, $wp_oc, $r, "coord", $lastcoord[$r['cache_id']], $coord);
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
     // cache country
349 349
     $rs = sql("SELECT `cache_id`, LEFT(`date_created`,10) AS `date_modified`, `country`, `restored_by`
350 350
                FROM `cache_countries`
351
-                         WHERE `cache_id` IN " . $cachelist . "
351
+                         WHERE `cache_id` IN " . $cachelist."
352 352
                          ORDER BY `date_created` ASC");
353 353
     // order is relevant, because multiple changes per day possible
354 354
     $lastcountry = array();
@@ -364,17 +364,17 @@  discard block
 block discarded – undo
364 364
     // all other cache data
365 365
     // first the current data ...
366 366
     $nextcd = array();
367
-    $rs = sql("SELECT * FROM `caches` WHERE `cache_id` IN " . $cachelist);
367
+    $rs = sql("SELECT * FROM `caches` WHERE `cache_id` IN ".$cachelist);
368 368
     while ($r = sql_fetch_assoc($rs)) {
369 369
         $nextcd[$r['wp_oc']] = $r;
370
-        $user_id = $r['user_id'];     // is used later for logs
370
+        $user_id = $r['user_id']; // is used later for logs
371 371
     }
372 372
     sql_free_result($rs);
373 373
 
374 374
     // .. and then the changes
375 375
     $rs = sql(
376 376
         "SELECT * FROM `caches_modified`
377
-        WHERE `cache_id` IN " . $cachelist . "
377
+        WHERE `cache_id` IN " . $cachelist."
378 378
         ORDER BY `date_modified` DESC"
379 379
     );
380 380
     while ($r = sql_fetch_assoc($rs)) {
@@ -417,8 +417,8 @@  discard block
 block discarded – undo
417 417
                 $wp_oc,
418 418
                 $r,
419 419
                 "time",
420
-                $r['search_time'] . '&nbsp;h',
421
-                $nextcd[$wp]['search_time'] . '&nbsp;h'
420
+                $r['search_time'].'&nbsp;h',
421
+                $nextcd[$wp]['search_time'].'&nbsp;h'
422 422
             );
423 423
         }
424 424
         if ($r['way_length'] != $nextcd[$wp]['way_length']) {
@@ -428,8 +428,8 @@  discard block
 block discarded – undo
428 428
                 $wp_oc,
429 429
                 $r,
430 430
                 "way",
431
-                $r['way_length'] . '&nbsp;km',
432
-                $nextcd[$wp]['way_length'] . '&nbsp;km'
431
+                $r['way_length'].'&nbsp;km',
432
+                $nextcd[$wp]['way_length'].'&nbsp;km'
433 433
             );
434 434
         }
435 435
         if ($r['wp_gc'] != $nextcd[$wp]['wp_gc']) {
@@ -465,9 +465,9 @@  discard block
 block discarded – undo
465 465
     // attributes
466 466
     $rs = sql(
467 467
         "SELECT * FROM `caches_attributes_modified`
468
-         WHERE `cache_id` IN " . $cachelist . "  /* OConly attrib is shown, but not restorable */
468
+         WHERE `cache_id` IN " . $cachelist."  /* OConly attrib is shown, but not restorable */
469 469
          ORDER BY `date_modified` ASC"
470
-    );   // order doesn't matter as long it is date only
470
+    ); // order doesn't matter as long it is date only
471 471
     while ($r = sql_fetch_assoc($rs)) {
472 472
         append_data(
473 473
             $data,
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
             $wp_oc,
476 476
             $r,
477 477
             "attrib",
478
-            ($r['was_set'] ? "-" : "+") . labels::getLabelValue('cache_attrib', $r['attrib_id']),
478
+            ($r['was_set'] ? "-" : "+").labels::getLabelValue('cache_attrib', $r['attrib_id']),
479 479
             ''
480 480
         );
481 481
     }
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
             LENGTH(`short_desc`) AS `sdl`,
514 514
             `restored_by`
515 515
         FROM `cache_desc_modified`
516
-        WHERE `cache_id` IN " . $cachelist . "
516
+        WHERE `cache_id` IN " . $cachelist."
517 517
         ORDER BY `date_modified` DESC"
518 518
     );
519 519
     // order doesn't matter as long only one change per day is recorded
@@ -535,9 +535,9 @@  discard block
 block discarded – undo
535 535
                 $admins,
536 536
                 $wp_oc,
537 537
                 $r,
538
-                "desc(" . $r['language'] . ")",
538
+                "desc(".$r['language'].")",
539 539
                 $r['dl'] + 0,
540
-                ($next['dl'] + 0) . ' bytes'
540
+                ($next['dl'] + 0).' bytes'
541 541
             );
542 542
         }
543 543
         if ($r['hl'] + 0 != $next['hl'] + 0) {
@@ -546,9 +546,9 @@  discard block
 block discarded – undo
546 546
                 $admins,
547 547
                 $wp_oc,
548 548
                 $r,
549
-                "hint(" . $r['language'] . ")",
549
+                "hint(".$r['language'].")",
550 550
                 $r['hl'] + 0,
551
-                ($next['hl'] + 0) . ' bytes'
551
+                ($next['hl'] + 0).' bytes'
552 552
             );
553 553
         }
554 554
         if ($r['sdl'] + 0 != $next['sdl'] + 0) {
@@ -557,9 +557,9 @@  discard block
 block discarded – undo
557 557
                 $admins,
558 558
                 $wp_oc,
559 559
                 $r,
560
-                "shortdesc(" . $r['language'] . ")",
560
+                "shortdesc(".$r['language'].")",
561 561
                 $r['sdl'] + 0,
562
-                ($next['sdl'] + 0) . ' bytes'
562
+                ($next['sdl'] + 0).' bytes'
563 563
             );
564 564
         }
565 565
 
@@ -582,7 +582,7 @@  discard block
 block discarded – undo
582 582
               (SELECT 1 AS `op`, `deletion_date` AS `date_modified`, `cache_id`,
583 583
                     `user_id`, `type`, `date`, `restored_by`
584 584
                    FROM `cache_logs_archived`
585
-                  WHERE `cache_id` IN " . $cachelist . "AND `deleted_by`='&1' AND `user_id`<>'&1'
585
+                  WHERE `cache_id` IN " . $cachelist."AND `deleted_by`='&1' AND `user_id`<>'&1'
586 586
                   UNION
587 587
                   SELECT 2 AS `op`, `date_modified`, `cache_id`,
588 588
                        (SELECT `user_id` FROM `cache_logs_archived` WHERE `id`=`original_id`),
@@ -590,7 +590,7 @@  discard block
 block discarded – undo
590 590
                        (SELECT `date` FROM `cache_logs_archived` WHERE `id`=`original_id`),
591 591
                        `restored_by`
592 592
                  FROM `cache_logs_restored`
593
-                  WHERE `cache_id` IN " . $cachelist . ") `logs`
593
+                  WHERE `cache_id` IN " . $cachelist.") `logs`
594 594
                 INNER JOIN `user` ON `user`.`user_id`=`logs`.`user_id`
595 595
               ORDER BY `logs`.`date_modified` ASC",
596 596
         // order may not be exact when redoing reverts, because delete and insert
@@ -604,7 +604,7 @@  discard block
 block discarded – undo
604 604
             $wp_oc,
605 605
             $r,
606 606
             $r["op"] == 1 ? "dellog" : "restorelog",
607
-            "<a href='viewprofile.php?userid=" . $r['user_id'] . "' target='_blank'>" . $r['username'] . "</a>/" . $r['date'],
607
+            "<a href='viewprofile.php?userid=".$r['user_id']."' target='_blank'>".$r['username']."</a>/".$r['date'],
608 608
             ''
609 609
         );
610 610
     }
@@ -620,10 +620,10 @@  discard block
 block discarded – undo
620 620
 
621 621
     $piccacheid = "IF(`object_type`=2, `object_id`, IF(`object_type`=1, IFNULL((SELECT `cache_id` FROM `cache_logs` WHERE `id`=`object_id`),(SELECT `cache_id` FROM `cache_logs_archived` WHERE `id`=`object_id`)), 0))";
622 622
     $rs = sql(
623
-        "SELECT *, " . $piccacheid . "AS `cache_id` FROM `pictures_modified`
624
-         WHERE " . $piccacheid . " IN " . $cachelist . "
623
+        "SELECT *, ".$piccacheid."AS `cache_id` FROM `pictures_modified`
624
+         WHERE " . $piccacheid." IN ".$cachelist."
625 625
          ORDER BY `date_modified` ASC"
626
-    );  // order is relevant for the case of restore-reverts
626
+    ); // order is relevant for the case of restore-reverts
627 627
     while ($r = sql_fetch_assoc($rs)) {
628 628
         $r['date_modified'] = substr($r['date_modified'], 0, 10);
629 629
         switch ($r['operation']) {
@@ -645,14 +645,14 @@  discard block
 block discarded – undo
645 645
                 $picchange .= "-cache";
646 646
                 break;
647 647
         }
648
-        append_data($data, $admins, $wp_oc, $r, $picchange . "pic", $r['title'], '');
648
+        append_data($data, $admins, $wp_oc, $r, $picchange."pic", $r['title'], '');
649 649
     }
650 650
     sql_free_result($rs);
651 651
 
652 652
     // admins
653 653
     foreach ($admins as $adate => $adata) {
654 654
         foreach ($adata as $awp => $alist) {
655
-            $data[$adate][$awp] .= "<br /><strong class='adminrestore'>admins:</strong> " . implode(',', $alist);
655
+            $data[$adate][$awp] .= "<br /><strong class='adminrestore'>admins:</strong> ".implode(',', $alist);
656 656
         }
657 657
     }
658 658
 
@@ -701,9 +701,9 @@  discard block
 block discarded – undo
701 701
     } else {
702 702
         $text .= " class='userchange'";
703 703
     }
704
-    $text .= ">$field</strong>: $oldvalue" . ($newvalue != "" ? " &rarr; $newvalue" : "");
704
+    $text .= ">$field</strong>: $oldvalue".($newvalue != "" ? " &rarr; $newvalue" : "");
705 705
     if (isset($data[$mdate][$wp])) {
706
-        $data[$mdate][$wp] .= ", " . $text;
706
+        $data[$mdate][$wp] .= ", ".$text;
707 707
     } else {
708 708
         $data[$mdate][$wp] = $text;
709 709
     }
@@ -716,8 +716,8 @@  discard block
 block discarded – undo
716 716
             $admins[$mdate][$wp] = [];
717 717
         }
718 718
         $admins[$mdate][$wp][$r['restored_by'] + 0]
719
-            = "<a href='viewprofile.php?userid=" . $r['restored_by'] . "' target='_blank'>" .
720
-            sql_value("SELECT `username` FROM `user` WHERE `user_id`='&1'", "", $r['restored_by']) .
719
+            = "<a href='viewprofile.php?userid=".$r['restored_by']."' target='_blank'>".
720
+            sql_value("SELECT `username` FROM `user` WHERE `user_id`='&1'", "", $r['restored_by']).
721 721
             "</a>";
722 722
     }
723 723
 }
@@ -727,7 +727,7 @@  discard block
 block discarded – undo
727 727
 {
728 728
     global $opt, $login;
729 729
 
730
-    sql("SET @restoredby='&1'", $login->userid);         // is evaluated by trigger functions
730
+    sql("SET @restoredby='&1'", $login->userid); // is evaluated by trigger functions
731 731
     sql_slave("SET @restoredby='&1'", $login->userid);
732 732
 
733 733
     $restored = array();
@@ -837,12 +837,12 @@  discard block
 block discarded – undo
837 837
                     if ($setfields != "") {
838 838
                         $setfields .= ",";
839 839
                     }
840
-                    $setfields .= "`$field`='" . sql_escape($r[$field]) . "'";
840
+                    $setfields .= "`$field`='".sql_escape($r[$field])."'";
841 841
                     $restored[$wp][$field] = true;
842 842
                 }
843 843
             }
844 844
             if ($setfields != "" && !$simulate) {
845
-                sql("UPDATE `caches` SET " . $setfields . " WHERE `cache_id`='&1'", $cacheid);
845
+                sql("UPDATE `caches` SET ".$setfields." WHERE `cache_id`='&1'", $cacheid);
846 846
             }
847 847
         }
848 848
         sql_free_result($rs);
@@ -1019,7 +1019,7 @@  discard block
 block discarded – undo
1019 1019
                         // id, uuid, date_created and last_modified are set automatically;
1020 1020
                         // picture will be updated automatically on picture-restore
1021 1021
                         $log = new cachelog();
1022
-                        $log->setNode($r['node']);  // cachelog class currently does not initialize node field
1022
+                        $log->setNode($r['node']); // cachelog class currently does not initialize node field
1023 1023
                         $log->setCacheId($r['cache_id']);
1024 1024
                         $log->setUserId($r['user_id']);
1025 1025
                         $log->setType($r['type'], true);
@@ -1071,7 +1071,7 @@  discard block
 block discarded – undo
1071 1071
                 }  // not already processed
1072 1072
 
1073 1073
                 if ($error != "") {
1074
-                    $restored[$wp]['internal error - could not $error log ' + $r['id'] + "/" + $logid];
1074
+                    $restored[$wp]['internal error - could not $error log ' +$r['id'] + "/" +$logid];
1075 1075
                 }
1076 1076
                 if ($logs_restored) {
1077 1077
                     $restored[$wp]['logs'] = true;
@@ -1203,7 +1203,7 @@  discard block
 block discarded – undo
1203 1203
                 }  // not already processed
1204 1204
 
1205 1205
                 if ($error != "") {
1206
-                    $restored[$wp]['internal error - could not $error picture ' . $r['id'] + "/" + $picid] = true;
1206
+                    $restored[$wp]['internal error - could not $error picture '.$r['id'] + "/" +$picid] = true;
1207 1207
                 }
1208 1208
                 if ($pics_restored) {
1209 1209
                     $restored[$wp]['pictures'] = true;
Please login to merge, or discard this patch.
htdocs/search.php 3 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -1461,6 +1461,10 @@
 block discarded – undo
1461 1461
         }
1462 1462
 
1463 1463
         // helper function for output modules
1464
+
1465
+        /**
1466
+         * @param string $str
1467
+         */
1464 1468
         function append_output($str)
1465 1469
         {
1466 1470
             global $db, $content, $bUseZip;
Please login to merge, or discard this 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.
Braces   +24 added lines, -12 removed lines patch added patch discarded remove patch
@@ -84,7 +84,8 @@  discard block
 block discarded – undo
84 84
 $called_by_search = isset($_REQUEST['calledbysearch']) ? $_REQUEST['calledbysearch'] <> 0 : true;
85 85
 $called_by_profile_query = false;
86 86
 
87
-if (isset($_REQUEST['queryid']) || isset($_REQUEST['showresult'])) {  // Ocprop: showresult, queryid
87
+if (isset($_REQUEST['queryid']) || isset($_REQUEST['showresult'])) {
88
+// Ocprop: showresult, queryid
88 89
     $bCookieQueryid = false;
89 90
     $queryid = isset($_REQUEST['queryid']) ? $_REQUEST['queryid'] : 0;
90 91
     if ($queryid &&
@@ -208,7 +209,8 @@  discard block
 block discarded – undo
208 209
             sql_free_result($rs_name);
209 210
         }
210 211
     }
211
-} else {  // $queryid == 0
212
+} else {
213
+// $queryid == 0
212 214
     // build search options from GET/POST parameters or default values
213 215
 
214 216
     // hack
@@ -287,12 +289,14 @@  discard block
 block discarded – undo
287 289
         if (!isset($_REQUEST['utf8'])) {
288 290
             $options['cachename'] = iconv("ISO-8859-1", "UTF-8", $options['cachename']);
289 291
         }
290
-    } elseif (isset($_REQUEST['searchbyowner'])) { // Ocprop
292
+    } elseif (isset($_REQUEST['searchbyowner'])) {
293
+// Ocprop
291 294
         $options['searchtype'] = 'byowner';
292 295
 
293 296
         $options['ownerid'] = isset($_REQUEST['ownerid']) ? $_REQUEST['ownerid'] : 0;
294 297
         $options['owner'] = isset($_REQUEST['owner']) ? stripslashes($_REQUEST['owner']) : '';
295
-    } elseif (isset($_REQUEST['searchbyfinder'])) { // Ocprop
298
+    } elseif (isset($_REQUEST['searchbyfinder'])) {
299
+// Ocprop
296 300
         $options['searchtype'] = 'byfinder';
297 301
 
298 302
         $options['finderid'] = isset($_REQUEST['finderid']) ? $_REQUEST['finderid'] : 0;
@@ -437,7 +441,8 @@  discard block
 block discarded – undo
437 441
 $bRememberQuery = isset($_REQUEST['skipqueryid']) ? !$_REQUEST['skipqueryid'] : true;
438 442
 // This is used by the map, which implements its own query-caching.
439 443
 if ($bRememberQuery) {
440
-    if ($queryid == 0 && $options['showresult'] != 0) { // 'showresult' = "execute query"
444
+    if ($queryid == 0 && $options['showresult'] != 0) {
445
+// 'showresult' = "execute query"
441 446
         sql(
442 447
             "INSERT INTO `queries` (`user_id`, `options`, `last_queried`) VALUES (0, '&1', NOW())",
443 448
             serialize($options)
@@ -854,7 +859,8 @@  discard block
 block discarded – undo
854 859
                 outputSearchForm($options);
855 860
                 exit;
856 861
             }
857
-        } elseif ($options['searchtype'] == 'bydistance') { // Ocprop
862
+        } elseif ($options['searchtype'] == 'bydistance') {
863
+// Ocprop
858 864
             //check the entered data
859 865
             if (isset($options['lat']) && isset($options['lon'])) {
860 866
                 $lat = $options['lat'] + 0;
@@ -924,7 +930,8 @@  discard block
 block discarded – undo
924 930
             $sql_innerjoin[] = '`cache_logs` ON `caches`.`cache_id`=`cache_logs`.`cache_id`';
925 931
             $sql_where[] = '`cache_logs`.`user_id`=\'' . sql_escape($finder_id) . '\'';
926 932
 
927
-            if ($options['logtype'] != '0') { // 0 = all types
933
+            if ($options['logtype'] != '0') {
934
+// 0 = all types
928 935
                 $ids = explode(',', $options['logtype']);
929 936
                 $idNumbers = '0';
930 937
                 foreach ($ids as $id) {
@@ -1405,7 +1412,8 @@  discard block
 block discarded – undo
1405 1412
     }
1406 1413
 
1407 1414
     $count = $caches_per_page;
1408
-    if (isset($_REQUEST['count'])) { // Ocprop
1415
+    if (isset($_REQUEST['count'])) {
1416
+// Ocprop
1409 1417
         $count = floor($_REQUEST['count'] + 0);
1410 1418
     }
1411 1419
     if ($count == 'max') {
@@ -1525,7 +1533,8 @@  discard block
 block discarded – undo
1525 1533
     } else {
1526 1534
         exit;
1527 1535
     }
1528
-} else { // $options['showresult'] == 0
1536
+} else {
1537
+// $options['showresult'] == 0
1529 1538
     //=============================================================
1530 1539
     //  F5. present search options form to the user
1531 1540
     //=============================================================
@@ -1597,7 +1606,8 @@  discard block
 block discarded – undo
1597 1606
 
1598 1607
     if (isset($options['sort'])) {
1599 1608
         $bBynameChecked = ($options['sort'] == 'byname');
1600
-    } else { // Ocprop
1609
+    } else {
1610
+// Ocprop
1601 1611
         $bBynameChecked = (!$login->logged_in());
1602 1612
     }
1603 1613
     $tpl->assign('byname_checked', $bBynameChecked);
@@ -1759,7 +1769,8 @@  discard block
 block discarded – undo
1759 1769
     }
1760 1770
     if ($options['searchtype'] == 'bydistance') {
1761 1771
         $dByDistanceChecked = ($options['searchtype'] == 'bydistance');
1762
-    } else { // Ocprop
1772
+    } else {
1773
+// Ocprop
1763 1774
         $dByDistanceChecked = false;
1764 1775
     }
1765 1776
     $tpl->assign('dbydistance_checked', $dByDistanceChecked);
@@ -1800,7 +1811,8 @@  discard block
 block discarded – undo
1800 1811
     );
1801 1812
     if ($options['searchtype'] == 'bywaypoint') {
1802 1813
         $dByWaypointChecked = ($options['searchtype'] == 'bywaypoint');
1803
-    } else { // Ocprop
1814
+    } else {
1815
+// Ocprop
1804 1816
         $dByWaypointChecked = false;
1805 1817
     }
1806 1818
     $tpl->assign('dbywaypoint_checked', $dByWaypointChecked);
Please login to merge, or discard this patch.
htdocs/src/Oc/Libse/ChildWp/PresenterChildWp.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -54,6 +54,9 @@  discard block
 block discarded – undo
54 54
         $this->onDoSubmit($this->coordinate->getCoordinate(), $this->getDesc());
55 55
     }
56 56
 
57
+    /**
58
+     * @param \Oc\Libse\Coordinate\CoordinateCoordinate $coordinate
59
+     */
57 60
     abstract protected function onDoSubmit($coordinate, $description);
58 61
 
59 62
     protected function getType()
@@ -74,6 +77,9 @@  discard block
 block discarded – undo
74 77
         $this->typeImages = $childWpHandler->getChildNamesAndImages();
75 78
     }
76 79
 
80
+    /**
81
+     * @param \Oc\Libse\Coordinate\CoordinateCoordinate $coords
82
+     */
77 83
     public function initCoordinate($coords)
78 84
     {
79 85
         $this->coordinate->init($coords->latitude(), $coords->longitude());
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 use Oc\Libse\Validator\AlwaysValidValidator;
12 12
 use Oc\Libse\Validator\ArrayValidator;
13 13
 
14
-require_once __DIR__ . '/../../../../lib2/error.inc.php';
14
+require_once __DIR__.'/../../../../lib2/error.inc.php';
15 15
 
16 16
 abstract class PresenterChildWp
17 17
 {
Please login to merge, or discard this patch.
htdocs/src/Oc/Libse/Coordinate/PresenterCoordinate.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -35,6 +35,9 @@  discard block
 block discarded – undo
35 35
         $this->init(0, 0);
36 36
     }
37 37
 
38
+    /**
39
+     * @param boolean $request
40
+     */
38 41
     private function initRequest($request)
39 42
     {
40 43
         if ($request) {
@@ -44,6 +47,9 @@  discard block
 block discarded – undo
44 47
         return new RequestHttp();
45 48
     }
46 49
 
50
+    /**
51
+     * @param boolean $translator
52
+     */
47 53
     private function initTranslator($translator)
48 54
     {
49 55
         if ($translator) {
Please login to merge, or discard this patch.
htdocs/src/Oc/SmartyPlugins/prefilter.t.php 3 patches
Doc Comments   +8 added lines patch added patch discarded remove patch
@@ -84,6 +84,11 @@  discard block
 block discarded – undo
84 84
 /* $block ... {t[ a=$a|nbsp b="a" ...]}
85 85
  *
86 86
  */
87
+/**
88
+ * @param string $block
89
+ * @param string $message
90
+ * @param integer $line
91
+ */
87 92
 function smarty_prefilter_t_process_block($block, $message, &$smarty, $line)
88 93
 {
89 94
     if ($message != '') {
@@ -252,6 +257,9 @@  discard block
 block discarded – undo
252 257
     return $attrs;
253 258
 }
254 259
 
260
+/**
261
+ * @param string[] $needles
262
+ */
255 263
 function smarty_prefilter_t_strpos_multi($haystack, $needles)
256 264
 {
257 265
     $arg = func_get_args();
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -57,10 +57,10 @@  discard block
 block discarded – undo
57 57
     $end = 0;
58 58
     while (($start = smarty_prefilter_t_strpos_multi(
59 59
             $source,
60
-            [$smarty->left_delimiter . 't ', $smarty->left_delimiter . 't' . $smarty->right_delimiter],
60
+            [$smarty->left_delimiter.'t ', $smarty->left_delimiter.'t'.$smarty->right_delimiter],
61 61
             $end
62 62
         )) !== false) {
63
-        $end = mb_strpos($source, $smarty->left_delimiter . '/t' . $smarty->right_delimiter, $start);
63
+        $end = mb_strpos($source, $smarty->left_delimiter.'/t'.$smarty->right_delimiter, $start);
64 64
         $block_t = mb_substr($source, $start, $end - $start);
65 65
 
66 66
         $messgage_start = mb_strrpos($block_t, '}') + 1;
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         );
73 73
 
74 74
         $output .= mb_substr($source, $output_start, $start - $output_start);
75
-        $output_start = $end + mb_strlen($smarty->left_delimiter . $smarty->right_delimiter) + 2;
75
+        $output_start = $end + mb_strlen($smarty->left_delimiter.$smarty->right_delimiter) + 2;
76 76
 
77 77
         $output .= $block_t;
78 78
     }
@@ -116,11 +116,11 @@  discard block
 block discarded – undo
116 116
                     if ($block != '') {
117 117
                         $block .= ' ';
118 118
                     }
119
-                    $block .= $k . '=' . $v;
119
+                    $block .= $k.'='.$v;
120 120
                 }
121 121
 
122 122
                 // pass it to block.t
123
-                return $smarty->left_delimiter . 't ' . $block . $smarty->right_delimiter . $message . $smarty->left_delimiter . '/t' . $smarty->right_delimiter;
123
+                return $smarty->left_delimiter.'t '.$block.$smarty->right_delimiter.$message.$smarty->left_delimiter.'/t'.$smarty->right_delimiter;
124 124
             }
125 125
             unset($attrs['plural']);
126 126
             unset($attrs['count']);
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 
149 149
     /* Tokenize tag attributes. */
150 150
     preg_match_all(
151
-        '~(?:' . $smarty->_obj_call_regexp . '|' . $smarty->_qstr_regexp . ' | (?>[^"\'=\s]+)
151
+        '~(?:'.$smarty->_obj_call_regexp.'|'.$smarty->_qstr_regexp.' | (?>[^"\'=\s]+)
152 152
                       )+ |
153 153
                       [=]
154 154
                     ~x',
@@ -206,16 +206,16 @@  discard block
 block discarded – undo
206 206
                             if ($token == 'null') {
207 207
                                 $token = 'null';
208 208
                             } else {
209
-                                if (preg_match('~^' . $smarty->_num_const_regexp . '|0[xX][0-9a-fA-F]+$~', $token)) {
209
+                                if (preg_match('~^'.$smarty->_num_const_regexp.'|0[xX][0-9a-fA-F]+$~', $token)) {
210 210
                                     /* treat integer literally */
211 211
                                 } else {
212 212
                                     if (!preg_match(
213
-                                        '~^' . $smarty->_obj_call_regexp . '|' . $smarty->_var_regexp . '(?:' . $smarty->_mod_regexp . ')*$~',
213
+                                        '~^'.$smarty->_obj_call_regexp.'|'.$smarty->_var_regexp.'(?:'.$smarty->_mod_regexp.')*$~',
214 214
                                         $token
215 215
                                     )
216 216
                                     ) {
217 217
                                         /* treat as a string, double-quote it escaping quotes */
218
-                                        $token = '"' . addslashes($token) . '"';
218
+                                        $token = '"'.addslashes($token).'"';
219 219
                                     }
220 220
                                 }
221 221
                             }
@@ -299,12 +299,12 @@  discard block
 block discarded – undo
299 299
     $number = 1;
300 300
     foreach ($attrs as $attr) {
301 301
         if (is_numeric($attr)) {
302
-            $trans = mb_ereg_replace('%' . $number, $attr, $trans);
302
+            $trans = mb_ereg_replace('%'.$number, $attr, $trans);
303 303
         } else {
304
-            $trans = mb_ereg_replace('%' . $number, $smarty->left_delimiter . $attr . $smarty->right_delimiter, $trans);
304
+            $trans = mb_ereg_replace('%'.$number, $smarty->left_delimiter.$attr.$smarty->right_delimiter, $trans);
305 305
         }
306 306
 
307
-        $number ++;
307
+        $number++;
308 308
     }
309 309
 
310 310
     return $trans;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@
 block discarded – undo
112 112
 
113 113
                 // rebuild block with replaced plural
114 114
                 $block = '';
115
-                foreach ($attrs AS $k => $v) {
115
+                foreach ($attrs as $k => $v) {
116 116
                     if ($block != '') {
117 117
                         $block .= ' ';
118 118
                     }
Please login to merge, or discard this patch.