海洋CMS如果出现播放页if判断无效的解决方法

常用判断(用于显示当前播放来源):

{playpage:playlist}<dd id="[playlist:ename]"{if:'{playpage:from}'<>'[playlist:from]'} style="display: none;"{else} style="display: block;"{end if}><p>资源来自<strong>[playlist:from]</strong>,[playlist:intro]</p><ul>[playlist:link]</ul></dd>{/playpage:playlist}
{playpage:playlist}{if:{playpage:from}==[playlist:from]}'#[playlist:ename]'{end if}{/playpage:playlist}

但上面的判断在最新版本,即6.46版中无效。

解决方法:

编辑 /include/mkhtml.func.php 文件,找到第573行,将

$content=$mainClassObj->parseIf($content);
$playArr = playData2Ary($row['v_playdata']);
makePlayByData($vType,$vId,$playArr,$content,date('Y-n',$row['v_addtime']),$row['v_enname'],$stringecho);

修改为

//$content=$mainClassObj->parseIf($content);
$playArr = playData2Ary($row['v_playdata']);
makePlayByData($vType,$vId,$playArr,$content,date('Y-n',$row['v_addtime']),$row['v_enname'],$stringecho);

找到第583行,将:

function makePlayByData($vType,$vId,$playArr,$content,$sdate,$enname,$stringecho)
{
    if($GLOBALS['cfg_ismakeplay']==1){
        for($i=0;$i<$playArr[0];$i++)
        {
            $tmp =$content;
            $tmp = str_replace("{playpage:from}",$playArr[1][$i],$tmp);
            foreach ($playArr[2][$i] as $n=>$play){
                $tmp1 =$tmp;
                $playLink = str_replace($GLOBALS['cfg_cmspath'],"",getPlayLink2($vType,$vId,$sdate,$enname,$i,$n));
                $tmp1 = str_replace("{playpage:part}",$play,$tmp1);
                createTextFile($tmp1,sea_ROOT.$playLink,"");
                $stringecho .= echoEach($play, $i, '..'.$playLink, "play");
            }
        }
    }else{
        $content = str_replace("{playpage:part}","",$content);
        $content = str_replace("{playpage:from}","",$content);
        $playLink = str_replace($GLOBALS['cfg_cmspath'],"",getPlayLink2($vType,$vId,$sdate,$enname));
        createTextFile($content,sea_ROOT.$playLink,"");
    }
    
}

修改为:

function makePlayByData($vType,$vId,$playArr,$content,$sdate,$enname,$stringecho)
{
    global $mainClassObj;
    if($GLOBALS['cfg_ismakeplay']==1){
        for($i=0;$i<$playArr[0];$i++)
        {
            $tmp =$content;
            $tmp = str_replace("{playpage:from}",$playArr[1][$i],$tmp);
            
            foreach ($playArr[2][$i] as $n=>$play){
                $tmp1 =$tmp;
                $playLink = str_replace($GLOBALS['cfg_cmspath'],"",getPlayLink2($vType,$vId,$sdate,$enname,$i,$n));
                $tmp1 = str_replace("{playpage:part}",$play,$tmp1);
                $tmp1=$mainClassObj->parseIf($tmp1);
                createTextFile($tmp1,sea_ROOT.$playLink,"");
                $stringecho .= echoEach($play, $i, '..'.$playLink, "play");
            }
        }
    }else{
        $content = str_replace("{playpage:part}","",$content);
        $content = str_replace("{playpage:from}","",$content);
        $playLink = str_replace($GLOBALS['cfg_cmspath'],"",getPlayLink2($vType,$vId,$sdate,$enname));
        $content=$mainClassObj->parseIf($content);
        createTextFile($content,sea_ROOT.$playLink,"");
    }
    
}

给TA买糖
共{{data.count}}人
人已赞赏
教程

海洋cms地图页按首字母调用时0-9内容不显示的解决方法

2021-9-9 13:15:03

教程

海洋CMS评论内容屏蔽网址,防广告

2021-9-9 13:16:26

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索