The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
On a custom page that is called periodically with ajax, I would like to check the userid of the user. (I want to compare it with a variable to show a ban button in my chat application).
So this is what I have: PHP Code:
I am logged in at the forum and global.php is found. I don't understand why it's not working. ![]() |
#2
|
||||
|
||||
![]()
You probably need to use this $bbuserinfo[userid]
|
#3
|
|||
|
|||
![]()
In a php script? The above code is not in a template.
|
#4
|
||||
|
||||
![]()
My guess would be that global.php is actually not being called. You say you know it's being called - how do you know that?
|
#5
|
|||
|
|||
![]()
In ths thread: https://vborg.vbsupport.ru/showthread.php?t=254375 I notice that your $_REQUEST doesn't contain any cookies. To be honest I'm not 100% sure that it should, but the docs say it should. So maybe somehow the cookies aren't being sent with your request and so you're not seen as logged in?
|
#6
|
|||
|
|||
![]() Quote:
2) Vbulletin->userinfo['userid'] is set to 0. I did not set it to zero, so global.php must have set it. --------------- Added [DATE]1291168079[/DATE] at [TIME]1291168079[/TIME] --------------- Quote:
![]() |
#7
|
|||
|
|||
![]()
Unfortunately I don't know. I always thought they got included automagically based on the domain name you are sending the request to.
Anyone else know? vvvv Lynne has a good idea. |
#8
|
||||
|
||||
![]()
Is this in the middle of a function - perhaps you need to make $vbulletin global?
(You wouldn't see errors if you don't have reporting on, so you may want to check your error_logs just in case.) |
#9
|
|||
|
|||
![]()
It's not in a function. I would have received a warning if global was not found.
And the code that I posted above appears exactly the way I posted it. It should work in a function. |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|