forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 permissions => Topic started by: Αndré on January 17, 2014, 02:03:05 pm

Title: Changing permissions on multiple categories
Post by: Αndré on January 17, 2014, 02:03:05 pm
Due to the site outage (http://forum.coppermine-gallery.net/index.php/topic,77004.0.html) we lost an already solved thread which could be useful for other people, that's why I post it again.

It's currently still available in Google's cache: http://webcache.googleusercontent.com/search?q=cache:yEYhzWPIEIUJ:forum.coppermine-gallery.net/index.php%3Ftopic%3D77007.0+&cd=2&hl=de&ct=clnk&gl=de&client=firefox-a


Question:
Quote from: Trickydicky
Just installed my first gallery. Have created a number of categories using mass import. Is there a way to permission all the categories in one go? I want to allow registered users to create albums in all of them.


Solution:
Quote from: Αndré
There's no interface to do that. If you want to do it in batch, you'd need to run an appropriate SQL query (e.g. with phpMyAdmin). This should work:
Code: [Select]
INSERT IGNORE INTO `cpg15x_categorymap` (SELECT cid, '2' FROM `cpg15x_categories` WHERE cid > 1);


Additional question:
Quote from: Trickydicky
Many thanks I'll try that when I have access.

One more unrelated question - we bulk imported some albums (empty) but have changed our minds about the structure - is there a way to delete them in bulk?


Solution:
Quote from: Αndré
SQL query:
Code: [Select]
DELETE FROM `cpg15x_albums` WHERE aid NOT IN (SELECT DISTINCT aid FROM `cpg15x_pictures`)