http://www.wiizelda.net/gallery/displayimage.php?pid=1
No matter what I edit in /themes/sample/theme.php, I can't change the alt text of thumbnail images in the displayimage.php file (the image you click on to open a popup of the full size image).
I got this code from another thread, I am using it now.
$pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$CURRENT_PIC_DATA['title']}\" title=\"{$CURRENT_PIC_DATA['title']}\"/><br />";
But as you can see in the URL above, the alt text of the image still says "Click to view full size image".
What am I doing wrong?
You're using the theme 'water_drop', so you have to edit that theme's theme.php file, not that one from the sample theme.
I already tried to to dat, but this is all that there is in the water_drop.php theme file:
<?php
/*************************
Coppermine Photo Gallery
************************
Copyright (c) 2003-2010 Coppermine Dev Team
v1.0 originally written by Gregory Demar
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3
as published by the Free Software Foundation.
********************************************
Coppermine version: 1.5.6
$HeadURL: https://coppermine.svn.sourceforge.net/svnroot/coppermine/trunk/cpg1.5.x/themes/water_drop/theme.php $
$Revision: 7620 $
**********************************************/
define('THEME_HAS_PROGRESS_GRAPHICS', 1);
// HTML template for template sys_menu spacer
$template_sys_menu_spacer = '<img src="themes/water_drop/images/orange_carret.gif" width="8" height="8" border="0" alt="" />';
?>
So where could this alt tag be?
Bah, meant to write water_drop's theme.php file not water_drop.php
Hey makwz
The code is in your sample/theme.php file.
This is the part, I think, that will work: you replace the default code with what you listed above.
$pic_html .= "<img src=\"images/image.gif?id=".floor(rand()*1000+rand())."\" width={$CURRENT_PIC_DATA['pwidth']} height={$CURRENT_PIC_DATA['pheight']} border=\"0\" alt=\" {$CURRENT_PIC_DATA['title']} \n {$CURRENT_PIC_DATA['caption']}\" /><br />" . $LINEBREAK;
That will put both the title and the caption of the image in the alt tag. I'm not 100% sure, but I think this is where you make the change; in the section marked /******************************************************************************
** Section <<<theme_html_picture>>> - START
******************************************************************************/
// Displays a picture
Copy that entire section to your water_drop/theme/php file and before the ?>
Hope this works for you.
Cheers
Carl
I tried editing all the <img> codes in the function you suggested, but to no avail. I've even tried replacing every single instance of the language variable that outputs "Click to view full size image" with {$CURRENT_PIC_DATA['title']} throughout sample/theme.php file but the gallery still has the damn "Click to view full size image" text in the image alt tags.
So I guess wherever this alt tag is it isn't in sample/theme.php, anyone have any idea where it could be?
You have to copy that part from themes/sample/theme.php to the theme.php file of your theme before you edit it! How should your theme know that you changed something in a different theme? Please post the link of the thread you got that code from:
$pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$CURRENT_PIC_DATA['title']}\" title=\"{$CURRENT_PIC_DATA['title']}\"/><br />";
Quote from: Αndré on March 22, 2011, 11:50:47 AM
You have to copy that part from themes/sample/theme.php to the theme.php file of your theme before you edit it! How should your theme know that you changed something in a different theme? Please post the link of the thread you got that code from:
$pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$CURRENT_PIC_DATA['title']}\" title=\"{$CURRENT_PIC_DATA['title']}\"/><br />";
Well it's pretty obvious that the water_drop theme uses the sample/theme.php file. The contents of water_drop/theme.php, as posted above, is just two lines of PHP code, plus how do you think I managed to edit the alt tags of thumbnails on the homepage of the gallery via sample/theme.php, despite the theme being water_drop?
Never mind, got it working now ;) I copied the function from sample/theme.php to the water drop's theme file and things are working now. It was confusing me because I was able to edit some aspects of the water_drop theme through sample/theme.php without having to copy it to the actual water_drop theme.php file. Thanks for the help all. ;D
I have the same problem... I m having trouble adding the alt.. Can you please explain how do I copy the function from sample/theme to my theme file.
You already have your own thread.
http://forum.coppermine-gallery.net/index.php/topic,75616.msg364408/topicseen.html#msg364408
Please do not hijack other threads, especially ones this old.
http://forum.coppermine-gallery.net/index.php/topic,55415.msg270632.html#msg270632
How to copy from the sample:
http://documentation.coppermine-gallery.net/en/theme_theme_php.htm#theme_sample
If you continue to have problems please use the thread you started.
Locking.