News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

lists and smileys

Started by emanuele, November 13, 2010, 09:50:00 AM

Previous topic - Next topic

emanuele

Using this code in SMF2 RC4 (SMF 1.1.12 is not affected):

[list]
[*] :)
[*] :P
[*] :(
[*] ::)
[/list]


the odd smileys are displayed as expected as images while the others only in text form.


  • :)
  • :P
  • :(
  • ::)
And if the list contains an odd number of items:

  • :)
  • :P
  • :(
  • ::)
  • :o
the problem affects also the smileys outside the list: ;D

Here the odd are displayed as text probably due to the previous list:

  • :)
  • :P
  • :(
  • ::)
  • :o
The sequence (odd/even) is restarted if a formatting code is used in one of the points of the list:

  • :)
  • :P
  • :( some bold
  • ::)
  • :o


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Brettflan

I'd just like to confirm that it does happen on another RC4 forum, not just here. I haven't had time to look into it further, though.

Darknico

I confirm this bug in my forum with SMF 2.0 RC4...
With SMF 1.1.12 work correctly, this bug is only with SMF 2.0
Italian SMF - Supporto Italiano per la board SMF - Ci trovate tutti li!! :)


Bugo

Try use normal list format:

[list]
[li]:)[/li]
[li]:P[/li]
[li]:([/li]
[li]::)[/li]
[/list]


  • :)
  • :P
  • :(
  • ::)

emanuele

I would assume that if there is the possibility to use this syntax it should works (like it does for SMF 1).

BTW with the normal list posted by Bugo there seems to be a misalignment with Opera (see attached picture).


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Brettflan

Another list example which demonstrates problems, probably related:
[list]
[0] aaa
[0] bbb
[0] ccc
[0] ddd
[/list]


  • aaa
  • bbb
  • ccc
  • ddd
Seems like it might be specifically with BBCode tags which don't require an end tag.

emanuele

I don't know if it is intended (and if it is worth another thread):

[list type=decimal]
[*] elem 1
[*] elem 2
[/list]

in SMF 1.1 render with numbers, in SMF 2 no.

  • elem 1
  • elem 2


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Aleksi "Lex" Kilpinen


  • elem 1
  • Test
  • elem 2
  • Test
Seems like mixing them together ads strange results too ;D
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

How you can help SMF

emanuele

Even funnier if you use this:

[list type=decimal]
[li] elem 1[/li]
[*] Test
[li] elem 2[/li]
[*] Test
[/list]


  • elem 1
  • Test
    • elem 2
  • Test
That after "post" becomes:

[list type=decimal]
[li] elem 1[/li][/list]
[*] Test
[list][li] elem 2[/li][/list]
[*] Test
[/list]

:D


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

emanuele

#9
In Subs.php:
Code (find) Select
if ($message[$pos + 1] == '0' && !in_array($message[$pos - 1], array(';', ' ', "\t", '>')))
Code (replace with) Select
if ($message[$pos + 1] == '0' && !in_array($message[$pos - 1], array(';', ' ', "\t", "\n", '>')))

and
Code (find) Select
$message = substr($message, 0, $pos2) . "\n" . (!empty($matches[0]) && substr($matches[0], -1) == '[' ? '[/li]' : '[/li][/list]') . "\n" . substr($message, $pos2);
Code (replace with) Select
$message = substr($message, 0, $pos2) . (!empty($matches[0]) && substr($matches[0], -1) == '[' ? '[/li]' : '[/li][/list]') . substr($message, $pos2);

The first one should fix Brettflan's report, while the second should fix mine.

Problem is the fix for the problem I reported shouldn't break anything because is explicitly for item codes, while the one for Brettflan's bug affects any bbcode, so I'm not 100% sure is doesn't break anything else...if someone would help reviewing and testing them feel free... O:)


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

NekoJonez

Quote from: emanuele on March 11, 2012, 12:15:21 PM
In Subs.php:
Code (find) Select
if ($message[$pos + 1] == '0' && !in_array($message[$pos - 1], array(';', ' ', "\t", '>')))
Code (replace with) Select
if ($message[$pos + 1] == '0' && !in_array($message[$pos - 1], array(';', ' ', "\t", "\n", '>')))

and
Code (find) Select
$message = substr($message, 0, $pos2) . "\n" . (!empty($matches[0]) && substr($matches[0], -1) == '[' ? '[/li]' : '[/li][/list]') . "\n" . substr($message, $pos2);
Code (replace with) Select
$message = substr($message, 0, $pos2) . (!empty($matches[0]) && substr($matches[0], -1) == '[' ? '[/li]' : '[/li][/list]') . substr($message, $pos2);

The first one should fix Brettflan's report, while the second should fix mine.

Problem is the fix for the problem I reported shouldn't break anything because is explicitly for item codes, while the one for Brettflan's bug affects any bbcode, so I'm not 100% sure is doesn't break anything else...if someone would help reviewing and testing them feel free... O:)

Apologies for the bump of this topic but I can't find the first line in my Subs.php in 2.0.4
Retro video game blogger, writer, actor, podcaster and general amazing dude.

Twitter
My Blog

emanuele

Which one of the two first lines?


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

NekoJonez

The stuff above the "and" word
Retro video game blogger, writer, actor, podcaster and general amazing dude.

Twitter
My Blog

emanuele

Strange...maybe I was working on 2.1 and it's a bit different from 2.0? Or maybe you have some mod installed...
Anyway I'm not sure that part is totally safe to apply, it may create nasty problems with other tags, it should be investigated a bit more.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

NekoJonez

Quote from: emanuele on May 03, 2013, 11:36:11 AM
Strange...maybe I was working on 2.1 and it's a bit different from 2.0? Or maybe you have some mod installed...
Anyway I'm not sure that part is totally safe to apply, it may create nasty problems with other tags, it should be investigated a bit more.

Well, I did a test and applied only the 2nd one.

The smileys are fixed and I'm not encountering any other probs.
Retro video game blogger, writer, actor, podcaster and general amazing dude.

Twitter
My Blog

Arantor

Included the patch into 2.1 since it seems to work without any side effects other than all the ones we already know about for the bbc parser. Thanks!
Holder of controversial views, all of which my own.


Advertisement: