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: Mass edit album properties / change the default album properties  (Read 3796 times)

0 Members and 1 Guest are viewing this topic.

cesari0

  • Coppermine newbie
  • Offline Offline
  • Posts: 5

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.
« Last Edit: April 23, 2007, 04:59:18 pm by Nibbler »
Logged

Nibbler

  • Guest
Re: Mass edit album properties / change the default album properties
« Reply #1 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:

Code: [Select]
UPDATE cpg_albums SET uploads = 'YES'
Logged

cesari0

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Mass edit album properties / change the default album properties
« Reply #2 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

Logged

cesari0

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Mass edit album properties / change the default album properties
« Reply #3 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
Logged

cesari0

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Mass edit album properties / change the default album properties
« Reply #4 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


Logged

Nibbler

  • Guest
Logged

cesari0

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Mass edit album properties / change the default album properties
« Reply #6 on: April 24, 2007, 01:15:28 pm »

problem solved. feel free to lock down the topic  8)
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 16 queries.