Users Album created automatically on registration Users Album created automatically on registration
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Users Album created automatically on registration

Started by jpepin, March 23, 2004, 02:41:48 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jpepin

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)?

intranet

tagging along. i would enjoy this feature too, to have a default album created until they get the hang of making their own.

TerryG


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


marian

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!  ::)

Casper

It's on our todo list for a future version.  It will have to be admin settable though.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

TerryG


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.

Casper

As bridged installations use the board user management, this will be very difficult, if not impossible to achieve, without altering the forums registation process.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Oasis

For non-bridged users, try this

in register.php find

$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

$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
Pixnet Gallery: http://www.pixnet.net
iNSiGNiA Weblog: http://www.jayliu.org

sliiper

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

MisterBlack

On my coppermine version 1.3.3 the mysql query to get the users id is different:


    $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!


ash

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...