Revision history for SpedoMeter


Revision [18614]

Last edited on 2008-01-28 00:12:17 by NilsLindenberg [Modified links pointing to docs server]

No Differences

Revision [10968]

Edited on 2005-09-08 23:44:24 by NilsLindenberg [highlighting]
Additions:
%%(php)
%%(php)
%%(php)
function LoadMostSpeed()
Deletions:
<?
<?
%% function LoadMostSpeed()


Revision [10935]

Edited on 2005-09-06 09:22:09 by PaulBelgian [highlighting]
Additions:
$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;
Deletions:
$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;


Revision [10934]

Edited on 2005-09-06 09:21:43 by PaulBelgian [highlighting]
Additions:
$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;
Deletions:
$newspeed= $row2[speed]*0.8+(365*24*60*60)/((time()-$row2[speeddate])*24*60*60)*0.2;
} else {
$newspeed= $row2[speed]*0.8+365*24*0.2;


Revision [10933]

Edited on 2005-09-06 09:12:12 by PaulBelgian [highlighting]
Additions:
// Paul Larmuseau code
// create speeddate as DATETIME variable !!
$thispage=$this->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))
{
// 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()-$row2[speeddate])*24*60*60)*0.2;
$tijdnu=time();
$sql = "UPDATE `".$this->config["table_prefix"]."pages` SET hits=$hit_count2,speeddate=now(),speed=$newspeed WHERE tag='$thispage' AND latest='Y'";
$result4 = mysql_query("SELECT hits,speeddate,speed FROM ".$this->config["table_prefix"]."pages WHERE tag='$thispage' AND latest='Y'");
//UNIX_TIMESTAMP( not needed
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";
Deletions:
$thispage=$this->GetPageTag();
// Get hit count
$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
if ($this->GetUserName() != $this->GetPageOwner($tag))
if($row2[speeddate]<(time()-60*60))
$newspeed= $row2[speed]*0.8+(365*24*60*60)/((time()-speeddate)*24*60*60)*0.2;
$sql = "UPDATE `".$this->config["table_prefix"]."pages` SET hits=$hit_count2,speeddate=CURRENT_TIMESTAMP,speed=$newspeed WHERE tag='$thispage' AND latest='Y'";
$result4 = mysql_query("SELECT hits,speed FROM ".$this->config["table_prefix"]."pages WHERE tag='$thispage' AND latest='Y'");
print " $row4[speed]";


Revision [10923]

The oldest known version of this page was created on 2005-09-03 22:15:02 by PaulBelgian [highlighting]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki