<?
//***************************************************
// http://www.niadesain.com
// Solusi Hemat Script Bisnis Online Anda
// Menerima Jasa Pembuatan Website & Template Website
//***************************************************
?>
<?php
$table=mysql_real_escape_string('berita');
$query = "SELECT * FROM {$table} where published='1' ORDER BY RAND() limit 12";
$hasil = mysql_query($query);

while($b=mysql_fetch_array($hasil)){

    $adafoto = $b[gambar];

                if ($adafoto !=''){
                echo "<a href=./?scrindo=detailberita&nid=$b[id_berita]&id=$id><img class='sidebar-gallery' src='images/news/".$b[gambar]."' width=107 height=44 hspace=6 vspace=4 alt='$b[judul]' title='$b[judul]'></a>";
		}
		else
		{
                echo "<a href=./?scrindo=detailberita&nid=$b[id_berita]&id=$id><img class='sidebar-gallery' src='images/news/noimage.jpg' width=107 height=44 hspace=6 vspace=4 alt='$b[judul]' title='$b[judul]'></a>";
		}

}
?>