脚本宝典收集整理的这篇文章主要介绍了phpcms自动检测百度是否收录插件,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
先上图
function checkBaiduIndex($url){
$url='http://www.baidu.COM/s?wd='.$url;
$curl=curl_init();
curl_setopt($curl,CURLOPT_URL,$url);
curl_setopt($curl,CURLOPT_RETURNtransfer,1);
$rs=curl_exec($curl);
curl_close($curl);
if(!strpos($rs,'抱歉,没有找到')){
return '收录';
}else{
return '未收录';
}
}
2、phpcms/modules/content/templates/content_list.tpl.php
找到<th><?php echo L('tITle');?></th>
下边插入<th>收录</th>
找到<td align='center' title="<?php echo L('today_hits');?>:<?php echo $hits_r['dayviews'];?>&#10;<?php echo L('yestoday_hits');?>:<?php echo $hits_r['yesterdayviews'];?> <?php echo L('week_hits');?>:<?php echo $hits_r['weekviews'];?> <?php echo L('month_hits');?>:<?php echo $hits_r['monthviews'];?>"><?php echo $hits_r['views'];?></td>
大概105行
上边插入<td align='center' class="mylist"><?php echo checkBaiduIndex($r['url']);?></td>
保存上传即可查看效果。
ps:缺点--由于不是ajax加载会导致列表页面加载有点慢 求各位会的大神修改发出修改教程
以上是脚本宝典为你收集整理的phpcms自动检测百度是否收录插件全部内容,希望文章能够帮你解决phpcms自动检测百度是否收录插件所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。