vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=321013

global.php missing in vB5?
by michaeld42
08 Dec 2015 23:37

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 09 Dec 2015 00:37

There is no global.php file like you're expecting in vBulletin 5.

What did your custom page do?

michaeld42 09 Dec 2015 03:03

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?

Dave 09 Dec 2015 10:11

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 09 Dec 2015 15:18

Not a problem, I'm a programmer, but is this the right place to find out how to do it?

Dave 09 Dec 2015 16:54

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 09 Dec 2015 17:41

Thanks! It does look like the same file (but updated). I overlooked the core folder.

--------------- Added 10 Dec 2015 at 03:49 ---------------

I attempted to use the global.php as in vB4 but now I get the error message "Access denied".


All times are GMT. The time now is 19:41.

Powered by vBulletin® Version 3.8.14
Copyright © 2020, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.