";
$root_element ="homepage";
$xml .= "<$root_element>";
error_reporting(0);
require '../include/asset.php';
require '../include/Conn.php';
require '../include/config.php';
$main_img_path="393x213";
//$thumb_img_path="155x81";
$thumb_img_path="150x81";
$xml.="";
$i=0;
$query="
SELECT news.ID,news.fb_country,news.fb_cont,news.fb_comp,news.fb_teams,news.pdate,news.title,news.sData,news.nWriter,news.mStatus,news.mCat,news.picture,news.userInserted,news.sCat,news.smalltitle,news.picPath,news.scroll,news.udate,news.stnews,news.links,news.mLocation,news.erea,news.searchtags,news.mobilevideo,news.articleviews, ncategories2.Name as subcat
FROM news
LEFT JOIN ncategories ncategories2 ON news.sCat = ncategories2.ID
WHERE mLocation > 0 AND mLocation < 14 AND mCat!=7
LIMIT 13";
$result=mysql_query($query) or die(mysql_error());
while($row=mysql_fetch_assoc($result)){
$vviews=$row['articleviews'];
if($vviews==0 OR $vviews == "") {
$vviews=100;
}
$sdata=$row['sData'];
if($row['links']){
$goto=htmlspecialchars($row['links']);
$target="target=\"_blank\"";
}else{
$goto="/Article/".$row['ID'];
$target="target=\"_self\"";
}
$txt="no";
//$row['smalltitle']=htmlentities($row['smalltitle']);
//$row['title']=htmlentities($row['title']);
//$row['sData']=htmlentities($row['sData']);
$image="https://images.alarab.com/data/news/{$row['picPath']}/{$row['picture']}?aspect_ratio=16:9&auto_optimize=high";
$thumb="https://images.alarab.com/data/news/{$row['picPath']}/{$row['picture']}?aspect_ratio=15:8&auto_optimize=high";
if($row['stnews']==3) {$txt="خبر عاجل"; }
if($row['stnews']==2) {$txt="خبر حصري";}
if($row['stnews']==1) {$txt="نشر اول";}
if($row['stnews']==4) {$txt="بث مباشر";}
if ($row[mobilevideo] !="" ){
if (strpos($row[mobilevideo], 'youtube') !== false) {
$row[mobilevideo]=$row[mobilevideo];
}else{
$mp4file =$row[mobilevideo];
$mp4file=basename($row[mobilevideo]);
$mp4file=str_replace(".mp4","",$mp4file);
$mp4file=str_replace(" ","",$mp4file);
if($mp4file < 122212) {
$v= "https://cdn.alarab.com/str1,,,/".$mp4file.".mp4.urlset/playlist.m3u8";
$v= "https://cdn.alarab.com/".$mp4file.".mp4/index-v1-a1.m3u8";
}
if($mp4file > 122211 AND $mp4file < 150000) {
$v= "https://cdn.alarab.com/vod,6,15,00/".$mp4file.".mp4.urlset/playlist.m3u8";
$v= "https://cdn.alarab.com/".$mp4file.".mp4/index-v1-a1.m3u8";
}
if($mp4file > 150001 AND $mp4file < 151497) {
$v= "https://cdn.alarab.com/vod,6,15,00/".$mp4file.".mp4.urlset/playlist.m3u8";
}
if($mp4file > 151496) {
$url='http://render.alarab.com:8099/indicator.php?id='.$mp4file;
//file_get_contents() reads remote webpage content
$lines_string=file_get_contents($url);
//output, you can also save it locally on the server
htmlspecialchars($lines_string);
$lines_string=preg_replace('/\s+/', ' ', $lines_string);
$data=explode(":",$lines_string);
$renderations=str_replace(" ","",$data[0]);
$renderations=str_replace("0p","",$renderations);
//$v= "https://cdn.alarab.com/vod/".$mp4file."_,".$renderations.",0p.mp4.urlset/playlist.m3u8";
$v= "https://cdn.alarab.com/h264/".$mp4file."_,".$renderations.",0p.mp4.urlset/playlist.m3u8";
if($renderations=="SD"){
$v= "https://cdn.alarab.com/h264/".$mp4file."_".$renderations.",,,.mp4.urlset/playlist.m3u8";
}
}
}
}else{
$v="no";
}
$vviews=$row['articleviews'];
if($vviews==0 OR $vviews == "") {
$vviews=100;
}
$xml .="
{$row['ID']}
{$row['title']}
{$row['smalltitle']}
{$row['sData']}
{$image}
{$thumb}
{$goto}
{$target}
{$row['mLocation']}
{$txt}
{$row['mCat']}
{$row['subcat']}
/{$row['mCat']}/
{$row['ID']}
/Archive/{$row['sCat']}/1
{$row['subcat']}
{$vviews}
{$row['erea']}
{$row['udate']}
{$row['stnews']}
";
$i++;
}
$i=0;
$query="
SELECT news.ID,news.fb_country,news.fb_cont,news.fb_comp,news.fb_teams,news.pdate,news.title,news.sData,news.nWriter,news.mStatus,news.mCat,news.picture,news.userInserted,news.sCat,news.smalltitle,news.picPath,news.scroll,news.udate,news.stnews,news.links,news.mLocation,news.erea,news.searchtags,news.mobilevideo,news.articleviews, ncategories2.Name as subcat
FROM news
LEFT JOIN ncategories ncategories2 ON news.sCat = ncategories2.ID
WHERE mLocation > 0 AND mLocation < 13 AND news.mCat=7
LIMIT 1";
$result=mysql_query($query) or die(mysql_error());
while($row=mysql_fetch_assoc($result)){
$sdata=$row['sData'];
if($row['links']){
$goto=htmlspecialchars($row['links']);
$target="target=\"_blank\"";
}else{
$goto="/Article/".$row['ID'];
$target="target=\"_self\"";
}
$txt="no";
//$row['smalltitle']=htmlentities($row['smalltitle']);
//$row['title']=htmlentities($row['title']);
//$row['sData']=htmlentities($row['sData']);
$image="https://images.alarab.com/data/news/{$row['picPath']}/{$row['picture']}?aspect_ratio=16:9&auto_optimize=high";
$thumb="https://images.alarab.com/data/news/{$row['picPath']}/{$row['picture']}?aspect_ratio=15:8&auto_optimize=high";
if($row['stnews']==3) {$txt="خبر عاجل"; }
if($row['stnews']==2) {$txt="خبر حصري";}
if($row['stnews']==1) {$txt="نشر اول";}
if($row['stnews']==4) {$txt="بث مباشر";}
if ($row[mobilevideo] !="" ){
if (strpos($row[mobilevideo], 'youtube') !== false) {
$row[mobilevideo]=$row[mobilevideo];
}else{
$mp4file =$row[mobilevideo];
$mp4file=basename($row[mobilevideo]);
$mp4file=str_replace(".mp4","",$mp4file);
$mp4file=str_replace(" ","",$mp4file);
if($mp4file < 122212) {
$v= "https://cdn.alarab.com/str1,,,/".$mp4file.".mp4.urlset/playlist.m3u8";
$v= "https://cdn.alarab.com/".$mp4file.".mp4/index-v1-a1.m3u8";
}
if($mp4file > 122211 AND $mp4file < 150000) {
$v= "https://cdn.alarab.com/vod,6,15,00/".$mp4file.".mp4.urlset/playlist.m3u8";
$v= "https://cdn.alarab.com/".$mp4file.".mp4/index-v1-a1.m3u8";
}
if($mp4file > 150001 AND $mp4file < 151497) {
$v= "https://cdn.alarab.com/vod,6,15,00/".$mp4file.".mp4.urlset/playlist.m3u8";
}
if($mp4file > 151496) {
$url='http://render.alarab.com:8099/indicator.php?id='.$mp4file;
//file_get_contents() reads remote webpage content
$lines_string=file_get_contents($url);
//output, you can also save it locally on the server
htmlspecialchars($lines_string);
$lines_string=preg_replace('/\s+/', ' ', $lines_string);
$data=explode(":",$lines_string);
$renderations=str_replace(" ","",$data[0]);
$renderations=str_replace("0p","",$renderations);
//$v= "https://cdn.alarab.com/vod/".$mp4file."_,".$renderations.",0p.mp4.urlset/playlist.m3u8";
$v= "https://cdn.alarab.com/h264/".$mp4file."_,".$renderations.",0p.mp4.urlset/playlist.m3u8";
if($renderations=="SD"){
$v= "https://cdn.alarab.com/h264/".$mp4file."_".$renderations.",,,.mp4.urlset/playlist.m3u8";
}
}
}
}else{
$v="no";
}
$vviews=$row['articleviews'];
if($vviews==0 OR $vviews == "") {
$vviews=100;
}
$xml .="
{$row['ID']}
{$row['title']}
{$row['smalltitle']}
{$row['sData']}
{$image}
{$thumb}
{$goto}
{$target}
{$row['mLocation']}
{$txt}
{$row['mCat']}
{$row['subcat']}
/{$row['mCat']}/
{$row['ID']}
/Archive/{$row['sCat']}/1
{$row['subcat']}
{$vviews}
{$row['erea']}
{$row['udate']}
{$row['stnews']}
";
$i++;
}
$xml.="";
$xml.="";
$query="SELECT title,ID,pdate,udate FROM news WHERE (scroll=1 AND mStatus=1) OR (mCat=2235 AND mStatus=1) ORDER BY udate DESC LIMIT 15";
$result=mysql_query($query) or die(mysql_error());
while($row=mysql_fetch_assoc($result)){
//$row['smalltitle']=htmlentities($row['smalltitle']);
//$row['title']=htmlentities($row['title']);
//$row['sData']=htmlentities($row['sData']);
$sdata=text_summarise($row['title'], 19);
$xml .="
{$row['ID']}
{$row['title']}
".date("H:i",strtotime($row['udate']))."
";
}
$xml.="";
$main_cats=array(1,6,4349,3,3564,12,7,11,2792,10);
//$main_cats=array(3,1);
$xml.="";
for($i=0;$i";
$xml.="
{$w['Name']}
{$url}
{$id}
";
$sub="SELECT ID,Name FROM ncategories WHERE MainCat='$id' AND ID!=2235 ORDER BY ID DESC LIMIT 6";
$sresult=mysql_query($sub) or die(mysql_error());
while($srow=mysql_fetch_assoc($sresult)){
$surl="http://api.alarab.com/api/category/".$srow['ID']."/";
$srow['Name']=text_summarise($srow['Name'], 2);
$sqqql="OR srow={$row[ID]} ";
$xml.="{$srow['Name']}".$srow['ID']." {$surl}
";
}
$query="SELECT ID,smalltitle,sData,picture,picPath,links,mobilevideo,udate FROM news where mStatus=1 AND mCat='$id' AND sCat!=2235 AND (mLocation>13 OR mLocation < 1) ORDER BY udate DESC limit 5";
$result=mysql_query($query) or die(mysql_error());
while($row=mysql_fetch_assoc($result)){
//$row['smalltitle']=htmlentities($row['smalltitle']);
//$row['title']=htmlentities($row['title']);
//$row['sData']=htmlentities($row['sData']);
$sdata=$row['sData'];
if($row['links']){
$goto=htmlspecialchars($row['links']);
$target="target=\"_blank\"";
}
else{
$goto="/Article/".$row['ID'];
$target="target=\"_self\"";
}
$image="https://images.alarab.com/data/news/{$row['picPath']}/{$row['picture']}?aspect_ratio=16:9&auto_optimize=high";
$thumb="https://images.alarab.com/data/news/{$row['picPath']}/{$row['picture']}?aspect_ratio=15:8&auto_optimize=high";
if ($row[mobilevideo] !="" ){
if (strpos($row[mobilevideo], 'youtube') !== false) {
$row[mobilevideo]=$row[mobilevideo];
}else{
$mp4file=basename($row['mobilevideo']);
$mp4file=str_replace(".mp4","",$mp4file);
$mp4file=str_replace(" ","",$mp4file);
if($mp4file < 122212) {
$row[mobilevideo] = "https://cdn.alarab.com/".$mp4file.".mp4/index-v1-a1.m3u8";
}
if($mp4file > 122211 AND $mp4file < 150000) {
$row[mobilevideo] = "https://cdn.alarab.com/".$mp4file.".mp4/index-v1-a1.m3u8";
}
if($mp4file > 151496) {
$row[mobilevideo]= "https://cdn.alarab.com/h264/".$mp4file."_,48,24,0p.mp4.urlset/playlist.m3u8";
/*
$url='http://conv.alarab.com/indicator.php?id='.$mp4file;
//file_get_contents() reads remote webpage content
$lines_string=file_get_contents($url);
//output, you can also save it locally on the server
htmlspecialchars($lines_string);
$lines_string=preg_replace('/\s+/', ' ', $lines_string);
$data=explode(":",$lines_string);
$renderations=str_replace(" ","",$data[0]);
$renderations=str_replace("0p","",$renderations);
$row[mobilevideo]= "https://cdn.alarab.com/h264/".$mp4file."_,".$renderations.",0p.mp4.urlset/playlist.m3u8";
if($renderations=="SD"){
$row[mobilevideo]= "https://cdn.alarab.com/h264/".$mp4file."_".$renderations.",,,.mp4.urlset/playlist.m3u8";
}
*/
}
}
$v=$row[mobilevideo];
}else{
$v="no";
}
$vviews=$row['articleviews'];
if($vviews==0 OR $vviews == "") {
$vviews=100;
}
$xml .="
{$row['ID']}
{$row['smalltitle']}
{$row['sData']}
{$thumb}
{$image}
{$goto}
{$target}
{$vviews}
{$row['udate']}
";
}
$xml.="";
}
}
$xml.="";
$q="SELECT ID,Name FROM ncategories WHERE ID=3 ORDER BY ID DESC LIMIT 1";
$r=mysql_query($q) or die(mysql_error());
while($w=mysql_fetch_assoc($r)){
$id=$w['ID'];
$url="http://api.alarab.com/api/mothercategory/".$w['ID']."/";
$xml.="";
$xml.="
رياضة عالمية
{$url}
{$id}
";
$sub="SELECT ID,Name FROM ncategories WHERE MainCat=3 ORDER BY ID DESC LIMIT 15";
$sresult=mysql_query($sub) or die(mysql_error());
while($srow=mysql_fetch_assoc($sresult)){
$surl="http://api.alarab.com/api/category/".$srow['ID']."/";
$srow['Name']=text_summarise($srow['Name'], 2);
$sqqql="OR srow={$row[ID]} ";
$xml.="{$srow['Name']}".$srow['ID']." {$surl}
";
}
$query="SELECT ID,smalltitle,sData,picture,picPath,links,mobilevideo,udate FROM news where mStatus=1 AND sCat!=28 AND mCat=3 ORDER BY udate DESC limit 20";
$result=mysql_query($query) or die(mysql_error());
while($row=mysql_fetch_assoc($result)){
//$row['smalltitle']=htmlentities($row['smalltitle']);
//$row['title']=htmlentities($row['title']);
//$row['sData']=htmlentities($row['sData']);
$sdata=$row['sData'];
if($row['links']){
$goto=htmlspecialchars($row['links']);
$target="target=\"_blank\"";
}
else{
$goto="/Article/".$row['ID'];
$target="target=\"_self\"";
}
$image="https://images.alarab.com/data/news/{$row['picPath']}/{$row['picture']}?aspect_ratio=16:9&auto_optimize=high";
$thumb="https://images.alarab.com/data/news/{$row['picPath']}/{$row['picture']}?aspect_ratio=15:8&auto_optimize=high";
if ($row[mobilevideo] !="" ){
if (strpos($row[mobilevideo], 'youtube') !== false) {
$row[mobilevideo]=$row[mobilevideo];
}else{
$mp4file=basename($row['mobilevideo']);
$mp4file=str_replace(".mp4","",$mp4file);
$mp4file=str_replace(" ","",$mp4file);
if($mp4file < 122212) {
$row[mobilevideo] = "https://cdn.alarab.com/".$mp4file.".mp4/index-v1-a1.m3u8";
}
if($mp4file > 122211 AND $mp4file < 150000) {
$row[mobilevideo] = "https://cdn.alarab.com/".$mp4file.".mp4/index-v1-a1.m3u8";
}
if($mp4file > 151496) {
$row[mobilevideo]= "https://cdn.alarab.com/h264/".$mp4file."_,48,24,0p.mp4.urlset/playlist.m3u8";
/*
$url='http://conv.alarab.com/indicator.php?id='.$mp4file;
//file_get_contents() reads remote webpage content
$lines_string=file_get_contents($url);
//output, you can also save it locally on the server
htmlspecialchars($lines_string);
$lines_string=preg_replace('/\s+/', ' ', $lines_string);
$data=explode(":",$lines_string);
$renderations=str_replace(" ","",$data[0]);
$renderations=str_replace("0p","",$renderations);
$row[mobilevideo]= "https://cdn.alarab.com/h264/".$mp4file."_,".$renderations.",0p.mp4.urlset/playlist.m3u8";
if($renderations=="SD"){
$row[mobilevideo]= "https://cdn.alarab.com/h264/".$mp4file."_".$renderations.",,,.mp4.urlset/playlist.m3u8";
}
*/
}
}
$v=$row[mobilevideo];
}else{
$v="no";
}
$vviews=$row['articleviews'];
if($vviews==0 OR $vviews == "") {
$vviews=100;
}
$xml .="
{$row['ID']}
{$row['smalltitle']}
{$row['sData']}
{$thumb}
{$image}
{$goto}
{$target}
{$vviews}
{$row['udate']}
";
}
}
$xml.="";
$q="SELECT ID,Name FROM ncategories WHERE ID=6 ORDER BY ID DESC LIMIT 1";
$r=mysql_query($q) or die(mysql_error());
while($w=mysql_fetch_assoc($r)){
$id=$w['ID'];
$url="http://api.alarab.com/api/mothercategory/".$w['ID']."/";
$xml.="";
$xml.="
{$w['Name']}
{$url}
{$id}
";
$sub="SELECT ID,Name FROM ncategories WHERE MainCat=6 ORDER BY ID DESC LIMIT 6";
$sresult=mysql_query($sub) or die(mysql_error());
while($srow=mysql_fetch_assoc($sresult)){
$surl="http://api.alarab.com/api/category/".$srow['ID']."/";
$srow['Name']=text_summarise($srow['Name'], 2);
$sqqql="OR srow={$row[ID]} ";
$xml.="{$srow['Name']}".$srow['ID']." {$surl}
";
}
$query="SELECT ID,smalltitle,sData,picture,picPath,links,mobilevideo,udate FROM news where mStatus=1 AND mCat=6 AND sCat!=2235 ORDER BY udate DESC limit 20";
$result=mysql_query($query) or die(mysql_error());
while($row=mysql_fetch_assoc($result)){
//$row['smalltitle']=htmlentities($row['smalltitle']);
//$row['title']=htmlentities($row['title']);
//$row['sData']=htmlentities($row['sData']);
$sdata=$row['sData'];
if($row['links']){
$goto=htmlspecialchars($row['links']);
$target="target=\"_blank\"";
}
else{
$goto="/Article/".$row['ID'];
$target="target=\"_self\"";
}
$image="https://images.alarab.com/data/news/{$row['picPath']}/{$row['picture']}?aspect_ratio=16:9&auto_optimize=high";
$thumb="https://images.alarab.com/data/news/{$row['picPath']}/{$row['picture']}?aspect_ratio=15:8&auto_optimize=high";
if ($row[mobilevideo] !="" ){
if (strpos($row[mobilevideo], 'youtube') !== false) {
$row[mobilevideo]=$row[mobilevideo];
}else{
$mp4file=basename($row['mobilevideo']);
$mp4file=str_replace(".mp4","",$mp4file);
$mp4file=str_replace(" ","",$mp4file);
if($mp4file < 122212) {
$row[mobilevideo] = "https://cdn.alarab.com/".$mp4file.".mp4/index-v1-a1.m3u8";
}
if($mp4file > 122211 AND $mp4file < 150000) {
$row[mobilevideo] = "https://cdn.alarab.com/".$mp4file.".mp4/index-v1-a1.m3u8";
}
if($mp4file > 151496) {
$row[mobilevideo]= "https://cdn.alarab.com/h264/".$mp4file."_,48,24,0p.mp4.urlset/playlist.m3u8";
/*
$url='http://conv.alarab.com/indicator.php?id='.$mp4file;
//file_get_contents() reads remote webpage content
$lines_string=file_get_contents($url);
//output, you can also save it locally on the server
htmlspecialchars($lines_string);
$lines_string=preg_replace('/\s+/', ' ', $lines_string);
$data=explode(":",$lines_string);
$renderations=str_replace(" ","",$data[0]);
$renderations=str_replace("0p","",$renderations);
$row[mobilevideo]= "https://cdn.alarab.com/h264/".$mp4file."_,".$renderations.",0p.mp4.urlset/playlist.m3u8";
if($renderations=="SD"){
$row[mobilevideo]= "https://cdn.alarab.com/h264/".$mp4file."_".$renderations.",,,.mp4.urlset/playlist.m3u8";
}
*/
}
}
$v=$row[mobilevideo];
}else{
$v="no";
}
$vviews=$row['articleviews'];
if($vviews==0 OR $vviews == "") {
$vviews=100;
}
$xml .="
{$row['ID']}
{$row['smalltitle']}
{$row['sData']}
{$thumb}
{$image}
{$goto}
{$target}
{$vviews}
{$row['udate']}
";
}
}
$xml.="";
$xml.="";
$xml.="
فيديو اخباري
";
$query="SELECT ID,smalltitle,sData,picture,picPath,links,mobilevideo,udate FROM news where mStatus=1 AND mobilevideo!='' ORDER BY udate DESC limit 50";
$result=mysql_query($query) or die(mysql_error());
while($row=mysql_fetch_assoc($result)){
//$row['smalltitle']=htmlentities($row['smalltitle']);
//$row['title']=htmlentities($row['title']);
//$row['sData']=htmlentities($row['sData']);
$sdata=$row['sData'];
if($row['links']){
$goto=htmlspecialchars($row['links']);
$target="target=\"_blank\"";
}
else{
$goto="/Article/".$row['ID'];
$target="target=\"_self\"";
}
$image="https://images.alarab.com/data/news/{$row['picPath']}/{$row['picture']}?aspect_ratio=16:9&auto_optimize=high";
$thumb="https://images.alarab.com/data/news/{$row['picPath']}/{$row['picture']}?aspect_ratio=15:8&auto_optimize=high";
$vviews=$row['articleviews'];
if($vviews==0 OR $vviews == "") {
$vviews=100;
}
if ($row[mobilevideo] !="" ){
if (strpos($row[mobilevideo], 'youtube') !== false) {
$row[mobilevideo]=$row[mobilevideo];
}else{
$mp4file=basename($row['mobilevideo']);
$mp4file=str_replace(".mp4","",$mp4file);
$mp4file=str_replace(" ","",$mp4file);
if($mp4file < 122212) {
$row[mobilevideo] = "https://cdn.alarab.com/".$mp4file.".mp4/index-v1-a1.m3u8";
}
if($mp4file > 122211 AND $mp4file < 150000) {
$row[mobilevideo] = "https://cdn.alarab.com/".$mp4file.".mp4/index-v1-a1.m3u8";
}
if($mp4file > 151496) {
$row[mobilevideo]= "https://cdn.alarab.com/h264/".$mp4file."_,48,24,0p.mp4.urlset/playlist.m3u8";
/*
$url='http://conv.alarab.com/indicator.php?id='.$mp4file;
//file_get_contents() reads remote webpage content
$lines_string=file_get_contents($url);
//output, you can also save it locally on the server
htmlspecialchars($lines_string);
$lines_string=preg_replace('/\s+/', ' ', $lines_string);
$data=explode(":",$lines_string);
$renderations=str_replace(" ","",$data[0]);
$renderations=str_replace("0p","",$renderations);
$row[mobilevideo]= "https://cdn.alarab.com/h264/".$mp4file."_,".$renderations.",0p.mp4.urlset/playlist.m3u8";
if($renderations=="SD"){
$row[mobilevideo]= "https://cdn.alarab.com/h264/".$mp4file."_".$renderations.",,,.mp4.urlset/playlist.m3u8";
}
*/
}
}
$v=$row[mobilevideo];
}else{
$v="no";
}
$xml .="
{$row['ID']}
{$row['smalltitle']}
{$row['sData']}
{$thumb}
{$image}
{$goto}
{$target}
{$vviews}
{$row['udate']}
";
}
$xml.="";
$xml .= "";
$cities=array(294098,294801,293286,281184,293397,295721,293688,294604,281132,295277);
$names=array("الناصرة","حيفا","ام الفحم","القدس","تل ابيب","عكا","راس الناقورة","كفر قاسم","قطاع غزة","ايلات");
for($i=0;$i";
$q = "SELECT id,video FROM arabtv ORDER BY video DESC limit 5";
$res = mysql_query($q) or die(mysql_error());
while($ids = mysql_fetch_array($res, MYSQL_ASSOC)){
$artid=$ids['video'];
$query="SELECT ID,title,smalltitle,picPath,picture,stnews,sData,mobilevideo FROM news WHERE ID=$artid AND mStatus=1 ORDER by id desc";
$result=mysql_query($query) or die(mysql_error());
$row=mysql_fetch_assoc($result);
$image="https://images.alarab.com/data/news/{$row['picPath']}/{$main_img_path}/{$row['picture']}";
$thumb="https://images.alarab.com/data/news/{$row['picPath']}/{$thumb_img_path}/{$row['picture']}";
$file_headers = @get_headers($thumb);
if($file_headers[0] == 'HTTP/1.1 404 Not Found') {
$thumb="https://images.alarab.com/data/news/{$row['picPath']}/150x88/{$row['picture']}";
}
$sdata=text_summarise($row['sData'],3);
$title=text_summarise($row['smalltitle'],6);
$aLink=GenerateLinks("Article",$row['title'],$row['ID'],true);
if($row['mobilevideo']!=''){
$v= str_replace('&', '&',$row['mobilevideo']);
}else{
$v="no";
}
$xml .="
{$row['ID']}
{$row['smalltitle']}
{$row['sData']}
{$thumb}
{$goto}
{$target}
";
}
$xml.="";
$xml.="";
$theUploadFolder="https://images.alarab.com/data/cubes/";
$i=1;
$result = mysql_query("SELECT link,cube,ID FROM cubes WHERE corder !=0 ORDER BY corder ASC LIMIT 22");
while($row = mysql_fetch_array($result)){
if($row['link']!=""){
$link="https://www.alarab.com/redirect.php?url=".$row['link'];
}else{
$link="https://www.alarab.com/redirect.php?url=https://kul.alarab.com/loadads.php?adid={$row['ID']}";
}
$row[cube]=htmlspecialchars($row[cube]);
$link=htmlspecialchars($link);
$xml.="
{$theUploadFolder}{$row['cube']}
{$link}
";
$i++;
}
$xml.="";*/
$vodcat=array(8,299,5573,311);
$tabs=array(1,2,3,4);
$tabname=array("جديد","الاكثر رواجاً","افلام","الأحدث");
for($k=0;$k DATE( NOW( ) - INTERVAL 7
DAY )
ORDER BY views DESC
LIMIT 15" ;
}
if($tab==3) {
$query="SELECT *
FROM vedio_files
WHERE mCat= 1
ORDER BY ID DESC
LIMIT 15" ;
}
if($tab==4) {
$query="SELECT *
FROM vedio_files
WHERE mCat= 10
ORDER BY ID DESC
LIMIT 15" ;
}
$result=mysql_query($query) or die(mysql_error());
$xml .= "";
while($row=mysql_fetch_assoc($result)){
$name=$row['smalltitle'];
$title=$row['smalltitle'];
$t=text_summarise($row['sData'],5) ;
$v_url=url_create("id",$t,$row['ID'],$title);
//$image="https://images6.alarab.com".create_thumb($row['film'])."146-100/" . $row['picture'];
$image="https://images.alarab.com/".create_thumb($row['film']) . $row['picture'];
if ($row['file'] !="" ){
if (strpos(row['file'], 'youtube') !== false) {
$row['file']=$row['file'];
}else{
$mp4file= $row['file'];
if(($mp4file > 5000 AND $mp4file < 96982) OR ($mp4file > 100025 AND $mp4file < 12509) ) {
if($mp4file > 5000 AND $mp4file < 96982) {
$file= "https://cdn.alarab.com/media,,,/{$mp4file}.mp4.urlset/playlist.m3u8";
}
if($mp4file > 100025 AND $mp4file < 12509) {
$file= "https://cdn.alarab.com/hdiphone,,,/{$mp4file}.mp4.urlset/playlist.m3u8";
}
}
if($mp4file > 151496) {
$row[mobilevideo]= "https://cdn.alarab.com/h264/".$mp4file."_,48,24,0p.mp4.urlset/playlist.m3u8";
/*
$url='http://conv.alarab.com/indicator.php?id='.$mp4file;
//file_get_contents() reads remote webpage content
$lines_string=file_get_contents($url);
//output, you can also save it locally on the server
htmlspecialchars($lines_string);
$lines_string=preg_replace('/\s+/', ' ', $lines_string);
$data=explode(":",$lines_string);
$renderations=str_replace(" ","",$data[0]);
$renderations=str_replace("0p","",$renderations);
$row[file]= "https://cdn.alarab.com/h264/".$mp4file."_,".$renderations.",0p.mp4.urlset/playlist.m3u8";
if($renderations=="SD"){
$row[file]= "https://cdn.alarab.com/h264/".$mp4file."_".$renderations.",,,.mp4.urlset/playlist.m3u8";
}
*/
}
}
}
$xml .="
";
}
$xml .= "";
}
$xml .="";
$xml .="+972 52-301-5230";
$xml .="+972 52-301-5230";
$xml .="+972 52-301-5230";
$xml .="+972 52-301-5230";
$xml .="true";
$xml .="No";
$xml .="2";
$xml .="";
$xml .="
https://www.alarab.com/include/ads/app_ads/ad.php?width=320
320
100
https://www.alarab.com/include/ads/app_ads/ad.php?width=320
320
100
https://www.alarab.com/include/ads/app_ads/bad.php?width=320
380
220
https://static.alarab.com/include/ads/app_ads/interstitial.php
320
480
https://www.alarab.com/include/ads/app_ads/ad.php?width=320
320
100
https://www.alarab.com/include/ads/app_ads/bad.php?width=320
380
220
https://www.alarab.com/include/ads/app_ads/ad.php?width=320
320
100
https://www.alarab.com/include/ads/app_ads/ad.php?width=320
320
100
https://www.alarab.com/include/ads/app_ads/bad.php?width=320
380
220
https://www.alarab.com/include/ads/app_ads/ad.php?width=320
320
100
https://www.alarab.com/include/ads/app_ads/ad.php?width=320
320
100
https://www.alarab.com/include/ads/app_ads/ad.php?width=320
320
100
https://www.alarab.com/include/ads/app_ads/ad.php?width=320
320
100
https://www.alarab.com/include/ads/app_ads/ad.php?width=320
320
100
https://www.alarab.com/include/ads/app_ads/ad.php?width=320
320
100
https://www.alarab.com/include/ads/app_ads/ad.php?width=320
320
100
https://www.alarab.com/include/ads/app_ads/ad.php?width=320
320
100
https://www.alarab.com/include/ads/app_ads/ad.php?width=320
320
100
https://www.alarab.com/include/ads/app_ads/ad.php?width=320
320
100
https://www.alarab.com/include/ads/app_ads/ad.php?width=320
320
100
https://www.alarab.com/include/ads/app_ads/ad.php?width=320
320
100
";
$xml .= "$root_element>";
libxml_use_internal_errors(true);
$xml = simplexml_load_string($xml);
if (false === $xml) {
$errors = libxml_get_errors();
echo 'Errors are '.var_export($errors, true);
throw new \Exception('invalid XML');
}
// where $xml_string is the XML data you'd like to use (a well-formatted XML string). If retrieving from an external source, you can use file_get_contents to retrieve the data and populate this variable.
$json = json_encode($xml,JSON_UNESCAPED_UNICODE); // convert the XML string to JSON
$array = json_decode($json,TRUE);
echo $json;
mysql_close($conn);
$fp = fopen($cachefile, 'w');
// save the contents of output buffer to the file
fwrite($fp, ob_get_contents());
// close the file
fclose($fp);
// Send the output to the browser
ob_end_flush();
?>