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
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
[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
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?
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?
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.
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…
After updating our OJS, we decided to try Most Read Articles block plugin. At first glance, everything is very cool. I figured out the Russian language by creating a Russian locale through Translator plugin.
But faced with the following problem. The plugin always shows the article title in Russian. Regardless of which version of the site is used:
Although, of course, all articles have both Russian and English titles.
@ajnyga, what are we doing wrong? Is it possible to somehow match the language of the article title to the language version of the site?
The plugin creates a cache file so that it works faster. However, that cache is not localized. So if you create the cache using the russian locale, it will show that same cache also for the english locale as long as the cache becomes old.
I have to look around how other things in OJS are taking localised data into consideration.
Wow… Yes, definitely for most of our journals the Russian locale is the default. I now turned on the plugin in the English locale on one of the journal. And it displays only English article titles in both versions of the site. So now the cache is not “multilingual” for sure.
this is definitely something I can fix, I just have to figure out the best way. You could either have a cache file for each locale or alternatively have the all the versions of the title in the single cache file and make sure you call the right one. I will see what the better solution is in this case.