Official Everybody Edits Forums

Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?

You are not logged in.

#1 Before February 2015

Atik
Guest

More BBCodes

You should add more BBCodes like [s]/[strike] to strike text, maybe a [size=1-6] to change text size, possibly a

Hidden text

#2 Before February 2015

Cyclone or Meredith
Guest

Re: More BBCodes

Strikethrough text doesn't have much use on these forums, size could be annoying, and as far as the "mod" messages go, if they're leaving a warning within a post then they should leave an edited by instead of a silent edit.

You were saying about color tags?

Thank you for your generous offer to provide the code, but I'd much rather add my own code in.

I play Code Golf with friends sometimes, here is a bbcode parser I did (341 bytes including shorttags):

<?foreach(array('b\*b'=>'b>$1</b','u\*u'=>'u>$1</u','i\*i'=>'i>$1</i','s\*s'=>'s>$1</s','url\*url'=>'a href="$1">$1</a','img\*img'=>'img src="$1"','url=%*url'=>'a href="$1">$2</a','color=%*color'=>'span style="color:$1;">$2</span')as$a=>$b){$i=preg_replace('/\['.str_replace('%','(.+?)\\',str_replace('*',']%[\/',$a)).'\]/i','<'.$b.'>',$i);}die($i);

This parser handles:

[b][u][i][s][img][url][color=][url=]

#3 Before February 2015

Cyclone or Meredith
Guest

Re: More BBCodes

Oh and, here is the official information about this round of golf:

http://forumify.com/golf/bbcode/
The sourcecode for the parser is by no means supposed to be human readable. If you try to expand it out, you'll see a foreach statement with and array of patterns and replacements for the preg_replace, and a few str_replaces used for the most commonly occurring patterns in the code.

Atik 1423699544261888

Board footer

Powered by FluxBB

[ Started around 1711692955.7464 - Generated in 0.040 seconds, 13 queries executed - Memory usage: 1.38 MiB (Peak: 1.49 MiB) ]