[Solved]: How do we enable Admin view count? [Solved]: How do we enable Admin view count?
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

[Solved]: How do we enable Admin view count?

Started by Takako, December 02, 2008, 02:52:53 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Takako

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?

Nibbler

Edit theme_html_picture() in your custom theme.php.


    // 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:


    // 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);
    //}

Takako

Again, Thankyou sincerely for your quick response~

I applied the change, and everything works like a charm now!!!