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']); ?> - +