if($_REQUEST[id]){ //GET REQUESTED ID $id=(is_numeric($_REQUEST[id]))?($_REQUEST[id]):('1'); $sql="select id,title,tanggal,content,images from t_article where type='PARLEMEN' AND status='ONLINE' AND id=$id order by tanggal desc limit 1"; } else{ //GET LATEST $sql="select id,title,tanggal,content,images from t_article where type='PARLEMEN' AND status='ONLINE' order by tanggal desc limit 1"; } $rs =mysql_query($sql); $i='1'; $res=''; while($row=mysql_fetch_array($rs)) { $res[$i]=$row; $i++; } $curID=$res[1][id]; $smarty->assign('detail',$res); $smarty->assign('curID',$curID); //KOMENTAR $sql="select id,nama,module,article_id,komentar,tanggal from t_komentar where status='ONLINE' AND article_id=$curID AND module='$module' order by tanggal desc"; $rs =mysql_query($sql); $i='1'; $res=''; while($row=mysql_fetch_array($rs)) {@ $res[$i]=$row; $i++; } $smarty->assign('komentar',$res); //GET OLDER LINK $sql="select id,title from t_article where type='PARLEMEN' AND status='ONLINE' AND id!=$curID order by tanggal desc limit 6"; $rs =mysql_query($sql); $i='1'; $res=''; while($row=mysql_fetch_array($rs)) { $res[$i]=$row; $i++; } $smarty->assign('others',$res); //GET OLDER LINK TESTIMONIAL $sql="select id,nama,profesi,images from t_testimoni where status='ONLINE' order by RAND() desc limit 4"; $rs =mysql_query($sql); $i='1'; $res=''; while($row=mysql_fetch_array($rs)) { $res[$i]=$row; $i++; } $smarty->assign('testi',$res); ?>