Sort Tag

Started by Anguz, November 17, 2004, 05:50:57 PM

Previous topic - Next topic

Anguz

Link to Mod

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
Cristián Lávaque http://cristianlavaque.com

Anguz

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
Cristián Lávaque http://cristianlavaque.com

Anguz

1.01


  • Updated for SMF 1.0.1
Cristián Lávaque http://cristianlavaque.com

Anguz

1.02


  • Updated for SMF 1.0.2.
Cristián Lávaque http://cristianlavaque.com

Chan Kong-sang

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.

Anguz

Err.. no, haven't updated this one yet. I'll try to get to it tonight.
Cristián Lávaque http://cristianlavaque.com

Chan Kong-sang

One month later... did you get time to work on it?

Anguz

Wow, time does fly sometimes. Sorry for the wait.

1.03
  • Updated for SMF 1.0.5.
Cristián Lávaque http://cristianlavaque.com

Chan Kong-sang


Anguz

Cristián Lávaque http://cristianlavaque.com

@ngel

Any way to have this functionnality for version 1.1.1 final ?

MIAUS

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?

Advertisement: