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: Is it possible to edit pictures titles and descriptions in batch?  (Read 2997 times)

0 Members and 1 Guest are viewing this topic.

Fab

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 29
Is it possible to edit pictures titles and descriptions in batch?
« on: September 04, 2006, 11:13:35 am »

I have to add titles and descritions to close to a thousand pictures, a lot of them will have the same title and description.

Is it possible to edit the pictures titles and descriptions in batch? maybe with a plugin or straight from a file.
Logged

ralfs

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 37
Re: Is it possible to edit pictures titles and descriptions in batch?
« Reply #1 on: September 04, 2006, 03:31:23 pm »

Hi.

In your case I would go the direct way:
Run phpmyadmin, take your database.
Then 'SQL' and enter

Update cpg_pictures
  SET title = x
  WHERE aid = y

Regards,
Ralf
Logged

Fab

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 29
Re: Is it possible to edit pictures titles and descriptions in batch?
« Reply #2 on: September 04, 2006, 07:50:03 pm »

Thanks Ralf, but I need some clarification.

Let say I want to set title to "RED" for  pictures named redpic001 to redpic150

What should I type?

And can I use the same method for keywords?
« Last Edit: September 04, 2006, 08:05:37 pm by Fab »
Logged

ralfs

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 37
Re: Is it possible to edit pictures titles and descriptions in batch?
« Reply #3 on: September 04, 2006, 11:50:34 pm »

Hmm,

Ok, there might be special SQL terms where these things could be done, but I don't know much more than the 'standard command calls' in SQL.
You could try regular expressions in your SQL query:

Update cpg_pictures
  SET title = 'x'
  WHERE filename REGEXP 'xyz'

Without trying it, I think, in your special case REGEXP '^redpic[0-1][0-5][0-9]' would output 'redpic000.jpg' to 'redpic159.jpg'
So you could have a deeper look into SQL syntax, regular expressions & co. or you try something totally different:

Create a new temporary album. Move all pictures, which have something in common such as title, to that album. After batch update via SQL, as I described in my first answer, you can move them back where they came from.

It doesn't matter, what you do: you have to address exactly these files, you want to change. Be it via a special REGEXP in an SQL call or be it by placing all relevant pictures in a temporary album (where aid = xyz).

And: Of course, you can use any field in your table, also the keywords field:
Update cpg_pictures
   SET title = 'x'
   WHERE keywords REGEXP 'xyz'

Regards,
Ralf

Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Is it possible to edit pictures titles and descriptions in batch?
« Reply #4 on: September 05, 2006, 03:18:00 am »

Be extra carefull when messing with the database in phpMyAdmin. Make sure to backup everything before trying, as  there's a great danger of ruining your entire site running a query that gies wrong.
Logged

Fab

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 29
Re: Is it possible to edit pictures titles and descriptions in batch?
« Reply #5 on: September 05, 2006, 05:18:59 am »

Be extra carefull when messing with the database in phpMyAdmin. Make sure to backup everything before trying, as  there's a great danger of ruining your entire site running a query that gies wrong.

Yes I know, I think I will install another gallery to experiment.

Before I try this are there any other alternatives to batch edit titles?

Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 21 queries.