Parašė Karolis· 2009 Rugp. 12 17:08:32
#10
opentable("Naujienos");
$limitleme = true; //limit varsa true , yoksa false yazin
$miktar = 10; //kaç tane gözükecekse onu yazýn , ----Amount Of Threads That Will Be Shown
$renkli=1; //renkli bulut olsun mu? kapamak için 0 yazýn---setting if the cloud will be colorful or not, to disable, set variaašo 0
$size=array(10,12,16,18,24,30); //font size pixels
$sizefinal=count($size)-1;//dizinin son elemanýnýn deðeri --Last element of font size array
//renkli seçili ise renklerimiz bir dizi olsun
$renkler=array("ffdb00", "1c4c8c", "d8c6f2", "8cbd57", "f25b17", "bec6cf", "1c83c8", "e68810", "3168d6", "cccccc", "000000", "b53800", "b9ed8b", "9cdeff", "9474b3");//renk kodlarý - hexademical color codes, you can add or edit any hexademical RGB color code, they will be automatically added
$renklerson=count($renkler)-1; //renklerin son dizi deðeri - last array element number of colors
$cats_on_row = 100;
function news_size($ncount) {
if ($ncount == 0) return "10";
for ($i=12;$i<30;$i+=2)
if ($ncount > $i-12 && $ncount < $i-9) return $i;
if ($ncount > 20) return "32";
}
$cat_id = array();
$cat_name = array();
$cat_size = array();
if ($limitleme == true) {
$sorgulimit = "LIMIT $miktar";
} else {
$sorgulimit = "";
}
$nor = dbquery("SELECT news_cat_id, news_cat_name FROM ".$db_prefix."news_cats ORDER BY rand()");
echo "<div align='center'>";
while ($d = dbarray($nor)) {
$cat_id[] .= $d['news_cat_id'];
$cat_name[] .= $d['news_cat_name'];
$r = dbquery("SELECT count(*) FROM ".$db_prefix."news WHERE news_cat='".$d['news_cat_id']."'");
$cnt = dbarray($r);
$cat_size[] .= news_size($cnt['count(*)']);
}
for ($i=0;$i<count($cat_id);$i++) {
echo "<a style='font-size: ".$size[rand(0,$sizefinal)]."px;".($renkli?"color: #".$renkler[rand(0,$renklerson)].";":"")."'href='".BASEDIR."news_cats.php?cat_id=".$cat_id[$i]."' style='font-size:".$cat_size[$i]."px'>".$cat_name[$i]."</a>".(($i+1) % $cats_on_row ? " \n" : "<br/>\n");
}
echo"
<div style='text-align: right;'>
<div style='text-align: right;'>
</div>
</div>";
closetable();
Radau modu saite tik spalvotos naujienų kategorijos kitokio nėra. ;D
Redagavo Karolis· 2009 Rugp. 12 17:08:49