Hello all member!
I am trying to get vbulletin session variables eg: userID and username from an external page/file in the parent directory of vbulletin(in a magento installation). I have followed the steps suggested for this process as follows.
i would then echo data like the following code
This works perfectly inside the vbulletin directory however it returns Unregistered for username and 0 for userid and it also logs me out of the current vbulletin session aswell.
I have checked that 1.Path to Save Cookies set to "Suggested Settings '/' " 2.$bbuserinfo['userid'] doesnt work 3.$vbulletin->userinfo['userid'] and $vbulletin->userinfo['username'] return 0 and Unregistered respectively 4.code is correct for vbulletin version 4.2.3 as suggested
Can anyone advise me how to correctly get the vbulletin session variables(userid and username)/
array of the current logged in user in an external directory to the vbulletin installation.
NOTE: I am experiencing a failed to open stream: No such file or directory in autoload.php error in the magento directory (parent directory) where I used the above code which I doubt is related to the problem at hand
Please feel free to ask for any additional info.
Thank's a lot!
author: van tien
I am trying to get vbulletin session variables eg: userID and username from an external page/file in the parent directory of vbulletin(in a magento installation). I have followed the steps suggested for this process as follows.
Code:
<?php global $vbulletin; $curdir = getcwd(); chdir($curdir.'/forum'); require_once('./global.php'); //Use $bbuserinfo. echo('userid: ' . $vbulletin->userinfo['userid']); echo('username: ' . $vbulletin->userinfo['username']); chdir($curdir); ?>
Code:
<?php echo $vbulletin->userinfo['username']; ?>
I have checked that 1.Path to Save Cookies set to "Suggested Settings '/' " 2.$bbuserinfo['userid'] doesnt work 3.$vbulletin->userinfo['userid'] and $vbulletin->userinfo['username'] return 0 and Unregistered respectively 4.code is correct for vbulletin version 4.2.3 as suggested
Can anyone advise me how to correctly get the vbulletin session variables(userid and username)/
PHP Code:
$vbulletin->userinfo
NOTE: I am experiencing a failed to open stream: No such file or directory in autoload.php error in the magento directory (parent directory) where I used the above code which I doubt is related to the problem at hand
Please feel free to ask for any additional info.
Thank's a lot!
author: van tien
Comment