[原创]给PPVOD2.0内容页添加上一视频和下一视频

2012-07-08飞飞CMS3913

这个是针对ppvod2.0的神棍版修改.修改之前记得备份哦,养成良好习惯.
第一步:打开Lib\Lib\Action\Home\VodAction.class.php 找到

$rs = D("Vod");
$array_vod = $rs->where($where)->relation('Tag')->find();
if($array_vod){

然后在后面插入

$where['vod_id'] = array('lt',$Url['id']);
$array_vod['vod_last']=$rs->switchModel("Adv")->field('vod_id,vod_name,vod_play,vod_cid,vod_jumpurl')->where($where)->order('vod_id desc')->first();
$where['vod_id'] = array('gt',$Url['id']);
$array_vod['vod_next']=$rs->switchModel("Adv")->field('vod_id,vod_name,vod_play,vod_cid,vod_jumpurl')->where($where)->order('vod_id asc')->first();

第二步:打开Lib\Lib\Action\AllAction.class.php 找到

$array_list = list_search(F('_ppvod/list'),'list_id='.$array['vod_cid']);
//播放列表
$array['vod_playlist'] = $this->ff_playlist_all($array);
//2.0新加参数

然后在后面插入

if(!empty($array['vod_last'])){
       $array['vod_lasturl'] = ff_data_url('vod',$array['vod_last']['vod_id'],$array['vod_last']['vod_cid'],$array['vod_last']['vod_name'],1,$array['vod_last']['vod_jumpurl']);
       $array['vod_lastname'] = $array['vod_last']['vod_name'];
}
if(!empty($array['vod_next'])){
       $array['vod_nexturl'] = ff_data_url('vod',$array['vod_next']['vod_id'],$array['vod_next']['vod_cid'],$array['vod_next']['vod_name'],1,$array['vod_next']['vod_jumpurl']);
       $array['vod_nextname'] = $array['vod_next']['vod_name'];
}

第三步:模版调用

上一篇:{$vod_lastname}
下一篇:{$vod_nextname}

关闭

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开微信扫一扫,即可进行扫码打赏哦

支付宝

微信