BBCode GeSHi Filter for MyBB (Syntax Highlighting)
BB Code Geshi Filter for Code Syntax Highlighting on programming forums, is designed for MyBB Forum 1.4+ (a free forum software).
The BB Code Plugin for MyBB is available as an attachment on this page.
It uses the GeSHi Filter.
You can see the live BB GeSHi Filter demo.
It works very nice, though there seems to be a br problem when there are no line numbers. Tell us on our forums if you have any other problems.
Simply use [code=language] to highlight.
How GeSHi Filter works
$data = "int x = 0;
int main(){
for(int i = 0; i < 5; i++){
printf(\"%d\", i);
}
}";
$language = "cpp"; // c++
$geshi = new GeSHi($data, $language);
echo $geshi->parse_code();
This would print the code like so:
int main(){
for(int i = 0; i < 5; i++){
printf("%d", i);
}
}
There are some ways to enable line numbers, and a couple of other settings in GeSHi documentation.
Update: Version 1.1 has been released, fixing the following:
1.1 --
- Fixed Line number error.
- Fixed spacing/new-line error.
- Fixed padding error.
- Fixed Color scheme to be more natural.
- Fixed parsing errors.
| Attachment | Size |
|---|---|
| BBGeSHi.zip | 496.95 KB |

Anonymous (not verified)
Can you add wordspacing?
Can you add wordspacing?
Post new comment