Old articles in the “Popular” module
Tags: joomla, popular, mos_mostread
Often there is such problem with the “Popular” module (”Most Read Content”, mos_mostread). There some articles are located, and everyone click on them. As a result these articles do not leave from “popular”, and new articles don’t appear here. It is vicious circle.
One of solutions is to show popular news for the last NNN days.
In order to do that, add in /modules/mod_mostread.php
."n AND ((TO_DAYS('".date("Y-m-d",time()+$mosConfig_offset*60*60). "') - TO_DAYS(a.created)) <= 'NNN')"
(where NNN is a number of days) in three places after lines (~37, 53, 93)
. "n AND ( a.publish_up = " . $database->Quote( $nullDate ) . " OR a.publish_up <= " . $database->Quote( $now ) . " )" . "n AND ( a.publish_down = " . $database->Quote( $nullDate ) . " OR a.publish_down >= " . $database->Quote( $now ) . " )"
And add “a.created” to the SELECT list of all the above sql-queries.
Or, you can download the “Popular of late” module (v1.1 - now Mambo-compatible) and use it instead of “Popular”. The module based on the original “Popular” module and have one additional parameter only - the period of “novelty”.
June 2nd, 2007 at 1:38 am
cool… gotta giv this a try..
=)
June 2nd, 2007 at 5:29 pm
Hi,
I’m using Mambo 4.5.2. When I installed your module, I got an error as below.
Fatal error: Call to undefined function: getnulldate() in /var/www/vhosts/kurumsalsistem.net/httpdocs/modules/mod_mostreadrecent.php on line 28
Thanks.
June 4th, 2007 at 4:53 pm
Hello, I have a question what is the mining of:
$period = intval( $params->get( ‘period’, 61 ) );
61?? is 61 days, i need is to set 1 week 7 days!
Please mail me the info, thenx, useful stuff!
June 4th, 2007 at 9:54 pm
Thanx Physicist,
I’ll re-dl it now.
Regards,
Clint
June 5th, 2007 at 2:34 am
I’ve tried the module in the sandbox for my website. It shows no errors, displays fine in the right column. However - it displays no links to popular content.
Later I have tried to enter SectionIDs, CategoryIDs and changed Period of Novelty. No joy. Any hints?
June 5th, 2007 at 4:07 am
keccsy:
You can change this value in module settings.
Mustafa:
I make mambo-version a little later.
Andrej:
What is the version of your Joomla?
June 6th, 2007 at 9:46 am
Joomla! 1.0.12 Stable [ Sunfire ] 25 December 2006 01:00 UTC
June 6th, 2007 at 10:34 am
My initial post did not format well because of the link tag. Please remove it, Physicist.
My problem above must have been something unrelated to the module. I re-tried the module after updating the database from live site, now it works as advertized. I also did a slight mod. Did not use because it didn’t look good in my template. I used a dot to start with and cut the titles after a specific number of characters:
title;
if (strlen($title_text) > $title_max_length) {
$title_text = substr($title_text,0,$title_max_length-1).”..”;
}
echo $title_text;
?>
I’m a slight noob at this, so if you can help me get $title_max_length into the module parameters I guess that would be useful for others too.
Great module, I’ve long wished for it. Cheers!
June 7th, 2007 at 9:04 am
The version 1.1 was released.
June 8th, 2007 at 10:46 pm
I was going to write my own modifications for it, but then I found your site.
Worked perfectly.
Time saver.
Thanks