修改数据库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采集地址相对路径问题深度解析与高效解决方案
相关推荐
- 如何在WordPress中优雅地显示文章日期:详细教程与代码示例
- 帝国CMS图集字段使用技巧:大图、小图及说明的完美调用方法详解
- 如何在帝国CMS网站快速生成并优化Sitemap提升SEO效果
- 如何使用array_unique函数在PHPCMS V9中高效解决采集网址重复问题
- DedeCMS 栏目列表页链接优化技巧:提升搜索引擎排名的实用攻略
- WordPress 在无Gzip模块的主机上实现JS和CSS压缩优化技巧
- WordPress 优化指南:提升网站速度与SEO排名的全面技巧
- dedecms blog博客模板安装详细指南:轻松搭建个性化博客
- 如何在WordPress中为自定义主题添加AJAX提交评论功能
- 帝国CMS教程:高效自定义列表SQL调用技巧详解