Abstract views, PDF views and Download Stats Made Public 😶

@RCVSK,

Try this inside any controller that’s preparing the template to be rendered (I would add it to the ArticleHandler controller, in the view method, around line 174, for example):

$articleId = $article->getId();
$metricsDao = DAORegistry::getDAO('MetricsDAO');
$result = $metricsDao->getMetrics($journal->getDefaultMetricType(), array(), array(STATISTICS_DIMENSION_SUBMISSION_ID => $articleId));
$totalViews = $result[0]['metric'];
$templateMgr->assign('totalViews', $totalViews);

Then you just have to use the {$totalViews} inside the templates/article/article.tpl file to show the total count.

That’s a quicker approach then retrieving the galleys stats, counting them, and then getting the abstract and summing everything.

Hope that it helps.
Regards,
Bruno