Avatar

BBCode Test (Features)

by Alex ⌂ @, Sunday, March 11, 2007, 21:47 (4542 days ago)

I implemented the StringParser_BBCode class. Testing...

This is bold, this is red and this is bold and green.

A link and a long url: http://www.google.com/search?as_q=my+little+forum&hl=en&num=10&btnG=Google+Search&...

This is a quote:

To be or not to be, that is the question: Whether 'tis nobler in the mind to suffer the slings and arrows of outrageous fortune or to take arms against a sea of troubles, and by opposing end them?

Here comes a list:

  • one
  • two
    • two.one
    • two.two
      • two.two.one
      • two.two.two
    • two.three
  • three

Some code:

function clear_config($var = null)
    {
        if(!isset($var)) {
            // clear all values
            $this->_config = array(array('vars'  => array(),
                                         'files' => array()));
        } else {
            unset($this->_config[0]['vars'][$var]);
        }
    }

:-) Text :-P with :-D smilies ;-)

Avatar

BBCode for [code]?

by Alfie ⌂ @, Vienna, Austria, Wednesday, March 21, 2007, 15:46 (4533 days ago) @ Alex
edited by Alfie, Wednesday, March 21, 2007, 15:57

Hi Alex!

Robert supplied me with some code, which also eliminated the unnecessary CR/LF before/after the code.
In my forum I often use the code-segment inline, or even for the construction of simple tables.

Please consider an inline-version, rather the linefeeds as in the 'old' forum (and v2) too.

--
Best regards,
Alfie (Helmut Schütz)
BEBA-Forum (v1.8β)

Avatar

BBCode for [code]?

by Alex ⌂ @, Wednesday, March 21, 2007, 21:13 (4532 days ago) @ Alfie

Hi Alfie,

Please consider an inline-version, rather the linefeeds as in the 'old' forum (and v2) too.

Code is now displayed as a block element within <pre></pre>:

text [ code]code[/code] text

will be replaced by

<p>text</p>
<pre><code>code</code></pre>
<p>text</p>

Do you mean we also need a bbcode for markups like
<p>text...<code>code</code> text...</p> ?

Alex

Avatar

BBCode for [code]?

by Alfie ⌂ @, Vienna, Austria, Wednesday, March 21, 2007, 22:35 (4532 days ago) @ Alex
edited by Alfie, Wednesday, March 21, 2007, 22:41

Hi Alex,

thanks for your relpy!

will be replaced by

<p>text</p>
<pre><code>code</code></pre>
<p>text</p>

Do you mean we also need a bbcode for markups like
<p>text...<code>code</code> text...</p> ?

Exactly the latter!
For an 'inline' example see this post in my forum (or for a simple 'table' this one).

--
Best regards,
Alfie (Helmut Schütz)
BEBA-Forum (v1.8β)

BBCode for [code]?

by bttr ⌂ @, Berlin, Germany, Thursday, March 22, 2007, 09:20 (4532 days ago) @ Alfie

Robert supplied me with some code, which also eliminated the unnecessary CR/LF before/after the code.

Are you talking 'bout me? ;-)
The GNU diff patch for mlf 1.5.4 or 1.6.2 is available at http://www.bttr-software.de/tmp/parse_code.zip.

Avatar

Off-Topic

by Alfie ⌂ @, Vienna, Austria, Thursday, March 22, 2007, 10:03 (4532 days ago) @ bttr

Robert supplied me with some code, which also eliminated the unnecessary CR/LF before/after the code.

Are you talking 'bout me? ;-)

Sure, your patch helped a lot! :-D

P.S.: Sorry about uncovering your nick!

--
Best regards,
Alfie (Helmut Schütz)
BEBA-Forum (v1.8β)

Avatar

BBCode for [code]?

by Alex ⌂ @, Thursday, March 22, 2007, 19:54 (4532 days ago) @ bttr

Hi Robert,

The GNU diff patch for mlf 1.5.4 or 1.6.2 is available at http://www.bttr-software.de/tmp/parse_code.zip.

That's interesting but it replaces indentations by something like "&nbsp; &nbsp; ". Actually <pre> is here more appropriate (one of the advantages of the BBCode class is better HTML output). How about two types of bbcodes: [ code] and [codeblock]? Maybe a little bit confusing?

I just downloaded phpBB to see how they've solved that. Indeed they don't use <pre> (not even <code>) but nevertheless inline code isn't possible.

BBCode for [code]?

by bttr ⌂ @, Berlin, Germany, Friday, March 23, 2007, 08:52 (4531 days ago) @ Alex

That's interesting but it replaces indentations by something like "&nbsp; &nbsp; ". Actually <pre> is here more appropriate (one of the advantages of the BBCode class is better HTML output). How about two types of bbcodes: [ code] and [codeblock]? Maybe a little bit confusing?

see source code comments:
1) Replace 2 spaces with "&nbsp; " so non-tabbed code indents without making huge long lines.
2) Replace tabs with "&nbsp; &nbsp;" so tabbed code indents sorta right without making huge long lines.

This was taken directly from phpBB and could be omitted, if you don't want it.

I just downloaded phpBB to see how they've solved that. Ideed they don't use <pre> (not even <code> ) but nevertheless inline code isn't possible:

Did you read my PHP source code? ;-) It has a line: code lifted from phpBB 2.0.20's file 'includes/bbcode.php' at http://www.phpbb.com/

Avatar

BBCode Test (syntax highlighting)

by Alex ⌂ @, Wednesday, April 11, 2007, 13:31 (4512 days ago) @ Alex

/**
 * return a reference to a registered object
 */
function &get_registered_object($name) {
   if (!isset($this->_reg_objects[$name]))
   $this->_trigger_fatal_error("'$name' is not a registered object");
   if (!is_object($this->_reg_objects[$name][0]))
   $this->_trigger_fatal_error("registered '$name' is not an object");
   return $this->_reg_objects[$name][0];
}
Avatar

BBCode Test (syntax highlighting)

by Alfie ⌂ @, Vienna, Austria, Wednesday, April 11, 2007, 20:33 (4512 days ago) @ Alex

Hi Alex!

wow, which BBCode(s) are you using for this format?

And please don't forget the possibility of inline-code as well - unless you want to start fiddling around with 'TeX' like in the SELFHTML-Forum and Wikipedia... ;-)

--
Best regards,
Alfie (Helmut Schütz)
BEBA-Forum (v1.8β)

Avatar

BBCode Test (syntax highlighting)

by Alex ⌂ @, Monday, April 16, 2007, 12:20 (4507 days ago) @ Alfie

wow, which BBCode(s) are you using for this format?

[ code=php]...[/code]. GeSHI does the rest. ;-)

And please don't forget the possibility of inline-code as well

OK.

Alex

Avatar

[inlinecode]

by Alfie ⌂ @, Vienna, Austria, Monday, April 23, 2007, 01:13 (4500 days ago) @ Alex
edited by Alfie, Monday, April 23, 2007, 01:46

Hi Alex,

thanks for [ inlinecode]bar[/inlinecode] (v2 beta 10)!

This inlinecode is displayed without leading/trailing paragraphs. :-)

Unfortunately a simple table can't be constructed from it (multiple blanks are collapsed) :crying:
+------------------------+------------------+------------------+
|   Program / Method     |  equal variance  | unequal variance |
+------------------------+------------------+------------------+
| R 2.4.1 (2006)         | 63.51% - 110.19% | 63.49% - 110.22% |
| NCSS 2001 (2001)       | 63.51% - 110.19% | 63.49% - 110.22% |
| STATISTICA 5.1H (1997) | 63.51% - 110.19% | 63.49% - 110.22% |
| WinNonlin 5.2 (2007)   | 63.51% - 110.20% |       NA!        |
| Kinetica 4.4.1 (2007)  | 63.51% - 110.19% |       NA!        |
| EquivTest/PK (2006)    | 63.51% - 110.18% |       NA!        |
+------------------------+------------------+------------------+

Of course I could use [ code]bar[/code] in this case, like:

+------------------------+------------------+------------------+
|   Program / Method     |  equal variance  | unequal variance |
+------------------------+------------------+------------------+
| R 2.4.1 (2006)         | 63.51% - 110.19% | 63.49% - 110.22% |
| NCSS 2001 (2001)       | 63.51% - 110.19% | 63.49% - 110.22% |
| STATISTICA 5.1H (1997) | 63.51% - 110.19% | 63.49% - 110.22% |
| WinNonlin 5.2 (2007)   | 63.51% - 110.20% |       NA!        |
| Kinetica 4.4.1 (2007)  | 63.51% - 110.19% |       NA!        |
| EquivTest/PK (2006)    | 63.51% - 110.18% |       NA!        |
+------------------------+------------------+------------------+

But mainly I would use it for simple formulas like

            1
R = ------------------
     1 - exp (-λ × τ)

getting rid of the additional paragraphs (which can be handled only in HTML, not in CSS).

P.S. Just realising, that additional BB-codes [bold, italic,...] within [ code] are not working (they did in v1.7.3).

--
Best regards,
Alfie (Helmut Schütz)
BEBA-Forum (v1.8β)

Avatar

[inlinecode]

by Alex ⌂ @, Monday, April 23, 2007, 08:39 (4500 days ago) @ Alfie

This inlinecode is displayed without leading/trailing paragraphs. :-)

Well, it isn't fully worked out yet. ;-)

P.S. Just realising, that additional BB-codes [bold, italic,...] within [ code] are not working (they did in v1.7.3).

Actually this is a bug in v 1.*! No parsing (bbcodes, smilies...) should be done within a code block (the problem can be seen e.g. here).

Alex

Avatar

[inlinecode]

by Alfie ⌂ @, Vienna, Austria, Monday, April 23, 2007, 11:30 (4500 days ago) @ Alex

This inlinecode is displayed without leading/trailing paragraphs. :-)


Well, it isn't fully worked out yet. ;-)

OK.

P.S. Just realising, that additional BB-codes [bold, italic,...] within [ code] are not working (they did in v1.7.3).


Actually this is a bug in v 1.*! No parsing (bbcodes, smilies...) should be done within a code block...

Oops - that's life (meaning a lot of manual editing of posts if migrating from v1 -> v2).

Test [ code]

simple text, [i]italic[/i]

Test [ inlinecode]
start ->simple text, [i]italic[/i], 10 blanks enclosed by brackets: [          ]<- end

--
Best regards,
Alfie (Helmut Schütz)
BEBA-Forum (v1.8β)

Avatar

BBCode Test (syntax highlighting)

by Micha ⌂, Saturday, June 02, 2007, 23:01 (4459 days ago) @ Alex

Hi,

how can I add another lang? I have download geshi from sf.net and copy the java.php in the directory. What is the next step?

Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

Avatar

BBCode Test (syntax highlighting)

by Micha ⌂, Monday, June 04, 2007, 18:31 (4458 days ago) @ Micha

Hi,

it runs now?!

Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

Avatar

BBCode Test

by Alex ⌂ @, Sunday, April 29, 2007, 21:06 (4493 days ago) @ Alex

Actually this is too klickibunti for me but for the sake of completeness I added a colorpicker and a BB Code for font sizes. Still missing are [MARQUEE] and [BLINKING]! ;-)

Avatar

BBCode Test

by Alfie ⌂ @, Vienna, Austria, Sunday, April 29, 2007, 23:28 (4493 days ago) @ Alex
edited by Alfie, Thursday, May 03, 2007, 22:46

klickibunti

Thanks for this link ( [image] )
Have you also seen this one?

Just documenting the BBCodes for font-sizes:
[ size=huge]bar[/size]: [size=huge]bar[/size]
[ size=large]bar[/size]: bar
[ size=tiny]bar[/size]: [size=tiny]bar[/size]

Did I miss one?

Still missing are [MARQUEE] and [BLINKING]! ;-)

Don't dare! :angry:

What do you think about super- and subscripts (HTML < sup > / < sub > ) ?

--
Best regards,
Alfie (Helmut Schütz)
BEBA-Forum (v1.8β)

Avatar

BBCode Test

by Alex ⌂ @, Monday, April 30, 2007, 11:58 (4493 days ago) @ Alfie

Did I miss one?

[size=small]bar[/size] (-->font-size: small), but actually this doesn't make a difference to the normal font size.

So I think I will implement these ones:
[size=small]foo[/size] --> font-size: x-small
[size=large]foo[/size] --> font-size: large
[size=huge]foo[/size] --> font-size: x-large

Still missing are [MARQUEE] and [BLINKING]! ;-)

Don't dare! :angry:
What do you think about super- and subscripts (HTML < sup > / < sub > ) ?

That's a better idea!

Alex

RSS Feed of thread
powered by my little forum