本要领有插件完成,本教程由独狼移植四少爷 博客制造的插件,如许就不必开启插件便可以使用了, 经由测试一般刚刚宣布,只为网络EMLOG教程,让更多的网友受益。不空话了,下面进入正题,起首将以下代码存放在模板目次的module文件中:
<?php //推断内容页是不是百度收录function baidu($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 1;}else{return 0;}}function logurl($id){$url=str_replace(array('http://'),'',Url::log($id));if(baidu($url)==1){echo "百度已收录";}else{echo "<a style=\"color:red;\" rel=\"external nofollow\" title=\"点击提交收录!\" target=\"_blank\" href=\"http://zhanzhang.baidu.com/sitesubmit/index?sitename=$url\">百度未收录</a>";}}?>在模板的echo_log.php文件中挪用<?php echo logurl($logid);?>即可。

评论列表