forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: pea32ant on March 06, 2006, 10:38:29 am

Title: Gallery and SEO - ALT for images
Post by: pea32ant on March 06, 2006, 10:38:29 am
How to add automatically each image title to be in <IMAGE ALT=TITLE> attribute?
Title: Re: Gallery and SEO - ALT for images
Post by: 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
Code: [Select]
            $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";and replace with
Code: [Select]
            $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']} {$CURRENT_PIC_DATA['title']}\" /><br />";
Title: Re: Gallery and SEO - ALT for images
Post by: pea32ant on March 06, 2006, 11:11:23 pm
thank you very much for very fast reply!!!    but I modified output code to:
Code: [Select]
$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?....
Title: Re: Gallery and SEO - ALT for images
Post by: pea32ant on March 06, 2006, 11:19:51 pm
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
Title: Re: Gallery and SEO - ALT for images
Post by: pea32ant on March 06, 2006, 11:36:02 pm
SOLVED

Code: [Select]
$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?
Title: Re: Gallery and SEO - ALT for images
Post by: Stramm on March 07, 2006, 09:40:55 am
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
Title: Re: Gallery and SEO - ALT for images
Post by: pea32ant on March 07, 2006, 02:48:32 pm
i am not php programmer,
can you help me in this?....
Title: Re: Gallery and SEO - ALT for images
Post by: pea32ant on March 07, 2006, 11:39:16 pm
SOLVED

Code: [Select]
$thumb_list[$i]['image'] = "<img src=\"" . $pic_url . "\" class=\"image\" {$image_size['geom']} border=\"0\" alt=\"{$row['caption']}\" >";
Thanks, STRAMM for support!
Title: Re: Gallery and SEO - ALT for images
Post by: pea32ant on March 14, 2006, 10:48:18 am
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/
Title: Re: Gallery and SEO - ALT for images
Post by: Aeronautic on October 03, 2006, 07:09:41 pm
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!
Title: Re: Gallery and SEO - ALT for images
Post by: Sami on October 03, 2006, 09:40:36 pm
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
Title: Re: Gallery and SEO - ALT for images
Post by: Aeronautic on October 03, 2006, 09:56:46 pm
Thank you for the clear explanation!
Title: Re: Gallery and SEO - ALT for images
Post by: RedPage on December 28, 2007, 11:37:47 am
from themes/sample/theme.php copy to the theme.php your using the function theme_html_picture()

find tin that function
Code: [Select]
            $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";and replace with
Code: [Select]
            $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?
Title: Re: Gallery and SEO - ALT for images
Post by: Joachim Müller on December 28, 2007, 11:42:45 am
How is your question related to the topic discussed in this thread?
Title: Re: Gallery and SEO - ALT for images
Post by: RedPage on December 28, 2007, 12:02:15 pm
How is your question related to the topic discussed in this thread?

as this do? help please
Title: Re: Gallery and SEO - ALT for images
Post by: RedPage on December 28, 2007, 12:04:58 pm
as this do? help please

Alt="?????" - rubric as on my picture
Title: Re: Gallery and SEO - ALT for images
Post by: Joachim Müller on December 28, 2007, 01:18:06 pm
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.
Title: Re: Gallery and SEO - ALT for images
Post by: TigerClaw on January 28, 2008, 02:31:01 am
Sorry to bump this old thread but the ALT mod is still necessary?
It seems to be already in place in last version.