<?php
 ##################################################################
 ## Development by CoMMoN web site author http://mirmastera.ru   ##
 ## fportal web site scripts http://fportal.tk                   ##
 ## All rights reserved authors                                  ##
 ##################################################################
 function ads($type,$limit,$a_class,$div_class)
 {
 global $mysql;
 
 $div_arr = explode('|',$div_class);
$total_query_v_ads = $mysql -> query("SELECT count(*) FROM `".PREFIX."ads` WHERE `pos` ='$type';");
$total_v_ads = one($total_query_v_ads);
if ($total_v_ads != 0) {
//
$query_v_ads = $mysql -> query("SELECT * FROM `".PREFIX."ads` WHERE `pos`='$type' ORDER BY `id` LIMIT $limit");
$i = 0;
while ($data_v_ads = $query_v_ads -> fetch_assoc()) {
++$i;
echo $div_arr[0].'<a '.$a_class.' href="/?mod=system&amp;act=go&amp;id='.$data_v_ads['id'].'"><span style="font-weight: bold;">'.$data_v_ads['name'].'</span></a>'.$div_arr[1];

}
//
}
}
?>