The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Help Adding Server Time to Footer
I'm trying to put the server time into the footer, so it would read something like this:
All times are GMT +8. The time now is 08:15 AM. | Server Time: 00:15 AM. I found an article on how to do it for vb3.8 but it doesn't want to work. The article can be found here. Thanks in advance. |
#2
|
|||
|
|||
Try using this for the plugin code:
Code:
$server_time = date('h:i:s A'); vB_Template::preRegister('footer', array('server_time' => $server_time)) and then in the template: HTML Code:
<br />The server time is now {vb:raw server_time}.
|
#3
|
|||
|
|||
Thanks kh99 - I'm at least now getting a result, albeit an incorrect one, or unexpected one.
Code in html is: HTML Code:
<div class="below_body"> <div id="footer_time" class="shade footer_time">{vb:rawphrase all_times_are_gmt_x_time_now_is_y} | Server Time: {vb:raw server_time} </div> All times are GMT +8. The time now is 09:18 AM. | Server Time: 08:18 PM Server time should be 02:18 AM Perhaps the server is running on a different timezone to GMT? Maybe I need to implement the timezone into the code you gave above? |
#4
|
|||
|
|||
Yeah, I'm not sure, I just copied the code from that thread you linked to. Reading the docs for date() it seems like your server is probably not set to GMT. I suppose you could just add 6 hours worth of seconds to it, something like date('h:i:s A', time() + 6 * 3600);
|
#5
|
|||
|
|||
Beautiful! That'll do the trick just nicely. Thanks for your help
|
#7
|
|||
|
|||
Oh even better. Thanks again!
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|