yes, thanks for link.
I have read, but there is no explanation…
i have never done it before.
could you give more extended instruction, please! maybe link…
where can i do this old log re-process? in phpmyadmin?
Thank you @franms for the plugin!
Although it’s working as expected with 2.4.8-1, I’m getting some warnings in the error log. For example:
Message: WARNING: Missing argument 4 for GenericPlugin::manage(), called in /[path]/ojs/plugins/generic/statistics/StatisticsPlugin.inc.php on line 106 and defined\n In file: /[path]/ojs/lib/pkp/classes/plugins/GenericPlugin.inc.php\n At line: 58\n
The following patch seems to solve the issue for me:
— a/plugins/generic/statistics/StatisticsPlugin.inc.php 2016-10-11 11:02:06.
+++ b/plugins/generic/statistics/StatisticsPlugin.inc.php 2016-10-11 11:03:26
@@ -100,10 +100,12 @@
* @param $verb string
* @param $args array
* @param $message string Location for the plugin to put a result msg
* @param $messageParams array Parameters for the message key
* @return boolean
*/
function manage($verb, $args, &$message) {
if (!parent::manage($verb, $args, $message)) return false;
function manage($verb, $args, &$message, &$messageParams) {
if (!parent::manage($verb, $args, $message, $messageParams)) return false;
switch ($verb) {
case 'statistics':
Request::redirect(null, 'statistics');
And one question: what code changes would be required to restrict access to this plugin to certain users? (so that ie only journal managers would be able to see the ‘Statistics’ link and also see the actual statistics)
Thank you @franms I have implemented your plugin in our journal: http://jtsiskom.undip.ac.id/index.php/jtsiskom/statistics.
Everything is going well, except for country chart. It shows small number of country download or abstract view.
I download the plugin from git.
How to fix this? Thank you.
I am using OJS 2.4.8-2, how to install Statistics Chart plugin on OJS 2.4.8-2? Although it only supports up to OJS 2.4.8-1, but there is definitely a way to change the code. Thanks
I try installing statistic plugin, download and extract file to plugins/generic/ and enable plugin, but when I click statistics menu on main menu show error 404 Not Found. Did I miss something ?
Really this countries are the last in the table. The query have a ASC, chague to DESC
This works fine to me.
function getMetricsByCountryType($journalId, $assoc_type, $year){
$result =& $this->retrieve(
‘SELECT country_id, SUM(metric) FROM metrics WHERE context_id = ? AND assoc_type = ? AND SUBSTR(month,1,4) = ? GROUP BY country_id order by SUM(metric) DESC LIMIT 20;’,
array((int) $journalId, (int) $assoc_type, $year)
);
Did you tar.gz the folder?
Did you remove the statistics folder before trying to install it via Dashbord?
It worked for me once I had removed the whole plugin before I install the Statistic.tar.gz with the OJS dashboard. Worked for me.
You need to use the Dashboard. I had the same issue until I delete the folder and remove the plugin data from the DB. Then I deployed it via Dashboard.
The problem is that OJS2.4 doesn’t register the plugin via parent::register when you copy it via command line, therefore it send you the 404 code.
function manage($verb, $args, &$message) {
if (!parent::manage($verb, $args, $message)) return false;
for
function manage($verb, $args, &$message, &$messageParams) {
if (!parent::manage($verb, $args, $message, $messageParams)) return false;