The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Errors when including global.php
I want to implement an external user registration functionality.
I use this code to include global.php chdir('../forum'); require_once('./global.php'); However, upon doing this I receive these errors: Notice: Undefined variable: errfile in /home/wa/public_html/forum/includes/functions_log_error.php on line 136 Warning: array_keys(): The first argument should be an array in /includes/functions.php on line 3090 Notice: Undefined variable: errfile in /home/wa/public_html/forum/includes/functions_log_error.php on line 136 Warning: Invalid argument supplied for foreach() in /includes/functions.php on line 3090 Fatal error: Call to a member function on a non-object in /home/wa/public_html/forum/includes/functions.php on line 2379 functions.php line 2379 = $temps = $vbulletin->db->query_read(" SELECT title, template FROM " . TABLE_PREFIX . "template WHERE templateid IN (" . implode(',', $templateids) . ") "); functions.php line 3090 = foreach(array_keys($vbulletin->forumcache) AS $forumid) { foreach($membergroupids AS $usergroupid) { $user['forumpermissions']["$forumid"] |= $vbulletin->forumcache["$forumid"]['permissions']["$usergroupid"]; } } Anyone know what is wrong and why? |
#2
|
|||
|
|||
You will find 4 arrays defined in each vB file, before the call to global.php. Just define those 4 arrays.
|
#3
|
|||
|
|||
Thanks for your quick reply,
I added the 4 arrays but the errors still remain. Here is the new code: PHP Code:
|
#4
|
||||
|
||||
Quote:
|
#5
|
|||
|
|||
Hello,
I changed the code snippet to this: PHP Code:
Could it be that the arrays required cannot be accessed by global.php because they are created in a function inside a class? (local scope) Just guessing here.. PSEUDO : Code:
class Registration function insert define arrays; chdir; include global.php; Is it possible to still have access to global.php inside a class or function? Update2: If there isn't, is it still possible to play with the datamanager? This is what I need global.php for: PHP Code:
For anyone wanting to test: This does not work : PHP Code:
Code:
Warning: array_keys(): The first argument should be an array in /includes/functions.php on line 3090 Warning: Invalid argument supplied for foreach() in /includes/functions.php on line 3090 Fatal error: Call to a member function on a non-object in /home/wa/public_html/forum/includes/functions.php on line 2379 Fatal error: Call to a member function on a non-object in /home/wa/public_html/forum/includes/functions.php on line 4198 |
#6
|
||||
|
||||
Global the variables...
PHP Code:
|
#7
|
|||
|
|||
Hi,
Just tried it, errors remain the same. Any other ideas? Thanks |
#8
|
||||
|
||||
As a side note, do you actually need all those templates you are declaring, or did you just copy the code from somewhere ?
|
#9
|
|||
|
|||
No i don't need them, I just copied it from index.php. Can they just be empty arrays?
|
#10
|
|||
|
|||
Like i said in my first reply, just define them.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|