Advanced search  

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

Pages: [1]   Go Down

Author Topic: Batch add files question  (Read 5809 times)

0 Members and 1 Guest are viewing this topic.

MarioKnight

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Batch add files question
« 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.  =)
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Batch add files question
« Reply #1 on: October 04, 2013, 04:43:30 pm »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Batch add files question
« Reply #2 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");
Logged

MarioKnight

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Batch add files question
« Reply #3 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!
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Batch add files question
« Reply #4 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.
Logged

MarioKnight

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Batch add files question
« Reply #5 on: October 05, 2013, 03:48:10 am »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Batch add files question
« Reply #6 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");
Logged

MarioKnight

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Batch add files question
« Reply #7 on: October 09, 2013, 02:44:41 am »

This works perfectly!  Thank you!  =D
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 21 queries.