Advanced search  

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

Pages: [1]   Go Down

Author Topic: Can't edit the ALT tag?  (Read 5931 times)

0 Members and 1 Guest are viewing this topic.

makwz

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Can't edit the ALT tag?
« 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?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Can't edit the ALT tag?
« Reply #1 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.
Logged

makwz

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Can't edit the ALT tag?
« Reply #2 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?
Logged

makwz

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Can't edit the ALT tag?
« Reply #3 on: March 22, 2011, 09:43:37 am »

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

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 380
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: Can't edit the ALT tag?
« Reply #4 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
Logged

makwz

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Can't edit the ALT tag?
« Reply #5 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?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Can't edit the ALT tag?
« Reply #6 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 />";
Logged

makwz

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Can't edit the ALT tag?
« Reply #7 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?
Logged

makwz

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Can't edit the ALT tag?
« Reply #8 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
Logged

moonflower102

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Re: Can't edit the ALT tag?
« Reply #9 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.
Logged

Jeff Bailey

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1322
  • Fishing relaxes me.
    • Bailey Family Co.
Re: Can't edit the ALT tag?
« Reply #10 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.
Logged
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford
Pages: [1]   Go Up
 

Page created in 0.026 seconds with 20 queries.