Net Step - 2006-08-14

Issue: News Module > View all News > Doesn't display the post date...reverts back to Dec 31, 1969...for all articles and query sorts by news item ID/creation order.

Goal: View all news with correct date in date order from newest to oldest.

My solution:

Template uses $newsitem->real_posted
I found it in actions/view.php:
$news->real_posted = ($news->publish != 0 ? $news->publish : $news->posted);

Didn't find function in view_all_news.php.
I added it below the $news[$i]->permissions = array(...);

$news[$i]->real_posted = ($news[$i]->publish != 0 ? $news[$i]->publish : $news[$i]->posted);
This worked to properly display the date in View All News.

NEXT
view_all_news.php news query at about Line 46 includes
ORDER BY posted " . $config->sortorder);

I modified this to this so it would show all the news from most recent first.
ORDER BY publish DESC);

Then this little sticker at line 49.
usort($news,($config->sortorder == "DESC".....
Comment out
//usort($news,($config->sortorder == "DESC".....

May not be perfect...but it works.