A variation on the counter.php 1° add in the database 2 columns first field: Speed, Float , 20 is actually a number that shows the 'current' speed of views, expressed by pages per year second field: Speeddate is the last date the page has been viewed by someone Ok its the bowen counter.php modified with selecting the two extra parameters and a speedcalculation, thast a kind of exponantial smoothing and is subsequently stored with the page. %%(php) GetPageTag(); // Get hit count, could be integrated as functions in Wikka, as to minimize reads, should be function GetSpeeddate() GetSpeed() $result2 = mysql_query( "SELECT hits,speeddate,speed FROM ".$this->config["table_prefix"]."pages WHERE tag='$thispage' AND latest='Y'" ); $row2 = mysql_fetch_array($result2); $hit_count1 = $row2[hits]; // Count is incremented if not your own page (thats bowen code transformed here) if ($this->GetUserName() != $this->GetPageOwner($tag)) { // End Get hit Count Start adding hits $hit_count2 = $hit_count1 + 1; $newspeed=0; // speed tuning, here it takes one hour as minimum if(strtotime($row2[speeddate])<(time()-60*60)) { $newspeed= $row2[speed]*0.8+365*24*60*60/(time()-strtotime($row2[speeddate]))*0.2; } else { $newspeed= $row2[speed]*0.8+365*24*0.1+$hit_count2*365*24*60*60/(time()-strtotime($this->GetPageTime()))*0.1; } // End adding hits Start Update Hit $tijdnu=time(); $sql = "UPDATE `".$this->config["table_prefix"]."pages` SET hits=$hit_count2,speeddate=now(),speed=$newspeed WHERE tag='$thispage' AND latest='Y'"; // $sql .= " WHERE `ref` = $ref"; mysql_query($sql) or die("Unable to process query: " . mysql_error()); } // End Update Hit // parameter show="off" or "no" being checked for $show = strtolower($show); // Start output of counter if ($show != 'off' && $show !='no') { $result4 = mysql_query("SELECT hits,speeddate,speed FROM ".$this->config["table_prefix"]."pages WHERE tag='$thispage' AND latest='Y'"); //UNIX_TIMESTAMP( not needed $row4 = mysql_fetch_array($result4); $hit_count3 = $row4['hits']; echo '
Total Hits: | '; print "$hit_count3"; print "Speed $row2[speed]"; // debugging // $temptijd1=strtotime($row2[speeddate]); // $temptijd2=strtotime($row4[speeddate]); // $age=$temptijd2-$temptijd1; // print " speeddate $temptijd1"; // print " speeddate $temptijd2"; // $temptijd3=$this->GetPageTime(); // print " speeddate $temptijd3"; // print " age $age"; // $temptijd=time(); // print " temptijd $temptijd"; echo ' |