[Solved]: Wanted: New album defaults to "Registered users" instead of "Everyone" [Solved]: Wanted: New album defaults to "Registered users" instead of "Everyone"
 

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

[Solved]: Wanted: New album defaults to "Registered users" instead of "Everyone"

Started by brainstormer, June 16, 2008, 08:38:23 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

brainstormer

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.

Nibbler

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

brainstormer

That worked, but I wish this was available from the config page.

brainstormer

For any other interested folks, in phpMyAdmin:

ALTER TABLE `cpg14x_albums` CHANGE `visibility` `visibility` INT( 11 ) NOT NULL DEFAULT '2'

Takako

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)

Joachim Müller

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.