diff --git a/e107_plugins/log/stats.php b/e107_plugins/log/stats.php index 815a32d5d..fd42db864 100644 --- a/e107_plugins/log/stats.php +++ b/e107_plugins/log/stats.php @@ -24,6 +24,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'); $mes = e107::getMessage(); + e107::css('inline', " /* Site Stats */ @@ -840,7 +841,10 @@ class siteStats */ function renderTodaysVisits($do_errors = FALSE) { - $do_errors = $do_errors && ADMIN && getperms('P'); // Only admins can see page errors + $tp = e107::getParser(); + $template = e107::getTemplate('log', 'log', 'todaysvisits', true, true); + + $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 $totalArray = array(); @@ -864,23 +868,29 @@ class siteStats $totalu += $info['unq']; } - $text = " - - - - - \n"; + $text = $template['start']; foreach($totalArray as $key => $info) { if($info['ttl']) - { + { $percentage = round(($info['ttl']/$totalv) * 100, 2); - $text .= "\n\n\n\n\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 .= "
".ADSTAT_L19."".ADSTAT_L20."%
".$this->getLabel($key)." - ".$this -> bar($percentage, $info['ttl']." [".$info['unq']."]")."".$percentage."%
".ADSTAT_L21." [".ADSTAT_L22."]{$totalv} [{$totalu}]
"; + $var = array('TOTALV' => $totalv, + 'TOTALU' => $totalu, + ); + $text .= $tp->simpleParse($template['end'], $var); + return $text; } diff --git a/e107_plugins/log/templates/log_template.php b/e107_plugins/log/templates/log_template.php new file mode 100644 index 000000000..2e8a14daf --- /dev/null +++ b/e107_plugins/log/templates/log_template.php @@ -0,0 +1,33 @@ + + + + + + +\n"; + +$LOG_TEMPLATE['todaysvisits']['item'] = +"\n\n +\n\n"; + +$LOG_TEMPLATE['todaysvisits']['end'] = +" +
".ADSTAT_L19."".ADSTAT_L20."%
+ +{ITEM_KEY} +{ITEM_BAR}{ITEM_PERC}%
".ADSTAT_L21." [".ADSTAT_L22."]{TOTALV} [{TOTALU}]
+"; + \ No newline at end of file