View Full Version : I would like to write some hacks which use the variables from vbulletin
Particularly the fonts and colors specified by the admin. Can someone post an example of code which I need to use to get access to these variables?
include ("./global.php");
Gives you access to the entire vBulletin engine.
Cool. So I can just look at the templates and files for examples of how they pull these variables. Thanks for the help. :)
Is there some way you can include globa.php if the software you are using is in a directory other than the one vB is in?
I have an image gallery program I'm trying to integrate, which is in websitename/gallery, whereas vB is in websitename/forums
If I hardcode the ref to global.php it obviously breaks, since it then tries to look up config.php, etc.
TIA,
Chris
Originally posted by wluke
include ("./global.php");
Gives you access to the entire vBulletin engine.
just put the absolute path inside the quotes, or if the directory isn't that far away in the hiarchy you could use the '..''s to create a relative path.
Hmm, so I need to edit the global.php too, then? The problem is I told my addon where global.php was, but then inside global.php it calls config.php, which has a relative path to global.php, which confused my addon.
Did I confuse anyone else now? :)
Chris
Originally posted by leadZERO
just put the absolute path inside the quotes, or if the directory isn't that far away in the hiarchy you could use the '..''s to create a relative path.
just use
include ("../gallery/global.php");
Ok...
The program resides in www.mysite.com/gallery. Forums are in www.mysite.com/forums
I did an include ("../forums/global.php"); but this is the error I get when I try to load the file that has the include:
Warning: Failed opening './admin/config.php' for inclusion (include_path='.:/usr/local/nusphere/apache/php/lib') in ../forums/global.php on line 48
Thanks,
Chris
Originally posted by cyo
just use
include ("../gallery/global.php");
I'd like to know the solution to this too (if there is one). My fix was to simply always put the php file using global.php in the folder with the rest of message board files.
chdir($DOCUMENT_ROOT . "/forums");
include("$DOCUMENT_ROOT/forums/global.php");
chdir($DOCUMENT_ROOT . "/gallery"); // Only need this if you are going to call any files in the /gallery directory
Thanks. I'll give it a try! :)
Thanks for the info there, Freddy! I'll give it a try!
Chris
Originally posted by freddie
chdir($DOCUMENT_ROOT . "/forums");
include("$DOCUMENT_ROOT/forums/global.php");
chdir($DOCUMENT_ROOT . "/gallery"); // Only need this if you are going to call any files in the /gallery directory
Originally posted by freddie
chdir($DOCUMENT_ROOT . "/forums");
include("$DOCUMENT_ROOT/forums/global.php");
chdir($DOCUMENT_ROOT . "/gallery"); // Only need this if you are going to call any files in the /gallery directory
Thx Freddie...that just answered a post i did in the php coding forum....
what if there is another folder inside the gallery folder and want the files inside to call global.php
shall i add
chdir($DOCUMENT_ROOT . "/gallery/new-folder");
or this would do?
chdir($DOCUMENT_ROOT . "/gallery");
Thanks
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.