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: the alt tag  (Read 3230 times)

0 Members and 1 Guest are viewing this topic.

grantson

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
the alt tag
« on: October 14, 2010, 04:31:47 pm »


Been pulling my hair out for a few days wondering why google tells me the most prevalent keyword on my page is .jpg
(it shouldnt be crawling thumbnails.php but never mind)

I had a quick search on how to change the alt tag from the filename under 1.5x and could only find the following abandoned post
http://forum.coppermine-gallery.net/index.php/topic,66104.msg328686.html#msg328686


whether its to the album name, website url or even just the filename without the extenion any help on this one would be apreciated

Grant
www.magicmirrorphoto.co.uk/gallery
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: the alt tag
« Reply #1 on: October 14, 2010, 05:02:54 pm »

What exactly do you want to achieve?
Logged

grantson

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
Re: the alt tag
« Reply #2 on: October 14, 2010, 05:59:44 pm »

as i say at the moment the alt text for each picture in my gallery is #####.jpg
which is screwing up the keywords when the site is crawled by the search engines

im just looking to edit the alt text for each picture whether there is a method to trim off .jpg or change it entirely
without having to edit several hundred manually

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: the alt tag
« Reply #3 on: October 14, 2010, 06:23:10 pm »

im just looking to edit the alt text for each picture whether there is a method to trim off .jpg or change it entirely
It's an easy task to trim the file extension. If that's the solution you want I'll come up with a code snippet. If you want to change it entirely, please specify what exactly should be used.
Logged

grantson

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
Re: the alt tag
« Reply #4 on: October 14, 2010, 06:45:20 pm »

go for trimming the file extension
i  can always use it for guidance later :)   
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: the alt tag
« Reply #5 on: October 15, 2010, 11:01:22 am »

Open include/functions.inc.php, find
Code: [Select]
            $thumb_list[$i]['image']        = '<img src="' . $pic_url . '" class="image" ' . $image_size['geom'] . ' border="0" alt="' . $row['filename'] . '" title="' . $pic_title . '" />';and replace with
Code: [Select]
            $row['fileinfo'] = pathinfo($row['filename']);
            $thumb_list[$i]['image']        = '<img src="' . $pic_url . '" class="image" ' . $image_size['geom'] . ' border="0" alt="' . basename($row['filename'], '.'.$row['fileinfo']['extension']) . '" title="' . $pic_title . '" />';
Logged

grantson

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
Re: the alt tag
« Reply #6 on: October 15, 2010, 05:32:00 pm »

Andre as always top notch :)

thats another beer I owe you lol
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 19 queries.