Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Anguz on November 17, 2004, 05:50:57 PM

Title: Sort Tag
Post by: Anguz on November 17, 2004, 05:50:57 PM
Link to Mod (http://mods.simplemachines.org/index.php?mod=54)

This mod adds the [sort][/sort] tag, which lets you re-arrange the lines inside it in many ways: [sort<] ascending, [sort>] descending, [sort?] shuffle, [sort-] inverse. Without a parameter, it'll leave the lines in the same order removing the empty ones. After doing it's magic when you post the message (either new or modified), the tag is removed, leaving the lines in their new order. Numbers will be sorted in natural order, ie: 1,2,10. The order of characters starting from lowest (a space) is:
!#%&'()*+,-.0123456789<=>?@ABCDEFGHIJKLMNOP
QRSTUVWXYZ"$\^_`abcdefghijklmnopqrstuvwxyz|~


Copyright 2004 by Cristian Lavaque. http://anguz.net
Title: Re: Sort Tag
Post by: Anguz on November 17, 2004, 05:59:32 PM
Here's an example:


[sort<]
32
457

dskl
oiw
68
klna

5
e45s
4set
[/sort]


will come out like this

Quote
4set
5
32
68
457
dskl
e45s
klna
oiw
Title: Re: Sort Tag
Post by: Anguz on February 06, 2005, 09:07:25 PM
1.01

Title: Re: Sort Tag
Post by: Anguz on February 23, 2005, 12:40:22 AM
1.02

Title: Re: Sort Tag
Post by: Chan Kong-sang on August 12, 2005, 05:22:53 PM
Hello :)
I see some needs for my forum when i look at the description but is this mod compatible to 1.0.5?

Thanks in advance.
Title: Re: Sort Tag
Post by: Anguz on August 12, 2005, 06:21:38 PM
Err.. no, haven't updated this one yet. I'll try to get to it tonight.
Title: Re: Sort Tag
Post by: Chan Kong-sang on September 12, 2005, 11:27:20 AM
One month later... did you get time to work on it?
Title: Re: Sort Tag
Post by: Anguz on September 12, 2005, 01:09:14 PM
Wow, time does fly sometimes. Sorry for the wait.

1.03
Title: Re: Sort Tag
Post by: Chan Kong-sang on September 14, 2005, 03:52:55 PM
Thank you very much! 8)
Title: Re: Sort Tag
Post by: Anguz on September 14, 2005, 08:17:22 PM
:)
Title: Re: Sort Tag
Post by: @ngel on January 16, 2007, 03:40:56 PM
Any way to have this functionnality for version 1.1.1 final ?
Title: Re: Sort Tag
Post by: MIAUS on April 29, 2009, 05:26:13 PM
Hi :)

I'd really love to use this in 1.1.8 - is there any way this is possible? The manual installation instructions tell me to find
// Mess with the tags outside [code].
else
fixTags($parts[$i]);

But there is only this part in my Subs-Post.php file:
// Only mess with stuff outside [code] tags.
for ($i = 0, $n = count($parts); $i < $n; $i++)
{
// It goes 0 = outside, 1 = begin tag, 2 = inside, 3 = close tag, repeat.
if ($i % 4 == 0)
{
fixTags($parts[$i]);


Any hints?