SiteTitle, "Seo_Meta_Title" => SiteTitle, "Seo_Meta_Description" => SiteTitle, "Seo_Meta_Keywords" => SiteTitle, "Seo_Meta_Image" => SiteURL."view/images/logo.png", "Seo_Meta_Abstract" => SiteTitle." | اخبارية مواقع", "Seo_Meta_Designer" => SiteTitle." | اخبارية مواقع", "Seo_Meta_Copyright" => SiteTitle, "Seo_Meta_DISTRIBUTION" => "News-Local News - International - Sports - News Discussion - Women world" ); $tpl = new TemplatePower( MyTemplate."index.htm" ); $tpl->prepare(); URL_Path_Definetion($tpl); $getParam = explode('/' , $SERVER_REQUEST_URI ); //echo $SERVER_REQUEST_URI; //print_r($getParam); $getParamIndex=1; //exit; switch($_GET['id']) { case "logout": session_destroy(); header("Location:".SiteURL); exit; break; case "signup": $sql="select username from registers where LOWER(username) =LOWER(".quote_smart($_POST['username']).")"; $r=mysql_query($sql); if($q=mysql_fetch_object($r)) { echo 'false'; } else { $sql="INSERT INTO registers (username,password,email,regdate,ipaddress,status) values(".quote_smart($_POST['username']).",".quote_smart($_POST['password1']).",".quote_smart($_POST['email']).",".quote_smart(@date('Y-m-d H:i:s')).",".quote_smart($_SERVER['REMOTE_ADDR']).",'1')"; mysql_query($sql); //------------------------------------------------- //$_SESSION['site_userid'] = $regid; ///setcookie('userid', $regid, time()+3600*24*30); $_SESSION['site_username'] = $_POST['username']; $_SESSION['site_useremail'] = $_POST['email']; echo "true"; } exit; break; case 'signin': $log=$tpl->assign('login', MainPage(MyTemplate."login.html","","") ); $sql="select username,LOWER(email) email,id,password from registers where status=1 and LOWER(username) =LOWER(".quote_smart($_POST['username']).") and password =".quote_smart($_POST['password'])." limit 1"; $r=mysql_query($sql); if($q=mysql_fetch_object($r)) { if(true) { $_SESSION['site_username'] = $q->username; $_SESSION['site_useremail'] = $q->email; echo "true"; }else { echo "false"; } } else { echo 'false'; } exit; break; case "rating": //echo $_GET['game']."-".$_GET['rate']; $sql="select * from news where id=".intval($_GET['game']); $result= mysql_query($sql); if($row = mysql_fetch_assoc($result)) { if($row['rating']=='') $rating = '0-0-0-0-0'; else $rating = $row['rating']; $values = explode('-', $rating ); $values[intval($_GET['rate'])-1]++; mysql_query("update news set rating='".$values[0]."-".$values[1]."-".$values[2]."-".$values[3]."-".$values[4]."' where id=".intval($_GET['game'])); } exit; break; case "favorite": //echo $_GET['game']."-".$_GET['rate']; $sqlReg="select id from registers where LOWER(username) =LOWER(".quote_smart($_SESSION['site_username']).")"; $r=mysql_query($sqlReg); if($qReg=mysql_fetch_object($r)) { $sql="select * from fav_game where newsid=".intval($_GET['game'])." and userid=".intval($qReg->id); $result= mysql_query($sql); if($row = mysql_fetch_assoc($result)) { if(intval($_GET['fav'])=='0') { mysql_query("delete from fav_game where newsid=".intval($_GET['game'])." and userid=".intval($qReg->id) ); } } else { if(intval($_GET['fav'])=='1') { mysql_query("insert into fav_game (newsid,userid) values (".intval($_GET['game'])." , ".intval($qReg->id).")" ); } } } exit; break; } if(true) { switch($getParam[$getParamIndex]) { case "games": $tpl->assign("body", newsControl($seoMetaData,$getParam,$getParamIndex+1) ); break; case 'postimg': postimg($getParam,$getParamIndex);exit;break; case 'Top-Games.html': $data2['categoryname'] = 'جديد الألعاب'; $data2['categoryid'] = TopGames; $seoMetaData['site_title'] = $data2['categoryname'].SiteTitleSeparator.SiteTitle; $seoMetaData['Seo_Meta_Title'] = $data2['categoryname'].SiteTitleSeparator.SiteTitle; $seoMetaData['Seo_Meta_Description'] = $data2['categoryname']; $seoMetaData['Seo_Meta_Keywords'] = $data2['categoryname']; $sql_top="select *,CONCAT('".SiteURL."',(select en_name from news_category where id=n.category),'/playgame_',id,'.html') game_url ,(select name from news_category where id=n.category) categoryname,(select image from news_category where id=n.category) categoryimage,CONCAT(YEAR(recorddate),'-',MONTH(recorddate),'-',DAY(recorddate)) date, CONCAT(HOUR(recorddate),':',MINUTE(recorddate)) time from news n where status=1 and type=1 order by orderid DESC LIMIT 200"; $data2['li-cat']=PrintToTemplate(MyTemplate."li-cat.html",$sql_top,1,"",null,null); //$data2["ads-left"]=MainPage(MyTemplate."ads-left.html","",""); // $data2["ads-right"]=MainPage(MyTemplate."ads-right.html","",""); $tpl->assign("body",MainPage(MyTemplate."cat.html","",$data2)); break; case 'Most-popular.html': $data2['categoryname'] = 'الأكثر مشاهدة'; $data2['categoryid'] = MostPopular; $seoMetaData['site_title'] = $data2['categoryname'].SiteTitleSeparator.SiteTitle; $seoMetaData['Seo_Meta_Title'] = $data2['categoryname'].SiteTitleSeparator.SiteTitle; $seoMetaData['Seo_Meta_Description'] = $data2['categoryname']; $seoMetaData['Seo_Meta_Keywords'] = $data2['categoryname']; $sql_top="select *,CONCAT('".SiteURL."',(select en_name from news_category where id=n.category),'/playgame_',id,'.html') game_url ,(select name from news_category where id=n.category) categoryname,(select image from news_category where id=n.category) categoryimage,CONCAT(YEAR(recorddate),'-',MONTH(recorddate),'-',DAY(recorddate)) date, CONCAT(HOUR(recorddate),':',MINUTE(recorddate)) time from news n where status=1 and type=2 order by orderid DESC LIMIT 200"; $data2['li-cat']=PrintToTemplate(MyTemplate."li-cat.html",$sql_top,1,"",null,null); //$data2["ads-left"]=MainPage(MyTemplate."ads-left.html","",""); // $data2["ads-right"]=MainPage(MyTemplate."ads-right.html","",""); $tpl->assign("body",MainPage(MyTemplate."cat.html","",$data2)); break; case 'others-gamez.html': $data['categoryname'] = "ألعاب أخري"; $seoMetaData['site_title'] = SiteTitle.SiteTitleSeparator."ألعاب أخري"; $seoMetaData['Seo_Meta_Title'] = SiteTitle.SiteTitleSeparator."ألعاب أخري"; $sql="select *,(select name from news_category where id=category) categoryname,(select image from news_category where id=category) categoryimage, CONCAT(YEAR(recorddate),'-',MONTH(recorddate),'-',DAY(recorddate)) date, CONCAT(HOUR(recorddate),':',MINUTE(recorddate)) time from news where status=1 and category='106' ORDER BY id desc limit 70"; $query=mysql_query($sql); $row=mysql_fetch_assoc($query); $data["li-cat"] = PrintToTemplate(MyTemplate."li-other.html",$sql); $tpl->assign("body",MainPage(MyTemplate."other.html","",$data)); break; case "index": $tpl->assign("body", indexControl($seoMetaData,$getParam,$getParamIndex+1) ); break; default : if($getParam[$getParamIndex]=='fav') { $tag = str_replace('tag-','',$getParam[$getParamIndex]); $getParam[$getParamIndex] = 'games'; $getParam[$getParamIndex+1] = 'fav'; //$getParam[$getParamIndex+2] = $tag; //$getParam[$getParamIndex+3] = $gameid; $tpl->assign("body", newsControl($seoMetaData,$getParam,$getParamIndex+1) ); } else if(substr($getParam[$getParamIndex],0,4)=='tag-') { $tag = str_replace('tag-','',$getParam[$getParamIndex]); $getParam[$getParamIndex] = 'games'; $getParam[$getParamIndex+1] = 'tag'; $getParam[$getParamIndex+2] = $tag; //$getParam[$getParamIndex+3] = $gameid; $tpl->assign("body", newsControl($seoMetaData,$getParam,$getParamIndex+1) ); } else { // $keyword=utf8_urldecode($getParam[$getParamIndex]); $sql="select * from news_category where en_name=".quote_smart($getParam[$getParamIndex]); // $sql="select * from news_category where en_name=".quote_smart($keyword); $r=mysql_query($sql); if($q=mysql_fetch_object($r)) { if(substr($getParam[$getParamIndex+1],-5)=='.html' && substr($getParam[$getParamIndex+1],0,9)=='playgame_') { $gameid = str_replace('playgame_','',str_replace('.html','',$getParam[$getParamIndex+1])); $getParam[$getParamIndex] = 'games'; $getParam[$getParamIndex+1] = 'view'; $getParam[$getParamIndex+2] = 'id'; $getParam[$getParamIndex+3] = $gameid; $tpl->assign("body", newsControl($seoMetaData,$getParam,$getParamIndex+1) ); } else { $getParam[$getParamIndex] = 'games'; $getParam[$getParamIndex+1] = 'cat'; $getParam[$getParamIndex+2] = 'id'; $getParam[$getParamIndex+3] = $q->id; $tpl->assign("body", newsControl($seoMetaData,$getParam,$getParamIndex+1) ); } } else $tpl->assign("body",Body()); } break; } } //----------------------------------------- foreach($seoMetaData as $key => $val) $tpl->assign($key,$val); //----------------------------------------- $tpl->assign("header",MainHeader()); //-------------------------------------------------------------------- $tpl->assign("footer",Footer()); //------------------------------------------------ $tpl->printToScreen();