Код работает нормально, но я все еще хочу получить случайные результаты при обновлении страницы. Теперь код дает мне результаты, например, по ссылке №1,2,3,4,5 ... и я не хочу, чтобы они были случайными, например, нет. 3,9,1, ...
А вот и код:
<?php
function print_cloud()
{ global $use_ads_scrl; $res=""; if ($use_ads_scrl=="yes"){$res=print_cloud2();} return $res; }
function print_cloud2()
{
global $table_ads, $HTTP_GET_VARS;
$city_sch="";
if ($HTTP_GET_VARS['city']!=""){$city_sch="and city='".$HTTP_GET_VARS['city']."' ";}
$sql_query="select * from $table_ads where (adcommkey is null or adcommkey=0) and visible=1 $city_sch
order by idnum desc limit 10";
$sql_res=mysql_query("$sql_query");
$min = '8'; // Minimum font size in pixel.
$max = '22'; // Maximum font size in pixel.
$decor = 'text-decoration:none;font-weight:100;'; // Inline CSS per link.
$k1=""; $html_res="";
while ($row = mysql_fetch_array($sql_res)){
$k1="1";
if($row['adphotos']=='yes'){$check_ph=$photo_mark;} else {$check_ph="";}
$html_res=$html_res."
<a style=' ".$decor." font-size:".rand($min,$max)."px; font-family:tahoma,sans-serif; color:#3B5998;' href='index.php?md=details&id= ".$row['idnum']." '> ".$row['title']." </a>
";
}
$html_res="
$html_res
";
if ($k1==""){$html_res="";}
return $html_res;
}
?>