diff --git a/e107_admin/includes/infopanel.php b/e107_admin/includes/infopanel.php index 495f5dadb..73f22ec7d 100644 --- a/e107_admin/includes/infopanel.php +++ b/e107_admin/includes/infopanel.php @@ -193,6 +193,10 @@ EOF; { $text2 .= $ns->tablerender("Visitors Last 10 Days", $this->renderStats(),"core-infopanel_stats",true); } + elseif(e107::isInstalled('awstats')) + { + $text2 .= $ns->tablerender("Visitors this Month", $this->renderStats(),"core-infopanel_stats",true); + } else { $text2 .= $ns->tablerender("Visitors This Week", "Log Statistics Plugin Not Installed","core-infopanel_stats",true); @@ -220,11 +224,11 @@ EOF; $ol = e107::getOnline(); -// echo "Users: ".print_a($ol->userList()); + $panelOnline = " - +
@@ -241,13 +245,12 @@ EOF; - "; - - - + "; - $online = $ol->userList(); - + $online = $ol->userList() + $ol->guestList(); + + // echo "Users: ".print_a($online); + foreach ($online as $val) { $panelOnline .= " @@ -339,18 +342,18 @@ EOF; if($row['user_bot'] === true) { - return ""; + return ""; } foreach($types as $icon=>$b) { if(strpos($row['user_agent'], $b)!==false) { - return ""; + return ""; } } - return ""; // FIXME find a default icon. + return ""; // FIXME find a default icon. } @@ -490,7 +493,11 @@ EOF; function getStats() { - + if(file_exists(e_PLUGIN."awstats/awstats.graph.php")) //FIXME Cam: Find a generic solution. + { + require_once(e_PLUGIN."awstats/awstats.graph.php"); + return; + } diff --git a/e107_handlers/online_class.php b/e107_handlers/online_class.php index bec39b1e6..3d6505ecd 100755 --- a/e107_handlers/online_class.php +++ b/e107_handlers/online_class.php @@ -60,6 +60,7 @@ class e_online { public $users = array(); + public $guests = array(); function __construct() @@ -242,20 +243,16 @@ class e_online $sql->db_Delete('online', '`online_timestamp` < '.(time() - $online_timeout)); // FIXME - don't use constants below, save data in class vars, call e_online signleton - e107::getOnline() - $total_online = $sql->db_Count('online'); - if ($members_online = $sql->db_Select('online', '*', 'online_user_id != 0')) + // $total_online = $sql->db_Count('online'); // 1 less query! :-) + if ($total_online = $sql->db_Select_gen('SELECT * FROM #online WHERE online_pagecount > 0 ORDER BY online_timestamp DESC')) { $member_list = ''; + $members_online = 0; $listuserson = array(); while ($row = $sql->db_Fetch()) { $row['online_bot'] = $this->isBot($row['online_agent']); - - - $vals = explode('.', $row['online_user_id'], 2); - $member_list .= "{$vals[1]} "; - $listuserson[$row['online_user_id']] = $row['online_location']; - + // Sort into usable format and add bot field. $user = array( 'user_id' => $vals[0], @@ -271,7 +268,20 @@ class e_online 'online_user_id' => $row['online_user_id'] ); - $this->users[] = $user; + if($row['online_user_id'] != 0) + { + $vals = explode('.', $row['online_user_id'], 2); + $member_list .= "{$vals[1]} "; + $listuserson[$row['online_user_id']] = $row['online_location']; + + $this->users[] = $user; + $members_online++; + } + else + { + $this->guests[] = $user; + } + } } @@ -310,6 +320,11 @@ class e_online } + function guestList() + { + return $this->guests; + + } diff --git a/e107_themes/bootstrap/admin_template.php b/e107_themes/bootstrap/admin_template.php index 8b8915045..0e28a089e 100644 --- a/e107_themes/bootstrap/admin_template.php +++ b/e107_themes/bootstrap/admin_template.php @@ -221,7 +221,7 @@ $ADMIN_HEADER .= '
{ADMIN_LOG=request} {ADMIN_MSG} {ADMIN_PLUGINS} - {ADMIN_UPDATE} + {SETSTYLE=site_info} {ADMIN_SITEINFO}
Agent