The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Integration of Vbulletin in website causing errors
Integrating Vbulletin functions into my website is causing me problems.
If I include the following in my script: <?php //Begin Define $rootdir $times=substr_count($_SERVER['PHP_SELF'],'/'); $rootdir=''; $x=1; while ($x < $times) {$rootdir .= "../";$x++;} $GLOBALS['rootdir']=$rootdir; //End Define $rootdir define('DIR',$rootdir.'board/'); define('CWD',$rootdir.'board/'); require_once(DIR.'global.php'); //these 4 files all (also separate) cause this problem require_once(DIR.'includes/functions_bigthree.php'); //these 4 files all (also separate) cause this problem require_once(DIR.'includes/class_postbit.php'); //these 4 files all (also separate) cause this problem require_once(DIR.'includes/class_bbcode.php'); //these 4 files all (also separate) cause this problem ?> Once I require a file from Vbulletin, all my vars are wiped. If I open the page as followed: myfile.php?page=test Then the following scripts give the following response <?php $pagina=$_GET['page'] echo $pagina; //test //vbinclude echo $pagina; //empty ?> <?php $pagina='about'; $pagina=$_GET['page'}; echo $pagina; //test //vbinclude echo $pagina; // empty ?> <?php $pagina='about'; echo $pagina; //about //vbinclude echo $pagina; //about ?> So it doesnt really wipe out the $vars, altho vars filled with $_GETs are wiped. What is causing this, and how can I solve this? I put this in my php.ini: register_globals = off thx for any help |
#2
|
|||
|
|||
Include global.php at the begging of your script. and use chdir().
Like this: PHP Code:
|
#3
|
|||
|
|||
vBulletin destroys most variables when it is included. If you define the variables as a constant, vbulletin will keep this value.
I suggest if you are going to use superglobals such as $_GET, $_POST, $_REQUEST, etc. to use the vBulletin Input Cleaner. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|