Post by susanjoy » Tue May 17, 2011 2:30 pm

Q,

I am using your CMS Module with Opencart v148. I am using it like a blog, so I would like my articles to be listed in order by date showing the newest articles on top. I saw your post showing how to sort them by date by changing article.php to

Code: Select all

	$sort = 'a.date_added';
			$sql .= " ORDER BY " . $sort;
But this puts the oldest on top. How do I put the newest on top?

Also, I can't find where to change the date format. Right now it is showing as: 2011-01-13 12:10:36
but I would like it to be listed as day,month,year.

Thank you in advance for your time.

Newbie

Posts

Joined
Mon Nov 29, 2010 11:44 am

Post by Qphoria » Tue May 17, 2011 11:25 pm

Change
$sql .= " ORDER BY " . $sort;
to
$sql .= " ORDER BY " . $sort . " DESC";

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by susanjoy » Wed May 18, 2011 3:57 am

Thank you so much. How would you fix the date/time format on the articles? ...

Right now it is showing as: 2011-01-13 12:10:36
but I would like it to be listed as month-day-year.

Thanks Q!

Newbie

Posts

Joined
Mon Nov 29, 2010 11:44 am
Who is online

Users browsing this forum: No registered users and 6 guests