From 546ec32899047bce396e37fd2837afa29a0a027f Mon Sep 17 00:00:00 2001 From: Jimmi08 Date: Sat, 20 Jan 2018 12:46:50 +0100 Subject: [PATCH] browser stats templated --- e107_plugins/log/stats.php | 43 ++++++++++----------- e107_plugins/log/templates/log_template.php | 29 ++++++++++++-- 2 files changed, 47 insertions(+), 25 deletions(-) diff --git a/e107_plugins/log/stats.php b/e107_plugins/log/stats.php index 47cc3f0c7..c10a4530c 100644 --- a/e107_plugins/log/stats.php +++ b/e107_plugins/log/stats.php @@ -956,7 +956,7 @@ class siteStats 'ITEM_TITLE' => $this->getLabel($key), 'ITEM_BAR' => $this->bar($percentage, $info['ttlv']), 'ITEM_PERC'=> $percentage, - 'ITEM_DELETE'=> ($can_delete ? " ($can_delete ? " ".ADSTAT_L39." " : ""), ); $text .= $tp->simpleParse($template['item'], $var); @@ -1097,18 +1097,11 @@ class siteStats $total = array_sum($browserArray); - $text .= " - \n - - - \n - - - \n - - \n"; + $var = array('START_CAPTION' => $this->browser_headings[$act].$pars['hdg_extra'], + 'START_TITLE' => ($this -> order ? ADSTAT_L48 : ADSTAT_L49), + 'START_URL' => e_SELF."?".($show_version ? "3" : "14").($this -> order ? "" : ".1" ), + ); + $text .= $tp->simpleParse($template['start'], $var); if (count($browserArray)) { @@ -1128,20 +1121,26 @@ class siteStats $image = "unknown.png"; } $percentage = round(($info/$total) * 100, 2); - $text .= " - ". - ($entries == 1 ? "" : "")." - - \n"; + $var = array( + 'ITEM_IMAGE' => ($image ? " " : ""), + 'ITEM_KEY' => $key, + 'ITEM_BAR' => $this -> bar($percentage, $info), + 'ITEM_PERC'=> $percentage, + ); + $text .= $tp->simpleParse($template['item'], $var); + + $text .= ""; } - $text .= " - \n"; + + $var = array('TOTAL' => number_format($total), + ); + $text .= $tp->simpleParse($template['end'], $var); + $text .= ""; } else { - $text .= "\n"; + $text .= $tp->simpleParse($template['nostatistic']); } - $text .= "
".$this->browser_headings[$act].$pars['hdg_extra']."
- ".ADSTAT_L26." - ".ADSTAT_L21."%
".($image ? " " : "").$key."".$this -> bar($percentage, $info)."".$this -> bar($percentage, $info)."".$percentage."%
".ADSTAT_L21."{$total}
".ADSTAT_L25."

"; } return $text; } diff --git a/e107_plugins/log/templates/log_template.php b/e107_plugins/log/templates/log_template.php index 4e2b7ea43..89075b735 100644 --- a/e107_plugins/log/templates/log_template.php +++ b/e107_plugins/log/templates/log_template.php @@ -80,9 +80,32 @@ $LOG_TEMPLATE['alltimevisits_unique']['end'] = " \n"; -$LOG_TEMPLATE['browsers']['start'] = ""; -$LOG_TEMPLATE['browsers']['item'] = ""; -$LOG_TEMPLATE['browsers']['end'] = ""; +$LOG_TEMPLATE['browsers']['start'] = " +
+\n + + + \n + + + \n + + \n"; +$LOG_TEMPLATE['browsers']['item'] = " + + + + +\n"; +$LOG_TEMPLATE['browsers']['end'] = " + + +
{START_CAPTION}
+ ".ADSTAT_L26." + ".ADSTAT_L21."%
{ITEM_IMAGE}{ITEM_KEY}{ITEM_BAR}{ITEM_PERC}%
".ADSTAT_L21."{TOTAL}

"; + +$LOG_TEMPLATE['browsers']['nostatistic'] = +"".ADSTAT_L25."
"; $LOG_TEMPLATE['oses']['start'] = ""; $LOG_TEMPLATE['oses']['item'] = "";