The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
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:
Quote:
|
#2
|
||||
|
||||
![]() PHP Code:
|
#3
|
||||
|
||||
![]()
Where / how are you calling this code?
And just out of interest, how are the various $foo variables ($username, etc) getting set? If this is a standalone piece of code, it would help if you posted the whole thing. -- hugh |
#4
|
|||
|
|||
![]()
im looking to make a script to help me bridge 2 applications
basically the app im using has a bridge function that when i choose a certain bridge, code gets executed in that bridge file, so there are create, update, delete functions in that bridge. for the purposes of this attempt its create a user im trying to do, assuming getting this working will mean that i can do the others once these issue's are ironed out. there are 2 options i have, use curl code to pass the data to an external file. or execute the vbulletin code in the bridge file, which would be for example, an index.php file, including another file which does an include on the bridge. so its nested inclusions and seems to be causing problems. with curl we lose the nesting and it should work. the above code however isnt, and the code posted by dismounted doesnt seem to work either ERROR0:Please complete the required field "Username". i get that when i try passing data via the address bar jm_adduser.php?username=testing&email=testing@gold enplec.com&password=simple though the data SEEMS to get passed ok using $username = $_REQUEST["username"] etc etc to get the data i can print the variable contents $username and it shows the passed data but $userdm->set('username', $username); returns the error given above. so this is my attempt at using an independent file to add a user to VB and i will curl the data to the file from the bridge file for simplisity any help much appreciated, ive been at this for weeks --------------- Added [DATE]1201414949[/DATE] at [TIME]1201414949[/TIME] --------------- scratch the above i solved it myself just as i wrote the last reply i thought to myself about a problem i had in work recently where data was there one minute, gone the next, and it was due to initialising something else killing the variables because they were only temporary so i moved the setting $username and $password down the script to beside the $userdm->set , well just before that, and wham it works, tried the curl code to call the script and wham that worked from that end too. so now i finally have the script working. although it might be helpful for others to explore what was causing the variables to get emptied between setting them and this code SET THE VARIABLES HERE // switch to vbulletin directory $cwd = getcwd(); chdir('/home3/goldccom/public_html/forum'); // include dependencies require_once('./global.php'); // initialise datamanager $userdm =& datamanager_init('User', $vbulletin, ERRTYPE_ARRAY); // set options GONE BY THE TIME THEY GET HERE $userdm->set('username', $username); |
#5
|
||||
|
||||
![]()
We'd have to see all the code between where you initially set them and calling global.php to know what was happening.
-- hugh |
#6
|
|||
|
|||
![]()
the code is that of above given by dismounted
in a non working example the taking the passed values into a variable i put the $_REQUESTS at the top in a working sample i put the $_REQUESTS above the $userdm->set('username', $username); |
#7
|
||||
|
||||
![]()
Strongly suggest you use $vbulletin->clean_array_gpc() to sanitize your inputs.
BTW, is the password clear text or md5 hashed? -- hugh |
#8
|
|||
|
|||
![]()
Thanks for the cleaning array tip, i didnt know that existed
password is plain text username is plain text email is plain text all passed through the address bar, recieved by $_REQUEST absolutely fine but after including global and initialising the datamanager the variables i have assigned the value of the passed parameters empty, so i had to move the $_REQUEST being passed into a variable lower in the script to keep the value's for use to pass to the datamanager to create a user. |
#9
|
||||
|
||||
![]()
So is it working now?
|
#10
|
|||
|
|||
![]()
aye if i move the variables down just before
$userdm->set('username', $username); it works absolutely fine anyone know where i'd get a list of bitfield and user options for the data manager, tried the manaul and developer docs but cant find a thing |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|