先上图
1、phpcms/libs/functions/extention.func.php 插入
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'];?> <?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加载会导致列表页面加载有点慢 求各位会的大神修改发出修改教程
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。