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
June 25th, 2007 at 10:36 am
Thank You So Much For This Mod!!!!
The standard “Most Popular” Joomla Mod has been getting on my nerves lately because I had no REAL way of knowing which of my articles were “Most Popular” or not because the displayed results were always the same!
Now thanks to this module I know exactly what IS “Most Popular” on my site! And best of all, I didn’t have to wait for more visitors to access different sections of my site to know what was “Most Popular”!… The Module plucked the most visited pages from the DB from first installation of this Mod and displayed them in their “Most Popular” order so I therefore knew straight away which pages have been most read from the word Go!
I agree 100% with previous comments that this Mod should become part of the Joomla Core Installation! It does exactly what it says on the tin and also does exactly what the existing default Joomla “Most Popular” Mod should have done in the first place!
Thanks again Soooo Much for this fantastic Mod!
June 26th, 2007 at 6:15 pm
Question.. any kind of mod I can make to not just drop an article because it’s older? I have an article that’s extremely popular.. accounts for like 15 percent of my daily hits, and I want it to stay on top because it’s hit on a daily basis. I’d like it to just calculate “hits in the last X amount of days” and that’s it.. any way to do this?
June 26th, 2007 at 9:58 pm
This mod is great.. but there is one function that I would really like to see.
I noticed that some of the calculation is based off of the published date.. is there any way to modify this somehow to ONLY calculate using the hits in the last X amount of days? I have older articles that are still relevant and popular that still get traffic, but the way this is written, they will drop off of the list if they are published outside of the specified range, no matter how much traffic they are still getting. Any help would be awesome.
June 27th, 2007 at 12:16 am
Unfortunately, Joomla! saves the total count of hits without its
dates.
June 27th, 2007 at 12:36 am
But it is possible to try to output, for example, N popular articles for all time and M popular for “period of novelty”.
June 17th, 2008 at 6:23 am
As Physicist said, Joomla! saves the total hit count regardless of the date at which the hit occurred. This poses a huge problem for the Popular module because old articles that are still "active" will nonetheless be omitted from the list of most read articles.
I have changed the module to select articles based on their modification date, not their creation date. This allows me to bump up selected old articles by just "touching" them.
June 17th, 2008 at 8:00 am
Malte, it's marvellous tip. Thanks.
August 18th, 2008 at 9:57 am
I like the idea of showing visitors popular links and this module works like a charm (taking the limitations of Joomla hit counter into account).
Unfortunately it can also work against you. If for example your Copyright / Trademark notice are watched regularly (or even worse your 404 page), that page could appear as most popular.
Is it possible to exclude pages from being taken into account? Ie. adding an exclusion parameter in the backend?
Thanx.
Richard
October 8th, 2008 at 3:41 pm
Does anyone know how to change the links are displayed? For example, how do you change it so that the links are NOT in a list style?
Does it involve editing mod.mostread.php (and if so, how?)
Or is it something to do with giving the Module a Module Class Suffix and then changing it in the template CSS?
Can anyone help?
Cheers