修改数据库v9_collection_node,增加两个字段replace_from,replace_to(varchar(200))
1、 /phpcms/modules/collection/templates/node_form.tpl.php第99行后增加(位置在</table></fieldset>之前)
<tr>
<td width=”120″>网址替换:</td>
<td>
<input type=”text” name=”data[replace_from]” value=”<?php if(isset($data[‘replace_from’])) echo $data[‘replace_from’]?>”/>替换为
<input type=”text” name=”data[replace_to]” value=”<?php if(isset($data[‘replace_to’])) echo $data[‘replace_to’]?>”/>
</td>
</tr>
2、 /phpcms/modules/collection/classes/collection.class.php第177行后增加(位置在:$html = str_replace(array(“</a>”, “</A>”), “</a> “, $html);之后)
if(!empty($config[‘replace_from’])){
$html = str_replace($config[‘replace_from’], $config[‘replace_to’], $html);}
3、 进入数据库给 数据库名_collection_node 增加字段:replace_from 和 replace_to 两个字段。字数50-100都可以。
然后在采集管理中我们能看到有替换网址的选项啦。将多余的../之类的替换掉就行了。
PHPCMS V9采集地址相对路径问题深度解析与高效解决方案
未经允许不得转载:搬瓦工中文网 » PHPCMS V9采集地址相对路径问题深度解析与高效解决方案
相关推荐
- 如何在Ubuntu系统中轻松安装、更新和删除Snap包:新手必看的简单使用指南
- 如何在CentOS 6/7系统中使用Yum轻松安装PHP 7:详细步骤指南
- Linux服务器安全检查必备:十款高效工具全面扫描恶意软件与漏洞
- CentOS 7 PHP环境配置详解:GD库及其他常用插件安装全攻略
- 如何在CentOS 7系统中安装PHP GD库:详细步骤与实例解析
- 如何在命令行中快速获取并监控公网动态IP地址的实时变化
- Linux 性能优化必备:13款超实用网络监控工具详解
- Windows IIS应用程序池配置详细指南与性能优化技巧
- 如何在Ubuntu 16.04系统中为PyCharm创建桌面快捷方式:详细步骤指南
- Oracle Linux 与 CentOS:深度对比解析,企业级系统替代选择指南
搬瓦工中文网





