As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/

Weird BBCode problems when using [code]?

MonoxideMonoxide Registered User, ClubPA regular
I suppose with the influx of new forumers posting in this thread, this should be noted.

This forum features a spoiler tag. Using the spoiler tag will cover the text in a black overlay, so that you must highlight it to see the spoiler. This prevents things from being spoiled to other forumers. The spoiler tag is used like this:
Halo 2 is just so great!
Please use spoiler tags when posting things about the game that other forumers may not want to know, about plot, enemies, or otherwise. Thank you.

[size] breaks if you [size] something up and use
in between? Kind of a strange bug. It works if you [size][/size] the parts before and after the code, but it doesn't carry over past the [code].

[quote=Test][size=18]Test[code]Testing
[/quote]

You also must end with [ / size] at some point for it to work. If you do so with text after the [code], it still doesn't size that code.

Monoxide on

Posts

  • ptlisptlis Registered User regular
    edited November 2004
    It's not a bug; the code tag is there specifically so you can post bits of bbcode / html / php as well as 'real' C / C++ / C# / Python / Perl code and such without it being parsed. So, for example I can demonstrate some basic html as such:
    <html>
      <head>
        <title>example</title>
      </head>
    
      <body>
       
    
    Stuff goes here</p>
      </body>
    </html>
    

    Or I can demonstrate how to use the bb list tag:
    [list]
      [*]Point 1
      [*]Point 2
      [*]Point 3
    [/list]
    

    So, yeah, the spoiler and realspoiler tag shouldn't be parsed into html when between code tags because then there'd be no easy way to demonstrate its usage.

    [spoiler:22b5072ebf]It's common sense really ;)[/spoiler:22b5072ebf]

    ptlis on
    I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.....my life is my own.
  • DogDog Registered User, Administrator, Vanilla Staff admin
    edited November 2004
    No, he's saying that size tags around code tags don't continue the size after the code.

    While it's normal that it won't size without a closing size tag, it's a bug that it won't size after a closing code tag but still inside a size tag.

    Unknown User on
  • ptlisptlis Registered User regular
    edited November 2004
    Ah, sorry I misread the problem.

    If you look at the html:
    <span style="font-size: 18px; line-height: normal">This forum features a spoiler tag. Using the spoiler tag will cover the text in a black overlay, so that you must highlight it to see the spoiler. This prevents things from being spoiled to other forumers. The spoiler tag is used like this: </span>
    
    <table width="90%" cellspacing="1" cellpadding="3" border="0" align="center">
    <tr> 	  <td><span class="genmed">[b]Code:[/b]</span></td>
    	</tr>
    	<tr>
    	  <td class="code">

    You can see that phpBB automagically closed the span tag (in some vague attempt at being XHTML 1.0 TRANSITIONAL compliant)... i'm not sure how heavily modified this board is, but I do know it's far from standard so I wouldn't want to hazard a guess at a fix for this (in fear of causing a conflict) but the bug is present in the default phpBB 2.0.10 installation (the only mod on that board is support for the jabber im network in user's userprofiles).

    ptlis on
    I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.....my life is my own.
  • DogDog Registered User, Administrator, Vanilla Staff admin
    edited November 2004
    Actually, the DOCTYPE is HTML 4.01 Transitional. I'm not sure if you've ever looked at the code behind phpBB, but it uses a lot of template files and a lot of PHP's str_replace() and preg_replace() functions when displaying the boards, most noticably in viewtopic.php

    There's a lot of room for display errors and that's why alpha has made plenty of coding changes to the forums. This is just yet another one to add to the pile. Fortunately, I'm almost certain it's a simple fix, and I think I know how to fix it.

    Unknown User on
  • ptlisptlis Registered User regular
    edited November 2004
    I've not looked the the phpBB software in any great detail because I prefer the vBulletin forum in many respects (ie I much prefer viewing topics in threaded form because you get a better idea of who's replying to what), and yeah, now I look at it I relise that. I probably pulled the doctype stuff out of my arse :/

    ptlis on
    I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.....my life is my own.
  • DogDog Registered User, Administrator, Vanilla Staff admin
    edited November 2004
    Ok, pretty sure this is a fix:

    In bbcode.tpl replace the code template with:
    <div align="center">
    <div class="genmed" style="width: 90%; padding: 3px; font-style: normal" align="left">[b]{L_CODE}:[/b]</div>
    <div class="code" style="width: 90%; padding: 3px; font-style: normal" align="left">
    
    
    </div>
    </div>
    

    Also in bbcode.tpl, replace the size template with:
    <div style="font-size: {SIZE}px; line-height: normal; display: inline">
    
    
    </div>
    

    alpha, if you're reading this, you might want to also consider changing the <span> tags in the bold, underscore, italics, and color templates to <div> tags too, but be sure to add the 'display: inline' attribute or you'll get line breaks at the end of each tag.

    Unknown User on
  • ptlisptlis Registered User regular
    edited November 2004
    That does indeed fix the bug, click in the link in my previous post to see the new non-borked quote.

    ptlis on
    I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.....my life is my own.
  • DogDog Registered User, Administrator, Vanilla Staff admin
    edited November 2004
    :)

    Unknown User on
Sign In or Register to comment.