Member Album Request Member Album Request
 

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

Member Album Request

Started by lupus2k5, January 30, 2006, 03:46:42 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lupus2k5

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

Nibbler

Edit register.php, find


    $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

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

lupus2k5


lupus2k5

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!

Joachim Müller

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.

lupus2k5

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.

Joachim Müller

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.

webfairy

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


Quote from: Nibbler on January 30, 2006, 03:15:32 PM
Edit register.php, find


    $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

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

Nibbler

No, it wont work with a bridge.

webfairy


webfairy

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?

Nibbler

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.

webfairy

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?

                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'



Quote from: Nibbler 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.

webfairy

Here is link to site:

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

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

Nibbler

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

webfairy

#15
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?


AWJunkies

#16
[ 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.

webfairy

#17
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.  :)


Quote from: AWJunkies on February 21, 2006, 04:41:28 AM
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.

Nibbler

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

Quote from: webfairy on February 21, 2006, 01:43:44 PM
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.

webfairy

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

Thanks again for the great mod.


Quote from: Nibbler on February 21, 2006, 01:50:56 PM
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.