Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Add line in TITLE tag on Thumbnails  (Read 4203 times)

0 Members and 1 Guest are viewing this topic.

Pascal YAP

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 13833
  • Hello World :-)
    • CPG 1.5.x ExperiMental website
Add line in TITLE tag on Thumbnails
« on: November 26, 2004, 09:54:45 pm »

Bonjour,
Look my screen-shot to understand my question ;-)
How to add an other line in the yellow window (here is 'TITLE' html tag, not 'alt' tag)

  I want to add the number of hits in this title, on all thumbnails. Is it possible ?
 Like that in english - this pictures viewed 12548 times.
(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fforum.pays-dignois.com%2Fuploads%2Ftag_viewedxxxtime.jpg&hash=cf1bdd23091206ca42f95abde62d9c0c116889a6)

Many thanx by advance
Pascal

(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fexpo.pays-dignois.com%2Falink_expo.php&hash=d6943ae54b2b38807403b59fc7d75c53818f08e7)
Logged

Nibbler

  • Guest
Re: Add line in TITLE tag on Thumbnails
« Reply #1 on: November 27, 2004, 05:32:06 pm »

include/functions.inc.php:

change the caption to include the new info:

Code: [Select]
                        $pic_title =$lang_display_thumbnails['filename'].$row['filename']."\n".
                                $lang_display_thumbnails['filesize'].($row['filesize'] >> 10).$lang_byte_units[1]."\n".
                                $lang_display_thumbnails['dimensions'].$row['pwidth']."x".$row['pheight']."\n".
                                $lang_display_thumbnails['date_added'].localised_date($row['ctime'], $album_date_fmt);

becomes

Code: [Select]
                        $pic_title =$lang_display_thumbnails['filename'].$row['filename']."\n".
                                $lang_display_thumbnails['filesize'].($row['filesize'] >> 10).$lang_byte_units[1]."\n".
                                $lang_display_thumbnails['dimensions'].$row['pwidth']."x".$row['pheight']."\n".
                                $lang_display_thumbnails['date_added'].localised_date($row['ctime'], $album_date_fmt) . "\n" .
sprintf($lang_get_pic_data['n_views'], $row['hits']);

and then add $lang_get_pic_data into the function scope:

Code: [Select]
global $album_date_fmt, $lang_display_thumbnails, $lang_errors, $lang_byte_units;
becomes:

Code: [Select]
global $album_date_fmt, $lang_display_thumbnails, $lang_errors, $lang_byte_units, $lang_get_pic_data;
and then add hits into the data we collect from the db:

Code: [Select]
select_columns = 'pid, filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, aid';
becomes

Code: [Select]
select_columns = 'pid, filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, aid, hits';

That's the best match there is for the language string, if you only want a specific language then you can hardcode it.
« Last Edit: November 27, 2004, 05:39:20 pm by Nibbler »
Logged

Pascal YAP

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 13833
  • Hello World :-)
    • CPG 1.5.x ExperiMental website
Re: Add line in TITLE tag on Thumbnails
« Reply #2 on: November 27, 2004, 08:15:02 pm »

Ah Ah ah :-))

Merci a lot Nibbler ...
Try this add in this minute :-)))

some minutes after :-)

(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fforum.pays-dignois.com%2Fuploads%2Ftag_viewedxxxtime2.jpg&hash=2319a8c462dfde62b83b1436b1e34ae1380d648f)
Your help work fine, but there's no Return before Vu 4 fois ! Why ? What's wrong ?
Thanx
Pascal
« Last Edit: November 27, 2004, 10:07:54 pm by PYAP »
Logged

goingon

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Add line in TITLE tag on Thumbnails
« Reply #3 on: December 10, 2005, 07:02:54 pm »

What if you just want it removed for one of your gallerys and let others still display it?
Logged
Pages: [1]   Go Up
 

Page created in 0.027 seconds with 19 queries.