phpcms采集地址中为相对路径解决方法

1.修改数据库v9_collection_node,增加两个字段replace_from,replace_to(varchar(200))

2./phpcms/modules/collection/templates/node_form.tpl.php第99行后增加

<tr>
<td width="120">网址替换:</td>
<td>
  <input type="text" name="data[replace_from]" style="width:250px" value="<?php if(isset($data['replace_from'])) echo $data['replace_from']?>"/>替换为
  <input type="text" name="data[replace_to]" style="width:250px" value="<?php if(isset($data['replace_to'])) echo $data['replace_to']?>"/>
</td>
</tr>

3./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);

 

转载于:https://www.cnblogs.com/savokiss/p/4019285.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值