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

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

Pages: « 1 2 [3] Show All

  1. 21
    Paul Radley Says:

    This is no longer applicable with the latest version.

Pages: « 1 2 [3] Show All

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

Leave a Reply