I'm trying to add geshi in the minibb forum. I allready have a working regex and a function to convert al to geshi.
Now I run into a little problem, beqausse I dont know were to put my codes..
I putted my codes into bb_codes.php, but as far as I know now, this file only handles what goes into the database and comes out into the edit screen, but not in the forums themself.
Since I dont want to waste the database with html garbage, I want to do the geshi parsing when the visitors look at a forum topic....
Where do I put my codes?
I have this so far:
$pattern[]="~\[code=([^][]+)](.+?)\[/code]~ie"; $replacement[]="maak_code('\\1','\\2')";
function maak_code( $hlt, $msg) { $geshi = new GeSHi(stripslashes($msg), $hlt); $geshi->set_tab_width(2); // $geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS); $geshi->set_header_type(GESHI_HEADER_DIV); $geshi->enable_strict_mode(true); return '<div style="border:solid 1px #000000;"><strong>'.$hlt.' code</strong><br /><br />'.$geshi->parse_code().'</div>'; }
When I put this in bb_codes, it doesnt make any difference (only in the edit screen, there you will finf your formatted code (clean in the database though)
Any help is appreciated. |