The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
How to connect to a vB database & sessions
Right, here's what i'm trying to do, i'm on vB3 Beta 7, and i'm trying to connect to the database and use the vB permisions and the whois online thinger, but i dont know how. Let me plug in this info right now, because i'm stupid and i'm running on localhost so this info is safe.
Server- localhost Database- forums Username- root Password- (I dont use a pass) And yes you can discuss this because it's not vB3 hacking, you arent editing any vB files, just accessing them and the database. The only thing i'm editing is my index page on my root site :P. |
#2
|
||||
|
||||
I'm a junior vb hacker but I think the first thing you want to do is take a look at global.php
Then you can include it in your script and essentially you get access to some good functions and variables. I've had no success using sessions after including vb3beta7 global.php (see my other thread) ... because I think vbulletin clears the session every time global.php runs. |
#3
|
||||
|
||||
PHP Code:
|
#4
|
||||
|
||||
PHP Code:
|
#5
|
||||
|
||||
Requiring global.php creates a database connection to you vBulletin database and creates the users session for you.
|
#6
|
||||
|
||||
ok, so now i'm using:
PHP Code:
Quote:
|
#7
|
||||
|
||||
PHP Code:
|
#8
|
||||
|
||||
why wont it work?
|
#9
|
||||
|
||||
Because you actually have to get the values to fill the variables, they aren't done automatically by requiring global.php.
|
#10
|
||||
|
||||
how are they done if i may ask :P
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|