ShannonA
11-06-2013, 11:25 PM
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.
<?
$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);
}
?>
I see the "A", but not the "B". Any ideas?
vB 4.2.2
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.
<?
$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);
}
?>
I see the "A", but not the "B". Any ideas?
vB 4.2.2