免安装,外链杀手,代码版,for 3.0 and 4.0免安装插件! [复制链接]

moqu8 2017-4-6

3214 0
3.0:
在模版,pc/view/ , mobile/view/
thread.htm的$first['message'],和post_list_body.inc.htm的$_post['message'] 代码之前分别插入:
<?php
$first['message'] = preg_replace('/<a href=(\W?)(\s*)/i',"<a href=\"",$first['message']);
$first['message'] = str_ireplace('href="http://'.$_SERVER['HTTP_HOST'].'/',"href=\"",$first['message']);
$first['message'] = str_ireplace('href="http://',"rel=\"nofollow\" href=\"http://",$first['message']);
$first['message'] = str_ireplace('href="https://',"rel=\"nofollow\" href=\"https://",$first['message']);
?>


<?php
$_post['message'] = preg_replace('/<a href=(\W?)(\s*)/i',"<a href=\"",$_post['message']);
$_post['message'] = str_ireplace('href="http://'.$_SERVER['HTTP_HOST'].'/',"href=\"",$_post['message']);
$_post['message'] = str_ireplace('href="http://',"rel=\"nofollow\" href=\"http://",$_post['message']);
$_post['message'] = str_ireplace('href="https://',"rel=\"nofollow\" href=\"https://",$_post['message']);
?>

那么,也可以利用跳转URL等方式:
	
$first['message'] = str_ireplace('href="http://',"rel=\"nofollow\" href=\"http://跳转url/?http://",$first['message']);

类似方法利用吧!

4.0:
也是针对模版文件,一个文章文件,一个回复文件,因为没怎么研究,大概是以下这两个文件,对应的修改一下就行了,上面代码也对应修改。。。如有错误请指出,这里只是提供思路!
thread.htm
<?php echo $first['message_fmt'];?>
thread_list.inc.htm
<?php echo $_thread['posts'];?>

因为4.0现在还没出正式版,所以研究了一下3.0的采集和外链,有这2个就能开搞了,本来是弄4.0的,但是出现一些问题吧,采集测试了几次都是有问题的,懒得弄了,3.0就比较完美了,采集内容和用户,自动发布,配合火车头几乎不用管了,也是因为之前站数据量太大,最后找到了xiuno,希望能扛得住吧,起码能抗个几年吧,dede都抗了很多年了,很久没动手了,有点生疏了,还好xiuno上手比较容易吧。。。。


最新回复 (0)
返回
支持中心
邮箱:winkill2012@qqcom
新站优化中!部分功能尚未完善,敬请谅解!
支持中心