News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Sort topic by date started - SMF 1.1.11

Started by RoyalMess, February 04, 2010, 12:45:20 PM

Previous topic - Next topic

RoyalMess

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.

Norv

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).
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

smp420

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
"Things turn out best for those who make the best of the way things turn out." -Jack Buck

Arantor

Custom Board Sort mod, perhaps? (It's already on the mod site)

smp420

"Things turn out best for those who make the best of the way things turn out." -Jack Buck

RoyalMess

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

smp420

It should still work are you getting any errors when installing.
"Things turn out best for those who make the best of the way things turn out." -Jack Buck

RoyalMess

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

smp420

In the admin panel did you edit a board the options should be there.
"Things turn out best for those who make the best of the way things turn out." -Jack Buck

Rav33n

Just to confirm that the Custom Board Sort mod works fine on SMF 1.1.11

Norv

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.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

Advertisement: