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] 2   Go Down

Author Topic: Member Album Request  (Read 14568 times)

0 Members and 1 Guest are viewing this topic.

lupus2k5

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Member Album Request
« on: January 30, 2006, 03:46:42 am »

Here's a request.

After a member has registered, I want Coppermine to automatically create an album named their username. I don't mean a user gallery, I want an album, so it can be listed in the Ablums list.

Greatly appreciated to anyone who can help me with this. ;)
« Last Edit: February 21, 2006, 05:55:12 pm by GauGau »
Logged

Nibbler

  • Guest
Re: Member Album Request
« Reply #1 on: January 30, 2006, 03:15:32 pm »

Edit register.php, find

Code: [Select]
    $sql = "INSERT INTO {$CONFIG['TABLE_USERS']} ".
           "(user_regdate, user_active, user_actkey, user_name, user_password, user_email, user_profile1, user_profile2, user_profile3, user_profile4, user_profile5, user_profile6) ".
           "VALUES (NOW(), '$active', '$act_key', '" . addslashes($user_name) . "', '" . addslashes($encpassword) . "', '" . addslashes($email) . "', '$profile1', '$profile2', '$profile3', '$profile4', '$profile5', '$profile6')";
    if ($CONFIG['log_mode']) {
        log_write('New user "'.addslashes($user_name).'" created on '.date("F j, Y, g:i a"),CPG_ACCESS_LOG);
    }
    $result = cpg_db_query($sql)

after, add

Code: [Select]
cpg_db_query("INSERT INTO {$CONFIG['TABLE_ALBUMS']} (`title`) VALUES ('".addslashes($user_name)."')");
Logged

lupus2k5

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Member Album Request
« Reply #2 on: January 31, 2006, 03:31:57 am »

Thank you!
Logged

lupus2k5

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Member Album Request
« Reply #3 on: January 31, 2006, 03:41:17 am »

Okay, here's a harder one... :)
In upload.php, I'm hoping I can make it so that the only gallery they can upload to is the one that is their username. ;D

Thanks for the cooperation!
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Member Album Request
« Reply #4 on: January 31, 2006, 05:57:02 am »

What's the point of all this, why don't you use personal galleries, because what you're up to do is exactly what personal galleries are for? You can't limit upload permissions in public boards by user. What you're trying to accomplish currently isn't possible.
Logged

lupus2k5

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Member Album Request
« Reply #5 on: February 04, 2006, 06:40:07 pm »

This has nothing to do with public forums, and I am doing this because I am specific to this rather than using this "Personal Gallery" feature. If you'd prefer not to help me, I'll just have to do without it.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Member Album Request
« Reply #6 on: February 05, 2006, 09:35:37 pm »

not a matter of my personal preferences. I'm just giving advice, because that's what I thought you were looking for on this board. Like I said: coppermine is designed in a certain way, while you're trying to use it in another way. All I did was pointing out that there is a way to accomplish what you're trying to do with a slightly different setup.
There's no need to be rude.
Logged

webfairy

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
Re: Member Album Request
« Reply #7 on: February 18, 2006, 05:43:30 pm »

Will this  work if you have attched coopermind to a phpbb board?  if yes please explain in detail.  ty


Edit register.php, find

Code: [Select]
    $sql = "INSERT INTO {$CONFIG['TABLE_USERS']} ".
           "(user_regdate, user_active, user_actkey, user_name, user_password, user_email, user_profile1, user_profile2, user_profile3, user_profile4, user_profile5, user_profile6) ".
           "VALUES (NOW(), '$active', '$act_key', '" . addslashes($user_name) . "', '" . addslashes($encpassword) . "', '" . addslashes($email) . "', '$profile1', '$profile2', '$profile3', '$profile4', '$profile5', '$profile6')";
    if ($CONFIG['log_mode']) {
        log_write('New user "'.addslashes($user_name).'" created on '.date("F j, Y, g:i a"),CPG_ACCESS_LOG);
    }
    $result = cpg_db_query($sql)

after, add

Code: [Select]
cpg_db_query("INSERT INTO {$CONFIG['TABLE_ALBUMS']} (`title`) VALUES ('".addslashes($user_name)."')");
Logged

Nibbler

  • Guest
Re: Member Album Request
« Reply #8 on: February 18, 2006, 05:45:27 pm »

No, it wont work with a bridge.
Logged

webfairy

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
Re: Member Album Request
« Reply #9 on: February 18, 2006, 08:50:56 pm »

Thank you.  appreciate   ;D
Logged

webfairy

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
Re: Member Album Request
« Reply #10 on: February 18, 2006, 11:24:32 pm »

Well exactly what is this Mod suspose to do?

I had a user register and log in and nothing happened.  even when they click the create album the suposidally action does not happen.

is not this suspose to automatacally make an album when they register?
Logged

Nibbler

  • Guest
Re: Member Album Request
« Reply #11 on: February 18, 2006, 11:29:08 pm »

It does what the OP requested. Check you applied the mod correctly. If it still does not work post a link to your site, enable registrations and debug mode.
Logged

webfairy

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
Re: Member Album Request
« Reply #12 on: February 19, 2006, 02:37:47 pm »

Ok,  How can I inow if I applyed the mod correctly if you won't tell  me exactly what to expect it to do.

From reading the original post they wanted an album in the users name to be automatacially created when the user resigestered...

This is where i inserted the new code.  After looking at it again and where you said to insert it I am not sure.
you say "after, add."  does this mean after the end of the top code or after a comma some where in the code?

Code: [Select]
                if ($CONFIG['enable_encrypted_passwords']) {
                        $encpassword = md5($password);
                } else {
                        $encpassword = $password;
                }

    $sql = "INSERT INTO {$CONFIG['TABLE_USERS']} ".
           "(user_regdate, user_active, user_actkey, user_name, user_password, user_email, user_profile1, user_profile2, user_profile3, user_profile4, user_profile5, user_profile6) ".
           "VALUES (NOW(), '$active', '$act_key', '" . addslashes($user_name) . "', '" . addslashes($encpassword) . "', '" . addslashes($email) . "', '$profile1', '$profile2', '$profile3', '$profile4', '$profile5', '$profile6')";
    if ($CONFIG['log_mode']) {
        log_write('New user "'.addslashes($user_name).'" created on '.date("F j, Y, g:i a"),CPG_ACCESS_LOG);
    }
    $result = cpg_db_query($sql);

[b]cpg_db_query("INSERT INTO {$CONFIG['TABLE_ALBUMS']} (`title`) VALUES ('".addslashes($user_name)."')");[/b]

    if ($CONFIG['reg_requires_valid_email']) {
        if (!$CONFIG['admin_activation']==1) { //user gets activation email
                                        $act_link = rtrim($CONFIG['site_url'], '/') . '/register.php?activate=' . $act_key;
                                        $template_vars = array(
                                                        '{SITE_NAME}' => $CONFIG['gallery_name'


It does what the OP requested. Check you applied the mod correctly. If it still does not work post a link to your site, enable registrations and debug mode.
Logged

webfairy

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
Re: Member Album Request
« Reply #13 on: February 19, 2006, 03:01:38 pm »

Here is link to site:

http://www.waterfowlmeetingplace.com/ourgallery/index.php

the register is on and the debug is on. for users
Logged

Nibbler

  • Guest
Re: Member Album Request
« Reply #14 on: February 19, 2006, 03:10:30 pm »

Judging by the debug output, you have not implemented this mod atall. Verify that you have actually editted and uploaded the file.
Logged

webfairy

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
Re: Member Album Request
« Reply #15 on: February 19, 2006, 03:41:06 pm »

Nibbler  could you please tell me how to do this.  I opened the register.php file and inserted the code. 

what do I have to do.

Also did I put th e code in the right place?

« Last Edit: February 20, 2006, 03:56:43 pm by webfairy »
Logged

AWJunkies

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
Re: Member Album Request
« Reply #16 on: February 21, 2006, 04:41:28 am »

[ b ] cpg_db_query("INSERT INTO {$CONFIG['TABLE_ALBUMS']} (`title`) VALUES ('".addslashes($user_name)."')");[ /b ]

it should be

cpg_db_query("INSERT INTO {$CONFIG['TABLE_ALBUMS']} (`title`) VALUES ('".addslashes($user_name)."')");

You have [ b ] and [ /b ] in there for some reason. This can work with bridge if you change your forum register and add this code only if databases are on same database system if not just grab the coppermine database info real quick and walla. I have it working with a bridge and a network (meaning not only a bridge but multiple sites 22 to be exact). I like this mod because everyone asks how to make an album or how to upload or what is going on. It just makes it easier for the users to just click upload and be able to upload right away. Then when they start to figure more things out they will see they can add more albums.

Please don't ask me how to make it work for a bridge!

Thanks Nibbler as always.
« Last Edit: February 21, 2006, 01:47:31 pm by Nibbler »
Logged

webfairy

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
Re: Member Album Request
« Reply #17 on: February 21, 2006, 01:43:44 pm »

AW, thanks.. but I have a couple of questions...

I do not see any change in the two you did below.  am I blind or what?  :)

I also need to know EXACCTLY where to put this. 

log_write('New user "'.addslashes($user_name).'" created on '.date("F j, Y, g:i a"),CPG_ACCESS_LOG);
    }
    $result = cpg_db_query($sql);

Do i put it exactly after the ($sql) and before the ;?    if so that leaves two ;'s at the end.  is that an and sign? 

AW, is the mod for a bridge so difficult?  I have both my forum and album on the same host. So I think i can use the same data base for the album.  I have not even tryed to bridge this yet...  If i can't get a couple of simple mods to work I am not ready to try bridging. LOL

Please post the mod you did for "databases are on same database system" just in case.   but you can put this on the back burner and do it in your spare time or when you get a block on another mod and just need to look at something else.  :)


cpg_db_query("INSERT INTO {$CONFIG['TABLE_ALBUMS']} (`title`) VALUES ('".addslashes($user_name)."')");

it should be

cpg_db_query("INSERT INTO {$CONFIG['TABLE_ALBUMS']} (`title`) VALUES ('".addslashes($user_name)."')");

You have and in there for some reason. This can work with bridge if you change your forum register and add this code only if databases are on same database system if not just grab the coppermine database info real quick and walla. I have it working with a bridge and a network (meaning not only a bridge but multiple sites 22 to be exact). I like this mod because everyone asks how to make an album or how to upload or what is going on. It just makes it easier for the users to just click upload and be able to upload right away. Then when they start to figure more things out they will see they can add more albums.

Please don't ask me how to make it work for a bridge!

Thanks Nibbler as always.
« Last Edit: February 21, 2006, 01:53:28 pm by webfairy »
Logged

Nibbler

  • Guest
Re: Member Album Request
« Reply #18 on: February 21, 2006, 01:50:56 pm »

I've adjusted AWJunkies's post so that the bbcode is visible.

I also need to know EXACCTLY where to put this. 

log_write('New user "'.addslashes($user_name).'" created on '.date("F j, Y, g:i a"),CPG_ACCESS_LOG);
    }
    $result = cpg_db_query($sql);

You don't put it anywhere, leave it exactly where it is and add the new line of code after it.
Logged

webfairy

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
Re: Member Album Request
« Reply #19 on: February 21, 2006, 02:24:16 pm »

Thanks.  I was just confused by the after , add
and that little , in there.  sorry. 

Thanks again for the great mod.

 
I've adjusted AWJunkies's post so that the bbcode is visible.

You don't put it anywhere, leave it exactly where it is and add the new line of code after it.
Logged
Pages: [1] 2   Go Up
 

Page created in 0.025 seconds with 20 queries.