1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 20:00:37 +02:00

domains stats templated

This commit is contained in:
Jimmi08
2018-01-24 19:19:34 +01:00
parent b502aeb0b6
commit f36ee93666
2 changed files with 41 additions and 18 deletions

View File

@@ -1267,8 +1267,8 @@ class siteStats
); );
$text .= $tp->simpleParse($template['item'], $var); $text .= $tp->simpleParse($template['item'], $var);
} }
$var = array('TOTAL' => number_format($total), $var = array('TOTAL' => number_format($total));
);
$text .= $tp->simpleParse($template['end'], $var); $text .= $tp->simpleParse($template['end'], $var);
} }
else else
@@ -1335,11 +1335,11 @@ class siteStats
} }
$total = array_sum($domArray); $total = array_sum($domArray);
$text .= " <table class='table table-striped fborder' style='width: 100%;'>\n $var = array('START_CAPTION' => $this->browser_headings[$act].$pars['hdg_extra'],
<tr><td class='fcaption' colspan='4' style='text-align:center'>".$this->browser_headings[$act].$pars['hdg_extra']."</td></tr>\n 'START_TITLE' => ($this -> order ? "sort by total" : "sort alphabetically"),
<tr>\n<td class='fcaption' style='width: 20%;'> 'START_URL' => e_SELF."?5".($this -> order ? "" : ".1" ),
<a title='".($this -> order ? "sort by total" : "sort alphabetically")."' href='".e_SELF."?5".($this -> order ? "" : ".1" )."'>".ADSTAT_L28."</a></td>\n );
<td class='fcaption' style='width: 70%;' colspan='2'>".ADSTAT_L21."</td>\n<td class='fcaption' style='width: 10%; text-align: center;'>%</td>\n</tr>\n"; $text .= $tp->simpleParse($template['start'], $var);
if (count($domArray)) if (count($domArray))
{ {
@@ -1348,20 +1348,22 @@ class siteStats
if($key = $this -> getcountry($key)) if($key = $this -> getcountry($key))
{ {
$percentage = round(($info/$total) * 100, 2); $percentage = round(($info/$total) * 100, 2);
$text .= "<tr> $var = array(
<td class='forumheader3' style='width: 20%;'>".$key."</td> 'ITEM_KEY' => $key,
<td class='forumheader3' style='width: 70%;'>".$this -> bar($percentage, $info)."</td> 'ITEM_BAR' => $this -> bar($percentage, $info),
<td class='forumheader3' style='width: 10%; text-align: center;'>".$percentage."%</td> 'ITEM_PERC'=> $percentage,
</tr>\n"; );
$text .= $tp->simpleParse($template['item'], $var);
} }
} }
$text .= "<tr><td class='forumheader' colspan='2'>".ADSTAT_L21."</td><td class='forumheader' style='text-align: center;'>$total</td><td class='forumheader'></td></tr>\n"; //before: $var = array('TOTAL' => $total,
$var = array('TOTAL' => number_format($total));
$text .= $tp->simpleParse($template['end'], $var);
} }
else else
{ {
$text .= "<tr><td class='fcaption' colspan='4' style='text-align:center'>".ADSTAT_L25."</td></tr>\n"; $text .= $tp->simpleParse($template['nostatistic']);
} }
$text .= "</table><br />";
} }
return $text; return $text;
} }

View File

@@ -130,9 +130,30 @@ $LOG_TEMPLATE['oses']['end'] = "
$LOG_TEMPLATE['oses']['nostatistic'] = $LOG_TEMPLATE['browsers']['nostatistic']; $LOG_TEMPLATE['oses']['nostatistic'] = $LOG_TEMPLATE['browsers']['nostatistic'];
$LOG_TEMPLATE['domains']['start'] = ""; $LOG_TEMPLATE['domains']['start'] = "
$LOG_TEMPLATE['domains']['item'] = ""; <div class='table-responsive' id='oses'>
$LOG_TEMPLATE['domains']['end'] = ""; <table class='table table-striped fborder' style='width: 100%;'>
<tr><td class='fcaption' colspan='4' style='text-align:center'>{START_CAPTION}</td></tr>
<tr><td class='fcaption' style='width: 20%;'>
<a title='{START_TITLE}' href='{START_URL}'>".ADSTAT_L28."</a></td>\n
<td class='fcaption' style='width: 70%;' colspan='2'>".ADSTAT_L21."</td>
<td class='fcaption' style='width: 10%; text-align: center;'>%</td>\n</tr>";
$LOG_TEMPLATE['domains']['item'] = "
<tr>
<td class='forumheader3' style='width: 20%;'>{ITEM_KEY}</td>
<td class='forumheader3' style='width: 70%;'>{ITEM_BAR}</td>
<td class='forumheader3' style='width: 10%; text-align: center;'>{ITEM_PERC}%</td>
</tr>";
$LOG_TEMPLATE['domains']['end'] = "
<tr>
<td class='forumheader' colspan='2'>".ADSTAT_L21."</td>
<td class='forumheader' style='text-align: center;'>{TOTAL}</td>
<td class='forumheader'>&nbsp;</td>
</tr>
</table><br /></div>";
$LOG_TEMPLATE['domains']['nostatistic'] = $LOG_TEMPLATE['browsers']['nostatistic'];
$LOG_TEMPLATE['screens']['start'] = ""; $LOG_TEMPLATE['screens']['start'] = "";
$LOG_TEMPLATE['screens']['item'] = ""; $LOG_TEMPLATE['screens']['item'] = "";