auto create Album functionality using Mambo com_gallery component

Todd_1215
Todd_1215's picture

Joined: 2005-08-16
Posts: 6
Posted: Sun, 2005-09-18 14:24

Hi,

I'm looking to automatically create User Albums when a new user registers with my mambo site. Currently I am using Gallery 1.5.x with Mambo 4.5.2.3. I know the com_gallery2 component that Integrates Gallery2 and mambo has this functionality but due to php memory limit restrictions at my hosting providers site I can't use Gallery2 Integrated with Mambo (That's another issue all together). So since that's really the only functionality I'm looking I was going to try and implement it myself.

I found this code (below) at this forum topic http://gallery.menalto.com/node/12290?highlight=create%2Calbum

Quote:
/**************************************************
Self-registration auto-album creation hack
**************************************************/
// the *name* of the albums used as root users album.
// Use empty quotes for top-level
$usersGallery = "users_galleries";
// create the album with name and title == "username", desc == "username's Gallery"
createNewAlbum( $usersGallery, $uname, $uname, $uname . "'s Gallery");
// create object from $user
$newUser = $gallery->userDB->getUserByUsername($uname);
// change creation perms. Get rid of 'loggedin', then set to username
$gallery->album->setCreateSubAlbum("loggedin", 0);
$gallery->album->setCreateSubAlbum($newUser->getUid(), 1);
// set owner to username
$gallery->album->setOwner($newUser->getUid());
// save all changes
$gallery->album->save();
/**************************************************
End hack
**************************************************/

This hack was written for Gallery user registration process and I need it to work with the mambo user registration process.

I'd do it myself but I don't know where the code needs to go in the com_gallery component or in mambo for that matter.

Anyone have any ideas?