From c359f1b22c8c5d9bba75b6cee6360fd1a78d1adf Mon Sep 17 00:00:00 2001 From: Kokororin Date: Sat, 8 Oct 2016 10:20:09 +0800 Subject: [PATCH] =?UTF-8?q?1.3=20=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Access.php | 8 -------- Plugin.php | 20 ++++++++++++++++++-- page/console.php | 6 +++--- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/Access.php b/Access.php index 1f4da56..c901827 100644 --- a/Access.php +++ b/Access.php @@ -90,14 +90,6 @@ class Access_Extend "bingbot", ); - public static function getInstance() - { - if (!(self::$_instance instanceof self)) { - self::$_instance = new self(); - } - return self::$_instance; - } - public function parseUA($ua) { $os = null; diff --git a/Plugin.php b/Plugin.php index 36ead4b..c72a40c 100644 --- a/Plugin.php +++ b/Plugin.php @@ -1,10 +1,10 @@ header = array('Access_Plugin', 'start'); + Typecho_Plugin::factory('admin/footer.php')->end = array('Access_Plugin', 'adminFooter'); return _t($msg); } @@ -141,4 +142,19 @@ class Access_Plugin implements Typecho_Plugin_Interface $db->query($db->insert('table.access')->rows($rows)); } + + public static function adminFooter() + { + $url = $_SERVER['PHP_SELF']; + $filename = substr($url, strrpos($url, '/') + 1); + if ($filename == 'index.php') { + echo ''; + } + } } diff --git a/page/console.php b/page/console.php index e927ed5..8451f3e 100644 --- a/page/console.php +++ b/page/console.php @@ -3,7 +3,7 @@ include_once 'common.php'; include 'header.php'; include 'menu.php'; require dirname(__FILE__) . '/../Access.php'; -$extend = Access_Extend::getInstance(); +$extend = new Access_Extend(); ?>
@@ -77,10 +77,10 @@ $extend = Access_Extend::getInstance(); logs['list'] as $log): ?> - "> + "> parseUA($log['ua']); ?> - +