@@ -10,8 +10,8 @@ discard block |
||
| 10 | 10 | ***************************************************************************/ |
| 11 | 11 | |
| 12 | 12 | $opt['rootpath'] = '../../'; |
| 13 | -require_once __DIR__ . '/../../lib2/cli.inc.php'; |
|
| 14 | -require_once __DIR__ . '/../../lib2/search/search.inc.php'; |
|
| 13 | +require_once __DIR__.'/../../lib2/cli.inc.php'; |
|
| 14 | +require_once __DIR__.'/../../lib2/search/search.inc.php'; |
|
| 15 | 15 | |
| 16 | 16 | |
| 17 | 17 | sql('DELETE FROM geodb_search'); |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | foreach ($simpletextsarray as $text) { |
| 31 | 31 | if ($text != '') { |
| 32 | 32 | if (nonalpha($text)) { |
| 33 | - die($text . "\n"); |
|
| 33 | + die($text."\n"); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | $simpletext = search_text2simple($text); |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | function nonalpha($str) |
| 52 | 52 | { |
| 53 | - for ($i = 0; $i < mb_strlen($str); $i ++) { |
|
| 53 | + for ($i = 0; $i < mb_strlen($str); $i++) { |
|
| 54 | 54 | if (!((ord(mb_substr($str, $i, 1)) >= ord('a')) && (ord(mb_substr($str, $i, 1)) <= ord('z')))) { |
| 55 | 55 | return true; |
| 56 | 56 | } |
@@ -10,8 +10,8 @@ discard block |
||
| 10 | 10 | header('Content-type: text/html; charset=utf-8'); |
| 11 | 11 | |
| 12 | 12 | $opt['rootpath'] = '../../'; |
| 13 | -require $opt['rootpath'] . 'lib2/web.inc.php'; |
|
| 14 | -require $opt['rootpath'] . 'templates2/ocstyle/search.tpl.inc.php'; |
|
| 13 | +require $opt['rootpath'].'lib2/web.inc.php'; |
|
| 14 | +require $opt['rootpath'].'templates2/ocstyle/search.tpl.inc.php'; |
|
| 15 | 15 | |
| 16 | 16 | $bbox = isset($_REQUEST['BBOX']) ? $_REQUEST['BBOX'] : '0,0,0,0'; |
| 17 | 17 | $abox = mb_split(',', $bbox); |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $kmlLine = |
| 47 | 47 | ' |
| 48 | 48 | <Placemark> |
| 49 | - <description><![CDATA[' . $t_by . ' {username}<br><br><a href="{urlbase}viewcache.php?cacheid={cacheid}">' . $t_showdesc . '</a><br> <br><table cellspacing="0" cellpadding="0" border="0"><tr><td>{typeimgurl} </td><td>' . $t_type . ' {type}<br>' . $t_size . ' {size}</td></tr><tr><td colspan="2">' . $t_difficulty . '<br>' . $t_terrain . '</td></tr></table>]]></description> |
|
| 49 | + <description><![CDATA[' . $t_by.' {username}<br><br><a href="{urlbase}viewcache.php?cacheid={cacheid}">'.$t_showdesc.'</a><br> <br><table cellspacing="0" cellpadding="0" border="0"><tr><td>{typeimgurl} </td><td>'.$t_type.' {type}<br>'.$t_size.' {size}</td></tr><tr><td colspan="2">'.$t_difficulty.'<br>'.$t_terrain.'</td></tr></table>]]></description> |
|
| 50 | 50 | <name>{name}</name> |
| 51 | 51 | <LookAt> |
| 52 | 52 | <longitude>{lon}</longitude> |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | $nCount = $nCount + 1; |
| 237 | 237 | $thisline = $kmlLine; |
| 238 | 238 | |
| 239 | - $typeimgurl = '<img src="' . $opt['page']['default_absolute_url'] . 'resource2/' . $opt['template']['style'] . '/images/cacheicon/' . $r['icon_large'] . '" alt="' . $r['typedesc'] . '" title="' . $r['typedesc'] . '" />'; |
|
| 239 | + $typeimgurl = '<img src="'.$opt['page']['default_absolute_url'].'resource2/'.$opt['template']['style'].'/images/cacheicon/'.$r['icon_large'].'" alt="'.$r['typedesc'].'" title="'.$r['typedesc'].'" />'; |
|
| 240 | 240 | |
| 241 | 241 | $thisline = mb_ereg_replace('{icon}', $r['kml_name'], $thisline); |
| 242 | 242 | $thisline = mb_ereg_replace('{typeimgurl}', $typeimgurl, $thisline); |
@@ -313,15 +313,15 @@ discard block |
||
| 313 | 313 | // prepare lines |
| 314 | 314 | $sZoomIn = str_replace("\r", "", $sZoomIn); |
| 315 | 315 | $sLines = mb_split("\n", $sZoomIn); |
| 316 | - for ($i = 0; $i < count($sLines); $i ++) { |
|
| 316 | + for ($i = 0; $i < count($sLines); $i++) { |
|
| 317 | 317 | $sLines[$i] = str_pad($sLines[$i], ($nColumnsCount - 1), ' '); |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | $nDegreePerLine = ($lat_to - $lat_from) / count($sLines); |
| 321 | 321 | $nDegreePerColumn = ($lon_to - $lon_from) / $nColumnsCount; |
| 322 | 322 | |
| 323 | - for ($nLine = 0; $nLine < count($sLines); $nLine ++) { |
|
| 324 | - for ($nColumn = 0; $nColumn < $nColumnsCount; $nColumn ++) { |
|
| 323 | + for ($nLine = 0; $nLine < count($sLines); $nLine++) { |
|
| 324 | + for ($nColumn = 0; $nColumn < $nColumnsCount; $nColumn++) { |
|
| 325 | 325 | if (substr($sLines[$nLine], $nColumn, 1) == '#') { |
| 326 | 326 | $nLat = $lat_to - $nDegreePerLine * $nLine; |
| 327 | 327 | $nLon = $lon_from + $nDegreePerColumn * $nColumn; |
@@ -331,14 +331,14 @@ discard block |
||
| 331 | 331 | <description><![CDATA[You have to zoom in to see the Geocaches]]></description> |
| 332 | 332 | <name></name> |
| 333 | 333 | <LookAt> |
| 334 | - <longitude>' . $nLon . '</longitude> |
|
| 335 | - <latitude>' . $nLat . '</latitude> |
|
| 334 | + <longitude>' . $nLon.'</longitude> |
|
| 335 | + <latitude>' . $nLat.'</latitude> |
|
| 336 | 336 | <range>5000</range> |
| 337 | 337 | <tilt>0</tilt> |
| 338 | 338 | <heading>3</heading> |
| 339 | 339 | </LookAt> |
| 340 | 340 | <Point> |
| 341 | - <coordinates>' . $nLon . ',' . $nLat . ',0</coordinates> |
|
| 341 | + <coordinates>' . $nLon.','.$nLat.',0</coordinates> |
|
| 342 | 342 | </Point> |
| 343 | 343 | </Placemark> |
| 344 | 344 | '; |
@@ -12,10 +12,10 @@ |
||
| 12 | 12 | ****************************************************************************/ |
| 13 | 13 | |
| 14 | 14 | // needs absolute rootpath because called as cronjob |
| 15 | -$opt['rootpath'] = __DIR__ . '/../../'; |
|
| 15 | +$opt['rootpath'] = __DIR__.'/../../'; |
|
| 16 | 16 | |
| 17 | -require __DIR__ . '/../../lib2/cli.inc.php'; |
|
| 18 | -require __DIR__ . '/../../lib2/search/ftsearch.inc.php'; |
|
| 17 | +require __DIR__.'/../../lib2/cli.inc.php'; |
|
| 18 | +require __DIR__.'/../../lib2/search/ftsearch.inc.php'; |
|
| 19 | 19 | |
| 20 | 20 | if (!cronjobs_enabled()) { |
| 21 | 21 | exit; |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | class gcwp_update |
| 14 | 14 | { |
| 15 | 15 | public $name = 'gcwp_update'; |
| 16 | - public $interval = 3600; // every hour |
|
| 16 | + public $interval = 3600; // every hour |
|
| 17 | 17 | |
| 18 | 18 | |
| 19 | 19 | public function run() |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | foreach ($opt['cron']['gcwp']['sources'] as $source) { |
| 27 | 27 | $wpdata = @file($source); |
| 28 | 28 | if ($wpdata === false) { |
| 29 | - echo 'gcwp_update: error reading ' . $source . "\n"; |
|
| 29 | + echo 'gcwp_update: error reading '.$source."\n"; |
|
| 30 | 30 | $errors = true; |
| 31 | 31 | } else { |
| 32 | 32 | foreach ($wpdata as $line) { |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | " |
| 49 | 49 | UPDATE caches |
| 50 | 50 | SET wp_gc_maintained = UCASE(TRIM(wp_gc)) |
| 51 | - WHERE wp_oc NOT IN ('" . implode("','", $ocwp_imported) . "')" |
|
| 51 | + WHERE wp_oc NOT IN ('" . implode("','", $ocwp_imported)."')" |
|
| 52 | 52 | ); |
| 53 | 53 | } |
| 54 | 54 | } |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | class autoarchive |
| 13 | 13 | { |
| 14 | 14 | public $name = 'autoarchive'; |
| 15 | - public $interval = 43200; // twice per day |
|
| 15 | + public $interval = 43200; // twice per day |
|
| 16 | 16 | |
| 17 | 17 | |
| 18 | 18 | public function run() |
@@ -21,12 +21,12 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | if ($opt['cron']['autoarchive']['run']) { |
| 23 | 23 | if (!$login->logged_in()) { |
| 24 | - echo $this->name . ": not logged in / no system user configured\n"; |
|
| 24 | + echo $this->name.": not logged in / no system user configured\n"; |
|
| 25 | 25 | } elseif ($login->hasAdminPriv(ADMIN_USER)) { |
| 26 | 26 | $this->archive_disabled_caches(); |
| 27 | 27 | $this->archive_events(); |
| 28 | 28 | } else { |
| 29 | - echo $this->name . ": user '" . $opt['logic']['systemuser']['user'] . "' cannot maintain caches\n"; |
|
| 29 | + echo $this->name.": user '".$opt['logic']['systemuser']['user']."' cannot maintain caches\n"; |
|
| 30 | 30 | } |
| 31 | 31 | } |
| 32 | 32 | } |
@@ -80,12 +80,12 @@ discard block |
||
| 80 | 80 | $months = ($rCache['listing_age'] > 366 ? 12 : 6); |
| 81 | 81 | $this->archive_cache( |
| 82 | 82 | $rCache['cache_id'], |
| 83 | - 'This cache has been "temporarily unavailable" for more than %1 months now; ' . |
|
| 84 | - 'therefore it is being archived automatically. The owner may decide to ' . |
|
| 83 | + 'This cache has been "temporarily unavailable" for more than %1 months now; '. |
|
| 84 | + 'therefore it is being archived automatically. The owner may decide to '. |
|
| 85 | 85 | 'maintain the cache and re-enable the listing.', |
| 86 | 86 | $months |
| 87 | 87 | ); |
| 88 | - ++ $archived; |
|
| 88 | + ++$archived; |
|
| 89 | 89 | |
| 90 | 90 | // This limit throttles archiving. If something goes wrong, it won't |
| 91 | 91 | // produce too much trouble. |
@@ -113,8 +113,8 @@ discard block |
||
| 113 | 113 | while ($rCache = sql_fetch_assoc($rs)) { |
| 114 | 114 | $this->archive_cache( |
| 115 | 115 | $rCache['cache_id'], |
| 116 | - 'This event took place more than five weeks ago; therefore it is ' . |
|
| 117 | - 'being archived automatically. The owner may re-enable the listing ' . |
|
| 116 | + 'This event took place more than five weeks ago; therefore it is '. |
|
| 117 | + 'being archived automatically. The owner may re-enable the listing '. |
|
| 118 | 118 | 'if it should stay active for some exceptional reason.' |
| 119 | 119 | ); |
| 120 | 120 | } |
@@ -127,11 +127,11 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | $log = cachelog::createNew($cache_id, $login->userid); |
| 129 | 129 | if ($log === false) { |
| 130 | - echo $this->name . ": cannot create log for cache $cache_id\n"; |
|
| 130 | + echo $this->name.": cannot create log for cache $cache_id\n"; |
|
| 131 | 131 | } else { |
| 132 | 132 | $cache = new cache($cache_id); |
| 133 | 133 | if (!$cache->setStatus(3) || !$cache->save()) { |
| 134 | - echo $this->name . ": cannot change status of cache $cache_id\n"; |
|
| 134 | + echo $this->name.": cannot change status of cache $cache_id\n"; |
|
| 135 | 135 | } else { |
| 136 | 136 | // create log |
| 137 | 137 | $log->setType(cachelog::LOGTYPE_ARCHIVED, true); |
@@ -143,11 +143,11 @@ discard block |
||
| 143 | 143 | // create log text in appropriate language |
| 144 | 144 | $translated_comment = $translate->t($comment, '', '', 0, '', 1, $cache->getDefaultDescLanguage()); |
| 145 | 145 | $translated_comment = str_replace('%1', $months, $translated_comment); |
| 146 | - $log->setText('<p>' . $translated_comment . '</p>'); |
|
| 146 | + $log->setText('<p>'.$translated_comment.'</p>'); |
|
| 147 | 147 | $log->setTextHtml(1); |
| 148 | 148 | |
| 149 | 149 | if (!$log->save()) { |
| 150 | - echo $this->name . ": could not save archive log for cache $cache_id\n"; |
|
| 150 | + echo $this->name.": could not save archive log for cache $cache_id\n"; |
|
| 151 | 151 | } |
| 152 | 152 | } |
| 153 | 153 | } |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | { |
| 19 | 19 | global $opt; |
| 20 | 20 | |
| 21 | - $files = glob($opt['okapi']['var_dir'] . '/garmin*.zip'); |
|
| 21 | + $files = glob($opt['okapi']['var_dir'].'/garmin*.zip'); |
|
| 22 | 22 | foreach ($files as $file) { |
| 23 | 23 | // delete old download files after 24 hours; this large interval filters out any |
| 24 | 24 | // timezone mismatches in file sysytems (e.g. on unconventional development |
@@ -26,12 +26,12 @@ discard block |
||
| 26 | 26 | $rsLayers = sql( |
| 27 | 27 | "SELECT `id`, `type_id`, AsText(`shape`) AS `geometry` |
| 28 | 28 | FROM `npa_areas` WHERE `exclude`=0 AND MBRWITHIN(GeomFromText('&1'), `shape`)", |
| 29 | - 'POINT(' . $rCache['longitude'] . ' ' . $rCache['latitude'] . ')' |
|
| 29 | + 'POINT('.$rCache['longitude'].' '.$rCache['latitude'].')' |
|
| 30 | 30 | ); |
| 31 | 31 | while ($rLayers = sql_fetch_assoc($rsLayers)) { |
| 32 | 32 | if (gis::ptInLineRing( |
| 33 | 33 | $rLayers['geometry'], |
| 34 | - 'POINT(' . $rCache['longitude'] . ' ' . $rCache['latitude'] . ')' |
|
| 34 | + 'POINT('.$rCache['longitude'].' '.$rCache['latitude'].')' |
|
| 35 | 35 | ) |
| 36 | 36 | ) { |
| 37 | 37 | $bExclude = false; |
@@ -44,12 +44,12 @@ discard block |
||
| 44 | 44 | AND `type_id`='&1' |
| 45 | 45 | AND MBRWITHIN(GeomFromText('&2'), `shape`)", |
| 46 | 46 | $rLayers['type_id'], |
| 47 | - 'POINT(' . $rCache['longitude'] . ' ' . $rCache['latitude'] . ')' |
|
| 47 | + 'POINT('.$rCache['longitude'].' '.$rCache['latitude'].')' |
|
| 48 | 48 | ); |
| 49 | 49 | while (($rExclude = sql_fetch_assoc($rsExclude)) && ($bExclude == false)) { |
| 50 | 50 | if (gis::ptInLineRing( |
| 51 | 51 | $rExclude['geometry'], |
| 52 | - 'POINT(' . $rCache['longitude'] . ' ' . $rCache['latitude'] . ')' |
|
| 52 | + 'POINT('.$rCache['longitude'].' '.$rCache['latitude'].')' |
|
| 53 | 53 | ) |
| 54 | 54 | ) { |
| 55 | 55 | $bExclude = true; |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | class orphan_cleanup |
| 14 | 14 | { |
| 15 | 15 | public $name = 'orphan_cleanup'; |
| 16 | - public $interval = 86400; // once per day |
|
| 16 | + public $interval = 86400; // once per day |
|
| 17 | 17 | |
| 18 | 18 | public function run() |
| 19 | 19 | { |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | "DELETE FROM `xmlsession_data` |
| 36 | 36 | WHERE `session_id` IN (SELECT `session_id` FROM &tmpsessiondata)" |
| 37 | 37 | ); |
| 38 | - echo 'orphan_cleanup: dropped ' . $count . " record(s) from xmlsession_data\n"; |
|
| 38 | + echo 'orphan_cleanup: dropped '.$count." record(s) from xmlsession_data\n"; |
|
| 39 | 39 | } |
| 40 | 40 | sql_drop_temp_table('tmpsessiondata'); |
| 41 | 41 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | "DELETE FROM `map2_data` |
| 58 | 58 | WHERE `result_id` IN (SELECT `result_id` FROM &tmpsessiondata)" |
| 59 | 59 | ); |
| 60 | - echo 'orphan_cleanup: dropped ' . $count . " record(s) from map2_data\n"; |
|
| 60 | + echo 'orphan_cleanup: dropped '.$count." record(s) from map2_data\n"; |
|
| 61 | 61 | } |
| 62 | 62 | sql_drop_temp_table('tmpsessiondata'); |
| 63 | 63 | } |
@@ -42,7 +42,8 @@ |
||
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | for ($n = 1; $n < count($instances); ++ $n) { |
| 45 | - if ($instances[$n]['filesize'] !== false) {// ensure that pic is stored locally |
|
| 45 | + if ($instances[$n]['filesize'] !== false) { |
|
| 46 | +// ensure that pic is stored locally |
|
| 46 | 47 | for ($nn = $n - 1; $nn >= 0; -- $nn) { |
| 47 | 48 | if ($instances[$nn]['filesize'] === $instances[$n]['filesize']) { |
| 48 | 49 | if (file_get_contents($instances[$nn]['pic']->getFilename()) |
@@ -51,9 +51,9 @@ |
||
| 51 | 51 | $picture = $instances[$n]['pic']; |
| 52 | 52 | echo |
| 53 | 53 | 'deleting duplicate picture ' |
| 54 | - . $picture->getPictureId() . ' ("' . $picture->getTitle() . '")' |
|
| 55 | - . ' from log ' . $rDuplicatePic['object_id'] |
|
| 56 | - . ' of cache ' . $instances[$n]['cache_id'] . "\n"; |
|
| 54 | + . $picture->getPictureId().' ("'.$picture->getTitle().'")' |
|
| 55 | + . ' from log '.$rDuplicatePic['object_id'] |
|
| 56 | + . ' of cache '.$instances[$n]['cache_id']."\n"; |
|
| 57 | 57 | $picture->delete(false); |
| 58 | 58 | $instances[$n]['filesize'] = false; |
| 59 | 59 | break; |