Quote:
Originally Posted by SilVert
can you post the code that you have inserted into the integration script? i will haev to look around in the code again to see if i can find the right code to pull..
|
This what you want?
PHP Code:
require_once('/www/site/www/beta/embed.php');
$ret = GalleryEmbed::init();
if ($ret) {
// echo $ret->getAsHtml();
}
// Set fullname based upon custom fields
$fullname=$this->existing['field13'] ." ". $this->existing['field14'];
// Set the array for updating
$args['fullname'] = $fullname ;
$args['username'] = $this->existing['username'];
$args['hashedpassword'] = $this->existing['password'];
$args['hashmethod'] = 'md5';
$args['email'] = $this->existing['email'];
$args['language'] = $this->existing['lang_code'];
$args['creationtimestamp'] = $this->existing['joindate'];
//$this->existing['usergroupid']
// Get the userid
$uid = $vbulletin->userinfo['userid'];
//$this->existing['userid']
$ret = GalleryEmbed::isExternalIdMapped($uid,$args);
//Now if no user exists, we'll create one
//If user exists, we'll update existing user
if ($ret && ($ret->getErrorCode() & ERROR_MISSING_OBJECT)) {
$ret2 = GalleryEmbed::createUser($uid,$args);
}else {
$ret2 = GalleryEmbed::updateUser($uid,$args);
}
if ($ret2) {
// echo "ret2: ". $ret2->getAsHtml() ;
}
and this is the error I recieve using the java applet template:
Upload error: Upload failed: 'user id: 5 doesn't have permission: core.addDataItem for item id: 1007'.
I get the same error when trying to upload on 2 different user accounts
well, I don't know what I did, but it works now lol.
I do have another question though if anyone can help.
I have a couple of "premium usergroups" on our forum and I would like to be able to give them a larger quota in the gallery. Any suggestions on how to modify the creation/update scripts to get it to translate a forum groupID into the gallery group?