Файл: rek_end.php
Строк: 26
<?php
$realtime = time();
$realtime = num($realtime);
$req = mysql_query("SELECT * FROM `reklama` WHERE `active` = '1' AND `position` = '2' ORDER BY `mesto` ASC");
if (mysql_num_rows($req) > 0)
{
echo '<div class="rek_end">';
while
($res = mysql_fetch_array($req))
{
$name = html($res['name']);
if (!empty ($res['font'])) {$name = '<strong>' . $name . '</strong>';}
if (!empty ($res['color'])) {$name = '<span style="color:#' . html($res['color']) . '">' . $name . '</span>';}
if ($res['redir'] == 1){$reklama = '<a href="' . $home . '/go.php?id=' . num($res['id']) . '">' . $name . '</a><br/>';}
else {$reklama = '<a href="'.$res['link'].'">' . $name . '</a><br/>';}
if (($res['day'] != 0 && $realtime >= ($res['time'] + $res['day'] * 3600 * 24)) || ($res['count_link'] != 0 && $res['count'] >= $res['count_link']))
{mysql_query("UPDATE `reklama` SET `active` = '2' WHERE `id` = '" . num($res['id']) . "'");}
echo $reklama;
}
echo '</div>';
}
?>