require_once("common.inc.php");
$sql = "SELECT * FROM `news` WHERE `display` = '1' ORDER BY `id` DESC, `date` DESC, `sorting` ASC";
$rs = $db->query($sql);
$list = "";
while($row = $db->fetch_array($rs)){
$photo = get_attachment("news",$row['id'],"photo");
if(file_exists($photo["path"].'original/'.$photo["file_name"])){
$img = '';
} else {
$img = '';
}
$list .= '