vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB5 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=263)
-   -   global.php missing in vB5? (https://vborg.vbsupport.ru/showthread.php?t=321013)

michaeld42 12-08-2015 09:37 PM

global.php missing in vB5?
 
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?

Dave 12-09-2015 08:11 AM

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?

Dave 12-09-2015 02:54 PM

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 [DATE]1449719387[/DATE] at [TIME]1449719387[/TIME] ---------------

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 11:24 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01161 seconds
  • Memory Usage 1,720KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete