The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
PHP: includig global.php outside of forum
Okay, including the global.php file isn't all that hard, but what I've noticed is a problem is that ANYTHING put in a $string before I include the global.php is removed / dumped and ... NULL... this messes up my scripts. I need to figure out a way of keeping the value of a $string I set before the inclusion..
please help me with this. Okay, to detail the issue a little, here is my header.php file: $currentdir = $_SERVER['DOCUMENT_ROOT']; chdir("/home/sporthoj.com/www/www.sporthoj.com/forum"); require("./global.php"); if($currentdir) { chdir("$currentdir"); } else { chdir("/home/sporthoj.com/www/www.sporthoj.com"); } You might see what I am trying to do. I am including the global.php file from other directories and need to return back to the original directory. but it just don't work because the value of $currentdir is set to NULL after the global.php file has been loaded. How I know: Because if I echo $currentdir before requre() there is a value inside it. But when I echo AFTER require, the value of $currentdir is no longer present. |
#2
|
||||
|
||||
PHP Code:
|
#3
|
||||
|
||||
thanks, but CURRENT_DIR is empty when I try to echo it with: echo CURRENT_DIR();
It gives me: Fatal error: Call to undefined function: current_dir() in /home/sporthoj.com/www/www.sporthoj.com/top.php on line 16 and I am not returned to the original dir. so apparently vB also unsets any define values as well? I am using vBulletin v3.0 RC2. There has to be a way? |
#4
|
||||
|
||||
CURRENT_DIR isn't a fucntion, its a constant, echo CURRENT_DIR; will work
|
#5
|
||||
|
||||
Quote:
|
#6
|
||||
|
||||
Quote:
I have now noticed that since I do: define('CURRENT_DIR', $_SERVER['DOCUMENT_ROOT']); inside the include file that is outside of the directory that I am actually in, the value of CURRENT_DIR is the one that my header.php file is in... always. Is there a way to go around this or would I have to specify the value of CURRENT_DIR inside the file that calls the header file? That would be a pain in the butt and would make the function kind of worthless for me. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|