The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
User Defined Date & Time Format Display Details »» | |||||||||||||||||||||||||||
User Defined Date & Time Format Display
Developer Last Online: Jan 2020
User Defined Date & Time Format Display
This is a simple add-in that allows your users to select a US / European date and time format. The "vB" way is supposed to be copying the languages and then setting defaults, but I find this as a much easier and cleaner alternative. Date Formats: - US Format - Expanded US Format - European Format - Expanded European Format Time Formats: - 12-Hour Time Format - 24-Hour Time Format Read the text file as you will need to create two additional user fields. The XML file will create the actual plugin, however it will need to be modified to match up with the two "just created" user fields. No further modifications are needed. All date / time displays will then be in whatever format the user chooses via their options. Image attached of UserCP Options. Setting these will globally change any date / time display on the forum (for that user). Changelog v1.0.0 - Initial Release Show Your Support
|
Comments |
#22
|
|||
|
|||
I second the above post. Need a 3.8 version!
|
#23
|
|||
|
|||
This will work on 3.8. Don't upload the XML. Just add the plugin directly using 'Add New Plugin' at the CP.
Product: vbuletin Hook Location: global_start Title: Custom Date & Time Formats Execution Order: 5 - I don't know if this needs to be changed but 5 works fine on mine. Plugin PHP Code: PHP Code:
Hope this helps. |
#24
|
|||
|
|||
Quote:
PHP Code:
|
#25
|
|||
|
|||
Is it possible to add more formats or allow users to put in their own custom format via the modification's options in the Admin CP, such as here?
Edit: This would be used on a forum running vBulletin 4.2.0, as seen by my signature, but KH99 said it should work. |
#26
|
|||
|
|||
I guess I'll answer since the author hasn't been around in a while: You could add additional formats, since with this mod you have to manually create the custom profile fields anyway. You would need to add any additional formats to the custom profile field(s) and to the code in the plugin. (And in any case the plugin would probably need to be edited so that it's using the correct custom field numbers).
To allow a user to enter a custom setting you could create another profile field (or two, for date and time) that are text fields, then have each dropdown have an option for using the custom format. Then the plugin would have to check for the dropdown field being "Custom", and if so use the content of the text field as the format, like: Code:
case 'Custom Date Format': $vbulletin->options['dateformat'] = $vbulletin->userinfo['fieldX']; break; |
#27
|
||||
|
||||
This is a very old MOD, and has never been modified since being posted. Never the less, in vBulletin Version 4.2.0 Patch Level 2 (currently), this 'feature' is lacking and many of our European members have lamented at this lack of what they feel, and I concur with, is an essential user setting.
I followed the instructions and had it setup within just a few minutes. Marked as Installed, voted as Excellent, and nominated for MOTM. |
#28
|
||||
|
||||
Quote:
Code:
if ($vbulletin->userinfo['userid']) { // ############ Date Format as Uservalue ################ switch ($vbulletin->userinfo['field5']) { case 'US Format': $vbulletin->options['dateformat'] = 'm-d-y'; break; case 'Expanded US Format': $vbulletin->options['dateformat'] = 'M jS, Y'; break; case 'European Format': $vbulletin->options['dateformat'] = 'd-m-y'; break; case 'Expanded European Format': $vbulletin->options['dateformat'] = 'jS M Y'; break; // ### Begin MOD by SteveRiley 2012-09-02 ### case 'ISO Format': $vbulletin->options['dateformat'] = 'Y-m-d'; break; case 'Counting Format': $vbulletin->options['dateformat'] = 'o:W:N/z'; break; // ### End MOD by SteveRiley 2012-09-02 ### default: $vbulletin->options['dateformat'] = 'm-d-y'; } // ############ Time Format as Uservalue ################ switch ($vbulletin->userinfo['field6']) { case '12-Hour Time Format': $vbulletin->options['timeformat'] = 'h:i A'; break; case '24-Hour Time Format': $vbulletin->options['timeformat'] = 'H:i'; break; // ### Begin MOD by SteveRiley 2012-09-02 ### case 'Swatch Internet Format': $vbulletin->options['timeformat'] = 'B'; break; case 'Unix Epoch Format': $vbulletin->options['timeformat'] = 'U'; break; // ### End MOD by SteveRiley 2012-09-02 ### default: $vbulletin->options['timeformat'] = 'h:i A'; } } |
#29
|
|||
|
|||
Could someone please explain in simple, step by step instructions how to get this to work in 4.2.0?
|
#30
|
|||
|
|||
I used the original mod instructions and the user comments in this thread to write up complete instructions for vB4: https://vborg.vbsupport.ru/showthread.php?t=303431
Thanks to all who contributed in this thread, hope you don't mind. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|