Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Filename ⇒ File title - ONLY rename those without a title...?  (Read 2851 times)

0 Members and 1 Guest are viewing this topic.

ashsimmonds

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
    • Aussie Exotics

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.
« Last Edit: August 01, 2007, 02:55:53 pm by Nibbler »
Logged

Nibbler

  • Guest
Re: Filename ⇒ File title - ONLY rename those without a title...?
« Reply #1 on: August 01, 2007, 01:45:17 pm »

util.php, change

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

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

ashsimmonds

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
    • Aussie Exotics
Re: Filename ⇒ File title - ONLY rename those without a title...?
« Reply #2 on: August 01, 2007, 02:22:07 pm »

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.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Filename ⇒ File title - ONLY rename those without a title...?
« Reply #3 on: August 01, 2007, 07:09:52 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).
Logged
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 20 queries.