sizeof($numcommas)) { $addchange=" if (parent.document.getElementById('tz').value == '" . $intz . "') { parent.document.getElementById('tz').value='" . str_replace('"','',str_replace("'","",$tzlist[-1 + sizeof($numcommas)])) . "'; } "; $good=str_replace('"','',str_replace("'","",$tzlist[-1 + sizeof($numcommas)])); $goods=explode("/", $good); if (strpos($tzcont, $atleast[0] . '"' . $words[0] . '",') !== false) { $tzcont=str_replace($atleast[0] . '"' . $words[0] . '",', $atleast[0] . '"#@$",', $tzcont); $onevs=strtoupper("/" . str_replace("_", " ", str_replace("-", " ", $goods[-1 + sizeof($goods)]))); if (sizeof($words) > 1) { $twovs=strtoupper("/" . str_replace("_", " ", str_replace("-", " ", substr($outtz, (1 + strlen($words[0])))))); } if (sizeof($words) <= 1) { $unresolved=false; } else if (sizeof($words) == 2 && strlen($words[1]) == 2) { $tz = new DateTimeZone($good); $cloc = $tz->getLocation(); $ctrycode = $cloc['country_code']; if (strtoupper($ctrycode) == strtoupper($words[1])) { $unresolved=false; } } else if (strpos($onevs, $twovs) !== false) { $unresolved=false; } } else { $unresolved=false; } } } else { $unresolved=false; } } } } } if ($good != "") { return $good; } return $outtz; } if (!isset($argc)) { if (isset($_GET['tz'])) { $fg=str_replace("+"," ",urldecode($_GET['tz'])); if (strpos(trim($fg), "/") === false && $fg != "") { $oneword=explode(" ", trim($fg)); if (sizeof($oneword) == 1) { if ($oneword[0] != strtoupper($oneword[0])) { if (!file_exists($proposed)) { $proposed="../PHP/tz_places.php"; } if (file_exists($proposed)) { $tzcont=@file_get_contents($proposed); if (strpos(strtoupper($tzcont), "/" . strtoupper($oneword[0])) !== false) { $fbit=explode("/" . strtoupper($oneword[0]), strtoupper($tzcont)); $lbit=explode('"', substr($tzcont, 0, strlen($fbit[0])))[-1 + sizeof(explode('"', substr($tzcont, 0, strlen($fbit[0]))))]; if (trim($fg) != $fg) { $fg=$lbit . explode('"', substr($tzcont, strlen($fbit[0])))[0] . " "; } else { $fg=$lbit . explode('"', substr($tzcont, strlen($fbit[0])))[0] . " "; } } } } } else if ($oneword[0] != strtoupper($oneword[0])) { if (!file_exists($proposed)) { $proposed="../PHP/tz_places.php"; } if (file_exists($proposed)) { $tzcont=@file_get_contents($proposed); if (strpos(strtoupper($tzcont), "/" . strtoupper( str_replace(" ", "_", trim($fg)) )) !== false) { $fbit=explode( "/" . strtoupper( str_replace(" ", "_", trim($fg)) ), strtoupper($tzcont)); $lbit=explode('"', substr($tzcont, 0, strlen($fbit[0])))[-1 + sizeof(explode('"', substr($tzcont, 0, strlen($fbit[0]))))]; if (trim($fg) != $fg) { $fg=$lbit . explode('"', substr($tzcont, strlen($fbit[0])))[0] . " "; } else { $fg=$lbit . explode('"', substr($tzcont, strlen($fbit[0])))[0] . " "; } } } } } $fgtz=firstof($fg); } $scr=""; if (isset($_GET['tz'])) { //while (1) { //sleep(1); if ($qm == "#") { echo "

" . passthru("date") . "

" . $scr . ""; } else { echo "

" . passthru("TZ=" . $fgtz . " date") . "

" . $scr . ""; } //} //exit; } else { $typefgtz=""; if (isset($_GET['typetz'])) { $typefgtz=str_replace("+"," ",urldecode($_GET['typetz'])); } if ($typefgtz != "") { echo "" . $scr . "

"; } else { echo "" . $scr . "

"; } } } else { if (file_exists("stop_x1.x1")) { unlink("stop_x1.x1"); } $line = readline("Optionally specify timezone that is not your local one eg. Europe/Berlin or CEST Berlin (append space to concurrently open webpage) (else return): "); if (strpos(trim($line), "/") === false && $line != "") { $oneword=explode(" ", trim($line)); if (sizeof($oneword) == 1) { if ($oneword[0] != strtoupper($oneword[0])) { if (!file_exists($proposed)) { $proposed="../PHP/tz_places.php"; } if (file_exists($proposed)) { $tzcont=@file_get_contents($proposed); if (strpos(strtoupper($tzcont), "/" . strtoupper($oneword[0])) !== false) { $fbit=explode("/" . strtoupper($oneword[0]), strtoupper($tzcont)); $lbit=explode('"', substr($tzcont, 0, strlen($fbit[0])))[-1 + sizeof(explode('"', substr($tzcont, 0, strlen($fbit[0]))))]; if (trim($line) != $line) { $line=$lbit . explode('"', substr($tzcont, strlen($fbit[0])))[0] . " "; } else { $line=$lbit . explode('"', substr($tzcont, strlen($fbit[0])))[0] . " "; } } } } } else if ($oneword[0] != strtoupper($oneword[0])) { if (!file_exists($proposed)) { $proposed="../PHP/tz_places.php"; } if (file_exists($proposed)) { $tzcont=@file_get_contents($proposed); if (strpos(strtoupper($tzcont), "/" . strtoupper( str_replace(" ", "_", trim($line)) )) !== false) { $fbit=explode( "/" . strtoupper( str_replace(" ", "_", trim($line)) ), strtoupper($tzcont)); $lbit=explode('"', substr($tzcont, 0, strlen($fbit[0])))[-1 + sizeof(explode('"', substr($tzcont, 0, strlen($fbit[0]))))]; if (trim($line) != $line) { $line=$lbit . explode('"', substr($tzcont, strlen($fbit[0])))[0] . " "; } else { $line=$lbit . explode('"', substr($tzcont, strlen($fbit[0])))[0] . " "; } } } } } if (strpos(trim($line), "/") !== false) { file_put_contents("stop_x1.x1", ""); sleep(2); if (trim($line) != $line) { if (strpos($line, "/") !== false) { exec("TZ=" . $line . " ./x1 " . $line . " ."); } else { exec("./x1 " . $line . " ."); } } } else { file_put_contents("stopx1.x1", "TZ=" . $line . " ./x1 " . $line); exec("./x1 " . $line . " ."); exit(1); } } ?>