Viewing file: tzset.phtml (2.16 KB) -rw-rw-r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?
require('ax2.inc');
function continent_form() { global $back;
echo "Setting your timezone involves two simple steps:\n"; echo "<FORM>\n"; echo "First, select your continent:\n"; echo "<SELECT name=continent>\n"; echo "<OPTION value=Africa>Africa\n"; echo "<OPTION value=America>Americas\n"; echo "<OPTION value=Asia>Asia\n"; echo "<OPTION value=Atlantic>Atlantic Ocean\n"; echo "<OPTION value=Australia>Australia\n"; echo "<OPTION value=Europe>Europe\n"; echo "<OPTION value=Indian>Indian Ocean\n"; echo "<OPTION value=Pacific>Pacific Ocean\n"; echo "<OPTION value=SystemV>SystemV\n"; echo "<OPTION value=Etc>Etc\n"; echo "</SELECT>\n"; echo "<INPUT type=hidden name=back value=\"$back\">"; echo "<INPUT type=submit name=action value=Select>\n"; echo "</FORM>\n"; }
function country_form($continent) { global $back;
echo "<FORM>\n"; echo "Second, select your city or region;<br> choose one where your local time is correctly displayed: <SELECT name=country>\n"; $fd=popen('cd /usr/share/zoneinfo/right/'.$continent.'; find -type f | cut -b 3- | while read; do echo `TZ='.$continent.'/$REPLY date +%H:%M` $REPLY; done | sort | while read alma korte; do echo \<OPTION value="$korte"\>$alma $korte; done', "r"); fpassthru($fd); echo "</SELECT>\n"; echo "<INPUT type=hidden name=continent value=\"$continent\">\n"; echo "<INPUT type=hidden name=back value=\"$back\">\n"; echo "<INPUT type=submit action=set value=Select>\n"; echo "</FORM>\n"; }
if ($continent) { if ($country) { setcookie("timezone","$continent/$country",time()+3650*86400); disp_preamble('Time Zone setup','Completed!'); echo "That was it!</p>\n"; echo "Your timezone is now set.</p>"; echo "Your local time is set to: "; passthru("TZ=$continent/$country date '+%Y-%m-%d %T'"); echo "</p>\n"; echo "Please don't forget to <b>Reload</b> the topic list so that you can see the change.</p>"; echo "<p align=center><a href=\"$back\">[Back]</a></p>\n"; disp_tail(); } else { disp_preamble('Time Zone setup','Second step'); country_form($continent); disp_tail(); } } else { disp_preamble('Time Zone setup','First step'); continent_form(); disp_tail(); }; ?>
|