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="250px" value="<?php if(isset($data['replace_from'])) echo $data['replace_from']?>"/>替换为
  <input type="text" name="data[replace_to]" style="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