How to use Invision’s BBCode

Using Invision’s BBCode isn’t straight forward. Chances are that you need to invoke the BBCode parser if you want to create a plugin or hook for Invision Powered Board. Here’s the rough code to do so, with $topics being the array containing all the topics from the database to be parsed:

[code lang=”php”]setAllowHtml( 1 );
//—————————————–
// Return the data
//—————————————–
foreach ($topics as &$topic) {
$topic[“formattedPost”] = $editor->process($topic[“post”]);
IPSText::getTextClass(“bbcode”)->parsing_section = “topics”;
IPSText::getTextClass(“bbcode”)->parse_smilies = TRUE;
IPSText::getTextClass(“bbcode”)->parse_bbcode = TRUE;
IPSText::getTextClass(“bbcode”)->parse_html = FALSE;
IPSText::getTextClass(“bbcode”)->parse_nl2br = TRUE;
IPSText::getTextClass(“bbcode”)->bypass_badwords = FALSE;
$topic[“formattedPost”] = IPSText::getTextClass(“bbcode”)->preDisplayParse( $topic[“formattedPost”] );
}
?>[/code]

For the parsing_section, you should put a value that corresponds to the editor section. In my case, I need it to ‘topics’. To get the full list, you may need to look up Invision Powered Board’s source code which I cannot provide.

I wrote this down more as a personal note and I hope it benefits you as it did for me. If you have any questions, feel free to post and I can attempt answering.

How to integrate Google Analytics into IP.Board

Google Analytics is easy to integrate to track your visitors and how they found your website. In the case of IP.Board or Invision Powered Board, integrating is very simple too.

First you will need to get your Google Analytics tracking code from your Google Analytics Admin page. If you don’t have the ‘Tracking Code’ option, it could be that you are assigned with admin permissions to your website.
Continue reading “How to integrate Google Analytics into IP.Board”