News:

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

Main Menu

BBCode in Board Description

Started by Surf3rDud3, March 20, 2011, 07:22:14 PM

Previous topic - Next topic

Surf3rDud3

Is there a mod or some where I can add BBC coding into the description of the boards? I run a gaming community and inwant to add gamer server status banners to the board descriptions.

Version: 2.5 RC5
Theme: Custom Template

DoctorMalboro

Not sure there is, but a simple way to do it would be:

./Themes/YOUR THEME/BoardIndex.template.php
Search:
echo '

<p>', $board['description'] , '</p>';


And replace it with:
echo '

<p>', parse_bbc($board['description']) , '</p>';


And you could use BBCodes and Smileys in the descriptions.

Surf3rDud3


Arantor

Or, to save yourself the performance penalty of calling the single largest part of SMF, you should be able to use HTML in the description.

Surf3rDud3

There is no code to change like that in that specific file.

Arantor

So just use regular HTML in the board description, no changes required.

Surf3rDud3

Lol You can?? Lol Didn't know that... Thx

Matthew K.

Arantor is right. First of all, even if you did want the descriptions to JUST be BBC? You'd want to run parse_bbc() Source side, NOT in the templates.

However, it's much better just to use HTML in this case as Arantor has pointed out. parse_bbc() is a huge function to run, and very taxing when you could just use plain HTML, which should work. If HTML is stripped in Board Descriptions, it would be possible to un_htmlspecialchars() it before output so that it would work.

Surf3rDud3

Thanks again I'll try it and if it fails I'll be back. ;)

Matthew K.

Soundss good. Let us know how it goes

Advertisement: