The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Timezone code not working in member.php
Can someone please tell me why the following code no longer works in the member.php? This code still works fine in the postbit but not in the member.php. Any help would be very welcomed and appreciated.
Code:
$userinfo['tzoffset'] = $userinfo['timezoneoffset']; if ($userinfo['dstonoff']) { // DST is on, add an hour $userinfo['tzoffset']++; } $gmdate_bugfix = (date('Z', TIMENOW) / 3600 - $userinfo['tzoffset']) * 3600; $timestamp_adjusted = max(0, TIMENOW - $gmdate_bugfix); $userinfo['localtime'] = vbdate($vbulletin->options['timeformat'], $timestamp_adjusted, false, true, false); $userinfo['localdate'] = vbdate($vbulletin->options['dateformat'], $timestamp_adjusted, false, true, false); |
#2
|
||||
|
||||
Where abounds in member.php?
|
#3
|
||||
|
||||
In the member_complete hook.
--------------- Added [DATE]1202014174[/DATE] at [TIME]1202014174[/TIME] --------------- Nobody has any ideas on this? |
#4
|
||||
|
||||
What isn't working? As it works fine on my test board.
|
#5
|
||||
|
||||
You have it working in the member_complete hook? Where did you put the variables so they show up in the profile? Whenever I tried to add the variables to the profile page under about me nothing shows up for the time or date.
|
#6
|
||||
|
||||
Yes, in the member_complete hook. I'm taking it you're doing this in 3.7? I haven't had the chance to install it yet so maybe there's something that differs in 3.7. Have you tried killing the script at the end of the hook and displaying the two variables?
|
#7
|
||||
|
||||
Yes, I'm using 3.7 beta 4. The code worked great on 3.5.4. But it shows up as nothing in the beta. The code works fine in the postbit_complete, so I thought it should work fine in the member profile, too.
|
#8
|
||||
|
||||
Maybe the "About Me" block template is evaluated before that hook. I haven't looked inside the new files yet (or downloaded them for that matter), but this may be the case. If it is, you will need a hook that is before the evaluation.
|
#9
|
||||
|
||||
You hit the nail right on the head! Thank you very much.
I had it in the wrong hook. I moved it to the member_execute_start hook it is working great now. I had to try a couple hooks to get it right but php didn't want to play nice with the hooks I tried first. I got a couple of DB errors. The last vb version I used before 3.7.0. beta 3 (and now beta 4), was 3.5.4. A lot of things have changed and been added since then, mostly for the good. Thanks again for sticking with me on this and putting up with my noobiness. I really appreciate it. |
#10
|
||||
|
||||
No problems . Your issue baffled me for a second too .
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|