Ok can anyone including the developers out there suggest a method for solving
PHP Fatal error: Call to a member function query_first_slave() on a non-object in /path/to/my/forum/includes/functions.php on line 1194
from doing a bit of research it seems this error comes up mostly when a file X.php included file Y.PHP and Y.PHP would include the code for adding a user and in turn would include the globals.php, class_dm.php and class_dm_user.php
so it seems nested including is a problem for objects further down the line
has anyone got any idea's of how we can solve this issue as i'd like to make use of the datamanager for inserting users rather than the silly method of SQL inserting which isnt the best method going
Quote:
$cwd = getcwd();
chdir('/home/content/d/i/o/dionsis/html/acuffe/test/forum');
require_once('./global.php');
require_once('./includes/class_dm.php');
require_once('./includes/class_dm_user.php');
chdir($cwd);
$userdm = new vB_DataManager_User($vbulletin, ERRTYPE_ARRAY);
$userdm->set('username', $username);
$userdm->set('email', $email);
$userdm->set('password', $password);
$userdm->set('usergroupid',$usergroupid);
//$userdm->set('ipaddress', $ipaddress);
$userdm->set('timezoneoffset', $timezoneoffset);
$userdm->set_bitfield('options', 'adminemail', '1');
$userdm->set_bitfield('options', 'showemail', '1');
#If there are errors (eMail not set, eMail banned, Username taken, etc.) you can check for errors using
if (count($userdm->errors))
{
for($i=0; $i<count($userdm->errors); $i++)
{
print "ERROR{$i}:{$userdm->errors[$i]}\n";
return(false);
}
}
else
{
# If everything is OK
$newuserid = $userdm->save();
print "vbuserid:$newuserid\n";
return(true);
}
|
i also occassionally from time to time recieve this error
Quote:
[24-Jan-2008 05:57:01] PHP Fatal error: Call to a member function unlock_tables() on a non-object in /location/of/forum/includes/functions.php on line 5218
|
Again its all using the datamanager. I receive similar errors when using the likes of the Connector API.