coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 permissions => Topic started by: charlie99 on November 26, 2006, 02:47:23 PM

Title: User albums private by default
Post by: charlie99 on November 26, 2006, 02:47:23 PM
Hi
I start this as a new topic, because i dont see any action in another similar topic. I just want all new user albums members are creating as private by a default value (only me). With a possibility to change that by them selves later if they want.

I played little with modify_album.php, changed some hidden values to 10002 and tried even in the database but with no luck so i have changed all back again.

Perhaps i played with wrong file or wrong place or it needs changes on more than one file? Anyway this should not be very difficult to solve, tell me if i'm wrong, but i need help, Please!

Congratulations to a fantastic gallery script!
Regards,Charlie
Title: Re: User albums private by default
Post by: Sami on November 26, 2006, 09:53:55 PM
Then play with delete.php ;)
look for case albmgr: and add visibility and its value to mysql insert query
Hope you got the idea
Title: Re: User albums private by default
Post by: charlie99 on November 26, 2006, 11:14:32 PM
Sorry, i dont get it!
Perhaps you can explane little more when and if you have time to it.
Title: Re: User albums private by default
Post by: Nibbler on November 27, 2006, 12:46:58 AM
The insert query should look similar to this:

$query = "INSERT INTO {$CONFIG['TABLE_ALBUMS']} (category, title, uploads, pos, description) VALUES ('$category', '".addslashes($op['album_nm'])."', 'NO',  '{$op['album_sort']}', '')";

You can change that to

if (GALLERY_ADMIN_MODE){           
$query = "INSERT INTO {$CONFIG['TABLE_ALBUMS']} (category, title, uploads, pos, description) VALUES ('$category', '".addslashes($op['album_nm'])."', 'NO',  '{$op['album_sort']}', '')";   
} else {
$query = "INSERT INTO {$CONFIG['TABLE_ALBUMS']} (category, title, uploads, pos, description, visibility) VALUES ('$category', '".addslashes($op['album_nm'])."', 'NO',  '{$op['album_sort']}', '', " . (FIRST_USER_CAT + USER_ID) . ")";
}


to mean "me only" for user albums.
Title: Re: User albums private by default
Post by: charlie99 on November 27, 2006, 08:21:16 AM
Thanks Nibbler
This worked fine. I now have the gallery exactly as i want it! Great!!
Title: Re: User albums private by default
Post by: Joachim Müller on November 27, 2006, 08:56:50 AM
Glad your issue is solved. Just for clarification: in Coppermine terms, the thread subject might be a bit misleading, as "me only" means exactly what it says: the pics in an album that is set to "me only" will only be visible for the user who owns the album. No other user (except the admin) will be able to view the pics contained in that album. Most users won't realize that their pics is not visible for the public and therefor won't edit the permissions. Subsequently, they will wonder why their pics don't get viewed at all.
The settings mentioned in this thread are not recommended at all, as most gallery owners like to have as many hits as possible.

Title: Re: User albums private by default
Post by: natrlhy on November 27, 2006, 09:06:23 AM
I tried replacing the mentioned query string in delete.php in two places that the string appeared in and it did not work. I must be modifying the wrong file?

I tried creating a new album logged in as myself as well as through uploading a file via the XP Publishing Wizard. Both still created an album that was viewable by Everybody.

Thanks!
Title: Re: User albums private by default
Post by: Sami on November 27, 2006, 11:40:09 AM
This hack doesn't apply to uploaded file by XP publishing wizard
Title: Re: User albums private by default
Post by: natrlhy on November 29, 2006, 06:33:58 PM
Thanks for the clarification Sami,

I'm still on the hunt for a way for when any user creates an album it is automatically created to be only viewable by the Registered users group.

Thanks!