Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Users Album created automatically on registration  (Read 12440 times)

0 Members and 1 Guest are viewing this topic.

jpepin

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
    • http://www.pepinonline.com
Users Album created automatically on registration
« 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)?
Logged

intranet

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Users Album created automatically on registration
« Reply #1 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.
Logged

TerryG

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 45
Re: Users Album created automatically on registration
« Reply #2 on: June 22, 2004, 08:20:28 pm »


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

Logged

marian

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 160
    • BYM Photo Gallery
Re: Users Album created automatically on registration
« Reply #3 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!  ::)
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Users Album created automatically on registration
« Reply #4 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.
Logged
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

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 45
Re: Users Album created automatically on registration
« Reply #5 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.
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Users Album created automatically on registration
« Reply #6 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.
Logged
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

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 252
  • iNSiGNiA
    • Pixnet Gallery
Re: Users Album created automatically on registration
« Reply #7 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
Logged
Pixnet Gallery: http://www.pixnet.net
iNSiGNiA Weblog: http://www.jayliu.org

sliiper

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Users Album created automatically on registration
« Reply #8 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
Logged

MisterBlack

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Users Album created automatically on registration
« Reply #9 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!

Logged

ash

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Users Album created automatically on registration
« Reply #10 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...
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 19 queries.