Mass edit album properties / change the default album properties Mass edit album properties / change the default album properties
 

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]

Main Menu

Mass edit album properties / change the default album properties

Started by cesari0, April 23, 2007, 01:49:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

cesari0

I'm making a gallery with quite a lot of categories and lots of albums under each category. The thing is when an album is created inside a category, the default options is set to 'no' for "Visitors can upload files ".
I know you can edit the properties of an album and change it.

But it's not really easy work to change the settings for each new album created. Is there a way to mass edit the album properties of all the albums or change the default settings of newly created albums to allow visitors to upload files?

I searched for an answer but couldn't find one. Just spent around an hour reading stuff here but no luck. Help would be appreciated.

Nibbler

Both things are possible. Changing the default permissions is already posted - search the board.

To mass change existing albums, run an SQL query:

UPDATE cpg_albums SET uploads = 'YES'

cesari0

Just searched again. Still couldn't find how to change the default settings. Could you tell how to do it? :-\

I need to change the default, so i don't have to do the database modification each time


cesari0

by the way it's:

UPDATE cpg1410_albums SET uploads = 'YES'

the tables are prefixed with the version number i think with the default install

cesari0

Figured out how to do it somehow:

file to edit:
root/cpg/delete.php
-----------------------------------------------------------------------
original code:
$query = "INSERT INTO {$CONFIG['TABLE_ALBUMS']} (category, title, uploads, pos, description) VALUES ('$category', '" . addslashes($op['album_nm']) . "', 'NO',  '{$op['album_sort']}', '')";
------------------------------------------------------------------------
edited code:
$query = "INSERT INTO {$CONFIG['TABLE_ALBUMS']} (category, title, uploads, pos, description) VALUES ('$category', '" . addslashes($op['album_nm']) . "', 'YES',  '{$op['album_sort']}', '')";


========================================================

This does the trick. And the SQL query Nibbler mentioned works for updating the already existing albums.

A question though. Is it how this is supposed to be done?  ;D I don't know coz I figured this on my own.  :P




cesari0