PDA

View Full Version : I would like to write some hacks which use the variables from vbulletin


irc
22 Feb 2001, 17:08
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?

22 Feb 2001, 17:09
include ("./global.php");

Gives you access to the entire vBulletin engine.

22 Feb 2001, 17:15
Cool. So I can just look at the templates and files for examples of how they pull these variables. Thanks for the help. :)

26 Feb 2001, 02:37
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.

26 Feb 2001, 02:39
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.

26 Feb 2001, 03:23
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.

27 Feb 2001, 13:42
just use

include ("../gallery/global.php");

27 Feb 2001, 14:25
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");

27 Feb 2001, 15:31
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.

27 Feb 2001, 15:55
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

27 Feb 2001, 16:05
Thanks. I'll give it a try! :)

27 Feb 2001, 18:57
Thanks for the info there, Freddy! I'll give it a try!

Chris
Originally posted by freddie


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

27 Feb 2001, 19:13
Originally posted by freddie


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Thx Freddie...that just answered a post i did in the php coding forum....

Ruth
27 Jul 2001, 01:53
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