the alt tag the alt tag
 

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

the alt tag

Started by grantson, October 14, 2010, 04:31:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

grantson


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

Αndré

What exactly do you want to achieve?

grantson

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


Αndré

Quote from: grantson on October 14, 2010, 05:59:44 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.

grantson

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

Αndré

Open include/functions.inc.php, find
            $thumb_list[$i]['image']        = '<img src="' . $pic_url . '" class="image" ' . $image_size['geom'] . ' border="0" alt="' . $row['filename'] . '" title="' . $pic_title . '" />';
and replace with
            $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 . '" />';

grantson

Andre as always top notch :)

thats another beer I owe you lol