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

Move user/group/view stats back off admin home page & only show last ranking...


Move user/group/view stats back off admin home page & only show last ranking update if there's a ranking
Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent fa9e428f
...@@ -187,6 +187,11 @@ function site_data_current() { ...@@ -187,6 +187,11 @@ function site_data_current() {
'users' => count_records_select('usr', 'id > 0 AND deleted = 0'), 'users' => count_records_select('usr', 'id > 0 AND deleted = 0'),
'groups' => count_records('group', 'deleted', 0), 'groups' => count_records('group', 'deleted', 0),
'views' => count_records_select('view', 'owner <> 0'), 'views' => count_records_select('view', 'owner <> 0'),
'rank' => array(
'users' => get_config('usersrank'),
'groups' => get_config('groupsrank'),
'views' => get_config('viewsrank'),
),
); );
} }
...@@ -251,21 +256,9 @@ function site_statistics($full=false) { ...@@ -251,21 +256,9 @@ function site_statistics($full=false) {
$data['diskusage'] = get_field('site_data', 'value', 'type', 'disk-usage'); $data['diskusage'] = get_field('site_data', 'value', 'type', 'disk-usage');
$data['cronrunning'] = !record_exists_select('cron', 'nextrun < CURRENT_DATE'); $data['cronrunning'] = !record_exists_select('cron', 'nextrun < CURRENT_DATE');
// root user doesn't count
$data['users'] = count_records_select('usr', 'deleted = 0') - 1;
$data['groups'] = count_records_select('group', 'deleted = 0');
$data['views'] = count_records_select('view');
$data['rank'] = array(
'users' => get_config('usersrank'),
'groups' => get_config('groupsrank'),
'views' => get_config('viewsrank'),
);
$data['strrankingsupdated'] = get_string('rankingsupdated', 'admin', date('Y-m-d H:i', get_config('registration_lastsent'))); $data['strrankingsupdated'] = get_string('rankingsupdated', 'admin', date('Y-m-d H:i', get_config('registration_lastsent')));
// FIXME: actually do this
$data['usersloggedin'] = 0;
return($data); return($data);
} }
......
...@@ -10,15 +10,25 @@ addLoadEvent(function () {literal}{{/literal} ...@@ -10,15 +10,25 @@ addLoadEvent(function () {literal}{{/literal}
{/if} {/if}
<div class="fl"> <div class="fl">
<p><strong>{str tag=siteinstalled section=admin}:</strong> {$sitedata.installdate}</p> <p><strong>{str tag=siteinstalled section=admin}:</strong> {$sitedata.installdate}</p>
{if $sitedata.users}
<p><strong>{str tag=users}:</strong> {$sitedata.users}{if $sitedata.rank.users} ({str tag=Rank section=admin}: {$sitedata.rank.users}){/if}</p> <p><strong>{str tag=users}:</strong> {$sitedata.users}{if $sitedata.rank.users} ({str tag=Rank section=admin}: {$sitedata.rank.users}){/if}</p>
<p>&nbsp;{str tag=activeusers section=admin}: {$sitedata.usersloggedin}</p> <p>&nbsp;{str tag=activeusers section=admin}: {$sitedata.usersloggedin}</p>
{/if}
{if $sitedata.groups}
<p><strong>{str tag=groups}:</strong> {$sitedata.groups}{if $sitedata.rank.groups} ({str tag=Rank section=admin}: {$sitedata.rank.groups}){/if}</p> <p><strong>{str tag=groups}:</strong> {$sitedata.groups}{if $sitedata.rank.groups} ({str tag=Rank section=admin}: {$sitedata.rank.groups}){/if}</p>
<p>&nbsp;{$sitedata.strgroupmemberaverage}</p> <p>&nbsp;{$sitedata.strgroupmemberaverage}</p>
{/if}
{if $sitedata.views}
<p><strong>{str tag=views}:</strong> {$sitedata.views}{if $sitedata.rank.views} ({str tag=Rank section=admin}: {$sitedata.rank.views}){/if}</p> <p><strong>{str tag=views}:</strong> {$sitedata.views}{if $sitedata.rank.views} ({str tag=Rank section=admin}: {$sitedata.rank.views}){/if}</p>
<p>&nbsp;{$sitedata.strviewsperuser}</p> <p>&nbsp;{$sitedata.strviewsperuser}</p>
{/if}
{if $sitedata.rank.users}
<p>{$sitedata.strrankingsupdated}</p> <p>{$sitedata.strrankingsupdated}</p>
{/if}
<p><strong>{str tag=databasesize section=admin}:</strong> {$sitedata.dbsize|display_size}</p> <p><strong>{str tag=databasesize section=admin}:</strong> {$sitedata.dbsize|display_size}</p>
{if $sitedata.diskusage}
<p><strong>{str tag=diskusage section=admin}:</strong> {$sitedata.diskusage|display_size}</p> <p><strong>{str tag=diskusage section=admin}:</strong> {$sitedata.diskusage|display_size}</p>
{/if}
<p><strong>{str tag=maharaversion section=admin}:</strong> {$sitedata.release}</p> <p><strong>{str tag=maharaversion section=admin}:</strong> {$sitedata.release}</p>
<p><strong>{str tag=Cron section=admin}:</strong> {if $sitedata.cronrunning}{str tag=runningnormally section=admin}{else}{str tag=cronnotrunning section=admin}{/if}</p> <p><strong>{str tag=Cron section=admin}:</strong> {if $sitedata.cronrunning}{str tag=runningnormally section=admin}{else}{str tag=cronnotrunning section=admin}{/if}</p>
</div> </div>
......
Supports Markdown
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