coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 permissions => Topic started by: cesari0 on April 23, 2007, 01:49:08 PM

Title: Mass edit album properties / change the default album properties
Post by: cesari0 on April 23, 2007, 01:49:08 PM
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.
Title: Re: Mass edit album properties / change the default album properties
Post by: Nibbler on April 23, 2007, 01:51:05 PM
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'
Title: Re: Mass edit album properties / change the default album properties
Post by: cesari0 on April 23, 2007, 03:05:44 PM
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

Title: Re: Mass edit album properties / change the default album properties
Post by: cesari0 on April 23, 2007, 03:14:18 PM
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
Title: Re: Mass edit album properties / change the default album properties
Post by: cesari0 on April 23, 2007, 03:34:26 PM
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


Title: Re: Mass edit album properties / change the default album properties
Post by: Nibbler on April 23, 2007, 04:58:10 PM
That is correct. See http://forum.coppermine-gallery.net/index.php?topic=31034.0
Title: Re: Mass edit album properties / change the default album properties
Post by: cesari0 on April 24, 2007, 01:15:28 PM
problem solved. feel free to lock down the topic  8)