Can't edit the ALT tag? Can't edit the ALT tag?
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Can't edit the ALT tag?

Started by makwz, March 22, 2011, 12:23:06 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

makwz

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?

Αndré

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.

makwz

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?

makwz

Bah, meant to write water_drop's theme.php file not water_drop.php

Walkinman

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

makwz

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?

Αndré

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 />";

makwz

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?

makwz

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

moonflower102

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.

Jeff Bailey

Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford