Revision [1866]
This is an old revision of GmBowenCounter made by GmBowen on 2004-10-16 04:23:28.
entry into _pages table....
`hits` int(50) NOT NULL default '0'
and the counter.php code....
%php%
<?
$thispage=$this->GetPageTag();
Get hit count
$result2 = mysql_query( "SELECT hits FROM wakka_pages WHERE tag='$thispage' AND latest='Y'" );
$row2 = mysql_fetch_array($result2);
$hit_count1 = $row2[hits];
End Get hit Count Start adding hits
$hit_count2 = $hit_count1 + 1;
End adding hits Start Update Hit
$sql = "UPDATE `wakka_pages` SET `hits` = '$hit_count2' WHERE tag='$thispage' AND latest='Y'";
$sql .= " WHERE `ref` = $ref";
mysql_query($sql) or die("Unable to process query: " . mysql_error());
End Update Hit
End Do not edit
Start output of counter
$result4 = mysql_query("SELECT hits FROM wakka_pages WHERE tag='$thispage' AND latest='Y'");
$row4 = mysql_fetch_array($result4);
$hit_count3 = $row4['hits'];
echo '<table cellpadding="0" cellspacing="0">';
echo '<tr><td><font face="verdana" size="2"><b>Total Hits:</b></font></td><td><font face="verdana" size="2"> ';
print "$hit_count3";
echo '</font></td></tr></table>';
End Output of counter
?>
%%