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 ''; 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 '
'; } // End Output of counter ?> %% 2° to activate this page, add in the footer.php somewhere this activates the script for your complete wikka at once %% include('/actions/counter.php'); %% 3° Now to show this top speed we use a third trick change the recentchages.xml.php to a mostpseed.xml.php and changing one line by changing the invoked SQL function to LoadMostSpeed(). Subsequently we must define the function in the wikka.php. This generates a complete xml output of the most currently viewed pages. Evidently with the %% {{rss url=http.yoursite.com/Homepage/mostspeed.xml}} %% should show you the list within any page %%(php) \n"; $xml .= 'GetConfigValue("base_url") .'/css/xml.css" type="text/css"?' .">\n"; $xml .= "\n"; $xml .= "\n"; $xml .= "".$this->GetConfigValue("wakka_name")." - ".$this->tag."\n"; $xml .= "".$this->GetConfigValue("base_url")."\n"; $xml .= "Most visited pages of ".$this->GetConfigValue("wakka_name")."\n"; $xml .= "en-us\n"; if ($pages = $this->LoadMostSpeed()) { $max = $this->GetConfigValue("xml_recent_changes"); $c = 0; foreach ($pages as $page) { $c++; if (($c <= $max) || !$max) { $xml .= "\n"; $xml .= "".$page["tag"]."\n"; $xml .= "".$this->Href("show", $page["tag"], "time=".urlencode($page["time"]))."\n"; $xml .= "\t".$page["time"]." by ".$page["user"].($page["note"] ? " - ".$page["note"] : "")."\n"; //$xml .= "\t".$page["id"].""; $xml .= "\t".date("r",strtotime($page["time"]))."\n"; $xml .= "\n"; } } } else { $xml .= "\n"; $xml .= "Error\n"; $xml .= "".$this->Href("show")."\n"; $xml .= "You're not allowed to access this information.\n"; $xml .= "\n"; } $xml .= "\n"; $xml .= "\n"; print($xml); ?> %% 4° So fourh code twinkering is in the wikka.php adding this function before LoadRecentlyChanged() %%(php) function LoadMostSpeed() { if ($pages = $this->LoadAll("select * from ".$this->config["table_prefix"]."pages where latest = 'Y' order by speed desc")) { foreach ($pages as $page) { $this->CachePage($page); } return $pages; } } %% And hence here you obtain a 'spedometer' say your top10 currently most viewed pages. Or your current hype in your wikka.