Log in

View Full Version : Question about products and directories


Chris11987
10-10-2008, 09:07 PM
Since this is more of a general product question, rather than a specific one, I figured I should ask it here.

If I take a file for a product and change the code to add my forums directory, will I be able to use it outside of the vbulletin directory?

example:
require_once('./global.php');

change to:

require_once('.forums/global.php');

Will I then be able to stick the file inside my root directory instead of my forums directory?

Dismounted
10-11-2008, 04:25 AM
No, global.php uses relative includes, and the files that global.php includes will include other files relatively, and so on. It will cause errors when you call global.php like that. Instead, use the chdir() function.
$cwd = getcwd();
chdir('./forums/');
require_once('./global.php');
chdir($cwd);

Chris11987
10-11-2008, 06:13 AM
That got the page to display and everything, but the css of the style isn't showing up at all. What else do I need to do to get the style showing up properly?

Dismounted
10-11-2008, 10:44 AM
Add a base element to the start of the headinclude template.
<base href="http://www.yoursite.com/forum/" />

Chris11987
10-11-2008, 11:00 AM
Awesome, seems to work now. Thanks a lot for the help, Dismounted.

--------------- Added 1223765785 at 1223765785 ---------------

I have another problem. When adding the base href tag, it seems that some members have to keep loging in multiple time or get logged out. Any idea what the solution to that is?