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.
[SOLVED] How to sort news articles by end time AND news title?
-
- New Member
- Posts: 4
- Joined: Wed Nov 03, 2010 12:10 am
[SOLVED] How to sort news articles by end time AND news title?
Last edited by CWUscholar on Wed Nov 03, 2010 1:45 am, edited 1 time in total.
Re: How to sort news articles by end time AND news title?
{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.
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.

Last edited by calguy1000 on Wed Nov 03, 2010 2:09 am, edited 1 time in total.
-
- New Member
- Posts: 4
- Joined: Wed Nov 03, 2010 12:10 am
Re: [SOLVED] How to sort news articles by end time AND news title?
Thank you very much! I really appreciate it!