forum.coppermine-gallery.net

No Support => Feature requests => Topic started by: chtito on January 04, 2004, 05:48:45 pm

Title: A config entry for the hits of a picture
Post by: chtito on January 04, 2004, 05:48:45 pm
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!
Title: A config entry for the hits of a picture
Post by: chtito on January 04, 2004, 09:01:59 pm
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)

Code: [Select]

<                         $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!