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 Picture  (Read 2522 times)

0 Members and 1 Guest are viewing this topic.

kenshiro

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Batch add Picture
« on: March 12, 2004, 04:31:29 pm »

Hi, There are a way when i make batch add picture, add a title of image equal to filename ?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Batch add Picture
« Reply #1 on: March 13, 2004, 12:10:01 pm »

not with the batch-add function, but you can use the "resize pictures" link in the admin menu to batch-rename pics in a folder.

GauGau
Logged

sharks

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Batch add Picture
« Reply #2 on: March 15, 2004, 01:58:49 am »

lol, I was looking for this the day before you posted... I didn't expect it under 'Resize Pictures!'  :D

I may as well post the way I came up with in case anyone wants a quick way if they are adding pictures frequently to lots of albums.

It's an SQL query - you need to have phpmyadmin or some other access to run SQL queries on MySQL.

Code: [Select]
update cpg11d_pictures set cpg11d_pictures.title =
SUBSTRING_INDEX(cpg11d_pictures.filename, '.', 1);


It simply sets the title to the filename without the extension. It works for filenames with only one '.' in them

If you want to keep existing titles, this should work:

Code: [Select]
update cpg11d_pictures set cpg11d_pictures.title =
SUBSTRING_INDEX(cpg11d_pictures.filename, '.', 1)
where cpg11d_pictures.title = ''
Logged
Pages: [1]   Go Up
 

Page created in 0.025 seconds with 15 queries.