Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: [Solved]: Wanted: New album defaults to "Registered users" instead of "Everyone"  (Read 4127 times)

0 Members and 1 Guest are viewing this topic.

brainstormer

  • Coppermine newbie
  • Offline Offline
  • Posts: 7

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
Code: [Select]
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
Code: [Select]
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

Code: [Select]
make_value('0',
but that had no effect. Any help is appreciated.
« Last Edit: June 16, 2008, 09:57:38 pm by Nibbler »
Logged

Nibbler

  • Guest

Either change the default value of the visibility field in the albums table using phpmyadmin or modify the query in delete.php

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

to

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

brainstormer

  • Coppermine newbie
  • Offline Offline
  • Posts: 7

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

brainstormer

  • Coppermine newbie
  • Offline Offline
  • Posts: 7

For any other interested folks, in phpMyAdmin:

Code: [Select]
ALTER TABLE `cpg14x_albums` CHANGE `visibility` `visibility` INT( 11 ) NOT NULL DEFAULT '2'
Logged

Takako

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26

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)
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de

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.
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 19 queries.