set_file("_common","./templates/news.htpl"); if($_GET['id'] == '' || !idRegularExpretion('id','index.php')) { $id = false; $t->set_var("all","yes"); } else { $id = $_GET['id']; $t->set_var("all","no"); } /// Start Of Work : $db = new DB; if(isset($_GET['archive']) && $_GET['archive'] == '1') { $where = 1; } else { $where = 0; } $query = "SELECT *, DATE_FORMAT(lastUpdate,'%e/%c/%Y') AS lastUpdateDate FROM news WHERE archive = '$where' ORDER BY newsId DESC"; $db->query($query); $res = array(); while($db->next_record()) { if($id == $db->f('newsId')) { $new = array("0"=>$db->f("newsTitle"),"1"=>$db->f("newsText")); $res[] = array("newId" => stripslashes($db->f("newsId")), "newTitle" => stripslashes($db->f("newsTitle")), "lastUpdate" => stripslashes($db->f("lastUpdateDate")) ); } else { $res[] = array("newId" => stripslashes($db->f("newsId")), "newTitle" => stripslashes($db->f("newsTitle"))); } } $t->set_var('archive',$where); $t->tset_var(array("row1"=>$res),"_common"); $t->set_var(array("mainTitle" => stripslashes($new['0']), "mainText" => stripslashes($new['1']))); $nav = array("secRow" => array(array("secM"=>1,"secN"=>"القرآن الكريم","secL"=>"./quraan.php"), array("secM"=>2,"secN"=>"المصاحف الكاملة","secL"=>"./completeQuraan.php"), array("secM"=>1,"secN"=>"البرامج","secL"=>"./programs.php"), array("secM"=>1,"secN"=>"الكتب الإلكترونية","secL"=>"./books.php"), array("secM"=>1,"secN"=>"قنوات مرئية ومسموعة","secL"=>"./channels.php"), array("secM"=>1,"secN"=>"إحصائيات الموقع","secL"=>"./statistics.php"), array("secM"=>1,"secN"=>"أخبار الموقع","secL"=>"./news.php"), array("secM"=>1,"secN"=>"المدونة","secL"=>"./blog/"), array("secM"=>1,"secN"=>"عن الموقع","secL"=>"./aboutUs.php"), )); mainFram($nav, "الأخبار :: ".stripslashes($new['0']) ); ?>