Most read article plugin for OJS 3.1.1.2

I enabled the plugin in one of our journals. Just uploaded the plugin to the blocks folder, enabled from the plugin settigns and moved the block to the sidebar:

(note that I will remove the link and the block in a while)

I have renamed the folder in block plugin and am able to pull the information on my website. It is working now.

Thanks @ajnyga

1 Like

As you can see it is very basic, feel free to modify the code.

1 Like

Dear,
Please update for new OJS Version 3.1.2

Got below error

PHP Fatal error: Uncaught → Smarty: Unknown resource type ‘plugins-plugins-blocks-mostRead-blocks-mostRead’ ←
thrown in /public_html/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_resource.php on line 112

Hi all,

I uploaded mostRead plugin in Generic folder and upgraded system installed off. Then the system didn’t work. Then I deleted the mostRead folder in the Generic folder, I tried to upload in Blocks folder. Then the system still didn’t work. I deleted mostRead folder too. Now the system is working but I can not reach the Installed Plugin seciton under the Plugins. The error message is “Acces denied” first and the second message is “undefined”. How can I reach the installed plugins section. Also I can reach the Plugin Gallery.

Thanks in advance.

1

2

3

the mostRead plugin is a block plugin and should not be uploaded to the generic folder.

It could be that your versions database table has a corrupted entry that got there when you moved the plugin to the generic folder and run an upgrade. You could try deleting the line for the mostRead plugin from that table.

I deleted and upgraded with installed off in the config file. But the problem continues. Can there be another solution?

Hi @ajnyga,

I installed your plugin here: www.bjbms.org.
How often should the view number change? Is it every 7 days?
My numbers seem like stuck more than 7 days.

Best regards,
Faruk

After installing Most read plugin receive in error.log

[25-Apr-2019 20:19:19 Europe/Belgrade] PHP Warning: file_get_contents(plugins/blocks/mostRead/block.tpl): failed to open stream: No such file or directory in /home/ijcadsee/public_html/lib/pkp/classes/template/PKPTemplateResource.inc.php on line 35
[25-Apr-2019 20:19:19 Europe/Belgrade] PHP Warning: Smarty error: unable to read resource: "plugins/plugins/blocks/mostRead/blocks/mostRead:block.tpl" in /home/ijcadsee/public_html/lib/pkp/lib/vendor/smarty/smarty/libs/Smarty.class.php on line 1094
[25-Apr-2019 20:19:55 Europe/Belgrade] ojs2: 404 Not Found

The list of most read article is not visible. OJS 3.1.1.4 used.

Hi @ajnyga,

Currently, the plugin shows number of File views on the last 7 days.
Is it possible to use different parameter, such as Total views or Abstract views?

If yes, could you tell me what modification should I make?
Can this options be implemented in the plugin settings?

Thanks for the great plugin!
Best regards,
Faruk

Hi @ajnyga,

Can I show sum of abstract and download views by modifying the SQL query I found inside the MostReadBlockPlugin.inc.php file:

SELECT submission_id, SUM(metric) AS metric FROM metrics WHERE (day BETWEEN $weekAgo AND $currentDate) AND (assoc_type='1048585' AND submission_id IS NOT NULL) AND (context_id='?') GROUP BY submission_id ORDER BY metric DESC LIMIT

How should I modify it?
Best regards,
Faruk

Hi both and sorry for the delay, have been busy.

I am planning to do an official release for OJS 3.1.2 within a month. At the moment the plugin does not support 3.1.2 (@Lazar_Stosic error) and the things @BJBMS is asking for will be available as plugin settings. There is already a dev branch here that includes some new features and should work with 3.1.2. You are welcome to test it. GitHub - ajnyga/mostRead at dev-3-1-2

Still error mistake and doesn`t work.
Error.log>

[06-May-2019 12:06:35 Europe/Belgrade] PHP Fatal error: Call to undefined method MostReadBlockPlugin::getTemplateResource() in /home/ijcadsee/public_html/plugins/blocks/mostRead/MostReadSettingsForm.inc.php on line 26
[06-May-2019 12:07:21 Europe/Belgrade] PHP Warning: file_get_contents(plugins/blocks/mostRead/block.tpl): failed to open stream: No such file or directory in /home/ijcadsee/public_html/lib/pkp/classes/template/PKPTemplateResource.inc.php on line 35
[06-May-2019 12:07:21 Europe/Belgrade] PHP Warning: Smarty error: unable to read resource: "plugins/plugins/blocks/mostRead/blocks/mostRead:block.tpl" in /home/ijcadsee/public_html/lib/pkp/lib/vendor/smarty/smarty/libs/Smarty.class.php on line 1094

1 Like

Hi AJ,

I’ve also upgraded from 3.1.1-4 to 3.1.2 and now several block plugins produce an error starting with: “Uncaught → Smarty: Unknown resource type 'plugins-plugins-blocks-”. Any idea what that may be?

Do you know of any documentation on making plugins OJS 3.1.2 compatible?

Regards
Jannie (AJOL)

Hi @ajnyga,

Thank you for updating your plugin. I find settings for title and number of days, however, is it possible to choose between showing a total number of views, downloads or abstract views?
How should I modify the files to choose between those?

Thanks a lot
Dijana

Hi @ajnyga,
I submitted the italian locale for the plugin on Github /it_IT/locale.xml by bolelligallevi · Pull Request #8 · ajnyga/mostRead · GitHub
I think it could be usefull to add a readme (i.e. to explain how often the view number changes, as @BJBMS asked), do you agree if I submit a draft on Github?
Best regards
Stefano Bolelli Gallevi

Thanks @bolelligallevi, please do!

The plugin started as a quick solution for a recurring request here at the forum. I have been working on getting it ready for an official release and for the official plugin gallery, but have not had the time.

Thank you @ajnyga.
I submitted the readme README.md suggestion by bolelligallevi · Pull Request #9 · ajnyga/mostRead · GitHub, but something is inferred from usage, I’m not sure everithing is correct, so please read it before merge.
Best regards

Hi everyone!
if this information can help, to change the time range of visits, just open the file “MostReadBlockPlugin.inc.php” at line 82 where there is:
$weekAgo = date(‘Ymd’, strtotime("-1 week"));
where if -1 is the week from the current day, just change it to -4 and it will be a month from the current day, and so on…

I hope I’ve clear. :slight_smile:

Bye
Tiziano