Display PDF and Abstract view number

Dear,

I am using OJS 3.0.1, I have several bugs which I don’t know where to fix,

The tab tools - > statistics does not work, blank page, so I can not run any statistic report
I am trying to display abstract and PDF view statistics on article-details.tpl however I could not find any documentation related to ojs3.0.1? I used this code but still nothing:
{translate key=“article.abstract”} | {$article->getViews()} | times
{if $galleys}
{foreach from=$galleys item=galley name=galleyList}
{$galley->getGalleyLabel()} | {$galley->pdfViews()}
{/foreach}
{/if}

3.in the plugins->report plugins, there is 4 plugins related to report, if I click on them to generate report I get directly 404 error

  1. I can’t see any folders for usageStat / processing / archive/ files_dir ??

Hi @Rania_Azad,

Before you start debugging this, I would suggest upgrading to the current release.

For blank pages, check your PHP error log for details.

Regards,
Alec Smecher
Public Knowledge Project Team

well, I can’t upgrade the system now, may be after another month, in meanwhile, I was digging regarding PDF and ABSTRACT counter views, I could implement the following code in templates/frontend/objects/article_summary.tpl:

{translate key=“article.abstract”} viewed = {$article->getViews()} times

{if is_a($article, ‘PublishedArticle’)}{assign var=galleys value=$article->getGalleys()}{/if} |
{if $galleys}
{foreach from=$galleys item=galley name=galleyList}
{$galley->getGalleyLabel()} downloaded = {$galley->getViews()} times
{/foreach}
{/if}

as well I had to change the function getviews() in classes/article/ArticleGalley.inc.php to:
function getViews() {
$application = PKPApplication::getApplication();
$fileId = $this->getFileId();
if ($fileId) {
return $application->getPrimaryMetricByAssoc(ASSOC_TYPE_SUBMISSION_FILE, $fileId);
} else {
return 0;
}
}

I have result such : Abstract viewed = 17 times | PDF downloaded = 137 times

by logic, the Abstract views must be bigger then PDF views right? all my result are like that,
So, is there SQL query to run to get the result of specific paper with the metrics?

Also, I could not find any documentation about metrics tables and variables meaning ? such : ASSOC_TYPE_SUBMISSION_FILE , ASSOC_Type and the numbers, ASSOC_id, which field represent the specific article and so on?

Hi @Rania_Azad

The statistics are calculated and saved in the DB table metrics.
Those assoc_type means:
256 - Journal (home page) - ASSOC_TYPE_JOURNAL
515 - Galley (downloads) - ASSOC_TYPE_SUBMISSION_FILE
1048585 - Article (abstract view) - ASSOC_TYPE_SUBMISSION
Looking at the column assoc_id you can figure out the object in question i.e. journal, galley, article. For example the entries with assoc_type = 1048585 and assoc_id = 1 will give you the access counts for abstract page of the article with the ID = 1.

Additionally, if exist, the object’s article ID (column submission_id), galley ID (column representation_id), journal ID (column context_id) can be found.
Column assoc_object_type and assoc_object_id is the issue i.e. issue ID.
For the usage statistics plugin, the column metric_type is ojs::counter.
In the column day and month you can find out the date i.e. the year.
The load_id corresponds to the usage stats log file.

Best,
Bozana

Thanks, it makes things more clear now to understand the results.