Commit 175d69c7 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Show page hit count on views you can edit


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 76e95469
......@@ -131,6 +131,7 @@ $string['updatewatchlistfailed'] = 'Update of watchlist failed';
$string['watchlistupdated'] = 'Your watchlist has been updated';
$string['editmyview'] = 'Edit my View';
$string['backtocreatemyview'] = 'Back to create my View';
$string['viewvisitcount'] = '%d page visit(s) from %s to %s';
$string['friend'] = 'Friend';
$string['profileicon'] = 'Profile Icon';
......
......@@ -63,6 +63,7 @@ class View {
private $copynewuser = 0;
private $copynewgroups;
private $type;
private $visits;
/**
* Valid view layouts. These are read at install time and inserted into
......@@ -2733,6 +2734,19 @@ class View {
return $title;
}
public function visit_message() {
$visitcountstart = max(get_config('stats_installation_time'), $this->ctime);
$visitcountend = get_config('viewloglatest');
if ($visitcountstart && $visitcountend && $visitcountstart < $visitcountend) {
return get_string(
'viewvisitcount',
'view',
$this->visits,
trim(format_date(strtotime($visitcountstart), 'strftimedate')),
trim(format_date(strtotime($visitcountend), 'strftimedate'))
);
}
}
}
......
......@@ -35,5 +35,6 @@
{if $objectionform}<div>{$objectionform}</div>{/if}
</div>
</div>
{if $visitstring}<div class="ctime center s">{$visitstring}</div>{/if}
{if $microheaders}{include file="microfooter.tpl"}{else}{include file="footer.tpl"}{/if}
\ No newline at end of file
......@@ -184,6 +184,7 @@ if (get_config('viewmicroheaders')) {
$smarty->assign('microheadertitle', $view->display_title(true, false));
if ($can_edit) {
$smarty->assign('visitstring', $view->visit_message());
if ($viewtype == 'profile') {
$microheaderlinks = array(
array(
......
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