A config entry for the hits of a picture A config entry for the hits of a picture
 

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]

Main Menu

A config entry for the hits of a picture

Started by chtito, January 04, 2004, 05:48:45 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

chtito

It is probably a fairly easy job to do that: add an entry in the config page to specify whether to show or not the number of hits ("n views") in the thumbnail views.

I'd like to have the number of comments but not the number of hits.

thanks!
Vous pouvez poser vos questions en français sur le forum francophone !

chtito

In fact it was so easy that i did it myself. Here is the code to modify in the file: include/functions.inc.php

(i put it in a diff format; the left code is the original, the right is the new code)


<                         $caption = ($rowset[$key]['title']||$rowset[$key]['hits']) ? "<span class=\"thumb_title\">".$rowset[$key]['title'].(($rowset[$key]['title'])?"-":"").sprintf($lang_get_pic_data['n_views'], $rowset[$key]['hits'])."</span>" : '';
---
>                         $caption = ($rowset[$key]['title']||$rowset[$key]['hits']) ? "<span class=\"thumb_title\">".$rowset[$key]['title'].(($rowset[$key]['title']&&$set_hit_caption)?"-":"").($set_hit_caption ? sprintf($lang_get_pic_data['n_views'], $rowset[$key]['hits']) : '')."</span>" : '';


The variable $set_hit_caption is the one that should be defined on the config page.

Hope this helps!
Vous pouvez poser vos questions en français sur le forum francophone !