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: [Solved]: How do we enable Admin view count?  (Read 1455 times)

0 Members and 1 Guest are viewing this topic.

Takako

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
[Solved]: How do we enable Admin view count?
« on: December 02, 2008, 02:52:53 pm »

I've tried to search for a solution, but couldn't find anything.

I've read enough to understand that Admin views don't increase the "Displayed" / "Views" counter, but I was wondering if there was any way that all hits including guest, user, admin and uploader are all counted?
« Last Edit: December 02, 2008, 05:39:46 pm by Nibbler »
Logged

Nibbler

  • Guest
Re: How do we enable Admin view count?
« Reply #1 on: December 02, 2008, 02:59:18 pm »

Edit theme_html_picture() in your custom theme.php.

Code: [Select]
    // Add 1 to hit counter
    if (!USER_IS_ADMIN && !in_array($pid, $USER['liv']) && isset($_COOKIE[$CONFIG['cookie_name'] . '_data'])) {
        add_hit($pid);
        if (count($USER['liv']) > 4) array_shift($USER['liv']);
        array_push($USER['liv'], $pid);
    }

Remove the checks like this:

Code: [Select]
    // Add 1 to hit counter
    //if (!USER_IS_ADMIN && !in_array($pid, $USER['liv']) && isset($_COOKIE[$CONFIG['cookie_name'] . '_data'])) {
        add_hit($pid);
        if (count($USER['liv']) > 4) array_shift($USER['liv']);
        array_push($USER['liv'], $pid);
    //}
Logged

Takako

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: How do we enable Admin view count?
« Reply #2 on: December 02, 2008, 04:09:06 pm »

Again, Thankyou sincerely for your quick response~

I applied the change, and everything works like a charm now!!!
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 20 queries.