View Full Version : global.php missing in vB5?
michaeld42
12-08-2015, 09:37 PM
In upgrading from vB4 to vB5, one custom page crashes because there is no global.php file in the vB5 folder. Should there be one, and if so where do I find it? Or is it no longer needed for vB5?
BTW, I had no idea what the thread prefix should be for this.
Zachery
12-08-2015, 10:37 PM
There is no global.php file like you're expecting in vBulletin 5.
What did your custom page do?
michaeld42
12-09-2015, 01:03 AM
The page has a JavaScript Google maps app. It was part of the CMS, not the forum, but users could log in to retrieve saved maps. The page is here (vB4) http://www.roadtripamerica.com/maps/mapwizard.php but in vB5 the page crashes on the PHP line "require_once('./global.php');" because there is no global.php in the appropriate directory (or anywhere else).
That PHP code is commented "Require back end", I assume because logging in is not usually part of the non-forum pages. Is there anything I need to do to be sure that users can log in (and the code can test for vBulletin variables) in the non-forum pages?
vBulletin 5 is quite different than vBulletin 4. Custom coded plugins/pages that relied on vBulletin 4 will probably have to be rewritten to work with vBulletin 5.
michaeld42
12-09-2015, 01:18 PM
Not a problem, I'm a programmer, but is this the right place to find out how to do it?
Well there seems to be a global.php file in the core folder, I don't know if it provides the same functionality as the vBulletin 4 version.
I think you can include the core/includes/init.php file which should provide you with the $vbulletin registry and $db database.
michaeld42
12-09-2015, 03:41 PM
Thanks! It does look like the same file (but updated). I overlooked the core folder.
--------------- Added 1449719387 at 1449719387 ---------------
I attempted to use the global.php as in vB4 but now I get the error message "Access denied".
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.