Commit e40fb07a authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Fixes for stats display on empty sites


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent be6f85e6
......@@ -378,6 +378,7 @@ function user_stats_table($limit, $offset) {
));
$result = array(
'count' => $count,
'tablerows' => '',
'pagination' => $pagination['html'],
'pagination_js' => $pagination['javascript'],
......@@ -559,6 +560,7 @@ function group_stats_table($limit, $offset) {
));
$result = array(
'count' => $count,
'tablerows' => '',
'pagination' => $pagination['html'],
'pagination_js' => $pagination['javascript'],
......@@ -705,13 +707,14 @@ function view_statistics($limit, $offset) {
array(), 0, $maxblocktypes
));
$smarty->assign('viewtypes', stats_graph_url('viewtypes'));
$smarty->assign('viewcount', $data['table']['count']);
$data['summary'] = $smarty->fetch('admin/viewstatssummary.tpl');
return $data;
}
function view_stats_table($limit, $offset) {
$count = count_records('view');
$count = count_records_select('view', 'owner != 0');
$pagination = build_pagination(array(
'id' => 'stats_pagination',
......@@ -724,6 +727,7 @@ function view_stats_table($limit, $offset) {
));
$result = array(
'count' => $count,
'tablerows' => '',
'pagination' => $pagination['html'],
'pagination_js' => $pagination['javascript'],
......@@ -741,6 +745,7 @@ function view_stats_table($limit, $offset) {
LEFT JOIN {usr} u ON v.owner = u.id
LEFT JOIN {group} g ON v.group = g.id
LEFT JOIN {institution} i ON v.institution = i.name
WHERE v.owner != 0
ORDER BY v.visits DESC",
array(),
$offset,
......
{if empty($grouptypecounts)}
<p>{str tag=nogroups section=group}</p>
{else}
<p>{str tag=groupcountsbytype section=admin}:
<ul>
{foreach from=$grouptypecounts item=item}
......@@ -15,3 +18,4 @@
{if $groupgraph}
<img src="{$groupgraph}" alt="" />
{/if}
{/if}
\ No newline at end of file
......@@ -15,7 +15,7 @@
<div class="statistics-subpage-left-column fl">
{$subpagedata.summary}
</div>
<div id="statistics_table_container" class="statistics-subpage-right-column fr">
<div id="statistics_table_container" class="statistics-subpage-right-column fr{if $subpagedata.table.count == 0} hidden{/if}">
<h3>{$subpagedata.tabletitle}</h3>
<table id="statistics_table" class="fullwidth">
<thead>
......
{if $viewcount == 0}
<p>{str tag=noviews section=view}</p>
{/if}
{if $blocktypecounts}
<p>{str tag=blockcountsbytype section=admin}:
<ul>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment