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. 1
    -fuQaHa- Says:

    cool… gotta giv this a try..

    =)

  2. 2
    Mustafa Says:

    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.

  3. 3
    keccsy Says:

    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!

  4. 4
    Clint Says:

    Thanx Physicist,

    I’ll re-dl it now.

    Regards,
    Clint

  5. 5
    Andrej Says:

    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?

  6. 6
    Physicist Says:

    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?

  7. 7
    Andrej Says:

    Joomla! 1.0.12 Stable [ Sunfire ] 25 December 2006 01:00 UTC

  8. 8
    Andrej Says:

    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!

  9. 9
    Physicist Says:

    The version 1.1 was released.

  10. 10
    rvdavid Says:

    I was going to write my own modifications for it, but then I found your site.
    Worked perfectly.
    Time saver.

    Thanks :)

Pages: [1] 2 » Show All

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

Leave a Reply