PostNuke: A Flexible Open Source Content Management System
home | forum | international support | contact us

Support Forum

Start ::  Developers Corner ::  Block Development ::  stats count trouble

Moderated by: Support Team

Bottom
stats count trouble

  • Link to this postingPosted: 01.04.2008, 18:57
    Profile Homepage
    inexinferis
    rank:
    pnFreshman pnFreshman
    registered:
     April 2008
    Status:
    offline
    last visit:
    04.04.08
    Posts:
    8
    Hi, I'd develop a visit count block using the pn_counter table, but I has the trouble than every time an user click's a module this value (total hits) change, although the time of session has not finished, I'd solved this trouble adding this code at modules\Stats\ pnuserapi.php -> stats_userapi_collect:
    Code
    // [Modification by Karman] Fix count bug making a new session var...
        if (!SecurityUtil::checkPermission('::','::',ACCESS_ADMIN)&&
    !isset($_SESSION['_PNSession']['StatCounter'])&&
    !isset($GLOBALS['_PNSession']['StatCounter'])){
            $_SESSION['_PNSession']['StatCounter'] = true;
            $GLOBALS['_PNSession']['StatCounter']= true;
        }else{
            return;
        }

    But I don't know if it is the best solution? any suggest?
    -----
    -. Karman .-
    http://www.inexinferis.co.nr
    PD: Excuse my English, I am learning... xD
  • Link to this postingPosted: 01.04.2008, 23:27
    Profile Homepage
    AmmoDump
    rank:
    pnProfessional pnProfessional
    registered:
     December 2003
    Status:
    offline
    last visit:
    08.05.08
    Posts:
    2635
    Sessions, are not the solution. Security variables change sessions times limits. A session can remain open indefinitely, and a guest may not use a session at all.

    -----
    -- David Pahl -- (PostNuke Support Team)

    <div id="me" class="none" style="none" />

  • Link to this postingPosted: 02.04.2008, 00:38
    Profile Homepage
    inexinferis
    rank:
    pnFreshman pnFreshman
    registered:
     April 2008
    Status:
    offline
    last visit:
    04.04.08
    Posts:
    8
    Yes, I thought that, but what other way are?



    -----
    -. Karman .-
    http://www.inexinferis.co.nr
    PD: Excuse my English, I am learning... xD
  • Link to this postingPosted: 02.04.2008, 01:29
    Profile Homepage
    AmmoDump
    rank:
    pnProfessional pnProfessional
    registered:
     December 2003
    Status:
    offline
    last visit:
    08.05.08
    Posts:
    2635
    Well, what exactly do you want to calculate?

    What should trigger a +1 ? What do you want your formula to be?

    Why not use a script that counts unique IPs per X hours...


    -----
    -- David Pahl -- (PostNuke Support Team)

    <div id="me" class="none" style="none" />

  • Link to this postingPosted: 02.04.2008, 03:47
    Profile Homepage
    inexinferis
    rank:
    pnFreshman pnFreshman
    registered:
     April 2008
    Status:
    offline
    last visit:
    04.04.08
    Posts:
    8
    AmmoDumpWell, what exactly do you want to calculate?

    There is not a calc. It's only add each visit to a variable (SQL)...

    AmmoDumpWhat should trigger a +1 ? What do you want your formula to be?

    The question was, way pnStats increments the number of visits when a user visit a module (downloads for example), the number of visits should be incremented only the first time the user load the pag.

    AmmoDumpWhy not use a script that counts unique IPs per X hours...

    Is not for hour what I want, but the total number of visits... you can see how it's in the left side of my web... below is the address...

    Regards


    -----
    -. Karman .-
    http://www.inexinferis.co.nr
    PD: Excuse my English, I am learning... xD
  • Link to this postingPosted: 02.04.2008, 16:01
    Profile Homepage
    AmmoDump
    rank:
    pnProfessional pnProfessional
    registered:
     December 2003
    Status:
    offline
    last visit:
    08.05.08
    Posts:
    2635
    Yes, but what makes a visit a unique visit?

    You really have to decide what make a visit unique. It is rather arbitrary, if you ask me. The only thing hit counter count is the number of times it adds 1. icon_smile

    Same with the stats, if the stats add 1 every time a module is refreshed, that gives an accurate account of how often the module is refreshed... nothing more. Throw in some Ajax, and you got some more worthless data. :P

    If you want better data, use webalyiser or sew google into your site...

    -----
    -- David Pahl -- (PostNuke Support Team)

    <div id="me" class="none" style="none" />

Start ::  Developers Corner ::  Block Development ::  stats count trouble

Main Menu

Extensions Database

Documentation

Development

Login





 


 Log in Problems?
 New User? Sign Up!

Donate to PostNuke