mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 21:27:25 +02:00
TodaysVisits templated
This commit is contained in:
@@ -25,6 +25,7 @@ e107::includeLan(e_PLUGIN.'log/languages/'.e_LANGUAGE.'.php');
|
|||||||
$bar = (file_exists(THEME.'images/bar.png') ? THEME_ABS.'images/bar.png' : e_IMAGE_ABS.'generic/bar.png');
|
$bar = (file_exists(THEME.'images/bar.png') ? THEME_ABS.'images/bar.png' : e_IMAGE_ABS.'generic/bar.png');
|
||||||
$mes = e107::getMessage();
|
$mes = e107::getMessage();
|
||||||
|
|
||||||
|
|
||||||
e107::css('inline', "
|
e107::css('inline', "
|
||||||
/* Site Stats */
|
/* Site Stats */
|
||||||
.b { background-image: url('".$bar."'); border: 1px solid #999; height: 10px; font-size: 0px }
|
.b { background-image: url('".$bar."'); border: 1px solid #999; height: 10px; font-size: 0px }
|
||||||
@@ -840,6 +841,9 @@ class siteStats
|
|||||||
*/
|
*/
|
||||||
function renderTodaysVisits($do_errors = FALSE)
|
function renderTodaysVisits($do_errors = FALSE)
|
||||||
{
|
{
|
||||||
|
$tp = e107::getParser();
|
||||||
|
$template = e107::getTemplate('log', 'log', 'todaysvisits', true, true);
|
||||||
|
|
||||||
$do_errors = $do_errors && ADMIN && getperms('P'); // Only admins can see page errors
|
$do_errors = $do_errors && ADMIN && getperms('P'); // Only admins can see page errors
|
||||||
|
|
||||||
// Now run through and keep either the non-error pages, or the error pages, according to $do_errors
|
// Now run through and keep either the non-error pages, or the error pages, according to $do_errors
|
||||||
@@ -864,23 +868,29 @@ class siteStats
|
|||||||
$totalu += $info['unq'];
|
$totalu += $info['unq'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$text = "<table class='table table-striped fborder' style='width: 100%;'>
|
$text = $template['start'];
|
||||||
<tr>
|
|
||||||
<th class='fcaption' style='width: 20%;'>".ADSTAT_L19."</th>
|
|
||||||
<th class='fcaption' style='width: 70%;' colspan='2'>".ADSTAT_L20."</th>
|
|
||||||
<th class='fcaption' style='width: 10%; text-align: center;'>%</th>
|
|
||||||
</tr>\n";
|
|
||||||
|
|
||||||
foreach($totalArray as $key => $info)
|
foreach($totalArray as $key => $info)
|
||||||
{
|
{
|
||||||
if($info['ttl'])
|
if($info['ttl'])
|
||||||
{
|
{
|
||||||
$percentage = round(($info['ttl']/$totalv) * 100, 2);
|
$percentage = round(($info['ttl']/$totalv) * 100, 2);
|
||||||
$text .= "<tr>\n<td class='forumheader3' style='width: 20%;text-align:left'><img src='".e_PLUGIN."log/images/html.png' alt='' style='vertical-align: middle;' /> <a href='".$info['url']."'>".$this->getLabel($key)."</a>
|
|
||||||
</td>\n<td class='forumheader3' style='width: 70%;'>".$this -> bar($percentage, $info['ttl']." [".$info['unq']."]")."</td>\n<td class='forumheader3' style='width: 10%; text-align: center;'>".$percentage."%</td>\n</tr>\n";
|
$var = array('ITEM_URL' => $info['url'],
|
||||||
|
'ITEM_KEY' => $this->getLabel($key),
|
||||||
|
'ITEM_BAR' => $this -> bar($percentage, $info['ttl']." [".$info['unq']."]"),
|
||||||
|
'ITEM_PERC'=> $percentage,
|
||||||
|
);
|
||||||
|
|
||||||
|
$text .= $tp->simpleParse($template['item'], $var);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$text .= "<tr><td class='forumheader' colspan='2'>".ADSTAT_L21." [".ADSTAT_L22."]</td><td class='forumheader' style='text-align: center;'>{$totalv} [{$totalu}]</td><td class='forumheader'></td></tr></table>";
|
$var = array('TOTALV' => $totalv,
|
||||||
|
'TOTALU' => $totalu,
|
||||||
|
);
|
||||||
|
$text .= $tp->simpleParse($template['end'], $var);
|
||||||
|
|
||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
33
e107_plugins/log/templates/log_template.php
Normal file
33
e107_plugins/log/templates/log_template.php
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright (C) e107 Inc (e107.org), Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
* News menus templates
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('e107_INIT')) exit;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$LOG_TEMPLATE['todaysvisits']['start'] =
|
||||||
|
"<div class='table-responsive' id='log-todaysvisits'>
|
||||||
|
<table class='table table-striped fborder' style='width: 100%;'>
|
||||||
|
<tr>
|
||||||
|
<th class='fcaption' style='width: 20%;'>".ADSTAT_L19."</th>
|
||||||
|
<th class='fcaption' style='width: 70%;' colspan='2'>".ADSTAT_L20."</th>
|
||||||
|
<th class='fcaption' style='width: 10%; text-align: center;'>%</th>
|
||||||
|
</tr>\n";
|
||||||
|
|
||||||
|
$LOG_TEMPLATE['todaysvisits']['item'] =
|
||||||
|
"<tr>\n<td class='forumheader3' style='width: 20%;text-align:left'>
|
||||||
|
<img src='".e_PLUGIN."log/images/html.png' alt='' style='vertical-align: middle;' />
|
||||||
|
<a href='{ITEM_URL}'>{ITEM_KEY}</a>
|
||||||
|
</td>\n<td class='forumheader3' style='width: 70%;'>{ITEM_BAR}</td>
|
||||||
|
<td class='forumheader3' style='width: 10%; text-align: center;'>{ITEM_PERC}%</td>\n</tr>\n";
|
||||||
|
|
||||||
|
$LOG_TEMPLATE['todaysvisits']['end'] =
|
||||||
|
"<tr><td class='forumheader' colspan='2'>".ADSTAT_L21." [".ADSTAT_L22."]</td><td class='forumheader' style='text-align: center;'>{TOTALV} [{TOTALU}]</td>
|
||||||
|
<td class='forumheader'></td></tr></table>
|
||||||
|
</div>";
|
||||||
|
|
Reference in New Issue
Block a user