Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
Sort Options

 
Reply to topic    Forum Index » Skins and snippets View previous topic
View next topic
Sort Options
Author Message
scottdallas



Joined: 04 May 2006
Posts: 1808
Location: US

Post Sort Options Reply with quote
I don't know about anyone else but even if this is posted only for my resource later, that's fine. I'm sure Google will pick this up. I'm always forgetting which to use... ASC or DESC for my sort options and I usually end up using 6 different ways.. so I wrote them all down for safe keeping so I could use over and over and never forget. Here it is:



Newest to Oldest

$sort = array('date', 'DESC');



Oldest to Newest

$sort = array('date', 'ASC');



Most Views to Least Views

$sort = array('views', 'DESC');



Least Views to Most Views

$sort = array('views', 'ASC');



Most Comments to Least Comments

$sort = array('comments', 'DESC');



Least Comments to Most Comments

$sort = array('comments', 'ASC');



If anyone thinks that this is a waste of a post, my feelings wont be hurt if you delete it.

_________________
www.scottdizzle.com uses cnr Smile
last update: 07-22-08: 8:30 pm
Thu Jul 20, 2006 6:30 pm View user's profile Send private message Visit poster's website AIM Address
Guest








Please login to hide the ads.

scottdallas



Joined: 04 May 2006
Posts: 1808
Location: US

Post Reply with quote
Updated list:

Quote:
Newest to Oldest
$sort = array('date', 'DESC');

Oldest to Newest
$sort = array('date', 'ASC');

Most Views to Least Views
$sort = array('views', 'DESC');

Least Views to Most Views
$sort = array('views', 'ASC');

Most Comments to Least Comments
$sort = array('comments', 'DESC');

Least Comments to Most Comments
$sort = array('comments', 'ASC');

Alphabetical (A-Z)
$sort = array('title', 'ASC');

Alphabetical (Z-A)
$sort = array('title', 'DESC');

Sort By Date (Today)
$year = date('Y');
$month = date('n');
$day = date('d');

Most Viewed Posts (30 Days)
$mktime = (time() - 3600 * 24 * 30);
$year = date('Y', $mktime);
$month = date('m', $mktime);
$sort = array('views', 'DESC');

Sorting By Date & Time:
$year = date('Y');
$month = date('n');
$day = date('d') - 1;
$sort = array('comments', 'DESC');

Sort by author name:
$author = "username";


_________________
www.scottdizzle.com uses cnr Smile
last update: 07-22-08: 8:30 pm
Sun Oct 28, 2007 3:26 am View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:    
Reply to topic    Forum Index » Skins and snippets All times are GMT + 1 Hour
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum



Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Music Lyrics.