stats count trouble

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?




edited by: inexinferis, Apr 01, 2008 - 03:25 PM

--
-. Karman .-
http://www.inexinferis.co.nr
PD: Excuse my English, I am learning... xD