4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: whosthis.ee on July 31, 2009, 07:22:12 AM

Title: how to change image alt text ??
Post by: whosthis.ee on July 31, 2009, 07:22:12 AM
Hi

how to change the image alt text ??

i want category description (cat_desc)  as image alt text

pls help
Title: Re: how to change image alt text ??
Post by: Rembrandt on July 31, 2009, 10:53:36 AM
Hi!
...
 want category description (cat_desc)  as image alt text...

in categorie.php:
alt=\"".format_text($cat_cache[$cat_id]['cat_description'], 1, 0, 1)."\"

in HTML:
alt="{cat_description}"

mfg Andi
Title: Re: how to change image alt text ??
Post by: whosthis.ee on August 02, 2009, 09:40:43 PM
sorry

i want to display image description in images alt text
Title: Re: how to change image alt text ??
Post by: Rembrandt on August 05, 2009, 08:20:22 AM
Hi!
Quote
i want to display image desc as alt text on thumbnails & detail page

search in templates/yourTemplates/media jpg.html:

alt="{image_name}"

replace it with:

alt="{image_description}"


search in includes/functions.php

 $site_template->register_vars(array(
    "image_id" => $image_row['image_id'],

add before:

$site_template->register_vars("image_description", format_text($image_row['image_description'], 2));


search:

"thumbnail" => get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link),

replace it with:

"thumbnail" => get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'],$image_row['image_description'], $mode, $show_link),

search:

function get_thumbnail_code($media_file_name, $thumb_file_name = "", $image_id, $cat_id, $image_name = "", $mode = "", $show_link = 1, $open_window = 0) {

replace it with:

function get_thumbnail_code($media_file_name, $thumb_file_name = "", $image_id, $cat_id, $image_name = "", $image_description = "",$mode = "", $show_link = 1, $open_window = 0) {

search:

$thumb = "<img src=\"".$file_src."\" border=\"0\"".$width_height." alt=\"".format_text($image_name, 2)."\" />";

replace it with:

$thumb = "<img src=\"".$file_src."\" border=\"0\"".$width_height." alt=\"".format_text($image_description, 2)."\" />";

search:

$thumb = "<img src=\"".$file_src."\" border=\"".$config['image_border']."\"".$width_height." alt=\"".format_text($image_name, 2)."\" />";

replace it with:

$thumb = "<img src=\"".$file_src."\" border=\"".$config['image_border']."\"".$width_height." alt=\"".format_text($image_description, 2)."\" />";



mfg Andi
Title: Re: how to change image alt text ??
Post by: whosthis.ee on August 06, 2009, 09:19:34 PM
the same is working fine

tks alot