A couple of plugins to the plugin gallery

Hi @asmecher,

I have a couple of plugins I could prepare for plugin gallery, when you have the time to check them:
Disqus integration: GitHub - ajnyga/disqus: Disqus plugin for OJS/OPS/OMP 3.2+
Allowed Uploads (for enforcing only specific submission file types): GitHub - ajnyga/allowedUploads: OJS/OMP 3.1+ plugin for limiting the allowed submission file types

And maybe also:
Forthcoming plugin (for ahead-of-print functionality): GitHub - ajnyga/forthcoming: OJS3 plugin for showing forthcoming articles

You are of course free to choose which are the right kind of candidates.

2 Likes

Hi @ajnyga,

Excellent work!

I’ve posted some review comments on the Disqus plugin, and I see you’ve also identified it as a good candidate for OMP support as well. Let me know when you’re ready to package the plugin up (taking or leaving my comments as you’d like).

Just one minor comment on the Allowed Uploads plugin – strictly cosmetic – and I think this one would also be a good candidate for some minor changes to make it applicable to OMP as well. Likewise, let me know when you’re ready to go.

Is GitHub - ajnyga/forthcoming: OJS3 plugin for showing forthcoming articles ready for a quick review too?

Thanks,
Alec Smecher
Public Knowledge Project Team

Thanks,
The problem with OMP support is that I have not used it too much. But I could of course do a test install for this purpose alone.

You can check Forthcoming plugin as well, but I think it needs more work.

Hi @ajnyga,

I’d be happy to test with OMP. For the most part, you’d just need to swap out variable and function names – journalId for contextId, $request->getJournal() for $request->getContext(), etc.

Regards,
Alec Smecher
Public Knowledge Project Team

I will do fixes and see if I just install OMP on a local server. Both of the plugins are easy to test.

1 Like

Hi @asmecher

GitHub - ajnyga/allowedUploads: OJS/OMP 3.1+ plugin for limiting the allowed submission file types should be ready.
However, there is one small thing. When you enable the plugin an try to add a filetype that is not allowed, the red notification box does not show up immediately. It only shows up after you have succesfully uploaded a file in the third stage of the file upload wizard. It seems that the notifications get stuck and are triggered when the file upload is successfully finished. Any ideas how to fix that? I mean there is actually no need for the red notification, but I am not sure how to control that.

I also did the needed changes for disqus plugin, but OMP does not have the required template hook. Of course I could do a smarty filter, but those are pretty horrible…
See https://github.com/pkp/ojs/blob/master/templates/frontend/pages/article.tpl#L29 and compare to https://github.com/pkp/omp/blob/master/templates/frontend/pages/book.tpl

Hi @ajnyga
I’m following this conversation. Just interested how to install and configure Disqus plugin. Do I need to perform some additional steps to make it work? I’m receiving a fatal error on my local OJS 3.1.0-1 installation (latest XAMPP with PHP 7.2) with plugin from master branch:

PHP Fatal error: Uncaught Error: Call to a member function get_template_vars() on null in C:\\xampp2\\htdocs\\ojs-3.1.0-1-theme\\plugins\\generic\\disqus\\DisqusPlugin.inc.php:126\nStack trace:\n#0 C:\\xampp2\\htdocs\\ojs-3.1.0-1-theme\\lib\\pkp\\classes\\plugins\\HookRegistry.inc.php(107): DisqusPlugin->addDisqus('Templates::Arti...', Array)\n#1 C:\\xampp2\\htdocs\\ojs-3.1.0-1-theme\\lib\\pkp\\classes\\template\\PKPTemplateManager.inc.php(1169): HookRegistry::call('Templates::Arti...', Array)\n#2 C:\\xampp2\\htdocs\\ojs-3.1.0-1-theme\\cache\\t_compile\\6267f877acd9b945f8a07db7bb24329a969a952a^%%A2^A2D^A2DEEC56%%articleMainText.tpl.php(317): PKPTemplateManager->smartyCallHook(Array, Object(TemplateManager))\n#3 C:\\xampp2\\htdocs\\ojs-3.1.0-1-theme\\lib\\pkp\\lib\\vendor\\smarty\\smarty\\libs\\Smarty.class.php(1870): include('C:\\\\xampp2\\\\htdoc...')\n#4 C:\\xampp2\\htdocs\\ojs-3.1.0-1-theme\\lib\\pkp\\classes\\template\\PKPTemplateManager.inc.php(419): Smarty->_smarty_include(Array)\n#5 C:\\xampp2\\htdocs\\ojs-3.1.0-1-theme\\cache\\t_compile\\89d777ad47fee49321727969b42b912e77adc9cd^%%2 in C:\\xampp2\\htdocs\\ojs-3.1.0-1-theme\\plugins\\generic\\disqus\\DisqusPlugin.inc.php on line 126, referer: http://ojs-3.1.0-1-theme.test/index.php/psp/index

Tagging @anupent because of interest in installing this plugin.

1 Like

Hi, it seems I made a small typo when I tried to add the OMP support (stopped when I realized that OMP does not have the same template hook as OJS has).

Just a moment…

Ok, working at least with 3.1.0.1 and PHP 5.6. Glad to hear if PHP7 has problems: GitHub - ajnyga/disqus: Disqus plugin for OJS/OPS/OMP 3.2+

Hi @ajnyga,

Thanks! I just had one minor comment about escaping, but when that’s handled, feel free to build a .tar.gz and upload it to the Releases area of your github repository. That’s where I’ll direct the Plugin Gallery to get the source from (md5 signed).

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks, but there is still this:
“I also did the needed changes for disqus plugin, but OMP does not have the required template hook. Of course I could do a smarty filter, but those are pretty horrible…
See https://github.com/pkp/ojs/blob/master/templates/frontend/pages/article.tpl#L29 and compare to https://github.com/pkp/omp/blob/master/templates/frontend/pages/book.tpl1

Of course I can do a pr for the needed template hook. Which would make sense because there is a hook like that in OJS.

Hi @ajnyga,

I think I mentioned this elsewhere – but yes, please do send a PR. The more we can align the hook calls for OJS and OMP, the better.

Regards,
Alec Smecher
Public Knowledge Project Team