include "./pages/cat/cat_right.php"; ?>
include "./pages/cat/cat_center.php"; ?>
include "./pages/cat/cat_left.php"; ?>
include './include/config.php'; include './include/nonMysqlFunctions.php'; $action = $_GET['action']; $action2 = $_GET['action']; $page = $_GET['page']; if($page=="") { $page=1; } $nextpage=(int)$page + 1; $identifier=$_GET['identifier']; if($identifier==2235){ header("HTTP/1.1 301 Moved Permanently"); header("Location: /breaking"); exit(); } if($page<1){ $page=1; } if($action=="search") { $daction="search1"; }else{ $adction=$_GET['action']; } $config_div = "
"; $topViewed = "data-query=\"{$identifier}\" data-action=\"{$action}\" data-status=\"false\""; //echo $url; if($action=="search") { $identifier=str_replace(" ","-",$_GET['identifier']); $q=$identifier; if($_GET['identifier'] == "موقع-بانيت") { header("HTTP/1.0 404 Not Found"); die(); } $url = "https://api.alarab.com/api/search/".urlencode($identifier)."/".$page; } if($action == "today") { $identifier=$_GET['identifier']; $url = "https://api.alarab.com/api/".$action."/news/".$page; } if($action == "city") { $identifier=$_GET['identifier']; $url = "https://apiv3.alarab.com/api/".$action."/".$identifier; } if($action == "category") { $identifier=$_GET['identifier']; $url = "https://apiv3.alarab.com/api/".$action."/".$identifier."/".$page; } if($action == "mothercategory") { $identifier=$_GET['identifier']; $url = "https://apiv3.alarab.com/api/".$action."/".$identifier."/".$page; } if($action == "blog") { $identifier=$_GET['identifier']; $url = "https://apiv3.alarab.com/api/".$action."/".$identifier."/".$page; } if($action == "copywriter") { $identifier=$_GET['identifier']; $url = "https://apiv3.alarab.com/api/".$action."/".urlencode($identifier)."/".$page; $auth=1; } if($action == "topvisitedToday") { $identifier=$_GET['identifier']; $url = "https://apiv3.alarab.com/api/".$action."/".$identifier."/01"; } $response = getJson($url); if($identifier==4385) {$cams=1;} $result = json_decode($response); $taginfo = json_decode(json_encode($result), True); $news_arr = json_decode(json_encode($result->data), True); $ps = json_decode(json_encode($result->page_suggestions), True); $ps_table_id = json_decode(json_encode($result->standings), True); $ps_table_id =$ps_table_id[0]; if($taginfo['status_message']=="redirect" AND $taginfo['status']==200){ header("HTTP/1.1 301 Moved Permanently"); header("Location: ".$taginfo['url']); exit(); } $subMenus = json_decode(json_encode($result->filters), True); /* usort($news_arr, function ($a, $b) {return $a['articleviews'] < $b['articleviews'];}); */ if(count($news_arr)==1){ // echo "should redirect to " . $news_arr[0][url]; // Permanent 301 redirection header("HTTP/1.1 301 Moved Permanently"); header("Location: {$news_arr[0][url]}"); exit(); }/* if(count($news_arr)==0){ // echo "should redirect to " . $news_arr[0][url]; // Permanent 301 redirection header("HTTP/1.1 301 Moved Permanently"); header("Location: /explore"); exit(); }*/ $pagetitle = $result->pageTtitle; $image=$storage.$news_arr[picPath].$news_arr[picture]; $thumb=$storage.$news_arr[picPath]."/150x81/".$news_arr[picture]; $top_viewd=array(); $subcat=""; $notfit=0; $fits=0; $overallvisits=0; for($fn=0;$fn