标签 判断 下的文章

SeaCMS后台自定义采集增加图片判断以决定新增或更新原数据

编辑 /include/collection.class.php 文件 找到:

//else 不勾选[只更新影片地址]
elseif(strpos($cfg_gatherset,'4')!==false)
{
        return $autocol_str.$this->update_movie_info_pic($rs,$v_data);
}

在下方插入:

elseif($v_data['v_pic']!==$rs['v_pic'])
{
        return $autocol_str.$this->_insert_database($v_data);
}

注:后台 智能采集设置 中仅勾选 按地址判断是否更新

SeaCMS播放页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版中无效。

- 阅读剩余部分 -

PHP判断搜索引擎蜘蛛来路进行301跳转

<?php
if (preg_match("#(Baiduspider|Googlebot|Sogou spider|Sogou web spider|Sogou wap spider|YodaoBot|YandexBot|bingbot|Yahoo! Slurp|MSNBot|Bytespider|YisouSpider|360Spider|Yahoo)#si", $_SERVER['HTTP_USER_AGENT'])) {
    header("HTTP/1.1 301 Moved Permanently");
    header("Location: https://www.2dan.cc/");
    exit;
}
?>

用户访问网站完全正常,搜索引擎蜘蛛 User Agent 就301跳转。这个不得不说很隐蔽,被搞了不容易发现。