OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



OJS Plugin::Popular Articles Block Plugin

The Plugin Gallery is a venue for users of PKP software to share their plugins.

Moderators: jmacgreg, michael, John

Forum rules
If you post a plugin here, please include information on which versions of which applications it is compatible with. Attach a tarball of the plugin (e.g. tar cvzf myPlugin-0.1.tar.gz plugins/generic/myPlugin). Thanks for contributing!

Re: OJS Plugin::Popular Articles Block Plugin

Postby lednakashim » Tue Jan 11, 2011 5:48 pm

I copied the "developedBy" plugin and renamed the folder and changed some code. The plugin shows up in the list of blocks but is only rendered when on the page called Step 5. Customizing the Look. This is not longer a pressing matter because I decided to work around this limitation by changing the developedBy block to my needs.
lednakashim
 
Posts: 33
Joined: Wed Dec 29, 2010 10:23 pm

Re: OJS Plugin::Popular Articles Block Plugin

Postby jmacgreg » Fri Jan 14, 2011 11:30 am

Hi lednakashim,

Depending on what you are trying to do, you may also find that the Custom Block Plugin, which allows you to create simple block plugins without needing to write/modify system files, will suffice. You can find it listed in the Generic Plugins list.

Cheers,
James
jmacgreg
 
Posts: 4190
Joined: Tue Feb 14, 2006 10:50 am

Re: OJS Plugin::Popular Articles Block Plugin

Postby pkpusr » Tue Jan 25, 2011 7:43 am

jmacgreg wrote:Hi pkpuser,

The Technical Reference was written before we were using block plugins, so you won't find any reference to them there until it's updated. You might find this page to be helpful. Take a look, and let us know if you have further questions. We will of course include this documentation in the reference guide when it is updated.

Cheers,
James

Hi James

Thank you very much for looking into this!

However, I modified everything as described, but still no luck... The same problem persists: I can only see the block plugin when browsing to Step 5. Customizing the Look. On all other pages, it is not displayed. I have added it to the right sightbar in the layout setup configuration page.

Could you maybe have a look? I reattached the modified version.
I think it might have something to do with plugin_settings in the database. (context? seq?)
When I delete the records, they are recreated automagically (based on settings.xml?)
plugins_settings table:
plugin_name journal_id setting_name setting_value setting_type
mostpopulararticlesblockplugin 1 context 2 int
mostpopulararticlesblockplugin 1 enabled 1 bool
mostpopulararticlesblockplugin 1 seq 14 int


Thanks!
pkpusr
Attachments
MostPopularArticles.rar
(4.15 KiB) Downloaded 243 times
pkpusr
 
Posts: 3
Joined: Fri Dec 24, 2010 2:22 am

Re: OJS Plugin::Popular Articles Block Plugin

Postby jmacgreg » Wed Jan 26, 2011 2:02 pm

Hi pkpusr,

Actually, the original plugin seems to work just fine for me in OJS 2.3.3. Can you check your server's error log to see if any sort of error is being reported when you load a page that should include the block (eg. any normal journal page -- not a site-level page, and not an article-level page).

cheers,
James
jmacgreg
 
Posts: 4190
Joined: Tue Feb 14, 2006 10:50 am

Re: OJS Plugin::Popular Articles Block Plugin

Postby pkpusr » Fri Jan 28, 2011 2:59 am

Hi James

Still no luck, At first it did appear!... But now, when I look again, it only appears on Step 5. Customizing the Look page..

In the error log I see the following:
[28-Jan-2011 10:25:01] PHP Fatal error: Call to a member function getDispatcher() on a non-object in htdocs\lib\pkp\classes\core\PKPRequest.inc.php on line 636

[28-Jan-2011 10:27:44] ojs2 has produced an error
Message: WARNING: Invalid argument supplied for foreach()
In file: htdocs\classes\manager\form\setup\JournalSetupStep5Form.inc.php
At line: 70
Stacktrace:
Server info:
OS: WINNT
PHP Version: 5.2.12
Apache Version: Apache/2.2
DB Driver: mysql
DB server version: 5.0.22

Thanks for investigating!
pkpusr
pkpusr
 
Posts: 3
Joined: Fri Dec 24, 2010 2:22 am

Re: OJS Plugin::Popular Articles Block Plugin

Postby RoboMod » Mon Aug 08, 2011 7:23 am

Hi everybody!

today I tried to get the PopularArticlesBlockPlugin running on every page of our OJS entity (http://www.sti-studies.de) ...

And I resolved the problem.

At first I modyfied a few things in the code as you can see in the attachment.
Then I erased everything a could find about the PopularArticlesBlockPlugin in ./plugins/blocks/ and in the MySQL-DB.
In the end I used the function "Install a New Plugin" and selected the position in the journal setup.

In future we could try to implement a settings form like for the custom theme plugin.

Good luck!
RoboMod
Attachments
popularArticlesPlugin.tar.gz
popular Articles Block Plugin 0.9.0.0
(3.51 KiB) Downloaded 278 times
RoboMod
 
Posts: 3
Joined: Mon Aug 08, 2011 7:04 am

Re: OJS Plugin::Popular Articles Block Plugin

Postby alirezaaa » Sun Aug 21, 2011 5:24 am

Hi RoboMod,
The plugin works just fine but there is a strange bug in this block !!
try observing different articles and you will find out that no matter which article you choose to view, the last article in this block is shown !
The title of the webpages change but you are forced to see only one article.
How could it be solved?
Cheers,

Alireza
alirezaaa
 
Posts: 26
Joined: Sat Jul 09, 2011 9:54 am

Re: OJS Plugin::Popular Articles Block Plugin

Postby Farshad » Mon Aug 29, 2011 12:28 am

Thank you very much, works very well, no problem at all
Farshad
 
Posts: 2
Joined: Sun Aug 28, 2011 11:53 pm

Re: OJS Plugin::Popular Articles Block Plugin

Postby RoboMod » Tue Sep 06, 2011 8:21 am

Hi everybody, hi Alireza,

I fixed the problem on my system. I hope it was the "foreach"-function of smarty. I switched it to "section". Now version 0.9.0.1 works.

Please tell me about more bugs.

Good luck!
RoboMod
Attachments
popularArticlesPlugin.tar.gz
popular Articles Block Plugin 0.9.0.1
(3.5 KiB) Downloaded 363 times
RoboMod
 
Posts: 3
Joined: Mon Aug 08, 2011 7:04 am

Re: OJS Plugin::Popular Articles Block Plugin

Postby Ajaks » Wed Sep 07, 2011 10:38 am

Hi RoboMod,

thank you for your useful plugin. I have some problem in implementing it. The information about views are visible only when I am registered as a Journal Manager in the Step 5 in Setup. I use the 2.3.3-3 version of OJS. Could you help me to solve this problem? I would very appreciate.

Kind regards,

Adam
Ajaks
 
Posts: 57
Joined: Thu Mar 10, 2011 4:35 am

Re: OJS Plugin::Popular Articles Block Plugin

Postby RoboMod » Thu Sep 08, 2011 2:51 am

Hi Adam,

maybe it is a version problem. I use version 2.6.
Another idea is about the installation. Try to delete all about your old plugin (data and database entries). Then install it again. In version 2.6 you have the possibility to install a plugin by uplouding the .tar.gz file.
Hope this helps!

Best,
RoboMod
RoboMod
 
Posts: 3
Joined: Mon Aug 08, 2011 7:04 am

Re: OJS Plugin::Popular Articles Block Plugin

Postby Ajaks » Thu Sep 08, 2011 6:44 am

Hi RoboMod,

thank you very much for your suggestion. Unfortunately, when I try to install the downloaded file I get the message
The uploaded plugin archive does not contain a folder that corresponds to the plugin name.
Could you give me a solution what should I do?
Many thanks in advance for your help.

Regards,

Adam
Ajaks
 
Posts: 57
Joined: Thu Mar 10, 2011 4:35 am

Re: OJS Plugin::Popular Articles Block Plugin

Postby alirezaaa » Sun Sep 11, 2011 8:04 am

Hi RoboMod,
Thank you for your help, I deleted the files from the FTP server and then reinstalled the plugin. Now it is perfect.
Best,

Alireza
alirezaaa
 
Posts: 26
Joined: Sat Jul 09, 2011 9:54 am

Re: OJS Plugin::Popular Articles Block Plugin

Postby jayfitzsimmons » Thu Nov 24, 2011 10:55 am

Hi RoboMod,

Thank you very much for developing this plugin. Unfortunately I'm having trouble installing it on my OJS 2.3.6 system.

I downloaded the popular Articles Block Plugin 0.9.0.1 from your Sept 6 2011 post on this forum. I tried to install the plugin's .tar.gz file using OJS's plugin installation tool, but it produced the error "Error uploading file". So I instead followed the Readme instructions and copied the extracted files into /plugins/blocks/. However, the instructions are a bit ambiguous on whether the extracted files should be in a specific folder or not. So I created a folder called "popularArticlesPlugin" within the Blocks folder, and put the extracted files into that directory. Then I went to Journal Setup and the popular articles plugin was listed as an option, which I chose to put on the right side. Unfortunately I cannot see the block plugin on any screen. Does this have to do with where I put the files in my OJS server? I look forward to whatever advice you or anyone else can offer.
UPDATE: I can see this plugin on the right side of my screen now, but only when I am in Journal Management > Plugin Management.

Jay
jayfitzsimmons
 
Posts: 78
Joined: Sun Aug 08, 2010 12:50 pm

Re: OJS Plugin::Popular Articles Block Plugin

Postby bolderimage » Tue Nov 29, 2011 2:39 pm

I had the same question - thanks for the tips.
bolderimage
 
Posts: 1
Joined: Tue Nov 29, 2011 1:20 pm

PreviousNext

Return to Plugin Gallery

Who is online

Users browsing this forum: No registered users and 2 guests