织梦DEDECMS视频模型中有一个小小的问题,即重新生成时没有aid的问题!而此文章解决DEDE视频模型中重新生成时没有aid的问题
//视频模型播放列表函数
function palyList($viedolist)
{
//return $viedolist;
//exit();
global $cfg_phpurl,$aid,$ID;
if(empty($aid)){
$vid = $ID;
}else{
$vid = $aid;
}
if(empty($vid)){
//if vid is empty ,the query from database ;
$strqueryid="SELECT aid FROM `ym_addonvideo` where videolist=\"".$viedolist."\"";
$dplaysql = new DedeSql();
$rsvid = $dplaysql->GetOne($strqueryid);
$vid=$videolist = $rsvid['aid'];
}
if(empty($viedolist)) {
return '播放列表为空!!!';
exit();
}
$list = explode('||',$viedolist);
//print_r($list);
//exit();
$palylist = '';
for($i=0;$i<count($list);$i++){
$video = explode('|',$list[$i]);
if(empty($video[0])) continue ;
if(empty($video[1])) continue ;
$play = $i+1;
//$url = $video[1];
$palylist .="<a href=\"{$cfg_phpurl}/play.php?aid={$vid}&play={$play}\" target=\"_blank\">{$video[0]}</a>";
}
unset($vid);
return $palylist;
}
?>