Page 1 of 1

[SOLVED] How to sort news articles by end time AND news title?

Posted: Wed Nov 03, 2010 12:17 am
by CWUscholar
I'm able to sort my news articles alphabetically (sortby="news_title") or by "expiration date" (sortby="end_time"), but not both, it seems.

Sorry if this is a stupid question, but how do I get my news articles to sort primarily by end_time and secondarily by news_title?

Thank you in advance.

Re: How to sort news articles by end time AND news title?

Posted: Wed Nov 03, 2010 1:42 am
by Wishbone
{news sortby="end_time,news_title"}

In effect, the code queries the database with "ORDER BY $sortby", which can take a comma-separated list, though it does filter out single quotes and semi-colons, so that you can't do too much SQL injection. At least in 1.6.6.. I don't know if this section changed later. I need to upgrade. :)

Re: [SOLVED] How to sort news articles by end time AND news title?

Posted: Wed Nov 03, 2010 1:46 am
by CWUscholar
Thank you very much!  I really appreciate it!