1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 20:30:39 +02:00

browser stats templated

This commit is contained in:
Jimmi08
2018-01-20 12:46:50 +01:00
parent 572e355aba
commit 546ec32899
2 changed files with 47 additions and 25 deletions

View File

@@ -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 ? "<a href='".e_SELF."?{$action}.rem.".rawurlencode($key)."'
'ITEM_DELETE'=> ($can_delete ? "<a href='".e_SELF."?{$action}.rem.".rawurlencode($key)."'>
<img src='".e_PLUGIN_ABS."log/images/remove.png' alt='".ADSTAT_L39."' title='".ADSTAT_L39."' style='vertical-align: middle;' /></a> " : ""),
);
$text .= $tp->simpleParse($template['item'], $var);
@@ -1097,18 +1097,11 @@ class siteStats
$total = array_sum($browserArray);
$text .= "
<table class='table table-striped fborder' style='width: 100%;'>\n
<tr>
<th class='fcaption' colspan='4' style='text-align:center'>".$this->browser_headings[$act].$pars['hdg_extra']."</th>
</tr>\n
<tr>
<th class='fcaption' style='width: 20%;'>
<a title='".($this -> order ? ADSTAT_L48 : ADSTAT_L49)."' href='".e_SELF."?".($show_version ? "3" : "14").($this -> order ? "" : ".1" )."'>".ADSTAT_L26."</a>
</th>
<th class='fcaption' style='width: 70%;' colspan='2'>".ADSTAT_L21."</th>\n
<th class='fcaption' style='width: 10%; text-align: center;'>%</th>
</tr>\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 .= "<tr>
<td class='forumheader3' style='width: 20%;'>".($image ? "<img src='".e_PLUGIN_ABS."log/images/{$image}' alt='' style='vertical-align: middle;' /> " : "").$key."</td>".
($entries == 1 ? "<td class='forumheader3' style='width: 70%;'>".$this -> bar($percentage, $info)."</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_IMAGE' => ($image ? "<img src='".e_PLUGIN_ABS."log/images/{$image}' alt='' style='vertical-align: middle;' /> " : ""),
'ITEM_KEY' => $key,
'ITEM_BAR' => $this -> bar($percentage, $info),
'ITEM_PERC'=> $percentage,
);
$text .= $tp->simpleParse($template['item'], $var);
$text .= "";
}
$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";
$var = array('TOTAL' => number_format($total),
);
$text .= $tp->simpleParse($template['end'], $var);
$text .= "";
}
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

@@ -80,9 +80,32 @@ $LOG_TEMPLATE['alltimevisits_unique']['end'] = "
<td class='forumheader'></td></tr>\n</table></div>";
$LOG_TEMPLATE['browsers']['start'] = "";
$LOG_TEMPLATE['browsers']['item'] = "";
$LOG_TEMPLATE['browsers']['end'] = "";
$LOG_TEMPLATE['browsers']['start'] = "
<div class='table-responsive' id='browsers'>
<table class='table table-striped fborder' style='width: 100%;'>\n
<tr>
<th class='fcaption' colspan='4' style='text-align:center'>{START_CAPTION}</th>
</tr>\n
<tr>
<th class='fcaption' style='width: 20%;'>
<a title='{START_TITLE}' href='{START_URL}'>".ADSTAT_L26."</a>
</th>
<th class='fcaption' style='width: 70%;' colspan='2'>".ADSTAT_L21."</th>\n
<th class='fcaption' style='width: 10%; text-align: center;'>%</th>
</tr>\n";
$LOG_TEMPLATE['browsers']['item'] = "
<tr>
<td class='forumheader3' style='width: 20%;'>{ITEM_IMAGE}{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>\n";
$LOG_TEMPLATE['browsers']['end'] = "
<tr><td class='forumheader' colspan='2'>".ADSTAT_L21."</td><td class='forumheader' style='text-align: center;'>{TOTAL}</td>
<td class='forumheader'></td></tr>
</table><br /></div>";
$LOG_TEMPLATE['browsers']['nostatistic'] =
"<tr><td class='fcaption' colspan='4' style='text-align:center'>".ADSTAT_L25."</td></tr></table><br /></div>";
$LOG_TEMPLATE['oses']['start'] = "";
$LOG_TEMPLATE['oses']['item'] = "";