1
Anonymous
News 1.67 : Display all articles in archive
  • 2011/8/29 20:14

  • Anonymous

  • Posts: 0

  • Since:


All,

Hopefully a question with a simple answer
I'am using the news 1.67 module to manage a lot of news articles.

In the archive (archive.php) only the active articles are displayed.

I want to display also the articles with status expired.

Which part of the code in archive.php must be edited to make this possible?

Thanks René

2
mboyden
Re: News 1.67 : Display all articles in archive
  • 2011/8/30 19:45

  • mboyden

  • Moderator

  • Posts: 484

  • Since: 2005/3/9 1


I'm basing this off 1.63 as I've not put 1.67 into use yet. However:

archive.php line 114:
$result $xoopsDB->query('SELECT published FROM '.$xoopsDB->prefix('stories').' WHERE (published>0 AND published<='.time().') AND (expired = 0 OR expired <= '.time().') ORDER BY published DESC');


remove the expired stuff from the where clause so that it looks like:
$result $xoopsDB->query('SELECT published FROM '.$xoopsDB->prefix('stories').' WHERE (published>0 AND published<='.time().') ORDER BY published DESC');


You will also have to change the article page to allow expired articles to be viewed:

article.php lines 144-158:
// Expired
if ( $article->expired() != && $article->expired() < time() ) {
    
redirect_header(XOOPS_URL.'/modules/news/index.php'2_NW_NOSTORY);
    exit();
}


You can likely just comment all that code out and it should work.

YMMV.
Pessimists see difficulty in opportunity; Optimists see opportunity in difficulty. --W Churchill

XOOPS: Latest | Debug | Hosting and Web Development

Login

Who's Online

247 user(s) are online (152 user(s) are browsing Support Forums)


Members: 0


Guests: 247


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits