vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Show times on Time Zone selection (https://vborg.vbsupport.ru/showthread.php?t=39029)

Admin 05-24-2002 10:00 PM

Show times on Time Zone selection
 
This is a pretty simple requested by yuma and JohnWarwick right here:
https://vborg.vbsupport.ru/showthrea...threadid=26385

I already coded it like 3 months ago, but never got around to release it. That thread reminded me so here it is. :)

Basically, instead of showing the places, it shows you what the time is in that particular timezone.
Check out posts #3 and #4 if you are confused.

Here's the vbHacker version of the hack, text version will follow, and screen shots in the 3rd and 4th posts.

Have fun. :)

Admin 05-25-2002 07:24 AM

Text file.

Admin 05-25-2002 07:26 AM

Before:

Admin 05-25-2002 07:26 AM

After:

Floris 05-25-2002 08:23 AM

Hey, that is very nice! I like this more then the default one :) I hope I have some time to install it soon. Thank you for (eventually) releasing this.

Brad 05-25-2002 08:37 AM

/me clicks install button :bunny:

BigJohnson 05-25-2002 12:53 PM

thanx nice hack its very useful

MrLister 05-25-2002 01:28 PM

thanks, this is quite helpful

N!ck 05-25-2002 05:41 PM

/me is lovin' it

Boofo 05-25-2002 05:52 PM

/me like... Boofo like

inetd 05-25-2002 07:38 PM

I'm used vb 2.2.5. And don't found
Code:

      eval("\$avatarbit = \"".gettemplate("register_avatar")."\";");
    }
  } else {
    $avatarbit = '';
  }

I'm only found:
Code:

        eval("\$avatarbits .= \"".gettemplate("register_avatarbit")."\";");
      }
      eval("\$avatarbit = \"".gettemplate("register_avatar")."\";");
    }
  }

  if ($who=="adult") {
    if ($litereg) {

:(

Unknown553 05-25-2002 09:37 PM

Installed and working perfectly :)

The Realist 06-05-2002 07:01 PM

tried to install this hack but when it comes to the bit in register.php at to replace this:

eval("\$avatarbit = \"".gettemplate("register_avatar")."\";");
}
} else {
$avatarbit = '';
}

with this:

eval("\$avatarbit = \"".gettemplate("register_avatar")."\";");
}
} else {
$avatarbit = '';
}

// ******************************************** \\
// *** Show times in timezone selection box *** \\
$times = array();
for ($i = -12; $i <= 12; $i += 0.5) {
$time = $i * 10;
if ($time < 0) {
$time = 'n' . substr($time, 1);
}
$times["$time"] = date($timeformat, time() + ($i - $timeoffset) * 3600); // 137 edit
}
// *** Show times in timezone selection box *** \\
// ******************************************** \\

I get a parse error? and I have also noticed that in my original register.php file I dont have these lines:

} else {
$avatarbit = '';
}

Any ideas?

cteselle 06-17-2002 10:10 PM

I actually like to see the zone names, so here is what I did:

my modifyoptions:
Code:

<tr>
        <td bgcolor="#F1F1F1"><normalfont><b>Time offset:</b><br>
        <smallfont>$timezone Please select your timezone from the list:</smallfont></normalfont></td>
        <td bgcolor="#F1F1F1"><smallfont><select name="timezoneoffset">
                <option value="-12" $timezonesel[n120]>(GMT -12:00 hours) Eniwetok, Kwajalein ($times[n120])</option>
                <option value="-11" $timezonesel[n110]>(GMT -11:00 hours) Midway Island, Samoa ($times[n110])</option>
                <option value="-10" $timezonesel[n100]>(GMT -10:00 hours) Hawaii ($times[n100])</option>
                <option value="-9" $timezonesel[n90]>(GMT -9:00 hours) Alaska ($times[n90])</option>
                <option value="-8" $timezonesel[n80]>(GMT -8:00 hours) Pacific Time (US & Canada) ($times[n80])</option>
                <option value="-7" $timezonesel[n70]>(GMT -7:00 hours) Mountain Time (US & Canada) ($times[n70])</option>
                <option value="-6" $timezonesel[n60]>(GMT -6:00 hours) Central Time (US & Canada), Mexico City ($times[n60])</option>
                <option value="-5" $timezonesel[n50]>(GMT -5:00 hours) Eastern Time (US & Canada), Bogota ($times[n50])</option>
                <option value="-4" $timezonesel[n40]>(GMT -4:00 hours) Atlantic Time (Canada), Caracas ($times[n40])</option>
                <option value="-3.5" $timezonesel[n35]>(GMT -3:30 hours) Newfoundland ($times[n35])</option>
                <option value="-3" $timezonesel[n30]>(GMT -3:00 hours) Brazil, Buenos Aires, Georgetown ($times[n30])</option>
                <option value="-2" $timezonesel[n20]>(GMT -2:00 hours) Mid-Atlantic ($times[n20])</option>
                <option value="-1" $timezonesel[n10]>(GMT -1:00 hours) Azores, Cape Verde Islands ($times[n10])</option>
                <option value="0" $timezonesel[0]>(GMT) Western Europe Time, London, Lisbon ($times[0])</option>
                <option value="+1" $timezonesel[10]>(GMT +1:00 hours) CET(Central Europe Time), Brussels, Paris ($times[10])</option>
                <option value="+2" $timezonesel[20]>(GMT +2:00 hours) EET(Eastern Europe Time), South Africa ($times[20])</option>
                <option value="+3" $timezonesel[30]>(GMT +3:00 hours) Baghdad, Riyadh, Moscow, St. Petersburg ($times[30])</option>
                <option value="+3.5" $timezonesel[35]>(GMT +3:30 hours) Tehran ($times[35])</option>
                <option value="+4" $timezonesel[40]>(GMT +4:00 hours) Abu Dhabi, Muscat, Baku, Tbilisi ($times[40])</option>
                <option value="+4.5" $timezonesel[45]>(GMT +4:30 hours) Kabul ($times[45])</option>
                <option value="+5" $timezonesel[50]>(GMT +5:00 hours) Ekaterinburg, Islamabad, Karachi, Tashkent ($times[50])</option>
                <option value="+5.5" $timezonesel[55]>(GMT +5:30 hours) Bombay, Calcutta, Madras, New Delhi ($times[55])</option>
                <option value="+6" $timezonesel[60]>(GMT +6:00 hours) Almaty, Dhaka, Colombo ($times[60])</option>
                <option value="+7" $timezonesel[70]>(GMT +7:00 hours) Bangkok, Hanoi, Jakarta ($times[70])</option>
                <option value="+8" $timezonesel[80]>(GMT +8:00 hours) Beijing, Perth, Singapore, Hong Kong ($times[80])</option>
                <option value="+9" $timezonesel[90]>(GMT +9:00 hours) Tokyo, Seoul, Osaka, Sapporo, Yakutsk ($times[90])</option>
                <option value="+9.5" $timezonesel[95]>(GMT +9:30 hours) Adelaide, Darwin ($times[95])</option>
                <option value="+10" $timezonesel[100]>(GMT +10:00 hours) EAST(East Australian Standard), Guam ($times[100])</option>
                <option value="+11" $timezonesel[110]>(GMT +11:00 hours) Magadan, Solomon Islands, New Caledonia ($times[110])</option>
                <option value="+12" $timezonesel[120]>(GMT +12:00 hours) Auckland, Wellington, Fiji, Kamchatka ($times[120])</option>
        </select></smallfont></td>
</tr>

my registeradult and registercoppa:
Code:

<tr>
        <td bgcolor="#F1F1F1"><normalfont><b>Time offset:</b><br>
        <smallfont>$timezone Please select your timezone from the list:</smallfont></normalfont></td>
        <td bgcolor="#F1F1F1"><smallfont><select name="timezoneoffset">
                <option value="-12">(GMT -12:00 hours) Eniwetok, Kwajalein ($times[n120])</option>
                <option value="-11">(GMT -11:00 hours) Midway Island, Samoa ($times[n110])</option>
                <option value="-10">(GMT -10:00 hours) Hawaii ($times[n100])</option>
                <option value="-9">(GMT -9:00 hours) Alaska ($times[n90])</option>
                <option value="-8">(GMT -8:00 hours) Pacific Time (US & Canada) ($times[n80])</option>
                <option value="-7">(GMT -7:00 hours) Mountain Time (US & Canada) ($times[n70])</option>
                <option value="-6">(GMT -6:00 hours) Central Time (US & Canada), Mexico City ($times[n60])</option>
                <option value="-5">(GMT -5:00 hours) Eastern Time (US & Canada), Bogota ($times[n50])</option>
                <option value="-4">(GMT -4:00 hours) Atlantic Time (Canada), Caracas ($times[n40])</option>
                <option value="-3.5">(GMT -3:30 hours) Newfoundland ($times[n35])</option>
                <option value="-3">(GMT -3:00 hours) Brazil, Buenos Aires, Georgetown ($times[n30])</option>
                <option value="-2">(GMT -2:00 hours) Mid-Atlantic ($times[n20])</option>
                <option value="-1">(GMT -1:00 hours) Azores, Cape Verde Islands ($times[n10])</option>
                <option value="0" selected>(GMT) Western Europe Time, London, Lisbon ($times[0])</option>
                <option value="+1">(GMT +1:00 hours) CET(Central Europe Time), Brussels, Paris ($times[10])</option>
                <option value="+2">(GMT +2:00 hours) EET(Eastern Europe Time), South Africa ($times[20])</option>
                <option value="+3">(GMT +3:00 hours) Baghdad, Riyadh, Moscow, St. Petersburg ($times[30])</option>
                <option value="+3.5">(GMT +3:30 hours) Tehran ($times[35])</option>
                <option value="+4">(GMT +4:00 hours) Abu Dhabi, Muscat, Baku, Tbilisi ($times[40])</option>
                <option value="+4.5">(GMT +4:30 hours) Kabul ($times[45])</option>
                <option value="+5">(GMT +5:00 hours) Ekaterinburg, Islamabad, Karachi, Tashkent ($times[50])</option>
                <option value="+5.5">(GMT +5:30 hours) Bombay, Calcutta, Madras, New Delhi ($times[55])</option>
                <option value="+6">(GMT +6:00 hours) Almaty, Dhaka, Colombo ($times[60])</option>
                <option value="+7">(GMT +7:00 hours) Bangkok, Hanoi, Jakarta ($times[70])</option>
                <option value="+8">(GMT +8:00 hours) Beijing, Perth, Singapore, Hong Kong ($times[80])</option>
                <option value="+9">(GMT +9:00 hours) Tokyo, Seoul, Osaka, Sapporo, Yakutsk ($times[90])</option>
                <option value="+9.5">(GMT +9:30 hours) Adelaide, Darwin ($times[95])</option>
                <option value="+10">(GMT +10:00 hours) EAST(East Australian Standard), Guam ($times[100])</option>
  <option value="+11">(GMT +11:00 hours) Magadan, Solomon Islands, New Caledonia ($times[110])</option>
  <option value="+12">(GMT +12:00 hours) Auckland, Wellington, Fiji, Kamchatka ($times[120])</option>
        </select></smallfont></td>
</tr>

Hope this is helpful to others!

Boofo 06-17-2002 11:57 PM

Isn't that the same code for all 3 templates? :)

X-Fan 06-18-2002 06:15 AM

Slightly off-topic, but does anyone know how to include those timezones that have daylight savings?

For example, I'm in Adelaide, Australia and there's the regular +9:30 timezone, but how can we set it to recognize our +10:30 timezone when we're in daylight saving?

And any way to have the system automatically update the various timezones when daylight savings comes into effect and when it ends?

Boofo 06-18-2002 07:08 AM

The server your site is on should handle that, shouldn't it? At least, I think it would. :)

X-Fan 06-18-2002 07:32 AM

I'm using the World Times hack:

http://x-mencomics.com/xfan/forums/worldtimes.php?s=

And I've got $timezones[10.5] = "Adelaide DST"; added to the php file but it doesn't come up right.

VAN 01-26-2003 12:36 AM

I'm having a problem with this one. When a user changes their time zone in ther CP, the select box does not "remember" the change.

The box shows -12:00 hours GMT by default. If I change it to -5:00GMT and go back to look at my options, it is back to showing -12:00 GMT.

Is there a quick fix for this?

poetic 09-14-2003 01:59 PM

umm this doesnt work i cant find the second code edit in members.php can someone please help

weirdpixels 03-21-2004 12:58 PM

*installs, works great


All times are GMT. The time now is 12:18 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01172 seconds
  • Memory Usage 1,795KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (21)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete