1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
function getCounterHTML($file = "counter.txt")
{
$fp = fopen($file,"r") ;
$fr = fread($fp,filesize($file)) ;
$value = $fr;
$counter = $fr+1 ;
$fp2 = fopen($file,"w") ;
$fw = fwrite($fp2,$counter) ;
return "<center><h3>".$value."</h3></center>" ;
}
$right_block = mysql_query("select * from blocks where b_dir='1' and b_active='1' order by b_order asc");
$num_right_block = mysql_num_rows($right_block);
if ($num_right_block > 0) {
while ($right_block_row=mysql_fetch_object($right_block)) {
echo "
<div class='head'>".$right_block_row->b_name."</div>
<div class='bodypanel'>". getCounterHTML() ."</div>
";
}
} |