Board Sorting Method

Started by Diego Andrés, August 27, 2022, 05:40:55 AM

Previous topic - Next topic

Diego Andrés

Link to the mod




Board Sorting Method
Developed by Diego Andrés



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

Features
  • Select default sorting method
  • Select default sorting order

Localization
English
Russian by Bugo


Changelog
GitHub

SMF Tricks - Free & Premium Responsive Themes for SMF.

d3vcho

I believe the repo is still private
"Greeting Death as an old friend, they departed this life as equals"

GL700Wing

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 ...
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

d3vcho

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 which Diego linked in his post. He now made it public.
"Greeting Death as an old friend, they departed this life as equals"

Mareid

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.

Diego Andrés

Yes you can do that and pair it with the preferred method for sorting.

SMF Tricks - Free & Premium Responsive Themes for SMF.

Mareid

It would be great if I could sort by prefix (your mod). I am using that too.

Diego Andrés

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.

SMF Tricks - Free & Premium Responsive Themes for SMF.

davo88

Very handy mod. Thank you Diego.

Senkusha

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?
-- Senkusha
The Kawaii Klub
The Creative Anime Role Playing Community.
(SMF v. 2.1.4, PHP v. 8.0)

Diego Andrés


SMF Tricks - Free & Premium Responsive Themes for SMF.

Senkusha

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?
-- Senkusha
The Kawaii Klub
The Creative Anime Role Playing Community.
(SMF v. 2.1.4, PHP v. 8.0)

Diego Andrés

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.

SMF Tricks - Free & Premium Responsive Themes for SMF.

Senkusha

Okay, that's good to know that there's no query manipulation.  But I find this interesting.  This is how my board is set:

You cannot view this attachment.

I click into the board and see this:
You cannot view this attachment.

(And that was before I selected a sort setting)
You cannot view this attachment.
But after I select Last Post, I see this:
You cannot view this attachment.

Maybe something isn't being set initially somewhere, if the default option is selected as Last Post in the Board Configuration?
-- Senkusha
The Kawaii Klub
The Creative Anime Role Playing Community.
(SMF v. 2.1.4, PHP v. 8.0)

Diego Andrés

Can't reproduce it.
Descending is the default sorting method, so it would display the newest at the top.

Perhaps you installed this MOD too?

SMF Tricks - Free & Premium Responsive Themes for SMF.

Senkusha

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.
-- Senkusha
The Kawaii Klub
The Creative Anime Role Playing Community.
(SMF v. 2.1.4, PHP v. 8.0)

Advertisement: