vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Miscellaneous Hacks - World Time Zones (https://vborg.vbsupport.ru/showthread.php?t=94505)

Boofo 08-16-2005 10:00 PM

World Time Zones
 
World Time Zones
(By Boofo)
==========

Description
--------------
This product will add a separate page with a listing of different world time zones.

Details
---------
1 Product XML
1 PHP file
3 Images


Installation
--------------
1. Upload worldtimes.php to your forums directory
2. Upload the 3 image files to your images/misc directory
3. Go to your AdminCP
Scroll down to 'Plugin System'
Click 'Manage Products'
Click 'Add/Import Product'
Click the 'Browse' button, and locate the product-worldtimes.xml file on your computer.

--------------
Done!
Enjoy!

plateau 08-17-2005 07:05 PM

哦,很不错!!!

oh, it is very nice!!! will install it!!!

Boofo 08-17-2005 07:06 PM

Don't forget the install button in case there are any updates. ;)

Marco van Herwaarden 08-17-2005 08:30 PM

So you must make a different file for each member living in another timezone? Or am i missing something?

Boofo 08-17-2005 09:16 PM

Quote:

Originally Posted by MarcoH64
So you must make a different file for each member living in another timezone? Or am i missing something?

No, it lists all the time zones and will highlight yours when you view it.

Marco van Herwaarden 08-17-2005 09:20 PM

Then why you have to set your timezone in the file?

Boofo 08-17-2005 09:30 PM

Quote:

Originally Posted by MarcoH64
Then why you have to set your timezone in the file?

Well, that is the only way, believe it or not, I could get it to show the times right. You are more than welcome to see if it can be done a better way. ;)

Boofo 08-17-2005 11:51 PM

This has been moved into beta as there is a problem with certain timezones. I will get a fix for it as soon as humanly possible. Sorry for releasing it before it was thoroughly tested.

Diana Notacat 08-18-2005 04:36 PM

This is a fantastic idea, and I might find it useful in the future. XD For some reason I'm always shaking my fist at people about timezones, and this might help them out! Great hack!

Boofo 08-18-2005 04:53 PM

New version uploaded. There is no need to change the setting in worldtimes.php now. It should work correctly no matter what setting the timezone setting is set at in the vBulletin Options.

Guests are no longer allowed to view the World Times. That saves from other sites linking to your World Times and using it without installing it. ;)

Dan 08-18-2005 06:46 PM

Nice job Bob :D I really like it

Boofo 08-18-2005 07:17 PM

Quote:

Originally Posted by Dan
Nice job Bob :D I really like it

Thank you, sir. ;)

Marco van Herwaarden 08-18-2005 08:05 PM

Bob i got another idea for you. Guess it should be fairly simple to make and i have been walking around with the idea a long time, but just never cam to making it. What about the posters local time in the postbit (the time he made the post, next to the time the post was made).

Boofo 08-18-2005 08:08 PM

Quote:

Originally Posted by MarcoH64
Bob i got another idea for you. Guess it should be fairly simple to make and i have been walking around with the idea a long time, but just never cam to making it. What about the posters local time in the postbit (the time he made the post, next to the time the post was made).

You lost me. The time he made the post would be the same as the time the post was made. Do you mean their local time where they are at? I did that for vb3. It showed their local time at the time the user was veiwing the post. Am I close here to what you are thinking? ;)

Marco van Herwaarden 08-18-2005 08:17 PM

Getting close yes :D

Maybe both the local time of the poster now, and when he made the post.

Boofo 08-18-2005 08:21 PM

Quote:

Originally Posted by MarcoH64
Getting close yes :D

Maybe both the local time of the poster now, and when he made the post.

Ok, I'll see what I can do. ;)

IceBurn3000 08-19-2005 02:50 AM

My forum is set for GMT+10 (Australian Eastern Standard Time). All is good, except for the fact that all times are 12 hours ahead of the current time.

Any suggestions on how to fix this?

EDIT: Also, I don't this plugin can tell whether Daylight Savings Time (DST) is active in a particular timezone or not. Currently, it is winter in Australia, and DST isnt 'active' in southern states, however, the times for Sydney, Melbourne & Canberra are all 1 hour ahead of Brisbane (AEST) time.

Thanks,

Boofo 08-19-2005 05:19 AM

Quote:

Originally Posted by IceBurn3000
My forum is set for GMT+10 (Australian Eastern Standard Time). All is good, except for the fact that all times are 12 hours ahead of the current time.

Any suggestions on how to fix this?

EDIT: Also, I don't this plugin can tell whether Daylight Savings Time (DST) is active in a particular timezone or not. Currently, it is winter in Australia, and DST isnt 'active' in southern states, however, the times for Sydney, Melbourne & Canberra are all 1 hour ahead of Brisbane (AEST) time.

Thanks,

Do you have a test account set up where I can look at the World Times?

IceBurn3000 08-19-2005 09:16 AM

Quote:

Originally Posted by Boofo
Do you have a test account set up where I can look at the World Times?

I will PM you details.

EDIT:
Quote:

Originally Posted by Boofo in PM
Ok, I see the problem. Your server is not set on GMT time, right? The line in the worldtimes.php is for servers set on GMT time. We need to adjust that line according to what time your server is actually on.

This line:

$servertime = ($timeoffset - ($timediff+2)); //Server is on GMT time

is GMT time. We need to change the 2 to match whatever your server time is set to, not the vb setting, but the actual server time. Does that make any sense? ;)

Try -10 instead of +2 and let me know what you get.

Work like a charm! Thanks for your help Bob!

merk 08-21-2005 06:13 AM

Just a few suggestions:

Your timezone arrangements for 10 and 11 are wrong. Sydney, Melbourne and Canberra are +10, not +11. They go to +11 for DST, but that should not affect their normal +10 offset.

I believe that they should always remain in the +10, but also highlight them to indicate they are in DST.

--

There should be a PHP method to determin if a certain timezone is in DST. I would use that instead of using a user's DST determination.

--

There is a better (less templates) way to show the local users timezone.

PHP Code:

if ($timediff == $vbulletin->userinfo['timezoneoffset'])
{
//blah
}
else
{
//blah


Can Become:

PHP Code:

 
$show
['localtimezone'] = false;
if (
$timediff == $vbulletin->userinfo['timezoneoffset'])
{
$show['localtimezone'] = true;


And using conditionals in the single template instead.

--

There are also functions available in the vbulletin options array for server time.

PHP Code:

$vbulletin->options['timeoffset'is server offset 

--

Finally, you should use UTC, not GMT, because GMT changes forward 1 hour for dst. UTC doesnt :)

mtha 09-02-2005 06:33 AM

nice,

you may want to add GMT+x index to the left of each timezone too.

says

GMT + 0 | [Western Europe Time] London, Lisbon, Dublin, Reykjavik, Casablanca

it'd be easier to track down time
just an idea, how about adding the timezone list into database, and let admin be able to edit the list (add/remove city name ...),

Cyricx 09-23-2005 04:22 PM

This is awesome Boofo :)

[high]* Cyricx clicks install!
[/high]

Definately like the two suggestions above as well :)

Mike Gaidin 09-23-2005 07:59 PM

Nice one Bob. :up:

[high]* Mike Gaidin clicks install.[/high]

SlipNslide281 09-23-2005 09:46 PM

This is awesome, do you think you will be making for for RC3??

Gizmo5h1t3 09-23-2005 09:47 PM

works fine on RC3 mate....

theArchitect 09-26-2005 03:17 AM

It works with the exception that the times are out by 12 hours.

My Local setting is for Eastern Australia and according to the forum clock it is 2:16 pm but on the world times page it is 2:16 am.

Any thoughts?

Boofo 09-26-2005 04:17 AM

Quote:

Originally Posted by theArchitect
It works with the exception that the times are out by 12 hours.

My Local setting is for Eastern Australia and according to the forum clock it is 2:16 pm but on the world times page it is 2:16 am.

Any thoughts?

Did you set your server time correctly in the worldtimes file?

theArchitect 09-26-2005 04:28 AM

Quote:

Originally Posted by Boofo
Did you set your server time correctly in the worldtimes file?

My appologies, I seem to have missed that step in the instructions.

Though, I don't seem to see a "how to" set the time in the instructions.

Boofo 09-26-2005 04:51 AM

In this line:

PHP Code:

 $servertime = ($vbulletin->options['timeoffset'] - ($timediff+2)); //Server is on GMT time 

change the:

PHP Code:

 +

to reflect your own server time. It is set at GMT by default. So, if you are 14 hours ahead of GMT, then it would have to be changed to +16. ;)

theArchitect 09-26-2005 05:18 AM

Quote:

Originally Posted by Boofo
In this line:

PHP Code:

 $servertime = ($vbulletin->options['timeoffset'] - ($timediff+2)); //Server is on GMT time 

change the:

PHP Code:

 +

to reflect your own server time. It is set at GMT by default. So, if you are 14 hours ahead of GMT, then it would have to be changed to +16. ;)

Many thanks kind Sir.

Boofo 09-26-2005 05:39 AM

Is it working all right for you now, then? ;)

poolking 09-26-2005 05:59 AM

/me installed

theArchitect 09-26-2005 06:08 AM

Quote:

Originally Posted by Boofo
Is it working all right for you now, then?

Certainly is :up:

Boofo 09-26-2005 07:30 AM

Quote:

Originally Posted by poolking
[high]* poolking installed[/high]

I wondered when you were going to fiund this thread. ;)

I'm about ready to release another one in a few mninutes I'm sure you will be interested in, sir. ;)

@theArchitect - Great! Enjoy!

jblackburn 09-26-2005 02:22 PM

Sorry for the stupid question, but... is this supposed to add a menu item to the vb menu or does one just need to go in and create a link to it? What's the best method to do this? The only way I see this now is by going directly to the URL /worldtimes.php.

Thx in advance,
Jim

Boofo 09-26-2005 02:27 PM

Quote:

Originally Posted by jblackburn
Sorry for the stupid question, but... is this supposed to add a menu item to the vb menu or does one just need to go in and create a link to it? What's the best method to do this? The only way I see this now is by going directly to the URL /worldtimes.php.

Thx in advance,
Jim

That's exactly what you need to do. ;)

theArchitect 09-26-2005 09:53 PM

Quote:

Originally Posted by jblackburn
Sorry for the stupid question, but... is this supposed to add a menu item to the vb menu or does one just need to go in and create a link to it? What's the best method to do this? The only way I see this now is by going directly to the URL /worldtimes.php.

Thx in advance,
Jim

As Boofo said, you will need to add a link yourself.

If you are not sure how to do this you will need to edit your navbar template, which is done via your style manager.

I added my link to the Quick Links menu. If you want to do the same search for

Code:

<if condition="$show['wollink']"><tr><td class="vbmenu_option"><a href="online.php$session[sessionurl_q]">$vbphrase[whos_online]</a></td></tr></if>
in the navbar template and then add after

Code:

<tr><td class="vbmenu_option"><a href="worldtimes.php">World Times</a></td></tr>
You could also choose to make world time a phrase but that would add another stage to the process.

Boofo 09-26-2005 10:24 PM

Quote:

Originally Posted by theArchitect
As Boofo said, you will need to add a link yourself.

If you are not sure how to do this you will need to edit your navbar template, which is done via your style manager.

I added my link to the Quick Links menu. If you want to do the same search for

Code:

<if condition="$show['wollink']"><tr><td class="vbmenu_option"><a href="online.php$session[sessionurl_q]">$vbphrase[whos_online]</a></td></tr></if>
in the navbar template and then add after

Code:

<tr><td class="vbmenu_option"><a href="worldtimes.php">World Times</a></td></tr>
You could also choose to make world time a phrase but that would add another stage to the process.

I will link this in the first post when I get back. ;)

theArchitect 09-26-2005 10:28 PM

Quote:

Originally Posted by Boofo
I will link this in the first post when I get back. ;)

Thanks. Glad to be of service.

jblackburn 09-27-2005 01:17 PM

Thanks all for the menu tips.

As for time, so things don't make sense, allthough I've edited the worldtimes.php file to get it to work:

San Diego is currently at UTC/GMT -7 hours; I had to set the $servertime to timediff+9 to get it to display proper PDT. By the instructions, it would have seemed that you'd take the line +2, add your time zone offset (-7) and get the setting -5.

Several of the world city times were also off; I'm assuming this might be because of the UTC/GMT/daylight saving time differences? Here's what I came up with (I've removed some I didn't want). Notice how for PDT below it had to be set to -8 where above it had to be set to +9.

$timezones['-11'] = "[Hawaii] Honolulu, Chatham Island, Papeete, Tahiti, Cook Islands";
$timezones['-8'] = "[PDT (Pacific Daylight Time)] Los Angeles, San Diego, Seattle, San Fransisco";
$timezones['-7'] = "[MDT (Mountain Daylight Time)] Denver, Phoenix, Salt Lake City";
$timezones['-6'] = "[CDT (Central Daylight Time)] Des Moines, Chicago, St. Paul, New Orleans, Houston";
$timezones['-5'] = "[EDT (Eastern Daylight Time)] Detroit, New York, Miami, Boston, Atlanta";
$timezones['0'] = "[WET (Western Europe Time)] London, Lisbon, Dublin";
$timezones['1'] = "[CET (Central Europe Time)] Brussels, Rome, Paris, Amsterdam, Zürich, Madrid, Berlin, Stockholm";
$timezones['2'] = "[EET (Eastern Europe Time)] Athens, Johannesburg, Cape Town, South Africa, Cairo, Jerusalem";
$timezones['2'] = "Riyadh, Baghdad, Khartoum, Kuwait City";
$timezones['3'] = "Dubai, Abu Dhabi, Tbilisi, Muscat, Baku";
$timezones['4.5'] = "Bombay, Calcutta, Madras, New Delhi";
$timezones['7'] = "Perth, Singapore, Beijing, Manila, Hong Kong, Taipei, Kuala Lumpur";
$timezones['9'] = "Tokyo, Seoul, Osaka, Saporro, Yakutsk";
$timezones['9'] = "[EAST (East Australian Standard)] Brisbane, Guam";
$timezones['9'] = "Sydney, Melbourne, Canberra, Magadan";
$timezones['11'] = "Auckland, Wellington, Fiji, Kamchatka";

Jim


All times are GMT. The time now is 04:45 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.01605 seconds
  • Memory Usage 1,846KB
  • 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
  • (7)bbcode_php_printable
  • (17)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete