$rCoord = sql_fetch_assoc($rsCoords); sql_free_result($rsCoords); if ($rCoord !== false) { $nGMInitLat = $rCoord['gmLat']; $nGMInitLon = $rCoord['gmLon']; $nGMInitZoom = $rCoord['gmZoom']; } else { // europe is the last fallback $nGMInitLat = 52.74959372674114; $nGMInitLon = 10.01953125; $nGMInitZoom = 4; } } $sGMInitWaypoint = isset($_REQUEST['wp']) ? $_REQUEST['wp'] : ''; if ($sGMInitWaypoint != '') { $cache = cache::fromWP($sGMInitWaypoint); if ($cache == null) { $sGMInitWaypoint = ''; } else { if ($cache->allowView()) { $nGMInitLon = $cache->getLongitude(); $nGMInitLat = $cache->getLatitude(); $nGMInitZoom = -1; $bGMInitCookiePos = false; } else { $sGMInitWaypoint = ''; } } } $nUserLon = 0; $nUserLat = 0;
$opt['rootpath'] = '../../'; require_once $opt['rootpath'] . 'lib2/web.inc.php'; require_once $opt['rootpath'] . 'lib2/logic/cache.class.php'; header('Content-type: text/html; charset=utf-8'); $cache = null; if (isset($_REQUEST['cacheid'])) { $cacheid = $_REQUEST['cacheid'] + 0; $cache = new cache($cacheid); } else { if (isset($_REQUEST['uuid'])) { $uuid = $_REQUEST['uuid']; $cache = cache::fromUUID($uuid); } else { if (isset($_REQUEST['wp'])) { $wp = $_REQUEST['wp']; $cache = cache::fromWP($wp); } } } if ($cache === null) { echo '0'; } else { if (!$cache->isPublic()) { echo '0'; } else { echo $cache->getCacheId(); echo ';'; echo '"' . mb_ereg_replace('"', '\\"', $cache->getName()) . '"'; echo ';'; echo '"' . mb_ereg_replace('"', '\\"', $cache->getUsername()) . '"'; echo ';';
function addCacheByWP($wp) { global $translate; $cache = cache::fromWP($wp); if (!is_object($cache)) { return false; } else { return $this->addCache($cache); } }
$tpl->add_body_unload('GUnload()'); // process start params $gm_initcookiepos = true; if (isset($_REQUEST['lat']) && isset($_REQUEST['lon']) && isset($_REQUEST['zoom'])) { $gm_initlat = $_REQUEST['lat']; $gm_initlon = $_REQUEST['lon']; $gm_initzoom = $_REQUEST['zoom']; $gm_initcookiepos = false; } else { $gm_initlat = 51; $gm_initlon = 10; $gm_initzoom = 6; } $gm_initwp = isset($_REQUEST['wp']) ? $_REQUEST['wp'] : ''; if ($gm_initwp != '') { $cache = cache::fromWP($gm_initwp); if ($cache == null) { $gm_initwp = ''; } else { if ($cache->allowView()) { $gm_initlon = $cache->getLongitude(); $gm_initlat = $cache->getLatitude(); $gm_initzoom = 13; $gm_initcookiepos = false; } else { $gm_initwp = ''; } } } $tpl->assign('gm_initlon', $gm_initlon); $tpl->assign('gm_initlat', $gm_initlat);