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 asmecher » Mon Sep 16, 2013 11:36 am

Hi solty,

Is there an entry for the plugin in the "versions" table?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8676
Joined: Wed Aug 10, 2005 12:56 pm

Re: OJS Plugin::Popular Articles Block Plugin

Postby solty » Fri Oct 04, 2013 11:33 pm

asmecher wrote:Hi solty,
Is there an entry for the plugin in the "versions" table?


I don't know.. Where is the "versions"?
solty
 
Posts: 140
Joined: Mon Mar 16, 2009 12:47 am
Location: Turkiye, İzmir

Re: OJS Plugin::Popular Articles Block Plugin

Postby asmecher » Sat Oct 05, 2013 8:33 am

Hi solty,

You'll have to check in the database, using e.g. MySQLAdmin (which most shared hosts have installed) or the command-line MySQL client.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8676
Joined: Wed Aug 10, 2005 12:56 pm

Re: OJS Plugin::Popular Articles Block Plugin

Postby solty » Sat Oct 05, 2013 10:04 am

asmecher wrote:Hi solty,
You'll have to check in the database, using e.g. MySQLAdmin (which most shared hosts have installed) or the command-line MySQL client.


OK, I will see ASAP.
Thanks Alec,
solty
 
Posts: 140
Joined: Mon Mar 16, 2009 12:47 am
Location: Turkiye, İzmir

Re: OJS Plugin::Popular Articles Block Plugin

Postby solty » Tue Oct 08, 2013 5:15 am

Yes, I see these;
Version 1 0 0 0 2012-04-13 12:31:12 1 plugins.blocks popularArticles MostPopularArticleBlockPlugin 1 0

I there any mean for problem?

solty
solty
 
Posts: 140
Joined: Mon Mar 16, 2009 12:47 am
Location: Turkiye, İzmir

Re: OJS Plugin::Popular Articles Block Plugin

Postby Looted » Thu Nov 21, 2013 3:07 pm

Hello,
after turning the plugin on (putting it on the right sidebar) i get error: "Unrecognized DAO MostPopularArticlesDAO!". Any idea why?
Looted
 
Posts: 16
Joined: Tue Oct 29, 2013 10:06 am

Re: OJS Plugin::Popular Articles Block Plugin

Postby jbsarma » Mon Dec 02, 2013 5:17 am

My version is 2.4.2 and I installed, run the upgrade script and activated 'popular article block' which worked fine displaying articles with view number as it is supposed to do. But I had a strange problem: now every single article clicked from the content page lead to the last displayed article title displayed in the 'popular article block' and not to the article title clicked. This happened to the current issue as well as the archive issue. Whenever, you click a article you simply lend up with the last article displayed in the block. I now removed the block (still in the system just not in the sidebar) and the problem gone. I installed the block available in the very first post of this thread. Any idea what the problem might be and how to fix!
I note this issue was reported before but not seen any solution:
ushasharma84 wrote:HI ALL
we are using ojs-2.3.4 had installed this plugin and it was working well.but then our authors complained that whenever they click on any article from any issue either current or archive only one article is opened which is the last article in top 10... pls test it... Thanks in advance
:roll:
jbsarma
 
Posts: 8
Joined: Wed Jun 06, 2012 2:22 pm

Re: OJS Plugin::Popular Articles Block Plugin

Postby memoemg » Tue Dec 10, 2013 12:39 pm

Hi all,

Yesterday I updated my version of OJS from 2.4.2 to 2.4.3 everything went ok, but this plugin in particular stop working. The reason (I guess), the file PopularArticlesDAO.inc.php at the where clauses, makes reference to pa.views and the new database schema doesn't have a column 'views' in published_articles.

Can you help me?


Guillermo
memoemg
 
Posts: 11
Joined: Thu Sep 05, 2013 2:35 pm

Re: OJS Plugin::Popular Articles Block Plugin

Postby asmecher » Tue Dec 10, 2013 1:01 pm

Hi Guillermo,

This plugin won't work with OJS 2.4.3 until it changes the way it expects to access article statistics. Statistics were overhauled in OJS 2.4.3 (see http://pkp.sfu.ca/wiki/index.php?title=PKP_Statistics_Framework). I'll ask the developer who did that work to make a couple of recommendations for how the plugin could be adapted.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8676
Joined: Wed Aug 10, 2005 12:56 pm

Re: OJS Plugin::Popular Articles Block Plugin

Postby memoemg » Tue Dec 10, 2013 1:26 pm

Hi Alec, thanks for the answer. I really hope we can recover this plugin, it was a big hit when we made it available for our journals. I will also check on the new Statistics Framework.

Guillermo
memoemg
 
Posts: 11
Joined: Thu Sep 05, 2013 2:35 pm

Re: OJS Plugin::Popular Articles Block Plugin

Postby bbeghelli » Wed Dec 11, 2013 9:01 pm

Hi Guillermo,

Try this solution: http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=8514

Let me know if you have any problem.

Cheers,
Bruno
bbeghelli
 
Posts: 113
Joined: Tue Jun 25, 2013 2:22 pm

Re: OJS Plugin::Popular Articles Block Plugin

Postby memoemg » Mon Dec 16, 2013 1:38 pm

Hi Bruno, I tried your solution but I got this errors

1 - syntax error, unexpected '?>', expecting function (T_FUNCTION)

I fixed it adding the closing } to the foreach

2 - Call to undefined method PopularArticlesDAO::getPopularArticles()

This one was because the original method's name was getPopularArticles and the one in your solution reads getMostPopularArticles

The last error, wich I haven't been able to manage is

3 - PHP Fatal error: Call to a member function getArticleId() on a non-object in /cache/t_compile/%%48^483^483BA8D4%%block.tpl.php on line 32

Don't know what to do...

Guillermo
memoemg
 
Posts: 11
Joined: Thu Sep 05, 2013 2:35 pm

Re: OJS Plugin::Popular Articles Block Plugin

Postby bbeghelli » Wed Dec 18, 2013 4:18 pm

Hi Guillermo,

Sorry, forgot to add the patch to fix the block template file. Try applying this one:

http://pkp.sfu.ca/bugzilla/attachment.cgi?id=3981

Cheers,
Bruno
bbeghelli
 
Posts: 113
Joined: Tue Jun 25, 2013 2:22 pm

Re: OJS Plugin::Popular Articles Block Plugin

Postby memoemg » Tue Jan 07, 2014 8:09 am

Hi Bruno, I couldn't apply the patch, maybe I didn't understand it but I feel like my block.tpl file is different.

This is my popularArticles/block.tpl file

Code: Select all
<div class="block" id="sidebarPopularArticles">
   <span class="blockTitle">{translate key="plugins.block.popularArticles.displayName"}</span>
   {section name=article loop=$popularArticles}
       {*{math equation="x+1" x=$smarty.section.article.index}*}&#187;&nbsp;<a href="{url page="article" op="view" path=$popularArticles[article]->getArticleId()}">{$popularArticles[article]->getArticleTitle()}</a><br />
       <strong>{$popularArticles[article]->getViews()} {translate key="plugins.block.popularArticles.views"}</strong><br />
   {/section}
</div>

{*:{$article->getDatePublished()|date_format:$dateFormatShort}*}


Thanks for your help,

Guillermo
memoemg
 
Posts: 11
Joined: Thu Sep 05, 2013 2:35 pm

Re: OJS Plugin::Popular Articles Block Plugin

Postby bbeghelli » Mon Jan 13, 2014 5:56 am

Hi Guillermo,

The block.tpl file that I used as a base to create the patch is this:
Code: Select all
{**
 * block.tpl
 *
 * Copyright (c) 2000-2008 John Willinsky
 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
 *
 * Most Popular Articles
 *
 *}
<div class="block" id="sidebarNavigation">
   <span class="blockTitle">{translate key="plugins.blocks.popularArticles.displayName"}</span>
{foreach from=$popularArticles item=article}
   &#187;<a href="{url page="article" op="view" path=$article->getArticleId()}">{$article->getArticleTitle()|escape}</a><br />
   <strong>{$article->getViews()} {translate key="plugins.blocks.popularArticles.viewsSince"}: {$article->getDatePublished()|date_format:$dateFormatShort}</strong><br />
{/foreach}
</div>


I don't know why you have it different. But I think that if you use this it should work:

Code: Select all
<div class="block" id="sidebarPopularArticles">
   <span class="blockTitle">{translate key="plugins.block.popularArticles.displayName"}</span>
   {section name=articleInfo loop=$popularArticles}
       {assign var=article value=$articleInfo.article}
       {*{math equation="x+1" x=$smarty.section.articleInfo.index}*}&#187;&nbsp;<a href="{url page="article" op="view" path=$article->getId()}">{$article->getLocalizedTitle()}</a><br />
       <strong>{$articleInfo.views} {translate key="plugins.block.popularArticles.views"}</strong><br />
   {/section}
</div>
bbeghelli
 
Posts: 113
Joined: Tue Jun 25, 2013 2:22 pm

PreviousNext

Return to Plugin Gallery

Who is online

Users browsing this forum: No registered users and 1 guest