Page 1 of 1

MiniDoc: How to make a Last Updated Module

Posted: Thu Dec 22, 2005 1:32 pm
by HarryB
Here's a quick hack of latest news that turns it into a "latest updates" module.  copy mod_latestnews.php to another file (I used mod_latestmods.php as name).  Then make following changes in mod_latestmod.php:

In the query in each of the three (3) case statements change these two lines:

    . "\n AND ( a.publish_up = '$nullDate' OR a.publish_up<= '$now' )"
    . "\n ORDER BY a.created DESC LIMIT $count"

to read:

    . "\n AND ( a.modified = '$nullDate' OR a.modified <= '$now' )"
    . "\n ORDER BY a.modified DESC LIMIT $count"

Then copy mod_latestnews.xml to mod_latestmods.xml.  Make following changes to mod_latestmods.xml:

Find this line:

    mod_latestnews.php

And change to read:

    mod_latestmod.php


You might also want to edit the ... and other documentation type statements to reflect this is  the latest updates module.

Zip mod_latestmod.php and mod_latestmod.xml into a mod_latestmod.zip file and install ....

You can see an example of this module at http://www.hrpr.com.

Re: MiniDoc: How to make a Last Updated Module

Posted: Thu Dec 22, 2005 2:03 pm
by guilliam
thank you harry for sharing!

let us hear others hwo they went with this hack.

- g

Re: MiniDoc: How to make a Last Updated Module

Posted: Tue Jan 31, 2006 5:19 pm
by FrostByghte
Just a heads up, but in order to make this work right I had to also change the ORDER BY statements to use a.modified

Re: MiniDoc: How to make a Last Updated Module

Posted: Fri Feb 03, 2006 11:08 pm
by HarryB
FrostByghte wrote:Just a heads up, but in order to make this work right I had to also change the ORDER BY statements to use a.modified

You're right...guess it got lost somewhere along the way during my original post...thanks...  :-[

Re: MiniDoc: How to make a Last Updated Module

Posted: Fri Feb 03, 2006 11:22 pm
by HarryB
Modified my first post in this thread to correct error...my apologies... :'(

Re: MiniDoc: How to make a Last Updated Module

Posted: Sat Feb 04, 2006 4:39 am
by mosey
Thanks for sharing! :D I thinkI'll find this solution very helpful :)