Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
User-defined Date and Time display options Details »
User-defined Date and Time display options
Mod Version: 1.00, by fwulfers (Coder) fwulfers is offline
Developer Last Online: Jan 2019 I like it Show Printable Version Email this Page

vB Version: 4.2.1 Rating: (4 votes - 5.00 average) Installs: 16
Released: 15 Oct 2013 Last Update: 15 Oct 2013 Downloads: 37
Not Supported Uses Plugins Additional Files Re-usable Code Translations  

This modification allows a user to select their own date and time format. vBulletin 4 only has the option to specify one format for one language or different formats for different languages. This allows the user to select the format regardless of the language.

Date Formats
International Format yyyy-mm-dd (example: 1998-04-25)
Expanded International Format (example: Mon 25 April 1998)
US Format mm/dd/yy (example: 04/25/98)
Expanded US Format (example: Mon Apr 25th, 1998)
European Format dd/mm/yy (example: 25/04/98)
Expanded European Format (example: Mon 25th Apr 1998)

Time Formats
24-Hour Time Format (example: 23:15)
12-Hour Time Format (example: 11:15 PM)

This 4.x modification is based on an old 3.x modification (http://www.vbulletin.org/forum/showthread.php?t=97469) and modified with a few new date options and tested on vB4. I didn't invent this mod and just used the original mod and user comments in that thread to make it easy for use on vBulletin 4.

This was tested on 4.2.1 but it should work for any 4.x version.

Installation:

Create 2 new user fields

AdminCP -> User Profile Fields -> Add New User Profile Field

Date field

Profile Field Type -> Single-Selection Menu
Title: Date Format
Description:
Format in which the date is presented on vBulletin pages.<br><br>International Format yyyy-mm-dd (example: 1998-04-25)<br>Expanded International Format (example: Mon 25 April 1998)<br>US Format mm/dd/yy (example: 04/25/98)<br>Expanded US Format (example: Mon Apr 25th, 1998)<br>European Format dd/mm/yy (example: 25/04/98)<br>Expanded European Format (example: Mon 25th Apr 1998)
Options
International Format
Expanded International Format
US Format
Expanded US Format
European Format
Expanded European Format
Set Default: Yes, but No First Blank Option
Which page displays this option: Options: Date / Time

Time field

Profile Field Type -> Single-Selection Menu
Title: Time Format
Description:
Format in which the time is presented on all vBulletin pages.<br><br>12-Hour Time Format (example: 11:15 PM)<br>24-Hour Time Format (example: 23:15)
Options
24-Hour Time Format
12-Hour Time Format
Set Default: Yes, but No First Blank Option
Which page displays this option: Options: Date / Time

Important: note the field names of the fields you just created. These can be different for your forum, depending on the other mods and plugins on your forum.

Any field option not mentioned above, use what you prefer.

Create new Plugin

You can either import the xml file or create the plugin manually.

Important: in the PHP code below or the imported xml plugin, you have to change the field names (switch ($vbulletin->userinfo['field#']) and replace field# with the names of the fields you created in the first step. For example: switch ($vbulletin->userinfo['field5']. To find the field names/numbers on your forum, go to AdminCP -> User Profile Field Manager and find the fields you created. The field names are in the Name column.

You can easily adjust the new fields and PHP code to remove or add any formats. The new Date and Time settings will show up under the General Settings for all users. Find more information about the possible date and time formats here: http://us1.php.net/manual/en/function.date.php

Import XML file

AdminCP -> Plugins & Products -> Download/Upload Plugins
Scroll down to the bottom, Choose the xml file and click Import

Create yourself

AdminCP -> Plugins & Products -> Add New Plugin

Product: vBulletin
Hook Location: global_start
Title: Custom Date and Time Formats
Execution Order: 5 (note: this is the default, seems to work fine)
Plugin PHP Code:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Download Now

Only licensed members can download files, Click Here for more information.

Screenshots

Click image for larger version

Name:	screen1.jpg
Views:	105
Size:	108.1 KB
ID:	146837   Click image for larger version

Name:	screen2.jpg
Views:	114
Size:	63.9 KB
ID:	146838   Click image for larger version

Name:	screen3.jpg
Views:	96
Size:	147.1 KB
ID:	146839   Click image for larger version

Name:	screen5.jpg
Views:	129
Size:	129.0 KB
ID:	146840  

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
User Defined Date & Time Format Display eoc_Jason vBulletin 3.5 Add-ons 28 15 Oct 2013 16:25

Comments
  #2  
Old 25 Apr 2014, 10:39
AthenaOfDelphi AthenaOfDelphi is offline
 
Join Date: Mar 2014
Great little fix and nice clear instructions. Thanks

If any one else wants to allow users to use the board defaults if they haven't picked a format or to explicitly use them, then you can make the following change to the two case statements:-


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I put the 'Forum Defaults' option at the top of the list of options in the two custom profile fields.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

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


New To Site? Need Help?

All times are GMT. The time now is 06:40.

Layout Options | Width: Wide Color: