The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Problems with: $vbulletin->userinfo['userid'];
Hey mates,
got a small problem, which is already transformed to a major one... i want to add a login box to my wordpress frontend, and if the user is logged in to the forum it should display a welcome message and some related stuff... main facts: i am including the global.php while using this code (added it to the header.php in wordpress. that it's openend on every page): if (!file_exists('/path/forum/global.php')) { echo "++++ IT!"; exit; } require_once('/path/forum/global.php'); got that code in my sidebar: $userid=$vbulletin->userinfo['userid']; echo '"'.$userid.'"'; the result i get: "" => that means, i can't read the userid of a logged in user. got any tipps? would be pretty happy if yes |
#2
|
||||
|
||||
Where is your wordpress script in relation to your forum? The issue will be the cookies on your forum won't also be on the wordpress site.
You could probably fix this by setting the vb cookie path to /. |
#3
|
|||
|
|||
wordpress installation is located in : domainname.de/
vb installation is located in: domainname.de/forum i have already set the cookiepath to / i also set the cookiedomain to .domainname.de i think i will get insane soon |
#4
|
||||
|
||||
Well I know my test forum is on /test/, I can access the vB cookies on the main part of my site which is in a folder up from test/. I only have cookie path to set /, no cookie domain setting.
Try logging out of your vB forum, then back in so vB re-makes the cookies for you |
#5
|
|||
|
|||
haha, i just uploaded a test.php which includes my code to the /forum directory, and. guess what. it's working. ...
i don't know why, but it don't want to work in the "/" directory... if i am testing it without wordpress (simply using the test.php, stand alone file) it says, that the paths inside of the global.php are not correctly anymore. i would have to add the /forum/ path inside of the global.php to all file-paths. like for the /includes/init.php ... otherwise it won't work - i think. |
#6
|
||||
|
||||
Perhaps try:
Code:
chdir('/path/to/forum'); require_once('./global.php'); chdir('/path/to/wordpress'); |
#7
|
|||
|
|||
Quote:
the strange => the wordpress vbbridge plugin is working correctly. that means, the plugin requires the global.php on the same way like me... AND it's working in the plugin . but not on the frontend, really really strange. PHP Code:
|
#8
|
||||
|
||||
Maybe a wordpress cookie is conflicting, do you have a unique cookie prefix for your vBulletin?
|
#9
|
|||
|
|||
Yes, i have got a unique cookie prefix for my vbulletin...
got the problem: it doesn't want to work in the wordpress theme!! tested it in the "/" dir in a excluded file and suddendly it did a good job. damn it. now i have to find a solution for that - i hate such situations ! |
#10
|
||||
|
||||
I have an idea, I remember issues with wordpress and variable scope
before you call global.php using require, place this code before it: Code:
global $vbulletin; |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|