The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Datestamp type per user
I'm looking for a way for users to alter how the datestamp appears, so instead of having a global setting for threads saying posted "5 minutes ago" it will show the time/date.
There was an old mod that did this, but it has been moved to the archive and the author no longer has the code: https://vborg.vbsupport.ru/showthread.php?t=96505 Is there any other mod that can do this? |
#2
|
|||
|
|||
I don't know if there's an existing mod or not, but you could create a radio button custom profile field with options:
Code:
Forum Default Normal Yesterday / Today Detailed (I copy and pasted the description from the "Datestamp Display Option" vb option.) Then create a plugin using global_setup_complete hook location (other hooks would probably work as well), with this code: Code:
switch ($vbulletin->userinfo['fieldX']) { case 'Normal': $vbulletin->options['yestoday'] = 0; break; case 'Yesterday / Today': $vbulletin->options['yestoday'] = 1; break; case 'Detailed': $vbulletin->options['yestoday'] = 2; break; case 'Forum Default': default: // Don't change value break; } (of course you need to replace the X in the first line with the actual field number you created.) |
#3
|
||||
|
||||
Yep, Kevin's way is the best way to do it. You would just need to check for the proper field number in the settings and you should be good to go.
|
#4
|
|||
|
|||
Thanks for this, that's a huge help and will get me on the right track.
Simple and elegant solution! --------------- Added [DATE]1303739419[/DATE] at [TIME]1303739419[/TIME] --------------- I've almost got this working using your code above - although on 3.8 if I choose one the 'Normal' or 'Yesterday / Today' option it doesn't show the time - only the Today/Yesterday/01-01-2001 part. Is there a way to fix that? --------------- Added [DATE]1303740017[/DATE] at [TIME]1303740017[/TIME] --------------- I've done some more looking around and it looks like it may have something to do with $show['detailedtime'] in the templates? If that isn't set then it won't show the time - would that have something to do with this? --------------- Added [DATE]1303741519[/DATE] at [TIME]1303741519[/TIME] --------------- Changed global_setup_complete to global_start and it seems to work |
#5
|
||||
|
||||
I would try global_init_bootstrap_start as global_start is deprecated, or going to be, anyway, IIRC.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|