Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Diego Andrés on August 27, 2022, 05:40:55 AM

Title: Board Sorting Method
Post by: Diego Andrés on August 27, 2022, 05:40:55 AM
Link to the mod (https://custom.simplemachines.org/index.php?mod=4340)

(https://smftricks.com/logos/logo.png) (https://smftricks.com/)

(https://img.shields.io/badge/License-MIT-248049) (https://img.shields.io/badge/Hooks%20Only-Yes-6041a3) (https://img.shields.io/badge/SMF-2.1-3f73a0)

Board Sorting Method
Developed by Diego Andrés (https://smftricks.com/index.php?action=profile;u=1)



Introduction
Board Sorting Method will provide the options to select a different default sort order for each board.

Features

Localization
(https://www.simplemachines.org/site_images/lang/english.gif) English
(https://www.simplemachines.org/site_images/lang/russian.gif) Russian by Bugo (https://www.simplemachines.org/community/index.php?action=profile;u=229017)


Changelog (https://github.com/SMFTricks/Board-Sorting-Method/blob/main/CHANGELOG.md)
GitHub (https://github.com/SMFTricks/Board-Sorting-Method)
Title: Re: Board Sorting Method
Post by: d3vcho on August 27, 2022, 06:48:31 AM
I believe the repo is still private
Title: Re: Board Sorting Method
Post by: GL700Wing on August 27, 2022, 08:03:46 AM
Quote from: d3vcho on August 27, 2022, 06:48:31 AMI believe the repo is still private
I don't know how to make the repo publicly available/accessible ...
Title: Re: Board Sorting Method
Post by: d3vcho on August 27, 2022, 05:07:35 PM
Quote from: GL700Wing on August 27, 2022, 08:03:46 AMI don't know how to make the repo publicly available/accessible ...

Sorry GL700Wing, I actually meant the GitHub repo (https://github.com/SMFTricks/Board-Sorting-Method) which Diego linked in his post. He now made it public.
Title: Re: Board Sorting Method
Post by: Mareid on February 20, 2023, 11:52:17 AM
Yes I think this will work, thank you.  I'll have to be careful how I name the topics, but alphabetic sorting will do what I want.  Or I could simply put a number as the first character in the order I want.
Title: Re: Board Sorting Method
Post by: Diego Andrés on February 20, 2023, 11:55:10 AM
Yes you can do that and pair it with the preferred method for sorting.
Title: Re: Board Sorting Method
Post by: Mareid on February 20, 2023, 03:21:27 PM
It would be great if I could sort by prefix (your mod). I am using that too.
Title: Re: Board Sorting Method
Post by: Diego Andrés on February 20, 2023, 03:25:44 PM
That's an interesting idea.
Though the prefixes don't really offer a real sorting method besides alphabetical or id + then a sorting method from the topic so I'm not sure it's too useful.
Title: Re: Board Sorting Method
Post by: davo88 on February 01, 2024, 01:49:22 PM
Very handy mod. Thank you Diego.
Title: Re: Board Sorting Method
Post by: Senkusha on March 07, 2025, 12:26:14 PM
How exactly does sorting by Last Date function?  Is it genuinely sorting by message date, or is it just defaulting to the "standard method" SMF uses to display messages?
Title: Re: Board Sorting Method
Post by: Diego Andrés on March 09, 2025, 01:17:49 AM
Default, using the id.
Title: Re: Board Sorting Method
Post by: Senkusha on March 09, 2025, 07:16:41 AM
But if I want to force the sorting to use Last Post Date, then it doesn't necessarily work, because ID's in descending order is assuming that the last message is always going to be highest ID number.  What happens in the rare event of a data import?  There should probably be another option added (Default: Message ID) to the list, and Last Post Date should force the Order By clause.  Am I correct?
Title: Re: Board Sorting Method
Post by: Diego Andrés on March 10, 2025, 02:10:40 AM
It uses the default sorting options of SMF primarily so that the default indicators are visible. Additionally, I am not editing the queries so it simply uses the options provided by SMF.
Title: Re: Board Sorting Method
Post by: Senkusha on March 10, 2025, 07:33:06 AM
Okay, that's good to know that there's no query manipulation.  But I find this interesting.  This is how my board is set:

2025-03-10 07_28_52-Modify Boards — Mozilla Firefox.png

I click into the board and see this:
2025-03-10 07_27_27-Kagome's General Gossip and Discussion — Mozilla Firefox.png

(And that was before I selected a sort setting)
2025-03-10 07_27_54-Kagome's General Gossip and Discussion — Mozilla Firefox.png
But after I select Last Post, I see this:
2025-03-10 07_28_10-Kagome's General Gossip and Discussion — Mozilla Firefox.png

Maybe something isn't being set initially somewhere, if the default option is selected as Last Post in the Board Configuration?
Title: Re: Board Sorting Method
Post by: Diego Andrés on March 11, 2025, 12:00:20 AM
Can't reproduce it.
Descending is the default sorting method, so it would display the newest at the top.

Perhaps you installed this MOD (https://custom.simplemachines.org/index.php?mod=4398) too?
Title: Re: Board Sorting Method
Post by: Senkusha on March 11, 2025, 08:08:32 PM
Nope.  I don't have that mod.  You probably can't reproduce my experience because I've injected messages into my database, therefore the id_msg is higher than the "latest message date".  I've also run Repair Database to correct issues with the Cache.