SimplePortal

Support => English Support => Topic started by: rtkane on May 07, 2012, 05:18:13 PM

Title: Bad tag nesting in signature breaks the pages when Simple Portal is turned on
Post by: rtkane on May 07, 2012, 05:18:13 PM
I've recently installed SP primarily to allow for multiple Shoutboxes on different pages of my boards.  But when enabling it, I've noticed that it is breaking the structure of the page so that the page seems to have open table tags and the quick reply ends up in the middle.  The only thing I have it displaying is a Shoutbox on a single page (and not even on the below pages).  Doesn't seem to affect top level pages, only subs:


(http://home.comcast.net/~openaccess/upload/boardss1.jpg)


And more weirdness and broken table tags.  Lower on the page (not in the screenshot) the quick reply again is in the middle.


(http://home.comcast.net/~openaccess/upload/boardss2.jpg)

Any ideas?  Any help is certainly appreciated. 


SMF 2.0.2 w/ the most recent version of SP. 
Title: Re: Enabling SimplePortal breaks table structure of sub-pages
Post by: Chen Zhen on May 07, 2012, 08:38:34 PM
Hello rktane and welcome to Simple Portal.

This may not be related to Simple Portal since I see that the html error shows up on a page where no blocks appear to be enabled.
Unless you have other blocks enabled with improper code in it, imo it would appear to be caused by an improperly parsed installation/uninstallation of a mod?!

Did Simple Portal install without flagging any errors?
Do you have any other blocks enabled that may cause the issue?


Title: Re: Enabling SimplePortal breaks table structure of sub-pages
Post by: rtkane on May 07, 2012, 08:45:49 PM
Hi Underdog and thanks for the reply. SimplePortal installed without a hitch showing no errors and I have no other blocks enabled.  In addition, the reason I figured it was SimplePortal related was because the errors only appear when I activate it (whether front page, integration, or standalone modes). When I switch the Portal mode to "disabled" the errors all disappear.  Thank you again for your help.
Title: Re: Enabling SimplePortal breaks table structure of sub-pages
Post by: Chen Zhen on May 07, 2012, 08:49:04 PM
Is this on a live installation?
May I have a link to a page showing the issue so I can examine the html?

Is this using the SimplePortal shoutbox? ... Or is it a 3rd party shoutbox?
Title: Re: Enabling SimplePortal breaks table structure of sub-pages
Post by: rtkane on May 07, 2012, 08:58:37 PM
Is this on a live installation?
May I have a link to a page showing the issue so I can examine the html?

Is this using the SimplePortal shoutbox? ... Or is it a 3rd party shoutbox?

It is a live installation. Can I PM you a link with user credentials so you can see the error? 

Edit: and yes, it is a SimplePortal shoutbox.
Title: Re: Enabling SimplePortal breaks table structure of sub-pages
Post by: rtkane on May 07, 2012, 09:41:54 PM
Here's some updated info:  It would appear that some extra tags in someone's forum sig was causing the breaks.  Cleaning up the tags seems to have fixed it, but I'm at a loss as to why a sig would break the boards when SimplePortal is active, but be fine when it's not.  Let me know how I can get info over to you as it would appear noobs on these boards don't have PM permissions.  :)

Thanks.
Title: Re: Enabling SimplePortal breaks table structure of sub-pages
Post by: AngelinaBelle on May 08, 2012, 11:28:38 AM
Hi, rtkane,
You need 5 or 10 posts to achieve PM-ability. I'm glad you have solved the problem.
Do you want to mark this "Topic Solved"?

SimplePortal makes the HTML on the page more complicated.
So, without SimplePortal, the bad HTML in the signature actuall broke the HTML on the page, but you don't notice it because the browser deals with it OK.

But when you use SimplePortal, the page has more layers of things inside things, and you really start noticing the problem. The browser is not smart enough to make a good guess about how the page is supposed to be displayed.

Now, of course, if you have fixed the problem, you may not need to PM Underdog immediately.
Title: Re: Enabling SimplePortal breaks table structure of sub-pages
Post by: rtkane on May 08, 2012, 11:47:59 AM
I think cosmetically it's solved, but if I had another member post some poor BB code within their signature, it'll break the forums again.  It seems like their signature should be isolated enough in the code that a mod wouldn't allow for a user to completely (and unintentionally) mess up the forum structure itself.  If this is normal functionality for SimplePortal, feel free to mark it solved.

Thanks!

Title: Re: Enabling SimplePortal breaks table structure of sub-pages
Post by: AngelinaBelle on May 08, 2012, 03:23:31 PM
What was in the bad signature, anyway?
It looks like it was some kind of BBC tag nesting mistake.

The interesting thing is that we cannot entirely protect the HTML from bad user HTML.
The BBC parser (called parse_bbc) tries to help with unclosed tags, but it cannot always succeed.
Title: Re: Enabling SimplePortal breaks table structure of sub-pages
Post by: rtkane on May 08, 2012, 03:26:53 PM
It was a missing part of the table structure, specifically this:

Code: [Select]
[TR][TD]
That's all that was causing all of the issues.  Of course, when I try to paste the bad table structure into another user's sig, it breaks it again.  I sent Underdog a PM that I can forward over to you (with user credentials) just for further explanation.

Thanks.
Title: Bad tag nesting in signature breaks the pages when Simple Portal is turned on
Post by: AngelinaBelle on May 10, 2012, 11:31:06 AM
Thanks for sending me the sample signature. That signature has a problem -- an extra [./center] tag.
This causes bad HTML to be output, whether or not the forum is a BBC forum.
I hope you won't mind that I've changed the Subject of this topic to get more specific about the cause of the problem.

If anything, this is an SMF error.  The extra  tag causes parse_bbc to close the table incorrectly.  Instead of </td></tr></table>, it puts [nobbc]</table></tr></td>[/tr][/table].

A very strict browser would just complain about this and refuse to display the page. But your browser tries to deal with it.
On an ordinary SMF forum, the page is laid out using a number of <div> elements, so the browser won't find any tables to try to stick the spare </tr></td> with, so it just basically throws them away and keeps going. Stuff winds up in the order you would expect if they weren't there at all.

But on a Simpleportal page, which puts a table around the central section of the page, the browser might assume that </tr> is meant to close the row that <td id="sp_center"> belongs to. And then it has to deal with the </tr></td>. At that point, there are no open rows or cells to close.  What is the browser going to make of that mess?  Or the text [/tr][/table], and bunches of stuff which follows it, which seems to be within a table, but not inside any cell or even inside a row.
The browser does its best, but makes a mess of the rest of the page. It appears to put them inside the body of the table, before any of the rows.

You will get the same sort of result if you make a mistake like this in a post, rather than in the signature.  Blame it on parse_bbc.

Code: [Select]
[nobbc][table][tr][td]image   [./center]
[/td][/tr][/table][/nobbc]
causes
Code: [Select]
<div class="signature" id="msg_134_signature"><table class="bbc_table"><tr><td>image&nbsp;&nbsp;&nbsp;<br /></table></tr></td>[/tr][/table]</div>
Code: [Select]
[table][tr][td]image   
[/td][/tr][/table]
Code: [Select]
<div id="msg_134_signature" class="signature"><table class="bbc_table"><tbody><tr><td>image&nbsp;&nbsp;&nbsp;<br></td></tr></tbody></table></div>
I have reported this to the SMF project at http://dev.simplemachines.org/mantis/view.php?id=4982 (http://dev.simplemachines.org/mantis/view.php?id=4982)
SimplePortal 2.3.8 © 2008-2024, SimplePortal