Old articles in the “Popular” module

Tags: , ,

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”.

Related Posts

19 Responses to “Old articles in the “Popular” module”

Pages: « 1 [2] Show All

  1. 11
    Orion Says:

    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!

  2. 12
    D. Duncan Says:

    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?

  3. 13
    D. Duncan Says:

    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.

  4. 14
    Physicist Says:

    Unfortunately, Joomla! saves the total count of hits without its
    dates.

  5. 15
    Physicist Says:

    But it is possible to try to output, for example, N popular articles for all time and M popular for “period of novelty”.

  6. 16
    Malte Says:

    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.

  7. 17
    Physicist Says:

    Malte, it's marvellous tip. Thanks.

  8. 18
    Richult.nlard Weber Says:

    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

  9. 19
    mika Says:

    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

Pages: « 1 [2] Show All

You can follow any responses to this entry through the RSS 2.0 feed.

Leave a Reply