', $wbits);
for ($iw=0; $iw<(-1 + sizeof($w30bits)); $iw+=1) { // used to be +=2
if (strpos($w30bits[$iw], " title=") !== false) {
$onebits=explode('', $w30bits[$iw]);
$suffixg="";
$suffixd="";
if (sizeof($onebits) > 1) {
//$preonebits=explode('"UTC', $w30bits[1 + $iw]);
$preonebits=explode('>', $w30bits[1 + $iw]);
if (strpos($onebits[-1 + sizeof($onebits)], ":3") !== false) $suffixg=".5";
if (strpos($preonebits[-1 + sizeof($preonebits)], ":3") !== false) $suffixd=".5";
$xdst=str_replace("−0", "-", str_replace("+", "", str_replace("+0", "", str_replace("-0", "-", str_replace(":0", "", str_replace(":3", "", $preonebits[-1 + sizeof($preonebits)])))))) . $suffixd;
$preonebits=explode('>', $onebits[-1 + sizeof($onebits)]);
$xgmt=str_replace("−0", "-", str_replace("+", "", str_replace("+0", "", str_replace("-0", "-", str_replace(":0", "", str_replace(":3", "", $preonebits[-1 + sizeof($preonebits)])))))) . $suffixg;
if (strpos($w30bits[1 + $iw], " title=") !== false) $xdst=$xgmt;
$preonebits=explode('>', $onebits[-2 + sizeof($onebits)]);
$vs=$preonebits[-1 + sizeof($preonebits)];
}
$onebits=explode('', $w30bits[$iw]);
if (sizeof($onebits) > 3) {
$preonebits=explode('>', $onebits[-4 + sizeof($onebits)]);
$latlong=$preonebits[-1 + sizeof($preonebits)];
if (strpos($vs, "°") === false) $overallextra .= "\n" . ' "TimeZoneId ' . $latlong . display_latlong($latlong, $vs) . '" : "' . str_replace("@%@/@%@", "-", $vs) . '", "DST" : "' . $xdst . '", "GMT" : "' . $xgmt . '" ';
}
}
}
file_put_contents("wbits.html", $overallextra);
$wcont=@file_get_contents("wbits.html");
}
return $wcont;
}
function display_latlong($inll, $vis) {
$outll=str_replace("~", "", str_replace("~ ", "", str_replace("+", " ", str_replace("-", " -", "~" . $inll))));
$obits=explode(" ", $outll);
if (sizeof($obits) != 2) return "";
$factor=1.0;
if (strpos($obits[0], "-") !== false) $factor=-1.0;
$latl=strlen(str_replace("-", "", $obits[0]));
$latis=0.0;
if ($latl >= 5) {
$latis+=substr($obits[0], strlen($obits[0]) - 2, 2) / 3600.0;
$latis+=substr($obits[0], strlen($obits[0]) - 4, 2) / 60.0;
$latis+=str_replace("-", "", substr($obits[0], 0, strlen($obits[0]) - 4));
$latis*=$factor;
} else if ($latl >= 3) {
$latis+=substr($obits[0], strlen($obits[0]) - 2, 2) / 60.0;
$latis+=str_replace("-", "", substr($obits[0], 0, strlen($obits[0]) - 2));
$latis*=$factor;
} else {
$latis+=str_replace("-", "", substr($obits[0], 0, strlen($obits[0]) - 0));
$latis*=$factor;
}
$factor=1.0;
if (strpos($obits[1], "-") !== false) $factor=-1.0;
$longl=strlen(str_replace("-", "", $obits[1]));
$longis=0.0;
if ($longl >= 6) {
$longis+=substr($obits[1], strlen($obits[1]) - 2, 2) / 3600.0;
$longis+=substr($obits[1], strlen($obits[1]) - 4, 2) / 60.0;
$longis+=str_replace("-", "", substr($obits[1], 0, strlen($obits[1]) - 4));
$longis*=$factor;
} else if ($longl >= 4) {
$longis+=substr($obits[1], strlen($obits) - 2, 2) / 60.0;
$longis+=str_replace("-", "", substr($obits[1], 0, strlen($obits[1]) - 2));
$longis*=$factor;
} else {
$longis+=str_replace("-", "", substr($obits[1], 0, strlen($obits[1]) - 0));
$longis*=$factor;
}
return " ,[" . str_replace("3333333", "33", str_replace("6666667", "66", $latis)) . "," . str_replace("3333333", "33", str_replace("6666667", "66", $longis)) . ",~" . $vis . "~]";
}
$firstgood="";
$retstuff="";
$zonematch="";
$tzi="";
$place="";
$region="";
if (isset($_GET['place'])) $place=$_GET['place'];
if (isset($_POST['place'])) $place=$_POST['place'];
if (isset($_GET['region'])) $region=$_GET['region'];
if (isset($_POST['region'])) $region=$_POST['region'];
if (isset($_GET['url'])) {
$prebits=explode("&", urldecode($_GET['url']));
$bits=explode("/", $prebits[0]);
$zonematch=str_replace("−", "-", $bits[-1 + sizeof($bits)]);
if (file_exists("wbits.html")) {
$acontobodyinnerHTML=@file_get_contents("wbits.html");
} else if (11 == 11) {
$acontobodyinnerHTML=dowbits();
} else {
$acontobodyinnerHTML=@file_get_contents(urldecode($_GET['url']));
}
$datacnt=1;
$pretablebit="
";
$mapbit=""; //Optional Google Map May Go Below | ";
$tablestuff="Time Zone ID | Daylight Saving Time (Now) | Greenwich Mean Time(zone) | " . $mapbit . "
---|
";
$disp=true;
$stuff=explode(" : ", $acontobodyinnerHTML);
if (sizeof($stuff) > 1) {
for ($i=1; $i", "" . $tzi . " | " . $dst . " (" . $dr . ") | " . $gmt . " | " . $formbit . "
", $tablestuff);
$tablestuff=str_replace("", "" . $tzi . " | " . $dst . " (" . $dr . ") | " . $gmt . " |
" . $formbit . $posttablebit, $tablestuff);
$tablestuff=str_replace("", "" . $tzi . " | " . $dst . " (" . $dr . ") | " . $gmt . " |
" . $formbit . $posttablebit, $tablestuff);
$tablestuff=str_replace(" var rt="' . str_replace("+", " ", urlencode(str_replace(" rowspan=1 ", " rowspan=" . $datacnt . " ", $tablestuff))) . '";