PDA

View Full Version : other directories. also top nav bar


flat6
06-05-2004, 01:04 PM
1) I need to use code from vB in another directory, basically I have vB in site.com/forum, and need to use the code in site.com. When I use it by including the relative path, there's all sorts of errors cropping up. How does one use it... in the examples I've seen, people seem to relocate automatically.

2) I need to completely rewite the top nav bar. So far all I've been able to do is get the last one or two items to be changed link wise and title wise, but the actual site.com Forum text (the first link) I don't know how to change.

Thanks!

flat6
06-05-2004, 09:04 PM
I figured out #2, but I still need to do #1 :ermm: It seems that even though I include the initial file with the right directory path, when that file itself calls the others, it screws everything up. The only solution seems to be putting everything directory, which is frankly horrible.

Velocd
06-06-2004, 12:00 AM
vBulletin's global.php requires other files to be included.

If you try to require global.php from your root directory, global.php will assume the files it needs to require will also be relative to your root's index.php, which is not the case.

So you need PHP to change directories for you, with chdir().

yoursite.com/index.php:


chdir('./forum');

require_once('./global.php');

flat6
06-06-2004, 03:09 PM
Great stuff. But my images are broken... it seems that img src ignores the chdir :ermm: