Advertisement:

Author Topic: Sort topic by date started - SMF 1.1.11  (Read 8691 times)

Offline RoyalMess

  • Semi-Newbie
  • *
  • Posts: 76
Sort topic by date started - SMF 1.1.11
« 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.
« Last Edit: November 20, 2010, 03:04:59 AM by Norv »

Offline Norv

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 18,313
  • Blue Wolf
Re: Sort topic by date started - SMF 1.1.11
« Reply #1 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).
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

Offline smp420

  • SMF Hero
  • ******
  • Posts: 1,520
Re: Sort topic by date started - SMF 1.1.11
« Reply #2 on: February 05, 2010, 03:17:20 AM »
in Sources/MessageIndex.php find
Code: [Select]
// 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
Code: [Select]
// 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

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,223
    • StoryBB/StoryBB on GitHub
Re: Sort topic by date started - SMF 1.1.11
« Reply #3 on: February 05, 2010, 03:31:41 AM »
Custom Board Sort mod, perhaps? (It's already on the mod site)
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline smp420

  • SMF Hero
  • ******
  • Posts: 1,520
Re: Sort topic by date started - SMF 1.1.11
« Reply #4 on: February 05, 2010, 12:35:32 PM »
“Things turn out best for those who make the best of the way things turn out.” -Jack Buck

Offline RoyalMess

  • Semi-Newbie
  • *
  • Posts: 76
Re: Sort topic by date started - SMF 1.1.11
« Reply #5 on: February 07, 2010, 06:15:07 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

Offline smp420

  • SMF Hero
  • ******
  • Posts: 1,520
Re: Sort topic by date started - SMF 1.1.11
« Reply #6 on: February 07, 2010, 07:32:25 PM »
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

Offline RoyalMess

  • Semi-Newbie
  • *
  • Posts: 76
Re: Sort topic by date started - SMF 1.1.11
« Reply #7 on: February 11, 2010, 09:19:12 AM »
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

Offline smp420

  • SMF Hero
  • ******
  • Posts: 1,520
Re: Sort topic by date started - SMF 1.1.11
« Reply #8 on: February 11, 2010, 05:33:00 PM »
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

Offline Rav33n

  • Semi-Newbie
  • *
  • Posts: 58
Re: Sort topic by date started - SMF 1.1.11
« Reply #9 on: June 03, 2010, 04:48:08 PM »
Just to confirm that the Custom Board Sort mod works fine on SMF 1.1.11

Offline Norv

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 18,313
  • Blue Wolf
Re: Sort topic by date started - SMF 1.1.11
« Reply #10 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.
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