forum.coppermine-gallery.net

No Support => Feature requests => Topic started by: jpepin on March 23, 2004, 02:41:48 am

Title: Users Album created automatically on registration
Post by: jpepin on March 23, 2004, 02:41:48 am
Is there a way to set it up so that when a person registers it automatically creates a user album for them (album name would=user name)?
Title: Users Album created automatically on registration
Post by: intranet on March 30, 2004, 02:27:30 pm
tagging along. i would enjoy this feature too, to have a default album created until they get the hang of making their own.
Title: Re: Users Album created automatically on registration
Post by: TerryG on June 22, 2004, 08:20:28 pm

I'm searching for info on this exact topic.  Definitely should be on a wish list.

Title: Re: Users Album created automatically on registration
Post by: marian on June 22, 2004, 08:55:22 pm
Agreed, I'm having enough trouble getting to grips with my new album and I foresee a flood of "How do I" coming from users when I let them loose!  ::)
Title: Re: Users Album created automatically on registration
Post by: Casper on June 23, 2004, 11:54:36 am
It's on our todo list for a future version.  It will have to be admin settable though.
Title: Re: Users Album created automatically on registration
Post by: TerryG on June 23, 2004, 05:51:14 pm

Hmm...I thought I'd whip up some SQL to do this, but unfortunately I'm running a cpg installation which is integrated with phpBB, and I'm having difficulty figuring out how to tag along on the phpBB registration.

I'm going to keep plugging away at it, will let you know if I figure it out

T.
Title: Re: Users Album created automatically on registration
Post by: Casper on June 23, 2004, 07:26:01 pm
As bridged installations use the board user management, this will be very difficult, if not impossible to achieve, without altering the forums registation process.
Title: Re: Users Album created automatically on registration
Post by: Oasis on July 07, 2004, 04:38:31 pm
For non-bridged users, try this

in register.php find

Code: [Select]
$sql = "INSERT INTO {$CONFIG['TABLE_USERS']} ".
  "(user_regdate, user_active, user_actkey, user_name, user_password, user_email, user_location, user_interests, user_website, user_occupation) ".
  "VALUES (NOW(), '$active', '$act_key', '".addslashes($user_name)."', '".addslashes($password)."', '".addslashes($email)."', '$location', '$interests', '$website', '$occupation' )";
$result = db_query($sql);

and add after it
Code: [Select]
$sql = "SELECT user_id FROM {$CONFIG['TABLE_USERS']} WHERE 1";
$result = db_query($sql);
$row=mysql_fetch_row($result);
$uid=$row[0]+10000;

$sql = "INSERT INTO {$CONFIG['TABLE_ALBUMS']} (category, title, uploads, pos) VALUES ('$uid', 'New Album', 'NO',  '1')";
$result = db_query($sql);

My installation is heavily modified, so no guarantees.  :D
Title: Re: Users Album created automatically on registration
Post by: sliiper on August 07, 2005, 02:51:05 pm
hi! your mod its good! tks

but i need another thing, but dont know how i do. you mod search 1 userid and create one album, it does not give to create the gallery with the name of user that it was registered?


tks
Title: Re: Users Album created automatically on registration
Post by: MisterBlack on September 16, 2005, 11:24:08 am
On my coppermine version 1.3.3 the mysql query to get the users id is different:

Code: [Select]
    $sql = "SELECT user_id FROM {$CONFIG['TABLE_USERS']} WHERE user_name='" . addslashes($user_name) . "';";
    $result = db_query($sql);
    $row=mysql_fetch_row($result);
    $uid=$row[0]+10000;

    $sql = "INSERT INTO {$CONFIG['TABLE_ALBUMS']} (category, title, uploads, pos) VALUES ('$uid', 'meine Fotos', 'NO\',  '1')";
    $result = db_query($sql);

the difference is that I dont say   WHERE 1 but WHERE user_name='" . addslashes($user_name)

Now it works for me!

Title: Re: Users Album created automatically on registration
Post by: ash on September 19, 2005, 03:07:27 pm
using 1.34

if i use the code by oasis the album is created in the name of the admin..not of the newly registered user..if i use the code by mister black it just gives an error..would like to get this feature going but doesnt seem to work for me...