| |||||||||||||||||||||||||||||||||||||
return [self::$_CITY_NAMES[$region][$city]["name"], self::regions(1, $region), self::regions(2, $region), self::$_CITY_NAMES[$region][$city]["parent_id"]??0, 1];
}
$gkey = "$region-$city";
if ($c=Geo_Go::rcs2info([$gkey])) {
$st = self::regions(2, $region);
$rc = Geo::rc($c[$gkey][1]);
$city_name = explode(',',$c[$gkey][0]);
self::$_CITY_NAMES[$region][$city] = ["name"=>$city_name[0], "parent_id"=> $rc[1] ?? null, "region" => $st];
return [$city_name[0], self::regions(1, $region), $st, $rc[1] ?? null, 1 /* USA ONLY */]; // !!
}
// if ($c=M("geo.city")->findOne( array("region" => (int) $region, "city" => (int) $city) )) {
|
| $c=self::_city($region, $city);
| 1 :
1 : apt
| $r[ $e["region"]."-".$e["city"] ] = $e["name"]." ".$r2n[$e["region"]];
return $r;
}
//
static function main_city($region, $city) { # city.id
$c=self::_city($region, $city);
return NVL($c[3]??0, $city);
}
// --------------------------------------------------------------------------------
//** ZIP
static function zip_name($zip) { # str: city state
|
| if ($main_city && $main_city_id=self::main_city($region, $city)){
| 1 :
1 : apt
| }
$r = self::_city($region, $city);
return $r[0]??'';
}
static function city_location($region, $city, $main_city=true) { # loc[lat,long]
if ($main_city && $main_city_id=self::main_city($region, $city)){
$city = $main_city_id;
}
$c=M("geo.city")->findOne( array("region" => (int) $region, "city" => (int) $city) );
if (!$c)
return [];
|
| $geo = Geo::city_location($loc["region"], $t);
| 1 :
1 : apt
| }
}
if (isset($loc["region"])) {
$t = NVL($loc["city"]??0, $loc["city_main"]??0);
if ($t) {
$geo = Geo::city_location($loc["region"], $t);
if($geo){
$loc["geo"] = $geo;
return 1;
}
}
| Geo
|
| 1 : {"street":"5001 Sher***,"zip":"00061","city":"apt","region":""}
| $loc["city"] = '';
$l_key = $loc["region"]."-".$loc["city"];
if (!isset($prefix_info["locations"][$l_key])) {
if($loc["city_state"]??0)
list($loc["city_name"], $loc["state"]) = HB::explode(", ", $loc["city_state"], 2);
Geo::resolveLoc($loc);
$loc["phones_cnt"] = 1;
$prefix_info["locations"][$l_key] = $loc;
} else {
$prefix_info["locations"][$l_key]["phones_cnt"] = ($prefix_info["locations"][$l_key]["phones_cnt"]??0) + 1;
}
|
| return call_user_func_array( [$this, $method], $r);
| 1 : 5634450
| }
} catch(Exception $ex) {
\Log::alert( $ex->getMessage() );
}
try {
return call_user_func_array( [$this, $method], $r);
} catch(RedirectException $ex) {
return $ex->getMessage();
}
}
function page404() {
|
| return $this->_reflection_call($method);
| 1 : prefix7
| if (method_exists($this, $method) )
$mex=1;
}
}
if ($mex)
return $this->_reflection_call($method);
// use template name (same as url)
return $url;
}
/* internal */
// serve method (normal or gzipped)
|
| $r = $A->_call($method, $path);
| 1 : prefix7
1 : 5634450
| Profiler::disable();
CD::set("AJAX", 1);
}
Profiler::in("{$class}::$method", $p);
$A = new $class($p);
$r = $A->_call($method, $path);
Profiler::out();
//respect called action's desire to act as AJAX.
$is_ajax = CD("AJAX");
// AJAX methods - default - no templates
if ($is_ajax) {
|
| $template = self::action($url, $params); // PARAM by REF!
| 1 : 5634450
1 : {"cssTableClass":"ow***45-0999","next_p":5634451,"count_ads":1}
| self::$layout=$layout;
if ($r = strpos($url,"?"))
$url = substr($url, 0, $r);
$url = substr($url,1); // remove leading "/"
restore_msg($params);
$template = self::action($url, $params); // PARAM by REF!
if (isset($_GET['TPL']) ) {
echo "<div style='padding-left: 3px; background: #eee'>";
vvv($params);
echo "</div>";
}
|
| Controller::dispatch($_SERVER["REDIRECT_URL"], $_GET + $_POST, "_layout");
| 1 : 5634450
1 : {"cssTableClass":"ow***45-0999","next_p":5634451,"count_ads":1} 1 : _layout
| <?
Controller::dispatch($_SERVER["REDIRECT_URL"], $_GET + $_POST, "_layout");
exit; |
ErrorException: Trying to access array offset on value of type int in lib.framework/Geo/Geo.php:1648 #0 lib.framework/Geo/Geo.php:1511 Geo::_city('', '...') #1 lib.framework/Geo/Geo.php:1447 Geo::main_city('', '...') #2 lib.framework/Geo/Geo.php:1799 Geo::city_location('', '...') #3 vhosts/phone/lib/Action/Phone/Root.php:353 Geo::resolveLoc(Array) #4 lib.framework/Action/Action.php:236 Action_Phone_Root->prefix7('...') #8 vhosts/phone/phoneowner.us/www/index.php:2 Controller::dispatch('...', Array, '...')