coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 permissions => Topic started by: brainstormer on June 16, 2008, 08:38:23 PM

Title: [Solved]: Wanted: New album defaults to "Registered users" instead of "Everyone"
Post by: brainstormer on June 16, 2008, 08:38:23 PM
I want to change the default permissions of new album defaults to "Registered users" instead of "Everyone". I already uses phpMyAdmin to modify the visibility column in table cpg14x_albums from 0 (Everyone) to 2 (Registered).

I figured the new album defaults must be hard coded in albmgr.php file, so in function Album_Create() section I changed make_option("<?php echo $lang_albmgr_php['new_album'?>", make_value('2', "<?php echo $lang_albmgr_php['new_album'?>", album_sort, '1'), to, to_pos);
to
make_option("<?php echo $lang_albmgr_php['new_album'?>", make_value('0', "<?php echo $lang_albmgr_php['new_album'?>", album_sort, '1'), to, to_pos);

Note new value was changed from 0 to 2 here

make_value('0',

but that had no effect. Any help is appreciated.
Title: Re: Wanted: New album defaults to "Registered users" instead of "Everyone"
Post by: Nibbler on June 16, 2008, 08:50:31 PM
Either change the default value of the visibility field in the albums table using phpmyadmin or modify the query in delete.php


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


to


$query = "INSERT INTO {$CONFIG['TABLE_ALBUMS']} (category, title, uploads, pos, description, visibility) VALUES ('$category', '" . addslashes($op['album_nm']) . "', 'NO',  '{$op['album_sort']}', '', 2)";
Title: Re: Wanted: New album defaults to "Registered users" instead of "Everyone"
Post by: brainstormer on June 16, 2008, 09:51:17 PM
That worked, but I wish this was available from the config page.
Title: Re: Wanted: New album defaults to "Registered users" instead of "Everyone"
Post by: brainstormer on June 16, 2008, 09:55:58 PM
For any other interested folks, in phpMyAdmin:

ALTER TABLE `cpg14x_albums` CHANGE `visibility` `visibility` INT( 11 ) NOT NULL DEFAULT '2'
Title: Re: [Solved]: Wanted: New album defaults to "Registered users" instead of "Everyone"
Post by: Takako on August 14, 2008, 11:32:35 AM
Thanks guys the above code was just what I needed.

Another question.
What would be the SQL query if I wanted to change all the existing albums(1400+) to be restricted to registered users only? Is it possible?
(I have already integrated my gallery with my phpbb3 forum)
Title: Re: [Solved]: Wanted: New album defaults to "Registered users" instead of "Every
Post by: Joachim Müller on August 14, 2008, 11:42:13 AM
Quote from: Takako on August 14, 2008, 11:32:35 AM
Another question.
You're not allowed to post "another question", as we have a strict "one question per thread" policy that you agreed to respect when signing up. Locking thread.

Quote from: Takako on August 14, 2008, 11:32:35 AM
What would be the SQL query if I wanted to change all the existing albums(1400+) to be restricted to registered users only?
Don't run silly queries - use the permissions built into coppermine.