Simple Machines Community Forum

SMF Development => Feature Requests => Applied or Declined Requests => Topic started by: RoyalMess on February 04, 2010, 12:45:20 PM

Title: Sort topic by date started - SMF 1.1.11
Post by: RoyalMess on February 04, 2010, 12:45:20 PM
I have a sports forum for sports in and around my city but in the match forum category i would like to just sort that forum category by date from the newest topic to the latest for me and all the users.
You are able to sort by User etc. but i would like to sort it by date created/started for just 2 forum categories.
I hope this could be added/implanted.

Regards RoyalMess.
Title: Re: Sort topic by date started - SMF 1.1.11
Post by: Norv on February 05, 2010, 02:10:15 AM
I'd rather see this implemented as a mod, myself.
Should it suffice to have another column that allows sorting by date started? (so by the first post, not the last post).
Title: Re: Sort topic by date started - SMF 1.1.11
Post by: smp420 on February 05, 2010, 03:17:20 AM
in Sources/MessageIndex.php find // Default sort methods.
$sort_methods = array(
'subject' => 'mf.subject',
'starter' => 'IFNULL(memf.real_name, mf.poster_name)',
'last_poster' => 'IFNULL(meml.real_name, ml.poster_name)',
'replies' => 't.num_replies',
'views' => 't.num_views',
'first_post' => 't.id_topic',
'last_post' => 't.id_last_msg'
);

// They didn't pick one, default to by last post descending.
if (!isset($_REQUEST['sort']) || !isset($sort_methods[$_REQUEST['sort']]))
{
$context['sort_by'] = 'last_post';
$_REQUEST['sort'] = 'id_last_msg';
$ascending = isset($_REQUEST['asc']);

}

replace with // Default sort methods.
$sort_methods = array(
'subject' => 'mf.subject',
'starter' => 'IFNULL(memf.real_name, mf.poster_name)',
'last_poster' => 'IFNULL(meml.real_name, ml.poster_name)',
'replies' => 't.num_replies',
'views' => 't.num_views',
'first_post' => 't.id_topic',
'last_post' => 't.id_last_msg'
);

// They didn't pick one, default to by last post descending.
if (!isset($_REQUEST['sort']) || !isset($sort_methods[$_REQUEST['sort']]))
{
$context['sort_by'] = 'first_post';
$_REQUEST['sort'] = 'id_topic';
$ascending = isset($_REQUEST['asc']);

}


EDIT-just noticed you are using 1.1.11 this is for 2.0 rc2 but I am sure it is almost the same I will look at it tommorrow
Title: Re: Sort topic by date started - SMF 1.1.11
Post by: Arantor on February 05, 2010, 03:31:41 AM
Custom Board Sort mod, perhaps? (It's already on the mod site)
Title: Re: Sort topic by date started - SMF 1.1.11
Post by: smp420 on February 05, 2010, 12:35:32 PM
Here is the link to that http://custom.simplemachines.org/mods/index.php?mod=382
Title: Re: Sort topic by date started - SMF 1.1.11
Post by: RoyalMess on February 07, 2010, 06:15:07 PM
Quote from: smp420 on February 05, 2010, 12:35:32 PM
Here is the link to that http://custom.simplemachines.org/mods/index.php?mod=382

First Created:
    July 09, 2006, 09:28:12 PM
Last Modified:
    May 01, 2008, 06:30:40 PM
Latest Version:
    1.0.1
Compatible With:
    1.1 RC2, 1.1 RC3, 1.1, 1.1.1, 1.1.2, 1.1.3, 1.1.5

It isn't working on my site, SMF 1.1.11
Title: Re: Sort topic by date started - SMF 1.1.11
Post by: smp420 on February 07, 2010, 07:32:25 PM
It should still work are you getting any errors when installing.
Title: Re: Sort topic by date started - SMF 1.1.11
Post by: RoyalMess on February 11, 2010, 09:19:12 AM
Quote from: smp420 on February 07, 2010, 07:32:25 PM
It should still work are you getting any errors when installing.

It did install just no option anywhere to change the sort by buttons, and i tried it manual but this whole mod is like outdated for SMF 1.1.11
Title: Re: Sort topic by date started - SMF 1.1.11
Post by: smp420 on February 11, 2010, 05:33:00 PM
In the admin panel did you edit a board the options should be there.
Title: Re: Sort topic by date started - SMF 1.1.11
Post by: Rav33n on June 03, 2010, 04:48:08 PM
Just to confirm that the Custom Board Sort mod works fine on SMF 1.1.11
Title: Re: Sort topic by date started - SMF 1.1.11
Post by: Norv on November 20, 2010, 03:04:46 AM
Whatever the status of this in SMF 2.x, I'd keep it in mind for even further versions... If not to implement in core, then to offer a possibility to sort on anything or add sorting on anything easily.