修改数据库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采集地址相对路径问题深度解析与高效解决方案
相关推荐
- 高效数据洞察:详解ELK Kibana查询与过滤技巧
- 全面指南:第14版ELK Topbeat部署详解与实践
- 深入解析ELK Stack之Logstash架构详解(第22版)
- ELK Stack与Packetbeat高效集成部署教程
- 灰度配置差异解析与新方案设计深度思考:提升系统稳定性的关键策略
- 精通ELK Logstash配置语法详解(第24版):高效日志管理实战指南
- ELK Stack Logstash 详细部署教程及20个版本更新变化解析
- 详解ELK Logstash高效日志处理全流程
- 深入解析ELK Stack中的Packetbeat:协议与进程配置详解
- ELK Stack升级攻略:Logstash 2.0迁移全解析及Logstash-Forwarder至Filebeat平滑过渡实操指南(21世纪版)
搬瓦工中文网





