plugin('RobotsPlus'); $botlist = $config->botlist; $pagecount = $config->pagecount; $isdrop = $config->droptable; if ($botlist == null || $pagecount == null || $isdrop == null) { throw new Typecho_Plugin_Exception('请先设置插件!'); } $db = Typecho_Db::get(); $prefix = $db->getPrefix(); $p = 1; $rtype = ''; $oldtype = ''; if (isset($_POST['rpage'])) { $p = $_POST['rpage']; } if (isset($_POST['do'])) { $do = $_POST['do']; if ($do == 'delete') { if (isset($_POST['lid'])) { $lids = $_POST['lid']; $deleteCount = 0; if ($lids && is_array($lids)) { foreach ($lids as $lid) { if ($db->query($db->delete($prefix.'robots_logs')->where('lid = ?', $lid))) { $deleteCount ++; } } } Typecho_Widget::widget('Widget_Notice')->set('成功删除蜘蛛日志',NULL,'success'); Typecho_Response::redirect(Typecho_Common::url('extending.php?panel=RobotsPlus%2FLogs.php', $options->adminUrl)); }else{ Typecho_Widget::widget('Widget_Notice')->set('当前没有选择的日志',NULL,'notice'); Typecho_Response::redirect(Typecho_Common::url('extending.php?panel=RobotsPlus%2FLogs.php', $options->adminUrl)); } } if (strpos($do,'clear')!==false) { try { $cleartype = substr($do, 6); $options = Typecho_Widget::widget('Widget_Options'); $timeStamp = $options->gmtTime; $offset = $options->timezone - $options->serverTimezone; $gtime = $timeStamp + $offset; $lowtime = $gtime - ($cleartype * 86400); $db->query($db->delete($prefix.'robots_logs')->where('ltime < ?', $lowtime)); Typecho_Widget::widget('Widget_Notice')->set('清除日志成功',NULL,'success'); Typecho_Response::redirect(Typecho_Common::url('extending.php?panel=RobotsPlus%2FLogs.php', $options->adminUrl)); } catch (Typecho_Db_Exception $e) { Typecho_Widget::widget('Widget_Notice')->set('清除日志失败',NULL,'notice'); Typecho_Response::redirect(Typecho_Common::url('extending.php?panel=RobotsPlus%2FLogs.php', $options->adminUrl)); } } } if (isset($_POST['oldtype'])) { $oldtype = $_POST['oldtype']; } if (isset($_POST['rpage']) && $_POST['rtype']!=='') { $rtype = $_POST['rtype']; if ($oldtype !== $rtype) { $p = 1; } $logs = $db->fetchAll($db->select()->from($prefix.'robots_logs')->where('bot = ?', $rtype)->order($prefix.'robots_logs.lid', Typecho_Db::SORT_DESC)->page($p, $pagecount)); $rows = count($db->fetchAll($db->select('lid')->from($prefix.'robots_logs')->where('bot = ?', $rtype))); }else{ $logs = $db->fetchAll($db->select()->from($prefix.'robots_logs')->order($prefix.'robots_logs.lid', Typecho_Db::SORT_DESC)->page($p, $pagecount)); $rows = count($db->fetchAll($db->select('lid')->from($prefix.'robots_logs'))); } $co = $rows % $pagecount; $pageno = floor($rows / $pagecount); if ($co !== 0) { $pageno += 1; } ?>

操作: 全选, 不选    选中项: 删除    清除选项: 清除所有 保留一天 保留两天 保留三天 保留一周 保留半个月 保留一个月

受访地址 蜘蛛名称 IP地址查询位置 日期
">