forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: makwz on March 22, 2011, 12:23:06 am

Title: Can't edit the ALT tag?
Post by: makwz on March 22, 2011, 12:23:06 am
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?
Title: Re: Can't edit the ALT tag?
Post by: Αndré on March 22, 2011, 08:41:41 am
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.
Title: Re: Can't edit the ALT tag?
Post by: makwz on March 22, 2011, 09:37:19 am
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?
Title: Re: Can't edit the ALT tag?
Post by: makwz on March 22, 2011, 09:43:37 am
Bah, meant to write water_drop's theme.php file not water_drop.php
Title: Re: Can't edit the ALT tag?
Post by: Walkinman on March 22, 2011, 11:06:42 am
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.

Code: [Select]
$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
Code: [Select]
/******************************************************************************
** 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
Title: Re: Can't edit the ALT tag?
Post by: makwz on March 22, 2011, 11:41:37 am
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?
Title: Re: Can't edit the ALT tag?
Post by: Α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:
Code: [Select]
$pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$CURRENT_PIC_DATA['title']}\" title=\"{$CURRENT_PIC_DATA['title']}\"/><br />";
Title: Re: Can't edit the ALT tag?
Post by: makwz on March 22, 2011, 01:45:30 pm
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:
Code: [Select]
$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?
Title: Re: Can't edit the ALT tag?
Post by: makwz on March 22, 2011, 01:50:18 pm
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
Title: Re: Can't edit the ALT tag?
Post by: moonflower102 on November 06, 2012, 04:36:21 pm
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.
Title: Re: Can't edit the ALT tag?
Post by: Jeff Bailey on November 06, 2012, 08:49:41 pm
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.