Hack for coppermine albums to automatically fill in personal gallery for new reg Hack for coppermine albums to automatically fill in personal gallery for new reg
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Hack for coppermine albums to automatically fill in personal gallery for new reg

Started by ninoo, January 08, 2012, 10:33:49 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

ninoo

Hello everyone
sorry for my bad English, but I need your big help.
1.5 I installed coppermine on my site but I would change it so it automatically when a user registers you create a personal gallery with three personal albums Type A, B, C. I know that coppermine does not allow this, but I think we can make anda small hack to automatically create them.
Thanks for your help
greetings from italy

Αndré

Open register.php, find
    // Create a personal album if corresponding option is enabled
    if ($CONFIG['personal_album_on_registration'] == 1) {

        $catid = mysql_insert_id() + FIRST_USER_CAT;
        cpg_db_query("INSERT INTO {$CONFIG['TABLE_ALBUMS']} (`title`, `category`) VALUES ('$user_name', $catid)");
    }

and replace with something like
    // Create a personal album if corresponding option is enabled
    if ($CONFIG['personal_album_on_registration'] == 1) {

        $catid = mysql_insert_id() + FIRST_USER_CAT;
        cpg_db_query("INSERT INTO {$CONFIG['TABLE_ALBUMS']} (`title`, `category`) VALUES ('Type A', $catid)");
        cpg_db_query("INSERT INTO {$CONFIG['TABLE_ALBUMS']} (`title`, `category`) VALUES ('Type B', $catid)");
        cpg_db_query("INSERT INTO {$CONFIG['TABLE_ALBUMS']} (`title`, `category`) VALUES ('Type C', $catid)");
    }


Don't forget to enable the option "Create user album in personal gallery on registration" in the config.

Additionally, you want to apply the same mod to usermgr.php.

ninoo

Thanks you are great, but I can not enable the "Create user albums in personal gallery on registration" 'cause I use a bridge that disables this option.
Do you have any idea to solve the problem?

thanks

Αndré

If your gallery is bridged the registration process is completely handled by your board application. Coppermine doesn't know when a new user is registered, so you'll have to modify your board application to create the albums in the Coppermine database. I cannot help you any further with that issue, as I don't know your board application (whichever you use).

ninoo

I use as a bridge "purple_cpg_bridge - A plugin to form a bridge between e107 and Coppermine" (http://www.purplescroll.com)
Use e107 and coppermine with purple_cpg_bridge.  :-\

I see the solution to this problem very difficult if not impossible for me  :'(
thanks for all the information I gave  ;) :)

ninoo

very well. OK it works! :)

I added making modifying Αndré works with the bridge.

The solution 'lies in the very simple to manage groups directly from the bridge and also reads automatically the changes to the management of albums.

Here is the result www.smallbigmedia.net or www.smallbigmedia.com

Thanks to all, especially Αndré.

Αndré

Quote from: Joachim Müller on September 28, 2008, 12:46:26 PM
Resolve your threads
If you have found an answer to your question, resolve your thread. Don't just post "I have found the answer", but tell others what you actually did to solve your issues. Posting a link to the page where you found the answer might help. Describing what you did might help as well. Finally, you can tag your answer as "solved" by clicking on the "Topic Solved" button on the bar at the left hand side at the bottom of your thread.

Please post the code changes and mark your thread as solved. Thanks.

ninoo

OK
in practice:

1) Activate the tunnel with the bridge and configure it all.
2) Turn off the bridge
3) Edit the register.php as explained by Αndré
4) Activate the bridge

The system is not 'scientific but it works very well:)

Hello

ninoo

The problem that this technique works only if you walk into the gallery as a group administrator, but not as a user group. How can 'do? I can not give permission to all administrators and make them. I need to find a solution to this problem

Αndré

Sorry, but I neither comprehend your tutorial nor what it has to do with "group administrator" or "user group". I thought you need to
Quote from: ninoo on January 08, 2012, 10:33:49 AM
automatically when a user registers you create a personal gallery with three personal albums Type A, B, C.
?

B3000

Quote from: Αndré on January 10, 2012, 04:31:20 PM

Additionally, you want to apply the same mod to usermgr.php.

I´ve made the same thing that it now creates a couple of albums automatically with registration.

However, as a regular user I can´t see these and can not modify them. I only can see albums that I - as a regular user - have created by myself.
When I am logged in as a different user I can see these automatically created albums from other users but not mine.

Refering to the quote above: I did not know how to apply the same mod to usermgr.php - but I don´t think this is the solution. Am I wrong?

Αndré

Try
    // Create a personal album if corresponding option is enabled
    if ($CONFIG['personal_album_on_registration'] == 1) {
        $user_id = mysql_insert_id();
        $catid = $user_id + FIRST_USER_CAT;
        cpg_db_query("INSERT INTO {$CONFIG['TABLE_ALBUMS']} (`title`, `category`, `owner`) VALUES ('Type A', $catid, $user_id)");
        cpg_db_query("INSERT INTO {$CONFIG['TABLE_ALBUMS']} (`title`, `category`, `owner`) VALUES ('Type B', $catid, $user_id)");
        cpg_db_query("INSERT INTO {$CONFIG['TABLE_ALBUMS']} (`title`, `category`, `owner`) VALUES ('Type C', $catid, $user_id)");
    }

Αndré

Quote from: B3000 on November 29, 2012, 02:10:08 PM
I did not know how to apply the same mod to usermgr.php - but I don´t think this is the solution.

You just need to apply the mod to that file if you create users manually (= if they don't register themselves). The mod looks very similar, just search for $CONFIG['personal_album_on_registration'].

B3000

Oh yeah, this helped for  new registrations.

But: I have encountered a different problem now. The captcha did not show up on the registration page - so I had do disable this option in the settings to be able to create a new account - to see if the new code works for new users.

Αndré

Quote from: Joachim Müller on September 28, 2008, 10:28:42 AM
10. One question per thread
We have a strict "One question/issue per thread rule", which helps both supporters/moderators to keep track of open/closed issues as well as users who search the board or browse it, looking for answers to their question. Don't try to "hijack" other's threads by posting unrelated questions to an existing thread.