Completed
Pull Request — master (#300)
by
unknown
07:10
created
htdocs/config2/settings-dist-common.inc.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -15,11 +15,11 @@  discard block
 block discarded – undo
15 15
  *   bin/dbsv-update.php will then migrate the tables' charset.
16 16
  */
17 17
 $opt['charset']['iconv'] = 'UTF-8'; // 'ISO-8859-1'; // use iconv compatible charset-name
18
-$opt['charset']['mysql'] = 'utf8';     // use mysql compatible charset-name
18
+$opt['charset']['mysql'] = 'utf8'; // use mysql compatible charset-name
19 19
 
20 20
 // handling of SQL and PHP errors
21 21
 $opt['db']['error']['display'] = false;
22
-$opt['db']['error']['mail'] = 'root';  // set '' to disable
22
+$opt['db']['error']['mail'] = 'root'; // set '' to disable
23 23
 
24 24
 // page title
25 25
 $opt['page']['title'] = 'OPENCACHING';
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
  * Additionally, the cookie domain (different vor lib1 and lib2) can be overwritten.
58 58
  * See examples for overriding in settings-sample.inc.php.
59 59
  */
60
-$opt['page']['meta']['keywords'] = 'Geocaching, Geocache, Cache, Schatzsuche, GPS, kostenlos, GPX, Koordinaten, Hobby, Natur';  // 5-10 keywords are recommended
60
+$opt['page']['meta']['keywords'] = 'Geocaching, Geocache, Cache, Schatzsuche, GPS, kostenlos, GPX, Koordinaten, Hobby, Natur'; // 5-10 keywords are recommended
61 61
 // see http://forum.opencaching.de/index.php?topic=3065.0
62 62
 // and http://forum.opencaching.de/index.php?topic=3065.0 regarding description
63 63
 $opt['page']['meta']['description'] = 'Opencaching.de ist das freie Portal für Geocaching, ein Schatzsuche-Spiel. Mittels GPS-Koordinaten sind Behälter oder Objekte zu finden.';
@@ -98,12 +98,12 @@  discard block
 block discarded – undo
98 98
 // see also setting in lib/settings.inc.php!
99 99
 $opt['logic']['admin']['team_comments_only_for_reports'] = true;
100 100
 $opt['logic']['admin']['enable_listing_admins'] = false;
101
-$opt['logic']['admin']['listingadmin_notification'] = '';  // Email address(es), comma separated
101
+$opt['logic']['admin']['listingadmin_notification'] = ''; // Email address(es), comma separated
102 102
 
103 103
 /*
104 104
  * html purifier
105 105
  */
106
-$opt['html_purifier']['cache_path'] = dirname(__FILE__) . '/../cache2/html_purifier/';
106
+$opt['html_purifier']['cache_path'] = dirname(__FILE__).'/../cache2/html_purifier/';
107 107
 
108 108
 /*
109 109
  * CMS links for external pages
@@ -178,9 +178,9 @@  discard block
 block discarded – undo
178 178
         $primary_httpsdefault = $opt['page']['https']['is_default'];
179 179
     }
180 180
     if ($primary_httpsdefault) {
181
-        $opt['page']['default_primary_url'] = 'https' . strstr($primary_site_url, '://');
181
+        $opt['page']['default_primary_url'] = 'https'.strstr($primary_site_url, '://');
182 182
     } else {
183
-        $opt['page']['default_primary_url'] = 'http' . strstr($primary_site_url, '://');
183
+        $opt['page']['default_primary_url'] = 'http'.strstr($primary_site_url, '://');
184 184
     }
185 185
 
186 186
     // 2. create settings for the current domain
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
     if (isset($opt['domain'][$current_domain]['url'])) {
192 192
         $current_site_url = $opt['domain'][$current_domain]['url'];
193 193
     } else {
194
-        $current_site_url = 'x://' . $current_domain . parse_url($primary_site_url, PHP_URL_PATH);
194
+        $current_site_url = 'x://'.$current_domain.parse_url($primary_site_url, PHP_URL_PATH);
195 195
     }
196 196
     if (substr($current_site_url, - 1, 1) != '/') {
197 197
         $current_site_url .= '/';
@@ -203,8 +203,8 @@  discard block
 block discarded – undo
203 203
     }
204 204
 
205 205
     $adr = strstr($current_site_url, '://');
206
-    $opt['page']['absolute_http_url'] = 'http' . $adr;
207
-    $opt['page']['absolute_https_url'] = 'https' . $adr;
206
+    $opt['page']['absolute_http_url'] = 'http'.$adr;
207
+    $opt['page']['absolute_https_url'] = 'https'.$adr;
208 208
     $opt['page']['https']['active'] = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off');
209 209
 
210 210
     if ($opt['page']['https']['active']) {
@@ -235,19 +235,19 @@  discard block
 block discarded – undo
235 235
         $opt['page']['default_primary_shortlink_url'] = false;
236 236
     } else {
237 237
         if ($primary_httpsdefault) {
238
-            $opt['page']['default_primary_shortlink_url'] = 'https://' . $primary_shortlink_domain . '/';
238
+            $opt['page']['default_primary_shortlink_url'] = 'https://'.$primary_shortlink_domain.'/';
239 239
         } else {
240
-            $opt['page']['default_primary_shortlink_url'] = 'http://' . $primary_shortlink_domain . '/';
240
+            $opt['page']['default_primary_shortlink_url'] = 'http://'.$primary_shortlink_domain.'/';
241 241
         }
242 242
 
243 243
         if (isset($opt['domain'][$current_domain]['shortlink_domain']) && $opt['domain'][$current_domain]['shortlink_domain']) {
244
-            $opt['page']['shortlink_url'] = $opt['page']['protocol'] . '://' . $opt['domain'][$current_domain]['shortlink_domain'] . '/';
245
-            $opt['page']['default_shortlink_url'] = $opt['page']['default_protocol'] . '://' . $opt['domain'][$current_domain]['shortlink_domain'] . '/';
244
+            $opt['page']['shortlink_url'] = $opt['page']['protocol'].'://'.$opt['domain'][$current_domain]['shortlink_domain'].'/';
245
+            $opt['page']['default_shortlink_url'] = $opt['page']['default_protocol'].'://'.$opt['domain'][$current_domain]['shortlink_domain'].'/';
246 246
         } else {
247 247
             if ($current_domain == $primary_domain) {
248 248
                 $opt['page']['default_shortlink_url'] = $opt['page']['default_primary_shortlink_url'];
249 249
                 $opt['page']['shortlink_url'] =
250
-                    $opt['page']['protocol'] . strstr($opt['page']['default_shortlink_url'], '://');
250
+                    $opt['page']['protocol'].strstr($opt['page']['default_shortlink_url'], '://');
251 251
             } else {
252 252
                 $opt['page']['shortlink_url'] = false;
253 253
                 $opt['page']['default_shortlink_url'] = false;
@@ -258,16 +258,16 @@  discard block
 block discarded – undo
258 258
     // 4. set location of uploaded images
259 259
 
260 260
     if (!isset($opt['logic']['pictures']['dir'])) {
261
-        $opt['logic']['pictures']['dir'] = dirname(__FILE__) . '/../images/uploads';
261
+        $opt['logic']['pictures']['dir'] = dirname(__FILE__).'/../images/uploads';
262 262
     }  // Ocprop, OKAPI !
263 263
     if (!isset($opt['logic']['pictures']['url'])) {
264
-        $opt['logic']['pictures']['url'] = $opt['page']['default_primary_url'] . 'images/uploads';
264
+        $opt['logic']['pictures']['url'] = $opt['page']['default_primary_url'].'images/uploads';
265 265
     }
266 266
     if (!isset($opt['logic']['pictures']['thumb_dir'])) {
267
-        $opt['logic']['pictures']['thumb_dir'] = $opt['logic']['pictures']['dir'] . '/thumbs';
267
+        $opt['logic']['pictures']['thumb_dir'] = $opt['logic']['pictures']['dir'].'/thumbs';
268 268
     }
269 269
     if (!isset($opt['logic']['pictures']['thumb_url'])) {
270
-        $opt['logic']['pictures']['thumb_url'] = $opt['logic']['pictures']['url'] . '/thumbs';
270
+        $opt['logic']['pictures']['thumb_url'] = $opt['logic']['pictures']['url'].'/thumbs';
271 271
     }
272 272
 }
273 273
 
Please login to merge, or discard this patch.
htdocs/map2.php 1 patch
Spacing   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 
10 10
 $build_map_towns_menu = true;
11 11
 
12
-require __DIR__ . '/lib2/web.inc.php';
12
+require __DIR__.'/lib2/web.inc.php';
13 13
 
14 14
 /* because the map does access some private info like
15 15
  * ignored caches, we need to verify the login data
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
                        WHERE option_id=6 AND user_id='&1'", true, $login->userid))
68 68
 ) {
69 69
     $fullscreen = true;
70
-    $tpl->popup = true;        // disables page header and -frame
70
+    $tpl->popup = true; // disables page header and -frame
71 71
     $tpl->popupmargin = false;
72 72
 } else {
73 73
     $fullscreen = false;
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
     $tpl->error($translate->t('There is no google maps key registered for this domain.', '', '', 0));
134 134
 }
135 135
 
136
-$tpl->add_header_javascript($opt['page']['protocol'] . '://maps.googleapis.com/maps/api/js?sensor=false&key=' . urlencode($sGMKey) . '&language=' . strtolower($opt['template']['locale']));
136
+$tpl->add_header_javascript($opt['page']['protocol'].'://maps.googleapis.com/maps/api/js?sensor=false&key='.urlencode($sGMKey).'&language='.strtolower($opt['template']['locale']));
137 137
 // https is supported by google, but may make problems in some environments,
138 138
 // e.g. does not work with MSIE 7 on WinXP
139 139
 $tpl->add_header_javascript('resource2/misc/map/dragzoom_packed.js');
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
     global $login;
280 280
 
281 281
     $rsCache = sql_slave(
282
-        "SELECT " . geomath::getSqlDistanceFormula($nLon, $nLat, $nDistance) . " AS `distance`,
282
+        "SELECT ".geomath::getSqlDistanceFormula($nLon, $nLat, $nDistance)." AS `distance`,
283 283
                                   `caches`.`wp_oc`
284 284
                              FROM `caches`
285 285
                        INNER JOIN `cache_status` ON `caches`.`status`=`cache_status`.`id`
@@ -389,42 +389,42 @@  discard block
 block discarded – undo
389 389
     $wphandler = new HandlerChildWp();
390 390
     $waypoints = $wphandler->getChildWps($rCache['cache_id'], true);
391 391
 
392
-    echo '<caches>' . "\n";
392
+    echo '<caches>'."\n";
393 393
     echo '  <cache ';
394
-    echo 'name="' . xmlentities($rCache['name']) . '" ';
395
-    echo 'wpoc="' . xmlentities($rCache['wp_oc']) . '" ';
396
-    echo 'coords="' . $rCache['longitude'] . ',' . $rCache['latitude'] . '" ';
397
-    echo 'inactive="' . xmlentities($rCache['inactive']) . '" ';
398
-    echo 'status_text="' . xmlentities($rCache['statustext']) . '" ';
399
-    echo 'type_id="' . xmlentities($rCache['type_id']) . '" ';
400
-    echo 'type_text="' . xmlentities($rCache['type_text']) . '" ';
401
-    echo 'size="' . xmlentities($rCache['size']) . '" ';
402
-    echo 'difficulty="' . xmlentities($rCache['difficulty'] / 2) . '" ';
403
-    echo 'terrain="' . xmlentities($rCache['terrain'] / 2) . '" ';
404
-    echo 'listed_since="' . xmlentities(strftime($opt['locale'][$opt['template']['locale']]['format']['date'], strtotime($rCache['date_created']))) . '" ';
405
-    echo 'is_publishdate="' . xmlentities($rCache['is_publishdate']) . '" ';
406
-    echo 'toprating="' . xmlentities($rCache['toprating']) . '" ';
407
-    echo 'geokreties="' . xmlentities($nGeokretyCount) . '" ';
408
-    echo 'found="' . xmlentities(($nFoundCount > 0) ? 1 : 0) . '" ';
409
-    echo 'notfound="' . xmlentities(($nNotFoundCount > 0) ? 1 : 0) . '" ';
410
-    echo 'attended="' . xmlentities(($nAttendedCount > 0) ? 1 : 0) . '" ';
411
-    echo 'oconly="' . xmlentities($rCache['oconly']) . '" ';
412
-    echo 'owner="' . xmlentities($rCache['owner']) . '" ';
413
-    echo 'username="' . xmlentities($rCache['username']) . '" ';
414
-    echo 'userid="' . xmlentities($rCache['user_id']) . '" ';
415
-    echo 'picurl="' . xmlentities($rCache['picurl']) . '" ';
416
-    echo 'pictitle="' . xmlentities(trim($rCache['pictitle'])) . '" >\n';
394
+    echo 'name="'.xmlentities($rCache['name']).'" ';
395
+    echo 'wpoc="'.xmlentities($rCache['wp_oc']).'" ';
396
+    echo 'coords="'.$rCache['longitude'].','.$rCache['latitude'].'" ';
397
+    echo 'inactive="'.xmlentities($rCache['inactive']).'" ';
398
+    echo 'status_text="'.xmlentities($rCache['statustext']).'" ';
399
+    echo 'type_id="'.xmlentities($rCache['type_id']).'" ';
400
+    echo 'type_text="'.xmlentities($rCache['type_text']).'" ';
401
+    echo 'size="'.xmlentities($rCache['size']).'" ';
402
+    echo 'difficulty="'.xmlentities($rCache['difficulty'] / 2).'" ';
403
+    echo 'terrain="'.xmlentities($rCache['terrain'] / 2).'" ';
404
+    echo 'listed_since="'.xmlentities(strftime($opt['locale'][$opt['template']['locale']]['format']['date'], strtotime($rCache['date_created']))).'" ';
405
+    echo 'is_publishdate="'.xmlentities($rCache['is_publishdate']).'" ';
406
+    echo 'toprating="'.xmlentities($rCache['toprating']).'" ';
407
+    echo 'geokreties="'.xmlentities($nGeokretyCount).'" ';
408
+    echo 'found="'.xmlentities(($nFoundCount > 0) ? 1 : 0).'" ';
409
+    echo 'notfound="'.xmlentities(($nNotFoundCount > 0) ? 1 : 0).'" ';
410
+    echo 'attended="'.xmlentities(($nAttendedCount > 0) ? 1 : 0).'" ';
411
+    echo 'oconly="'.xmlentities($rCache['oconly']).'" ';
412
+    echo 'owner="'.xmlentities($rCache['owner']).'" ';
413
+    echo 'username="'.xmlentities($rCache['username']).'" ';
414
+    echo 'userid="'.xmlentities($rCache['user_id']).'" ';
415
+    echo 'picurl="'.xmlentities($rCache['picurl']).'" ';
416
+    echo 'pictitle="'.xmlentities(trim($rCache['pictitle'])).'" >\n';
417 417
 
418 418
     foreach ($waypoints as $waypoint) {
419 419
         echo '    <wpt ';
420
-        echo 'typeid="' . xmlentities($waypoint['type']) . '" ';
421
-        echo 'typename="' . xmlentities($waypoint['name']) . '" ';
422
-        echo 'typepreposition="' . xmlentities($waypoint['preposition']) . '" ';
423
-        echo 'image="' . xmlentities($waypoint['image']) . '" ';
420
+        echo 'typeid="'.xmlentities($waypoint['type']).'" ';
421
+        echo 'typename="'.xmlentities($waypoint['name']).'" ';
422
+        echo 'typepreposition="'.xmlentities($waypoint['preposition']).'" ';
423
+        echo 'image="'.xmlentities($waypoint['image']).'" ';
424 424
         echo 'imagewidth="38" imageheight="38" ';
425
-        echo 'latitude="' . xmlentities($waypoint['latitude']) . '" ';
426
-        echo 'longitude="' . xmlentities($waypoint['longitude']) . '" ';
427
-        echo 'description="' . xmlentities(mb_ereg_replace('\r\n', '<br />', htmlentities(trim($waypoint['description']), ENT_NOQUOTES, 'UTF-8'))) . '" />\n';
425
+        echo 'latitude="'.xmlentities($waypoint['latitude']).'" ';
426
+        echo 'longitude="'.xmlentities($waypoint['longitude']).'" ';
427
+        echo 'description="'.xmlentities(mb_ereg_replace('\r\n', '<br />', htmlentities(trim($waypoint['description']), ENT_NOQUOTES, 'UTF-8'))).'" />\n';
428 428
     }
429 429
 
430 430
     echo '  </cache>\n';
@@ -438,9 +438,9 @@  discard block
 block discarded – undo
438 438
 {
439 439
     global $login, $opt;
440 440
 
441
-    echo '<caches>' . "\n";
441
+    echo '<caches>'."\n";
442 442
     $rs = sql_slave(
443
-        "SELECT " . geomath::getSqlDistanceFormula($nLon, $nLat, 0) . " AS `distance`,
443
+        "SELECT ".geomath::getSqlDistanceFormula($nLon, $nLat, 0)." AS `distance`,
444 444
                           `caches`.`name`, `caches`.`wp_oc`
445 445
                      FROM `map2_data`
446 446
                INNER JOIN `caches` ON `map2_data`.`cache_id`=`caches`.`cache_id`
@@ -449,30 +449,30 @@  discard block
 block discarded – undo
449 449
                       AND (`cache_status`.`allow_user_view`=1 OR `caches`.`user_id`='&3')
450 450
                       AND `map2_data`.`result_id`='&2'
451 451
                            ORDER BY `distance` ASC LIMIT 30",
452
-        '%' . $sName . '%',
452
+        '%'.$sName.'%',
453 453
         $nResultId,
454 454
         $login->userid
455 455
     );
456 456
     $caches_found = 0;
457 457
     while ($r = sql_fetch_assoc($rs)) {
458
-        echo '<cache name="' . xmlentities($r['name']) . '" wpoc="' . xmlentities($r['wp_oc']) . '" />' . "\n";
459
-        ++ $caches_found;
458
+        echo '<cache name="'.xmlentities($r['name']).'" wpoc="'.xmlentities($r['wp_oc']).'" />'."\n";
459
+        ++$caches_found;
460 460
     }
461 461
     sql_free_result($rs);
462 462
 
463 463
     if (!$caches_found && preg_match('/^[^\s[:punct:]]{2,}\.[^\s[:punct:]]{2,}\.[^\s[:punct:]]{2,}$/', $sName)) {
464
-        $result = @file_get_contents('http://api.what3words.com/w3w?key=' . $opt['lib']['w3w']['apikey']
465
-            . '&string=' . urlencode($sName));
464
+        $result = @file_get_contents('http://api.what3words.com/w3w?key='.$opt['lib']['w3w']['apikey']
465
+            . '&string='.urlencode($sName));
466 466
         if ($result) {
467 467
             $json = json_decode($result, true);
468 468
             if (!is_null($json['words']) && !is_null($json['position']) && count($json['position']) == 2) {
469
-                echo '<coord name="' . xmlentities(implode('.', $json['words'])) .
470
-                    '" latitude="' . xmlentities($json["position"][0]) .
471
-                    '" longitude="' . xmlentities($json["position"][1]) . '" />' . "\n";
469
+                echo '<coord name="'.xmlentities(implode('.', $json['words'])).
470
+                    '" latitude="'.xmlentities($json["position"][0]).
471
+                    '" longitude="'.xmlentities($json["position"][1]).'" />'."\n";
472 472
             }
473 473
         }
474 474
     }
475
-    echo '</caches>' . "\n";
475
+    echo '</caches>'."\n";
476 476
 
477 477
     exit;
478 478
 }
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
         "SELECT `slave_id`
496 496
         FROM `map2_result`
497 497
         WHERE `result_id`='&1' AND DATE_ADD(`date_created`, INTERVAL '&2' SECOND)>NOW()",
498
-        - 2,
498
+        -2,
499 499
         $nResultId,
500 500
         $opt['map']['maxcacheage']
501 501
     );
@@ -561,8 +561,8 @@  discard block
 block discarded – undo
561 561
     $bMaxRecordReached = ($nRecordCount > $maxrecords);
562 562
 
563 563
     // output data
564
-    echo '<searchresult count="' . xmlentities($nRecordCount) . '" available="1"' .
565
-        ' maxrecordreached="' . ($bMaxRecordReached ? '1' : '0') . '">' . "\n";
564
+    echo '<searchresult count="'.xmlentities($nRecordCount).'" available="1"'.
565
+        ' maxrecordreached="'.($bMaxRecordReached ? '1' : '0').'">'."\n";
566 566
 
567 567
     if (!$bMaxRecordReached) {
568 568
         $namequery = ($cachenames ? ", `caches`.`name` AS `cachename`" : "");
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
                             IF(`found_logs`.`id` IS NULL, 0, 1) AS `found`,
578 578
                             IF(`found_logs`.`id` IS NULL AND `notfound_logs`.`id` IS NOT NULL, 1, 0) AS `notfound`,
579 579
                             IF(`caches_attributes`.`attrib_id` IS NULL, 0, 1) AS `oconly`" .
580
-            $namequery . "
580
+            $namequery."
581 581
                        FROM `map2_data`
582 582
                  INNER JOIN `caches` ON `map2_data`.`cache_id`=`caches`.`cache_id`
583 583
                  INNER JOIN `user` ON `user`.`user_id`=`caches`.`user_id`
@@ -624,19 +624,19 @@  discard block
 block discarded – undo
624 624
                 echo
625 625
                     '<c d="'
626 626
                     . xmlentities(
627
-                        $r['wp_oc'] . '/' . round($r['longitude'], 5) . '/' .
628
-                        round($r['latitude'], 5) . '/' . $r['type'] . '/' . $flags
629
-                    ) . '"'
630
-                    . (isset($r['cachename']) ? ' n="' . xmlentities($r['cachename']) . '"' : '')
627
+                        $r['wp_oc'].'/'.round($r['longitude'], 5).'/'.
628
+                        round($r['latitude'], 5).'/'.$r['type'].'/'.$flags
629
+                    ).'"'
630
+                    . (isset($r['cachename']) ? ' n="'.xmlentities($r['cachename']).'"' : '')
631 631
                     . ' />';
632 632
             } else {
633 633
                 echo
634
-                    '<cache wp="' . xmlentities($r['wp_oc']) . '"' .
635
-                    ' lon="' . xmlentities(round($r['longitude'], 5)) . '"' .
636
-                    ' lat="' . xmlentities(round($r['latitude'], 5)) . '"' .
637
-                    ' type="' . xmlentities($r['type']) . '"' .
638
-                    (isset($r['cachename']) ? ' n="' . xmlentities($r['cachename']) . '"' : '') .
639
-                    ' f="' . xmlentities($flags) . '" />' . "\n";
634
+                    '<cache wp="'.xmlentities($r['wp_oc']).'"'.
635
+                    ' lon="'.xmlentities(round($r['longitude'], 5)).'"'.
636
+                    ' lat="'.xmlentities(round($r['latitude'], 5)).'"'.
637
+                    ' type="'.xmlentities($r['type']).'"'.
638
+                    (isset($r['cachename']) ? ' n="'.xmlentities($r['cachename']).'"' : '').
639
+                    ' f="'.xmlentities($flags).'" />'."\n";
640 640
             }
641 641
         }
642 642
         sql_free_result($rs);
Please login to merge, or discard this patch.
local/ocxml11client/index.php 1 patch
Spacing   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -27,12 +27,12 @@  discard block
 block discarded – undo
27 27
  * - Test mit aktuellem OC.de-Stand
28 28
  ***************************************************************************/
29 29
 
30
-$rootpath = __DIR__ . '/../../htdocs/';
30
+$rootpath = __DIR__.'/../../htdocs/';
31 31
 
32 32
 // chdir to proper directory (needed for cronjobs)
33 33
 chdir(substr(realpath($_SERVER['PHP_SELF']), 0, strrpos(realpath($_SERVER['PHP_SELF']), '/')));
34 34
 
35
-require_once $rootpath . 'lib/clicompatbase.inc.php';
35
+require_once $rootpath.'lib/clicompatbase.inc.php';
36 36
 require_once 'xml2array.inc.php';
37 37
 require_once 'settings.php';
38 38
 
@@ -67,16 +67,16 @@  discard block
 block discarded – undo
67 67
     $nFileNr = 0;
68 68
     $rs = sql('SELECT `id`, `url` FROM `pictures` WHERE `local`=0');
69 69
     while ($r = sql_fetch_array($rs)) {
70
-        $nFileNr ++;
70
+        $nFileNr++;
71 71
         $fileparts = mb_split('/', $r['url']);
72 72
         $filename = $fileparts[count($fileparts) - 1];
73 73
 
74
-        echo 'Downloading file ' . $nFileNr . ' of ' . $rCount['c'] . ': ' . $filename . "\n";
74
+        echo 'Downloading file '.$nFileNr.' of '.$rCount['c'].': '.$filename."\n";
75 75
 
76 76
         $success = true;
77
-        if (!file_exists($opt['pictures']['directory'] . $filename)) {
78
-            if (!@copy($r['url'], $opt['pictures']['directory'] . $filename)) {
79
-                echo 'error: Download nicht erfolgreich' . "\n";
77
+        if (!file_exists($opt['pictures']['directory'].$filename)) {
78
+            if (!@copy($r['url'], $opt['pictures']['directory'].$filename)) {
79
+                echo 'error: Download nicht erfolgreich'."\n";
80 80
                 $success = false;
81 81
             }
82 82
         }
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         if ($success == true) {
85 85
             sql(
86 86
                 "UPDATE `pictures` SET `local`=1, `url`='&1' WHERE `id`='&2'",
87
-                $opt['pictures']['url'] . $filename,
87
+                $opt['pictures']['url'].$filename,
88 88
                 $r['id']
89 89
             );
90 90
         }
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 
197 197
     if ($opt['session'] == 1) {
198 198
         // records abfragen
199
-        $sessionfile = $opt['tmpdir'] . 'session.xml';
199
+        $sessionfile = $opt['tmpdir'].'session.xml';
200 200
         if (file_exists($sessionfile)) {
201 201
             unlink($sessionfile);
202 202
         }
@@ -215,21 +215,21 @@  discard block
 block discarded – undo
215 215
         $recordscount += $session['OCXMLSESSION']['RECORDS']['PICTURE'];
216 216
         $recordscount += $session['OCXMLSESSION']['RECORDS']['REMOVEOBJECT'];
217 217
 
218
-        echo 'Abruf seit ' . $lastUpdate . "\n";
218
+        echo 'Abruf seit '.$lastUpdate."\n";
219 219
         echo "------------------------\n";
220
-        echo 'Session-Id: ' . $sessionid . "\n";
221
-        echo 'User: ' . $session['OCXMLSESSION']['RECORDS']['USER'] . "\n";
222
-        echo 'Cache: ' . $session['OCXMLSESSION']['RECORDS']['CACHE'] . "\n";
223
-        echo 'Cachdesc: ' . $session['OCXMLSESSION']['RECORDS']['CACHEDESC'] . "\n";
224
-        echo 'Cachelog: ' . $session['OCXMLSESSION']['RECORDS']['CACHELOG'] . "\n";
225
-        echo 'Picture: ' . $session['OCXMLSESSION']['RECORDS']['PICTURE'] . "\n";
226
-        echo 'Removedobject: ' . $session['OCXMLSESSION']['RECORDS']['REMOVEOBJECT'] . "\n";
220
+        echo 'Session-Id: '.$sessionid."\n";
221
+        echo 'User: '.$session['OCXMLSESSION']['RECORDS']['USER']."\n";
222
+        echo 'Cache: '.$session['OCXMLSESSION']['RECORDS']['CACHE']."\n";
223
+        echo 'Cachdesc: '.$session['OCXMLSESSION']['RECORDS']['CACHEDESC']."\n";
224
+        echo 'Cachelog: '.$session['OCXMLSESSION']['RECORDS']['CACHELOG']."\n";
225
+        echo 'Picture: '.$session['OCXMLSESSION']['RECORDS']['PICTURE']."\n";
226
+        echo 'Removedobject: '.$session['OCXMLSESSION']['RECORDS']['REMOVEOBJECT']."\n";
227 227
         echo "------------------------\n";
228
-        echo 'Summe: ' . $recordscount . "\n";
228
+        echo 'Summe: '.$recordscount."\n";
229 229
 
230 230
         $filescount = ($recordscount + (500 - $recordscount % 500)) / 500;
231 231
 
232
-        echo 'Anzahl der Pakete: ' . $filescount . "\n";
232
+        echo 'Anzahl der Pakete: '.$filescount."\n";
233 233
         echo "\n";
234 234
 
235 235
         if ($recordscount == 0) {
@@ -237,20 +237,20 @@  discard block
 block discarded – undo
237 237
             exit;
238 238
         }
239 239
 
240
-        for ($i = 1; $i <= $filescount; $i ++) {
241
-            echo "Download Paket: " . $i . ' von ' . $filescount . "\n";
240
+        for ($i = 1; $i <= $filescount; $i++) {
241
+            echo "Download Paket: ".$i.' von '.$filescount."\n";
242 242
 
243 243
             $fileurl = $opt['url_getsession'];
244 244
             $fileurl = mb_ereg_replace('{sessionid}', $sessionid, $fileurl);
245 245
             $fileurl = mb_ereg_replace('{file}', $i, $fileurl);
246 246
             $fileurl = mb_ereg_replace('{zip}', $opt['zip'], $fileurl);
247
-            $target = $opt['tmpdir'] . $sessionid . '-' . sprintf('%04d', $i) . $fileext;
247
+            $target = $opt['tmpdir'].$sessionid.'-'.sprintf('%04d', $i).$fileext;
248 248
 
249 249
             copy($fileurl, $target);
250 250
         }
251 251
     } else {
252
-        echo 'Download ...' . "\n";
253
-        $target = $opt['tmpdir'] . date('YmdHis') . $fileext;
252
+        echo 'Download ...'."\n";
253
+        $target = $opt['tmpdir'].date('YmdHis').$fileext;
254 254
         copy($url, $target);
255 255
     }
256 256
 }
@@ -262,24 +262,24 @@  discard block
 block discarded – undo
262 262
     // alle zips entpacken
263 263
     $hDir = opendir($opt['tmpdir']);
264 264
     while (false !== ($file = readdir($hDir))) {
265
-        if (is_file($opt['tmpdir'] . $file)) {
265
+        if (is_file($opt['tmpdir'].$file)) {
266 266
             $bCopy = false;
267 267
             if (mb_substr($file, mb_strrpos($file, '.')) == '.zip') {
268
-                echo 'Unzipping file ' . $file . "\n";
268
+                echo 'Unzipping file '.$file."\n";
269 269
                 system(
270
-                    $opt['unzip'] . ' --type=zip --src="' . $opt['rel_tmpdir'] . '/' . $file . '" --dst="' . $opt['rel_tmpdir'] . '"'
270
+                    $opt['unzip'].' --type=zip --src="'.$opt['rel_tmpdir'].'/'.$file.'" --dst="'.$opt['rel_tmpdir'].'"'
271 271
                 );
272 272
             } else {
273 273
                 if (mb_substr($file, mb_strrpos($file, '.')) == '.gz') {
274
-                    echo 'Unzipping file ' . $file . "\n";
274
+                    echo 'Unzipping file '.$file."\n";
275 275
                     system(
276
-                        $opt['unzip'] . ' --type=gzip --src="' . $opt['rel_tmpdir'] . '/' . $file . '" --dst="' . $opt['rel_tmpdir'] . '"'
276
+                        $opt['unzip'].' --type=gzip --src="'.$opt['rel_tmpdir'].'/'.$file.'" --dst="'.$opt['rel_tmpdir'].'"'
277 277
                     );
278 278
                 } else {
279 279
                     if (mb_substr($file, mb_strrpos($file, '.')) == '.bz2') {
280
-                        echo 'Unzipping file ' . $file . "\n";
280
+                        echo 'Unzipping file '.$file."\n";
281 281
                         system(
282
-                            $opt['unzip'] . ' --type=bzip2 --src="' . $opt['rel_tmpdir'] . '/' . $file . '" --dst="' . $opt['rel_tmpdir'] . '"'
282
+                            $opt['unzip'].' --type=bzip2 --src="'.$opt['rel_tmpdir'].'/'.$file.'" --dst="'.$opt['rel_tmpdir'].'"'
283 283
                         );
284 284
                     } else {
285 285
                         if (mb_substr($file, mb_strrpos($file, '.')) == '.xml') {
@@ -291,16 +291,16 @@  discard block
 block discarded – undo
291 291
 
292 292
             // und jetzt die gezippte Datei verschieben
293 293
             $archivdir = $opt['archivdir'];
294
-            $archivdir .= $opt['curdb'] . '/';
294
+            $archivdir .= $opt['curdb'].'/';
295 295
 
296 296
             if (!is_dir($archivdir)) {
297 297
                 mkdir($archivdir);
298 298
             }
299 299
 
300 300
             if ($bCopy == true) {
301
-                copy($opt['tmpdir'] . $file, $archivdir . '/' . $file);
301
+                copy($opt['tmpdir'].$file, $archivdir.'/'.$file);
302 302
             } else {
303
-                rename($opt['tmpdir'] . $file, $archivdir . '/' . $file);
303
+                rename($opt['tmpdir'].$file, $archivdir.'/'.$file);
304 304
             }
305 305
         }
306 306
     }
@@ -315,9 +315,9 @@  discard block
 block discarded – undo
315 315
 
316 316
     $hDir = opendir($opt['tmpdir']);
317 317
     while (false !== ($file = readdir($hDir))) {
318
-        if (is_file($opt['tmpdir'] . $file)) {
318
+        if (is_file($opt['tmpdir'].$file)) {
319 319
             if ($file != '.cvsignore') {
320
-                $files[] = $opt['tmpdir'] . $file;
320
+                $files[] = $opt['tmpdir'].$file;
321 321
             }
322 322
         }
323 323
     }
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
 
332 332
 function importxmlfile($file)
333 333
 {
334
-    echo 'Importing file ' . $file . "\n";
334
+    echo 'Importing file '.$file."\n";
335 335
 
336 336
     $xmlReader = new xmlReader();
337 337
     $xmlReader->open($file);
@@ -411,11 +411,11 @@  discard block
 block discarded – undo
411 411
                             if ($sSubElement != '') {
412 412
                                 // vorheriges element zuerst schlißen
413 413
                                 $sSubElement = '';
414
-                                $nRecursionLevel --;
414
+                                $nRecursionLevel--;
415 415
                             }
416 416
 
417 417
                             $sSubElement = mb_strtoupper($xmlReader->name);
418
-                            $nRecursionLevel ++;
418
+                            $nRecursionLevel++;
419 419
 
420 420
                             // attribute auslesen
421 421
                             if ($xmlReader->moveToFirstAttribute()) {
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
                         } else {
433 433
                             if ($xmlReader->nodeType == XMLReader::END_ELEMENT) {
434 434
                                 $sSubElement = '';
435
-                                $nRecursionLevel --;
435
+                                $nRecursionLevel--;
436 436
                             }
437 437
                         }
438 438
                     }
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
                     ImportRemovedObjectArray($node['REMOVEDOBJECT']);
460 460
                     break;
461 461
                 default:
462
-                    echo 'Unknown Element "' . $xmlReader->name . '", skipping' . "\n";
462
+                    echo 'Unknown Element "'.$xmlReader->name.'", skipping'."\n";
463 463
                     break;
464 464
             }
465 465
         }
@@ -481,9 +481,9 @@  discard block
 block discarded – undo
481 481
 
482 482
     $hDir = opendir($opt['tmpdir']);
483 483
     while (false !== ($file = readdir($hDir))) {
484
-        if (is_file($opt['tmpdir'] . $file)) {
484
+        if (is_file($opt['tmpdir'].$file)) {
485 485
             if ($file != '.cvsignore') {
486
-                unlink($opt['tmpdir'] . $file);
486
+                unlink($opt['tmpdir'].$file);
487 487
             }
488 488
         }
489 489
     }
@@ -501,14 +501,14 @@  discard block
 block discarded – undo
501 501
         // andere DB connecten?
502 502
         if (mb_substr($arg, 0, 5) == '--db=') {
503 503
             if (!is_numeric(mb_substr($arg, 5))) {
504
-                die('invalid alternative DB' . "\n");
504
+                die('invalid alternative DB'."\n");
505 505
             }
506 506
 
507 507
             $nDb = mb_substr($arg, 5);
508 508
 
509 509
             if ($nDb != 0) {
510 510
                 if (!isset($opt['db'][$nDb])) {
511
-                    die('invalid alternative DB' . "\n");
511
+                    die('invalid alternative DB'."\n");
512 512
                 }
513 513
 
514 514
                 mysql_close($dblink);
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
                     sql("SET NAMES 'utf8'");
518 518
                     sql('USE `&1`', $opt['db'][1]['name']);
519 519
                 } else {
520
-                    die('Connect to alternative DB failed' . "\n");
520
+                    die('Connect to alternative DB failed'."\n");
521 521
                 }
522 522
 
523 523
                 $opt['curdb'] = $nDb;
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
             sql("SET NAMES 'utf8'");
532 532
             sql('USE `&1`', $dbname);
533 533
         } else {
534
-            die('Connect to alternative DB failed' . "\n");
534
+            die('Connect to alternative DB failed'."\n");
535 535
         }
536 536
     }
537 537
 }
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
         !isset($r['USERNAME']['__DATA']) ||
545 545
         !isset($r['LASTMODIFIED']['__DATA'])
546 546
     ) {
547
-        echo 'warn: ImportUserArray required element not defined' . "\n";
547
+        echo 'warn: ImportUserArray required element not defined'."\n";
548 548
 
549 549
         return;
550 550
     }
@@ -637,7 +637,7 @@  discard block
 block discarded – undo
637 637
         !isset($r['DATECREATED']['__DATA']) ||
638 638
         !isset($r['LASTMODIFIED']['__DATA'])
639 639
     ) {
640
-        echo 'warn: ImportCacheArray required element not defined' . "\n";
640
+        echo 'warn: ImportCacheArray required element not defined'."\n";
641 641
 
642 642
         return;
643 643
     }
@@ -807,7 +807,7 @@  discard block
 block discarded – undo
807 807
         !isset($r['LANGUAGE']['__ATTR']['ID']) ||
808 808
         !isset($r['LASTMODIFIED']['__DATA'])
809 809
     ) {
810
-        echo 'error: ImportCacheDescArray required element not defined' . "\n";
810
+        echo 'error: ImportCacheDescArray required element not defined'."\n";
811 811
 
812 812
         return;
813 813
     }
@@ -964,7 +964,7 @@  discard block
 block discarded – undo
964 964
         !isset($r['DATECREATED']['__DATA']) ||
965 965
         !isset($r['LASTMODIFIED']['__DATA'])
966 966
     ) {
967
-        echo 'error: ImportCachelogArray required element not defined' . "\n";
967
+        echo 'error: ImportCachelogArray required element not defined'."\n";
968 968
 
969 969
         return;
970 970
     }
@@ -995,7 +995,7 @@  discard block
 block discarded – undo
995 995
 
996 996
     // logtype gültig?
997 997
     if (sqlValue(
998
-        "SELECT COUNT(*) FROM `log_types` WHERE `id`='" . sql_escape($r['LOGTYPE']['__ATTR']['ID']) . "'",
998
+        "SELECT COUNT(*) FROM `log_types` WHERE `id`='".sql_escape($r['LOGTYPE']['__ATTR']['ID'])."'",
999 999
         0
1000 1000
     ) == 0) {
1001 1001
         importError('cachelog', $r['ID']['__DATA'], $r, 'Logtype not valid, skipping');
@@ -1068,7 +1068,7 @@  discard block
 block discarded – undo
1068 1068
         !isset($r['DATECREATED']['__DATA']) ||
1069 1069
         !isset($r['LASTMODIFIED']['__DATA'])
1070 1070
     ) {
1071
-        echo 'error: ImportPictureArray required element not defined ' . "\n";
1071
+        echo 'error: ImportPictureArray required element not defined '."\n";
1072 1072
 
1073 1073
         return;
1074 1074
     }
@@ -1169,7 +1169,7 @@  discard block
 block discarded – undo
1169 1169
         !isset($r['OBJECT']['__DATA']) ||
1170 1170
         !isset($r['REMOVEDDATE']['__DATA'])
1171 1171
     ) {
1172
-        echo 'error: ImportRemovedObjectArray required element not defined' . "\n";
1172
+        echo 'error: ImportRemovedObjectArray required element not defined'."\n";
1173 1173
 
1174 1174
         return;
1175 1175
     }
@@ -1281,12 +1281,12 @@  discard block
 block discarded – undo
1281 1281
 
1282 1282
 function importError($recordtype, $uuid, $r, $info)
1283 1283
 {
1284
-    echo 'error: ' . $recordtype . ' (' . $uuid . '): ' . $info . "\n";
1284
+    echo 'error: '.$recordtype.' ('.$uuid.'): '.$info."\n";
1285 1285
 }
1286 1286
 
1287 1287
 function importWarn($recordtype, $uuid, $r, $info)
1288 1288
 {
1289
-    echo 'warn: ' . $recordtype . ' (' . $uuid . '): ' . $info . "\n";
1289
+    echo 'warn: '.$recordtype.' ('.$uuid.'): '.$info."\n";
1290 1290
 }
1291 1291
 
1292 1292
 function restorevalues()
Please login to merge, or discard this patch.
local/devel/strip_private_data.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -9,15 +9,15 @@  discard block
 block discarded – undo
9 9
  *  Unicode Reminder メモ
10 10
  ***************************************************************************/
11 11
 
12
-$opt['rootpath'] = __DIR__ . '/../../htdocs/';
13
-require $opt['rootpath'] . 'lib2/cli.inc.php';
12
+$opt['rootpath'] = __DIR__.'/../../htdocs/';
13
+require $opt['rootpath'].'lib2/cli.inc.php';
14 14
 
15 15
 if (!($opt['debug'] & DEBUG_DEVELOPER)) {
16 16
     die("This script deletes lot of data and must be run only on development systems.\n");
17 17
 }
18 18
 if ($argc != 2 || $argv[1] != 'go') {
19 19
     die(
20
-        "This script deletes lot of data. Make sure that you really want to dos this,\n" .
20
+        "This script deletes lot of data. Make sure that you really want to dos this,\n".
21 21
         "and confirm it by adding the parameter 'go'.\n"
22 22
     );
23 23
 }
@@ -63,11 +63,11 @@  discard block
 block discarded – undo
63 63
 echo "clearing user data\n";
64 64
 sql('TRUNCATE `cache_adoption`');
65 65
 sql('TRUNCATE `cache_ignore`');
66
-sql('DELETE FROM `cache_lists` WHERE `is_public`<2');  // trigger deletes dependent data
66
+sql('DELETE FROM `cache_lists` WHERE `is_public`<2'); // trigger deletes dependent data
67 67
 sql('TRUNCATE `cache_list_bookmarks`');
68 68
 sql('TRUNCATE `cache_list_watches`');
69 69
 sql('TRUNCATE `cache_watches`');
70
-sql('DELETE FROM `coordinates` WHERE `type`=2');   // personal cache notes and coords
70
+sql('DELETE FROM `coordinates` WHERE `type`=2'); // personal cache notes and coords
71 71
 sql('TRUNCATE `queries`');
72 72
 sql('TRUNCATE `user_options`');
73 73
 sql(
@@ -132,10 +132,10 @@  discard block
 block discarded – undo
132 132
 
133 133
 echo "clearing other nonpublic data\n";
134 134
 sql('TRUNCATE `news`');
135
-$rs = sql("SHOW TABLES WHERE `Tables_in_" . $opt['db']['placeholder']['db'] . "` LIKE '\_%'");
135
+$rs = sql("SHOW TABLES WHERE `Tables_in_".$opt['db']['placeholder']['db']."` LIKE '\_%'");
136 136
 $tables = sql_fetch_column($rs);
137 137
 foreach ($tables as $table) {
138
-    sql('DROP TABLE ' . $table);
138
+    sql('DROP TABLE '.$table);
139 139
 }
140 140
 
141 141
 echo "done.\n";
Please login to merge, or discard this patch.