Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
Time Zone Times Details »»
Time Zone Times
Version: 1.00, by Vowgaming Vowgaming is offline
Developer Last Online: Jun 2012 Show Printable Version Email this Page

Category: BB Code Enhancements - Version: 4.0.x Rating:
Released: 01-21-2011 Last Update: Never Installs: 9
Re-useable Code Translations  
No support by the author.

I have seen this requested a few times and required this for my own site so I thought it would be nice to share my solution.

This bbcode will take a date and time submitted in gmt time and display it in the time of the readers time zone

I have tried this on my site with just a 4 users and seems to work fine im using 4.1 but see no reason why this should not work on earlier versions

I would also like to state, I do not know javascript and im sure others could improve this code and please do so, but in it's current form it does what it needs

Go to you admincp, custom bb code, add new bbcode

Title: timezone

BB Code Tag Name : timezone

Replacement:
Code:
<script type="text/javascript">
text1a = "{param}";
var myarray = text1a.split(','); 
var d = new Date();
d.setUTCDate(myarray[0]);
d.setUTCMonth(myarray[1]-1);
d.setUTCHours(myarray[3]);
d.setUTCMinutes(myarray[4]);
d.setUTCSeconds(0);
document.write(d + "<br />");
</script>
Example : [timezone]10,3,2011,02,30[/timezone]

Description : Inset gmt time to show time in users local area format must be [timezone]day,month,year,hr,minutes[/timezone] must be put in as gmt time and each item seperated by a ,

Use {option} : no

Button Image : here I used a link to a picture of a clock

Remove Tag If Empty: Yes

Disable BB Code Within This BB Code: Yes

Disable Smilies Within This BB Code: Yes

Disable Word Wrapping Within This BB Code: Yes

Disable Automatic Link Parsing Within This BB Code: Yes

That it now save

Usage is [timezone]day,month,year,hr,min[/timezone]
This info must be entered as gmt data

Now if anyone can improve or give and advice feel free.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 01-24-2011, 10:13 AM
Dr.osamA's Avatar
Dr.osamA Dr.osamA is offline
 
Join Date: Aug 2004
Location: Syrie
Posts: 979
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

5 stars

installed

thank you bro
Reply With Quote
  #3  
Old 02-06-2011, 08:03 PM
NovoCiv NovoCiv is offline
 
Join Date: Aug 2010
Posts: 80
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I recently made something similar to this, but it was as simple as [gmt]12:45[/gmt].

The issue I ran into was that when a user makes or edits a post with this it goes to a blank page because of the document.write. I don't see anything that you've done to prevent this, so I assume it happens to you as well?
Reply With Quote
  #4  
Old 02-08-2011, 09:08 PM
Vowgaming Vowgaming is offline
 
Join Date: Jan 2011
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I was not aware of this issue. but now I go back and check and edit a post I see the issue mentioned it does not show up on the inital posting only on editing the post.

This is such a required thing for the site and can put up with this small issue

You can still edit your post and change the time and date but once you submit your changes it takes you to a white page because of the document.write

As I Mentioned in the inital post I'm no profesional so anyone has a better way any help would be great
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:26 AM.


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.04662 seconds
  • Memory Usage 2,236KB
  • Queries Executed 18 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (3)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete