require_once($this->GetPreference('g2_embed_php'));
$ret = GalleryEmbed::init(array('fullInit' => true));
if ($ret) {
print $ret->getAsHtml();
exit;
}
$ret = GalleryEmbed::isExternalIdMapped($username,'GalleryUser');
if ($ret) {
$ret = GalleryEmbed::createUser($username,array(
'username' => $username,
'email' => $email,
'fullname' => $fullname,
'creationtimestamp' => mktime()));
if ($ret) {
print "An error occurred during the user creation <br>";
print $ret->getAsHtml();
exit;
}
}
$g2data = GalleryEmbed::handleRequest();
Posts: 57
Does anyone have any information on this? Or if its possible?
Posts: 8339
this is my code from geeklog bridge for adding admin:
hope this helps
-s
Posts: 57
Do i have to require anything else other than embed.php?
Posts: 8339
no, but you must init gallery before calling any gallery functions.
In my geeklog/gallery2 bridge, everytime I involve gallery (showing sidebarblocks, random imageblock, photo viewing...) I call my init function which looks something like this:
then I check to see if that user is mapped to gallery already:
create a new G2 user if he/she does not already exsist:
and finally, if I'm going to add him/her to admin group, I use the function from above.
Know that this code is Geeklog specific, and should be used as a reference/example only, it is riddled with geeklog functions calls.
hope this helps
-s