先上图php
一、phpcms/libs/functions/extention.func.php 插入ajax
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 '未收录'; } }
二、phpcms/modules/content/templates/content_list.tpl.phpcurl
找到<th><?php echo L('title');?></th>
url
下边插入<th>收录</th>
spa
找到<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行code
上边插入<td align='center' class="mylist"><?php echo checkBaiduIndex($r['url']);?></td>
blog
保存上传便可查看效果。教程
ps:缺点--因为不是ajax加载会致使列表页面加载有点慢 求各位会的大神修改发出修改教程图片