mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 22:27:34 +02:00
Infopanel tweaks
This commit is contained in:
@@ -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 = "
|
||||
|
||||
<table class='table adminlist'>
|
||||
<table class='table table-condensed adminlist'>
|
||||
<colgroup>
|
||||
<col style='width: 10%' />
|
||||
<col style='width: 25%' />
|
||||
@@ -241,13 +245,12 @@ EOF;
|
||||
<th class='center'>Agent</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>";
|
||||
|
||||
|
||||
|
||||
<tbody>";
|
||||
|
||||
$online = $ol->userList();
|
||||
|
||||
$online = $ol->userList() + $ol->guestList();
|
||||
|
||||
// echo "Users: ".print_a($online);
|
||||
|
||||
foreach ($online as $val)
|
||||
{
|
||||
$panelOnline .= "<tr>
|
||||
@@ -339,18 +342,18 @@ EOF;
|
||||
|
||||
if($row['user_bot'] === true)
|
||||
{
|
||||
return "<i class='browser e-bot-32'></i>";
|
||||
return "<i class='browser e-bot-16'></i>";
|
||||
}
|
||||
|
||||
foreach($types as $icon=>$b)
|
||||
{
|
||||
if(strpos($row['user_agent'], $b)!==false)
|
||||
{
|
||||
return "<i class='browsers e-".$icon."-32' ></i>";
|
||||
return "<i class='browsers e-".$icon."-16' ></i>";
|
||||
}
|
||||
}
|
||||
|
||||
return "<i class='browsers e-firefox-32'></i>"; // FIXME find a default icon.
|
||||
return "<i class='browsers e-firefox-16'></i>"; // 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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@@ -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 .= "<a href='".SITEURL."user.php?id.{$vals[0]}'>{$vals[1]}</a> ";
|
||||
$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 .= "<a href='".SITEURL."user.php?id.{$vals[0]}'>{$vals[1]}</a> ";
|
||||
$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;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@@ -221,7 +221,7 @@ $ADMIN_HEADER .= '<div class="container-fluid">
|
||||
{ADMIN_LOG=request}
|
||||
{ADMIN_MSG}
|
||||
{ADMIN_PLUGINS}
|
||||
{ADMIN_UPDATE}
|
||||
|
||||
|
||||
{SETSTYLE=site_info}
|
||||
{ADMIN_SITEINFO}
|
||||
|
Reference in New Issue
Block a user