I want some help for integration of vbulletin and my own codes.
Firstly, I must use the $bbuserinfo[] variable on my portal site. I just tried to read user informations from cookie and also db but it doesn't work. My codes are like this:
PHP Code:
$cookie_userid = $_COOKIE[$cookieprefix.'userid']; //vbulletin3 userid
$cookie_password = $_COOKIE[$cookieprefix.'password']; //vbulletin3 password
$bbuserinfo = $db->query_first("SELECT * FROM ".$tableprefix."user WHERE userid = '$cookie_userid' and password = '$cookie_password'"); // $bbuserinfo variable for my portal
I know to include all vbulletin variables from global.php to my page but I don't want to do this. Is there any way to use $bbuserinfo variable without include global.php?
I want to help for integration of vbulletin and my own codes.
Firstly, I must use the $bbuserinfo[] variable on my portal site. I just tried to read user informations from cookie and also db but it doesn't work. My codes are like this:
PHP Code:
$cookie_userid = $_COOKIE[$cookieprefix.'userid']; //vbulletin3 userid
$cookie_password = $_COOKIE[$cookieprefix.'password']; //vbulletin3 password
$bbuserinfo = $db->query_first("SELECT * FROM ".$tableprefix."user WHERE userid = '$cookie_userid' and password = '$cookie_password'"); // $bbuserinfo variable for my portal
I know to include all vbulletin variables from global.php to my page but I don't want to do this. Is there any way to use $bbuserinfo variable without include global.php?
Thank you so much for your answers.
Of course if you wish to query the database directly and other such stuff, however simply put no , not without some work.
Of course if you wish to query the database directly and other such stuff, however simply put no , not without some work.
Well, but It seems to be $_COOKIE[$cookieprefix.'userid'] and also $_COOKIE[$cookieprefix.'password'] are blank : ) So my bbuserinfo query doesn't work.
$cookieprefix, $tableprefix variables and db options are the same as vbulletin settings.
just checking: did you use print_r($_COOKIE); ? try $HTTP_COOKIE_VARS instead and see what you get. and make sure cookie domain is set to .yourdomain.com in your vbulletin options.
just checking: did you use print_r($_COOKIE); ? try $HTTP_COOKIE_VARS instead and see what you get. and make sure cookie domain is set to .yourdomain.com in your vbulletin options.
Oow, I understood what my fault was. Now there is another problem, how can I read forum cookies from the portal pages.
you can read all the cookies that are set for that particular domain. make sure your cookie domain is .domain.com, so can read those cookies across your domain, and then just use print_r($_COOKIE); to find your vbulletin cookies.