forum.coppermine-gallery.net
Support => cpg1.4.x Support => Older/other versions => cpg1.4 permissions => Topic started 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.
-
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)";
-
That worked, but I wish this was available from the config page.
-
For any other interested folks, in phpMyAdmin:
ALTER TABLE `cpg14x_albums` CHANGE `visibility` `visibility` INT( 11 ) NOT NULL DEFAULT '2'
-
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)
-
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.
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.