![]() |
|
Thread Tools |
#1
|
|||
|
|||
TIMENOW and access to it outside the Forum Software
I want to display a logout button to logged in users on my new custom homepage that I am writing. I have been able to recreate the logout hash, but since it is based off of appending "time()-" to the front, the value it gets is different than what the value would be when generated by login.php.
How do I get to the global TIMENOW variable that VB uses? Do I need to just include global.php into my application? Is there another way to do this without including that entire file? Trying to avoid unnecessary bloat from 'over including' files. TIA No members have liked this post.
|
#2
|
||||||||
|
||||||||
There is no difference; vBulletin uses time() as TIMENOW.
See line 32 of init.php:
Check out line 1335 of functions.php:
__________________
Former vBulletin.org Staff Member Please feel free to re-use any of the code in any of my projects submitted to vB.org, so long as original attribution is retained. ![]() No members have liked this post.
|
#3
|
||||
|
||||
Maybe I need to update the forum that I'm working with. As this is the code from my functions.php...
Assume: 1. myscript.php is a script outside my forum root directory 2. login.php is the standard file included in vB Appending time() in myscript.php is going to be different than the generated one that would be generated from login.php. So when I pass the hash from one myscript.php to login.php, login.php will error out and then display a new (and correct) logout link w/proper logouthash. If the newest version of VB has dropped this timestamping feature of the logout hash then this simplifies things dramatically. No members have liked this post.
|
#4
|
||||
|
||||
Ah, I didn't realize the 3.7.3 hash now included the time (I was looking at 3.7.0).
Try including your global file. At least then the constant would be in namespace.
__________________
Former vBulletin.org Staff Member Please feel free to re-use any of the code in any of my projects submitted to vB.org, so long as original attribution is retained. ![]() No members have liked this post.
|
#5
|
|||
|
|||
Yeah I figured I had to do that so I started playing with that.
It works all well and good, but the logout hash is not correct. I click it and then I get an error page on login.php and it then generates a logouthash that is correct. I wonder what magical step I'm missing. Maybe I'm missing setting some cookie var, or session var. --------------- Added 09 Sep 2008 at 03:38 --------------- By including the global.php shouldnt I be able to use things like $bbuserinfo inside my custom php page? --------------- Added 09 Sep 2008 at 17:56 --------------- figured it out, just needed to use the right variable, $vbulletin->userinfo['logouthash'] No members have liked this post.
Last edited by CtrlAltDel; 09 Sep 2008 at 17:56. Reason: Auto-Merged DoublePost |
![]() |
«
Previous Thread
|
Next Thread
»
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
|
|
New To Site? | Need Help? |
All times are GMT. The time now is 20:56.