Castel
11-11-2001, 02:28 AM
This code is slightly modified code from Mas*Mind's world times on index hack. Because I like it to be a standalone page and not make my index page longer then it already is.
<?php
error_reporting(7);
$templatesused='worldtimes_cols,worldtimes_rows';
require('./global.php');
$dateformat = "l,F jS";
$hourformat = "H:i";
$perrow = 1;
$timezones[-8] = "Los Angeles, Seattle";
$timezones[-7] = "Denver,Edmonton";
$timezones[-6] = "Chicago,Mexico City";
$timezones[-5] = "New York,Miami";
$timezones[-10] = "Honolulu";
$timezones[-9] = "Anchorage,Juneau";
$i=0;
while(list($timediff, $cities)=each($timezones)) {
$i++;
$servertime = $timeoffset - $timediff;
$timestamp = mktime (date("H")-$servertime, date("i"), date("s"), date("m"), date("d"), date("Y"));
$datetime = date($dateformat, $timestamp);
$hourtime = date($hourformat, $timestamp);
eval("\$citycol .= \"".gettemplate('worldtimes_cols')."\";");
if($i % $perrow == 0) {
eval("\$cityzones .= \"".gettemplate('worldtimes_rows')."\";");
unset($citycol);
}
}
eval("dooutput(\"".gettemplate('worldtimes')."\");");
?>
This results into this page: World Times (http://www.tekkenzaibatsu.com/forums/worldtimes.php)
I want to display an icon in the first colunm indicating if this is the user's timezone or not. Basicly matching $hourtime to the user's timesetting, but I can't figure out how so far.
<?php
error_reporting(7);
$templatesused='worldtimes_cols,worldtimes_rows';
require('./global.php');
$dateformat = "l,F jS";
$hourformat = "H:i";
$perrow = 1;
$timezones[-8] = "Los Angeles, Seattle";
$timezones[-7] = "Denver,Edmonton";
$timezones[-6] = "Chicago,Mexico City";
$timezones[-5] = "New York,Miami";
$timezones[-10] = "Honolulu";
$timezones[-9] = "Anchorage,Juneau";
$i=0;
while(list($timediff, $cities)=each($timezones)) {
$i++;
$servertime = $timeoffset - $timediff;
$timestamp = mktime (date("H")-$servertime, date("i"), date("s"), date("m"), date("d"), date("Y"));
$datetime = date($dateformat, $timestamp);
$hourtime = date($hourformat, $timestamp);
eval("\$citycol .= \"".gettemplate('worldtimes_cols')."\";");
if($i % $perrow == 0) {
eval("\$cityzones .= \"".gettemplate('worldtimes_rows')."\";");
unset($citycol);
}
}
eval("dooutput(\"".gettemplate('worldtimes')."\");");
?>
This results into this page: World Times (http://www.tekkenzaibatsu.com/forums/worldtimes.php)
I want to display an icon in the first colunm indicating if this is the user's timezone or not. Basicly matching $hourtime to the user's timesetting, but I can't figure out how so far.