![]() |
getting userid on custom page
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. :confused: |
You probably need to use this $bbuserinfo[userid]
|
In a php script? The above code is not in a template.
|
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?
|
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?
|
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:
|
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. |
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.) |
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. |
All times are GMT. The time now is 02:18 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|