coppermine-gallery.com/forum

Support => Older/other versions => cpg1.3.x Support => Topic started by: neeth on June 30, 2005, 05:44:17 PM

Title: "problem" with number of views
Post by: neeth on June 30, 2005, 05:44:17 PM
i know that is beter that users cant just refresh and that picture have 100000views but on some my pictures we have "games" and there is litle problem on some pictures we have more comments than views , for users that is funny ;)
see http://www.neeth.info/galerija/displayimage.php?pos=-20996

what to do ?
is there any modification to every view of picture is numbered ?
Title: Re: "problem" with number of views
Post by: Nibbler on June 30, 2005, 07:23:55 PM
displayimage.php

    // Add 1 to hit counter
    if ($album != "lasthits" && !in_array($pid, $USER['liv']) && isset($HTTP_COOKIE_VARS[$CONFIG['cookie_name'] . '_data'])) {
        add_hit($pid);
        if (count($USER['liv']) > 4) array_shift($USER['liv']);
        array_push($USER['liv'], $pid);
    }


Adjust that code to work as you see fit.
Title: Re: "problem" with number of views
Post by: neeth on June 30, 2005, 07:46:26 PM
I try but no luck ;)

i need that every time when user open picture give it one views,

ex.. if i refresh my pic 100times that it have 100views

tnx.
Title: Re: "problem" with number of views
Post by: Nibbler on June 30, 2005, 07:59:53 PM
Change it to simply

add_hit($pid);

in that case.
Title: Re: "problem" with number of views
Post by: neeth on July 01, 2005, 01:13:29 PM
its work !!

thnx,