Filename ⇒ File title - ONLY rename those without a title...? Filename ⇒ File title - ONLY rename those without a title...?
 

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

Filename ⇒ File title - ONLY rename those without a title...?

Started by ashsimmonds, August 01, 2007, 12:44:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ashsimmonds

i assume this shouldn't be too difficult... i would like to have it so that when i run a batch command from the Admin Tools which updates File Titles to whatever the FileName is, that it ONLY updates those where a title doesn't exist.

i *almost* pressed the button on my whole gallery before i thought of this, so i tested on a single album and found that this tool overwrites existing Titles, would rather not do that.

Nibbler

util.php, change

$query = cpg_db_query("UPDATE {$CONFIG['TABLE_PICTURES']} SET title = '$newtitle' WHERE pid = '$pid'");

to

$query = cpg_db_query("UPDATE {$CONFIG['TABLE_PICTURES']} SET title = '$newtitle' WHERE pid = '$pid' AND title = ''");

ashsimmonds

excellent!  thankyou very much. :)

fwiw, i think this should be standard behaviour.

also, it still lists all the files *as if* it changed them, but doesn't change them.  probly easy enough to fix but it werks good enough for me for now.

Joachim Müller

Quote from: ashsimmonds on August 01, 2007, 02:22:07 PM
fwiw, i think this should be standard behaviour.
You're right: I've added this to the todo list of the dev team (provide a checkbox that is labelled something like "only apply this if the file name field is empty" or similar and apply the needed code changes).