Gallery and SEO - ALT for images Gallery and SEO - ALT for images
 

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]

Main Menu

Gallery and SEO - ALT for images

Started by pea32ant, March 06, 2006, 10:38:29 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pea32ant

How to add automatically each image title to be in <IMAGE ALT=TITLE> attribute?

Stramm

from themes/sample/theme.php copy to the theme.php your using the function theme_html_picture()

find tin that function
            $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
and replace with
            $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']} {$CURRENT_PIC_DATA['title']}\" /><br />";

pea32ant

thank you very much for very fast reply!!!    but I modified output code to:
$pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\" {$CURRENT_PIC_DATA['title']} \n {$CURRENT_PIC_DATA['caption']}\" /><br />";

and another question:
how to do the same on each thumbnails?....

pea32ant

Hmmm, I'm sitting and testing...

sorry, but this works only on photos that have full size  (intermediate photos)
how to make it on all photos including thumbnails?

--
gallery version 1.44

pea32ant

SOLVED

$pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\" {$CURRENT_PIC_DATA['title']} \n {$CURRENT_PIC_DATA['caption']}\" />";
            $pic_html .= "</a>\n";
        } else {
            $pic_html = "<img src=\"" . $picture_url . "\" {$image_size['geom']} class=\"image\" border=\"0\" alt=\" {$CURRENT_PIC_DATA['title']} \n {$CURRENT_PIC_DATA['caption']}\">\n";


this code works for both - intermediate photos + photos without intermediate sizes

But still thinking
HOW to make it on each thumbnails?

Stramm

there's no save solution for that. You'll have to modify a core file include/functions.inc.php

find function display_thumbnails and modify $thumb_list[$i]['image'] to your likings

pea32ant

i am not php programmer,
can you help me in this?....

pea32ant

SOLVED

$thumb_list[$i]['image'] = "<img src=\"" . $pic_url . "\" class=\"image\" {$image_size['geom']} border=\"0\" alt=\"{$row['caption']}\" >";

Thanks, STRAMM for support!

pea32ant

#8
On first page, there are no ALT tags for thumbnails on albums.... (filename)

Can you help me in this?...

example: http://www.kotlin.ru/gallery/

Aeronautic

Sorry for what may seem like a stupid question...

I'm using Hardwired (1.4.9)

I have gone to themes/sample/theme.php and found "function theme_html_picture()"

I see all the code. In looking at the themes/hardwired/theme.php file:

1) Where would one put the "function theme_html_picture()" code?
2) Why is this function not in the Hardwired theme.php file?

I'm trying to understand the programming logic so I don't ask stupid questions again.

I did make the other tweak in this thread to the thumbnails and that worked great.

@pea32ant Did you make your change in the two spots in include/functions.inc.php that call the thumbs?

I'd love to add alt tags to the cat thumbs too. Still poking around the code trying to find that.

Thanks!

Sami

gallery use a global theme file (theme.inc.php) , all functions are define on that file, by adding that function (with the same name) to your theme , you will overwrite to global setting
you can add function before ?> ( php end ) tag
‍I don't answer to PM with support question
Please post your issue to related board

Aeronautic

Thank you for the clear explanation!

RedPage

#12
Quote from: Stramm on March 06, 2006, 11:27:53 AM
from themes/sample/theme.php copy to the theme.php your using the function theme_html_picture()

find tin that function
            $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
and replace with
            $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']} {$CURRENT_PIC_DATA['title']}\" /><br />";

Help

[Edit GauGau] Replaced hotlinked image with attachment [/Edit]
How to add description, precisely, there where is written to red?

Joachim Müller

How is your question related to the topic discussed in this thread?

RedPage

Quote from: Joachim Müller on December 28, 2007, 11:42:45 AM
How is your question related to the topic discussed in this thread?

as this do? help please

RedPage


Joachim Müller

I don't understand your question in the first place. Instead of hijacking this thread, start a new thread and explain (using more words) what your actual question is or what you want to accomplish. Posting a link to your gallery in that new thread might help as well.

TigerClaw

Sorry to bump this old thread but the ALT mod is still necessary?
It seems to be already in place in last version.