forum.coppermine-gallery.net

Support => Older/other versions => cpg1.3.x Support => Topic started by: Pascal YAP on November 26, 2004, 09:54:45 pm

Title: Add line in TITLE tag on Thumbnails
Post by: Pascal YAP 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)
Title: Re: Add line in TITLE tag on Thumbnails
Post by: Nibbler 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.
Title: Re: Add line in TITLE tag on Thumbnails
Post by: Pascal YAP 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
Title: Re: Add line in TITLE tag on Thumbnails
Post by: goingon 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?