1
0
Code Issues Pull Requests Projects Releases Wiki Activity GitHub Gitee

111 lines
4.7 KiB
PHP
Raw Normal View History

2022-01-26 02:20:35 +08:00
<?php
$zbp->Load();
$action='root';
$act = '';
if (isset($_GET['act']) && $_GET['act']){$act = $_GET['act'] == "" ? 'config' : $_GET['act'];}
else $act = "config";
?>
<!--<script>alert(1);</script>-->
<link rel="stylesheet" type="text/css" href="plugin/spider/style.css"/>
<div class="SubMenu" style="overflow: initial;">
<?php zxd_ctrlcenter_spider_SubMenu($act);?>
</div>
<!--代码-->
<?php if ($act == 'config' || $act == ''){ ?>
<?php
if(isset($_POST['viewconut'])) {
$zbp->Config('zxd_ctrlcenter') -> plugin_spider_viewconut = $_POST['viewconut'];
$zbp->Config('zxd_ctrlcenter') -> plugin_spider_spiders = $_POST['spiders'];
$zbp->SaveConfig('zxd_ctrlcenter');
$zbp->SetHint('good');
Redirect('./main.php?&plugin=spider&act=config');
}
?>
<p style="color: red;">如果下面两个文本框默认状态下是空白的,没有内容,说明插件升级不完全,将【控制中心】插件关闭后再开启一次即可。关闭插件不会丢失其他子插件配置。</p>
<form method="post">
<table class="tb-set" width="100%">
<tr>
<td align="right"><b>显示篇数:</b></td>
<td><input type="text" class="txt" name="viewconut" value="<?php echo $zbp->Config('zxd_ctrlcenter') -> plugin_spider_viewconut; ?>" /></td>
</tr>
<tr>
<td align="right"><b>蜘蛛列表:</b><br />格式:蜘蛛名称,显示名称。<br />多个用“|”分隔,Baiduspider,Baidu|Googlebot,Google。</td>
<td><textarea class="txt txt-lar" name="spiders"><?php echo $zbp->Config('zxd_ctrlcenter') -> plugin_spider_spiders; ?></textarea></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="submit" name="submit" value="保存" /></td>
</tr>
</table>
<!-- CSRF -->
<?php if (function_exists('CheckIsRefererValid')) {echo '<input type="hidden" name="csrfToken" value="' . $zbp->GetCSRFToken() . '">';}?>
</form>
<p>模拟百度抓取查看插件效果:<a href="https://tools.aizhan.com/rb/" target="_blank">点击前往</a><br />输入要检测的网页URL如您的Z-Blog网站首页<?=$GLOBALS['bloghost']; ?>。</p>
<br />
【备注】
<p>1. 本插件可与【流年岁月】的【来访蜘蛛统计】同时开启,但无必要,且数据不互通,建议只开启一个。同时开启相当于每个插件分别记录,互不干扰。</p>
<p>2. 右上角清除设置和关闭插件均不会清空统计结果如需删除或清空统计结果请登录后台数据库删除表【表前缀_zxd_ctrlcenter_spider】。再次使用本【蜘蛛来访统计】子插件需要关闭【控制中心】插件然后再次打开以创建新表。</p>
<p>3. 本插件与爱站网无任何利益关系,提供上方的跳转将连接仅为方便测试插件是否能正常工作。对于该站点,本插件作者不保证服务始终可用,也不承担因此引发的任何问题。</p>
<br />
【默认设置】
<p>如果您不小心修改了上方文本框中的内容,可以将下方参数复制到上方文本框并保存以恢复默认设置。</p>
<p>显示篇数20</p>
<p>蜘蛛列表Baiduspider,Baidu|Googlebot,Google|Sosospider,SoSo|YoudaoBot,YouDao|bingbot,Bing|Sogou web spider,SoGou|Yahoo! Slurp,Yahoo|Alexa,Alexa|360Spider,So</p>
<br />
<?php } if ($act == 'spider') {
echo '<table border="1" class="tableFull tableBorder tableBorder-thcenter">';
echo '<tr>
<th> ID </th>
<th> 蜘蛛名称 </th>
<th> 蜘蛛IP </th>
<th> 抓取时间 </th>
<th> 抓取地址 </th>
<th> 抓取状态 </th>
</tr>';
$p = new Pagebar('{%host%}zb_users/plugin/zxd_ctrlcenter/main.php?plugin=spider&act=spider{&page=%page%}',false);
$p->PageCount = $zbp->Config('zxd_ctrlcenter') -> plugin_spider_viewconut;
$p->PageNow = (int)GetVars('page','GET')==0?1:(int)GetVars('page','GET');
$p->PageBarCount = $zbp->pagebarcount;
$select = array('*');
$where = array();
$order = array('Spider_ID'=>'DESC');
$limit = array(($p->PageNow-1) * $p->PageCount,$p->PageCount);
$option = array('pagebar'=>$p);
error_reporting(0); // 屏蔽掉可能出现的 Undefined index: ZC_MYSQL_ENGINE 提示
$sql = $zbp->db->sql->Select($zbp->table['zxd_ctrlcenter_spider'], $select, $where, $order, $limit, $option);
$array = $zbp->GetListType('zxd_ctrlcenter_spider',$sql);
foreach ($array as $key => $value) {
echo '<tr>';
echo '<td class="td5">' . $value->ID . '</td>';
echo '<td class="td5">' . $value->Name . '</td>';
echo '<td class="td5">' . $value->IP . '</td>';
echo '<td class="td20">' .$value->Time() . '</td>';
echo '<td><a href="'.$value->Url.'" target="_blank">' .$value->Url . '</a></td>';
echo '<td class="td5">' . $value->Status . '</td>';
echo '</tr>';
}
echo '</table>';
echo '<hr/><p class="pagebar">';
foreach ($p->buttons as $key => $value) {
echo '<a href="'. $value .'">' . $key . '</a>&nbsp;&nbsp;' ;
}
echo '</p>';
} ?>