Quote:
Originally Posted by Dismounted
global.php cannot be included outside of global scope.
|
Could you explain that a bit more? I'm good with PHP, but never seen this kind of problem before. Does this mean global.php has to be modified to work from functions? Hopefully not, as I suspect it's a big task.
Likely should be another thread, but I also get identical the error:
Fatal error: Call to a member function query_read_slave() on a non-object in /mypath/includes/functions.php on line 3189
This error has only started to appear over the last few weeks (with v3.8.3), and I've not made any code changes, nor have I seen this error in the last year or so (I carefully track PHP errors).
Similar to jonbach's function, I use a function to handle creating threads:
Code:
function newThread() {
... initialization stuff
chdir($forumDir);
require_once('./global.php');
require_once(DIR . '/includes/functions_databuild.php'); // for new thread
... forum actions
chdir($curDir);
}
This has been working perfectly for quite a while (many vBulletin versions over a year or so), so it's also puzzling why it's worked before and lately generates errors.