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: A config entry for the hits of a picture  (Read 5877 times)

0 Members and 1 Guest are viewing this topic.

chtito

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 186
  • I run Mac OS X, despite the penguin ;)
A config entry for the hits of a picture
« 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!
Logged
Vous pouvez poser vos questions en français sur le forum francophone !

chtito

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 186
  • I run Mac OS X, despite the penguin ;)
A config entry for the hits of a picture
« Reply #1 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!
Logged
Vous pouvez poser vos questions en français sur le forum francophone !
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 19 queries.