Batch add files question Batch add files question
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Batch add files question

Started by MarioKnight, October 04, 2013, 02:48:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MarioKnight

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.  =)

Αndré

We'd need to adjust the database query which fetch the albums from the database.

Αndré

This should work. Open include/functions.inc.php, find
$result = cpg_db_query("SELECT aid, title, category FROM {$CONFIG['TABLE_ALBUMS']} ORDER BY pos");
and replace with
$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");

MarioKnight

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!

Αndré

Of course, sorry. I'll update the query as soon as possible, probably not earlier than Monday.

MarioKnight

Works for me, I'll keep an eye out for it.  Thanks!

Αndré

This should work as expected:
$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");

MarioKnight

This works perfectly!  Thank you!  =D