forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 upload => Topic started by: MarioKnight on October 04, 2013, 02:48:33 pm

Title: Batch add files question
Post by: MarioKnight on October 04, 2013, 02:48:33 pm
I'm not having any problems, this has been working wonderfully so far.  As I am in the process of importing ~600 albums with ~300 in queue to process once I'm caught up, I was just curious if there was any way to only show empty albums in the batch add files drop down menu instead of all of them.  I couldn't find any information in searching, so I hope this is something that can be done.  If not, it's no big deal, would just be a help.  I'm very happy with this software.  =)
Title: Re: Batch add files question
Post by: Αndré on October 04, 2013, 04:43:30 pm
We'd need to adjust the database query which fetch the albums from the database.
Title: Re: Batch add files question
Post by: Αndré on October 04, 2013, 04:49:46 pm
This should work. Open include/functions.inc.php, find
Code: [Select]
$result = cpg_db_query("SELECT aid, title, category FROM {$CONFIG['TABLE_ALBUMS']} ORDER BY pos");and replace with
Code: [Select]
$result = cpg_db_query("SELECT a.aid, a.title, a.category FROM {$CONFIG['TABLE_ALBUMS']} AS a INNER JOIN {$CONFIG['TABLE_PICTURES']} AS p ON a.aid = p.aid ORDER BY pos");
Title: Re: Batch add files question
Post by: MarioKnight on October 04, 2013, 08:01:07 pm
Thank you for the quick response!  However it looks like this filters out the opposite as intended, as only albums with pictures show in the drop-down instead of albums without pictures.  Though I see what 's being attempted, My SQL is a bit rusty on how this can be tweaked to reverse the results.  This is certainly appreciated though!
Title: Re: Batch add files question
Post by: Αndré on October 04, 2013, 08:22:33 pm
Of course, sorry. I'll update the query as soon as possible, probably not earlier than Monday.
Title: Re: Batch add files question
Post by: MarioKnight on October 05, 2013, 03:48:10 am
Works for me, I'll keep an eye out for it.  Thanks!
Title: Re: Batch add files question
Post by: Αndré on October 07, 2013, 03:19:39 pm
This should work as expected:
Code: [Select]
$result = cpg_db_query("SELECT aid, title, category FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid NOT IN (SELECT aid FROM {$CONFIG['TABLE_PICTURES']}) ORDER BY pos");
Title: Re: Batch add files question
Post by: MarioKnight on October 09, 2013, 02:44:41 am
This works perfectly!  Thank you!  =D