The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Can't Get an External Page to Work with Data Manager
I've been trying to create an external page that accesses vBulletin to add (or later, subtract) a user to a secondary usergroup. It sounds like it should be an easy enough task using the datamanager, though I've never used the datamanager before.
Unfortunately, when I try to do this, the web page dies out sometime during its look at "includes/init.php". I can't find any errors in the WWW error files, nor does anything show up on screen. Code:
<? $forumFile = "/defined/here"; addUserToGroup(981,0); function addUserToGroup($userid,$groupid) { global $forumFile; define('VB_AREA', 'External'); define('SKIP_SESSIONCREATE',1); define('SKIP_USERINFO',1); define('THIS_SCRIPT', __FILE__); define('CWD',$forumFile); // I've verified that $forumFile is set correctly here echo "A"; require_once(CWD . '/includes/init.php'); echo "B"; $userinfo = fetch_userinfo($userid); $membergroups = fetch_membergroupids_array($userinfo); # $userdm =& datamanager_init('User', $vbulletin, ERRTYPE_STANDARD); } ?> vB 4.2.2 |
#2
|
|||
|
|||
What you are seeing is typical when running "init.php" -- the code is executing. I will not get into the details since what you need is a work-around.
Two methods are available to you write to a log file or capture / buffer the stdio using other php methods. I suggest, since you are learning, to use something like 'Firephp' a Firefox add-on which will let you log to the console log in Firefox. Chrome has a similar add-on but I am not familiar with it. https://addons.mozilla.org/en-US/firefox/addon/firephp/ At this point do not worry about why echo does not work after requiring "init.php". You will figure that out later when you are more familiar with vbulletin code. Hope this helps, have fun. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|