The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Calling vb username in another app
I know that I can require global.php and then call variables like $bbuserid and $bbusername. I've done that on pages I've built before.
What I need now is to pre-populate the form of another app. It's a recipe sharing script. Here: www.powwows.com/gathering/cookbook I want to have the name and email prepopulated on the add recipe page. I've trying adding require global.php and putting it in the main vb directory, but that apparently messes up it's internal mysql statements. Is there another way I can call the information from the cookies? Or some other way?? Thanks |
#2
|
|||
|
|||
Try leaving it in it's original directory and changing directories to vB before calling global.
chdir ('../forum'); require_once ('./global.php'); etc. where the first line contains the relative path to the forums. |
#3
|
||||
|
||||
Yes, you can avoid using global.php.
The important cookies are bbuserid and bbpassword. If you have these cookies you can verify if the combination is valid and retrieve the username from table user. For vB3 PHP Code:
You must also make sure that you have selected the correct database before executing this query, if your other tables are in another database. |
#4
|
||||
|
||||
Quote:
|
#5
|
||||
|
||||
Quote:
|
#6
|
|||
|
|||
>>Will I need to change it back to the orignal directory after I call global?
Always a good idea, I meant to add that in my original reply. |
#7
|
||||
|
||||
Quote:
Anyway to force the nopermission function with this? Thanks! |
#8
|
||||
|
||||
Ok that didn't work exactly how I needed. The two apps are in different databases. So I'm using this code
PHP Code:
|
#9
|
||||
|
||||
Shouldn't this work?? I get userid, but no username??
PHP Code:
|
#10
|
||||
|
||||
This should work.
Did you check that both cookies are set? Did you put in the correct license number (you can verify this on top of each PHP file)? Is $user[userid] set ($userid doesn't mean anything, as this will always be the value from the cookie if set)? You should add $conn as a second parameter to mysql_query() |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|