Файл: inc/_stat.php
Строк: 46
<?php
######################################
#плагин реклама - стат ссылки
#Автор daranger
#url :wm-scripts.ru
#icq: 403-964-898
######################################
$cache_expires_time = 150;
if(!defined('SBLOCKLINKS_FILE'))
define('SBLOCKLINKS_FILE', 'ban-cache/sblocklinks.inc');
if(!isset($sblocklinks_array) && is_file(SBLOCKLINKS_FILE)
&& filemtime(SBLOCKLINKS_FILE) > (time()-$cache_expires_time)){
$sblocklinks_array = @unserialize(file_get_contents(SBLOCKLINKS_FILE));
}else{
$db->Query("SELECT `url`, `description`,`color` FROM `wm_ads_slink` ORDER BY `id` DESC");
//if(mysql_num_rows($res)>0) {
if($db->NumRows() > 0){
while($row = $db->FetchArray())
//while($row = mysql_fetch_assoc($res))
$sblocklinks_array[] = array('url' => $row['url'], 'description' => $row['description'], 'color' => $row['color']);
}
if(!isset($sblocklinks_array)) $sblocklinks_array = array();
if(is_file(SBLOCKLINKS_FILE)){
file_put_contents(SBLOCKLINKS_FILE, serialize($sblocklinks_array));
}
}
echo '<table border="0" cellspacing="1" cellpadding="1">';
if(isset($sblocklinks_array[0])) {
$cnt = count($sblocklinks_array);
for($i = 0; $i < $cnt; $i++) {
if($sblocklinks_array[$i]['color']=="1") $style_sl='"';
else $style_sl='"';
echo '<tr><td style="padding-top:10px;"><font color="#32CD32">•</font><a rel="nofollow" href="'.$sblocklinks_array[$i]['url'].'" target="_blank"><b>'.$sblocklinks_array[$i]['description'].'</b></a></td></tr>';
}
}else{
echo '';
}
unset($cache_expires_time, $cnt, $sblocklinks_array);
echo '</table>';
echo '<table align="center"><tr><td><img src="img/forwd.png" width="14" border="0" align="middle" alt="" /></td><td><a href="/zakazstat">Добавить ссылку</a></td></tr></table>';
?>