<?php
require "../e/class/connect.php";
require "../e/class/db_sql.php";
require('../e/data/dbcache/class.php'); //引入栏目缓存文件
require "../e/class/movie_config.php";
require "../e/class/userfun.php";
$p=(int)$_GET[p];
$p=$p==''?0:$p;
$line=1000;
$offset=$p*$line;
$link=db_connect();
$empire=new mysqlquery;
$query="select classid,id,title,playurl,stb,filename from {$dbtbpre}ecms_movie order by id asc limit $offset,$line";
$query=$empire->query($query);
while($r=$empire->fetch($query)){
	  $stb=$r[stb];
$dataquery="select movieshow from {$dbtbpre}ecms_movie_data_".$stb." where id='$r[id]' ";
$r2=$empire->fetch1($dataquery);
$add=array_merge($r,$r2);
$playurl=getplayurl($add);
$id=$add[id];
$endtype=1;
$up=$empire->query("update {$dbtbpre}ecms_movie set playurl='$playurl' where id=$add[id] limit 1");
/*
if($up){ echo "<font color='green'>更新-->  $id 播放地址成功  playurl= $playurl</font><br />";}
else{ echo  "<font color='red'>更新-->  $id 播放地址失败</font><br />"; }
*/
$tid=$id;
$endtype=1;
}



$empire=NULL;
db_close();
$pagea=$p+1;

if(empty($endtype)){
echo"<br />刷新所有页面成功";
}
else{
echo '更新ID<b style="color:#f00;">'.$tid.'</b>成功！';	
echo"<meta http-equiv=\"refresh\" content=\"0;url=replayurl.php?&p=".$pagea."\">";
}


?>