<?PHP
if(!defined('beerman')) {exit();}
$sql = mysql_query("SELECT `id`,`url`,`balance`,`price`,`texto`,`views`,`description` FROM `tb_statlinks` WHERE `balance`>'0' AND `modered`='1' AND `paused`='0' ORDER BY RAND() LIMIT 6") or die(mysql_error());
while($row=mysql_fetch_assoc($sql)){
if(intval($row["balance"]/$row["price"])==0 or $row["balance"]<$row["price"]){
mysql_query("UPDATE `tb_statlinks` SET `paused`='1',`balance`='0' WHERE `id`='".$row["id"]."'") or die(mysql_error());
}
?>
<div class='contextlink'>
<a href='/st-link-<?=$row["id"] ?>.html' target='_blank' title='<?=$row["views"] ?> переходов'>
<?=$row["description"] ?><span><?=$row["texto"] ?><br />
</span></a></div>
<?
}
?>