1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01: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);
}
$var = array('TOTAL' => number_format($total),
);
$var = array('TOTAL' => number_format($total));
$text .= $tp->simpleParse($template['end'], $var);
}
else
@ -1335,11 +1335,11 @@ class siteStats
}
$total = array_sum($domArray);
$text .= " <table class='table table-striped fborder' style='width: 100%;'>\n
<tr><td class='fcaption' colspan='4' style='text-align:center'>".$this->browser_headings[$act].$pars['hdg_extra']."</td></tr>\n
<tr>\n<td class='fcaption' style='width: 20%;'>
<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";
$var = array('START_CAPTION' => $this->browser_headings[$act].$pars['hdg_extra'],
'START_TITLE' => ($this -> order ? "sort by total" : "sort alphabetically"),
'START_URL' => e_SELF."?5".($this -> order ? "" : ".1" ),
);
$text .= $tp->simpleParse($template['start'], $var);
if (count($domArray))
{
@ -1348,20 +1348,22 @@ class siteStats
if($key = $this -> getcountry($key))
{
$percentage = round(($info/$total) * 100, 2);
$text .= "<tr>
<td class='forumheader3' style='width: 20%;'>".$key."</td>
<td class='forumheader3' style='width: 70%;'>".$this -> bar($percentage, $info)."</td>
<td class='forumheader3' style='width: 10%; text-align: center;'>".$percentage."%</td>
</tr>\n";
$var = array(
'ITEM_KEY' => $key,
'ITEM_BAR' => $this -> bar($percentage, $info),
'ITEM_PERC'=> $percentage,
);
$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
{
$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;
}

View File

@ -130,9 +130,30 @@ $LOG_TEMPLATE['oses']['end'] = "
$LOG_TEMPLATE['oses']['nostatistic'] = $LOG_TEMPLATE['browsers']['nostatistic'];
$LOG_TEMPLATE['domains']['start'] = "";
$LOG_TEMPLATE['domains']['item'] = "";
$LOG_TEMPLATE['domains']['end'] = "";
$LOG_TEMPLATE['domains']['start'] = "
<div class='table-responsive' id='oses'>
<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']['item'] = "";