@@ -9,7 +9,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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); |
@@ -27,12 +27,12 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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() |
@@ -9,15 +9,15 @@ discard block |
||
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 |
||
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 |
||
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"; |
@@ -17,9 +17,9 @@ discard block |
||
17 | 17 | * $opt['locale'] |
18 | 18 | ***************************************************************************/ |
19 | 19 | |
20 | -define('OC_LOCALE_ACTIVE', 2); // enable language and show language button in header line |
|
21 | -define('OC_LOCALE_HIDDEN', 1); // enable language but hide language button in header line |
|
22 | -define('OC_LOCALE_DISABLED', 0); // disable language |
|
20 | +define('OC_LOCALE_ACTIVE', 2); // enable language and show language button in header line |
|
21 | +define('OC_LOCALE_HIDDEN', 1); // enable language but hide language button in header line |
|
22 | +define('OC_LOCALE_DISABLED', 0); // disable language |
|
23 | 23 | |
24 | 24 | $opt['template']['locales']['DE']['status'] = OC_LOCALE_ACTIVE; |
25 | 25 | $opt['template']['locales']['DE']['flag'] = 'images/flag/DE.png'; |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | $opt['locale']['DE']['page']['license'] = '<a rel="license" href="%1"><img alt="Creative Commons Lizenzvertrag" style="border-width:0" src="resource2/ocstyle/images/media/cc-by-nc-nd-small.png" /></a><div style="text-align:center; margin:8px 0 0 6px;">Die <a href="articles.php?page=impressum#datalicense">Inhalte</a> von {site} stehen unter der Creative-Commons-Lizenz <a rel="license" href="%1">BY-NC-ND 3.0 DE</a>.</div>'; |
132 | 132 | $opt['locale']['DE']['helpwiki'] = 'http://wiki.opencaching.de/index.php/'; |
133 | 133 | $opt['locale']['DE']['mostly_translated'] = true; |
134 | -$opt['locale']['DE']['what3words'] = true; // "beta" |
|
134 | +$opt['locale']['DE']['what3words'] = true; // "beta" |
|
135 | 135 | |
136 | 136 | $opt['locale']['IT']['format']['dateshort'] = '%d/%m/%y'; |
137 | 137 | $opt['locale']['IT']['format']['dm'] = '%d/%m'; |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | $opt['locale']['SV']['page']['subtitle1'] = 'Geocaching med Opencaching'; |
233 | 233 | $opt['locale']['SV']['page']['subtitle2'] = ''; |
234 | 234 | $opt['locale']['SV']['mostly_translated'] = false; |
235 | -$opt['locale']['SV']['what3words'] = true; // "beta" |
|
235 | +$opt['locale']['SV']['what3words'] = true; // "beta" |
|
236 | 236 | |
237 | 237 | $opt['locale']['NO']['format']['dateshort'] = '%d.%m.%y'; |
238 | 238 | $opt['locale']['NO']['format']['dm'] = '%d.%m.'; |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | $opt['locale']['RU']['format']['colonspace'] = ''; |
280 | 280 | $opt['locale']['RU']['country'] = 'RU'; |
281 | 281 | $opt['locale']['RU']['mostly_translated'] = false; |
282 | -$opt['locale']['RU']['what3words'] = true; // "beta" |
|
282 | +$opt['locale']['RU']['what3words'] = true; // "beta" |
|
283 | 283 | |
284 | 284 | $opt['locale']['DA']['format']['dateshort'] = '%d.%m.%y'; |
285 | 285 | $opt['locale']['DA']['format']['dm'] = '%d.%m.'; |
@@ -11,7 +11,7 @@ |
||
11 | 11 | $dev_baseurl = 'http://local.opencaching.de '; |
12 | 12 | |
13 | 13 | // common developer system settings |
14 | -require __DIR__ . '/settings-dev.inc.php'; |
|
14 | +require __DIR__.'/settings-dev.inc.php'; |
|
15 | 15 | |
16 | 16 | // database access |
17 | 17 | $opt['db']['servername'] = 'localhost'; |
@@ -11,7 +11,7 @@ |
||
11 | 11 | $dev_baseurl = 'http://local.opencaching.de '; |
12 | 12 | |
13 | 13 | // common developer system settings |
14 | -require __DIR__ . '/settings-dev.inc.php'; |
|
14 | +require __DIR__.'/settings-dev.inc.php'; |
|
15 | 15 | |
16 | 16 | // database access |
17 | 17 | $opt['db']['servername'] = 'localhost'; |