I use this "GeSHi - Generic Syntax Highlighter" on my private website with the Drupal CMS
and the "GeSHi Filter" module. GeSHi is just some PHP scripts, i think it should be possible to
add it to the PHPBB forum.
I use:
Code: Select all
pb, vb, vbnet, asm, c, cpp, csharp, java, javascript, pascal, php, python, ruby, css, drupal6, sql, mysql, xml
So for PureBasic I just write [pb] and [/pb], for C# it is [csharp] and [/csharp] etc.
Looks like the following screenshot:
You can edit the colors in geshi/geshi/purebasic.php
Copying works, the line numbers are not selected (very important):
There is a little fix required for geshi/geshi.php (the main file):
Replace the following (round about line 2137):
Code: Select all
function parse_code () {
// Start the timer
$start_time = microtime();
// Replace all newlines to a common form.
$code = str_replace("\r\n", "\n", $this->source);
$code = str_replace("\r", "\n", $code);
with:
Code: Select all
function parse_code () {
// Start the timer
$start_time = microtime();
// Replace all newlines to a common form.
$code = str_replace("\r\n", "\n", $this->source);
$code = str_replace("\r", "\n", $code);
// by Danilo
$code = str_replace(">" ,">" ,$code);
$code = str_replace("<" ,"<" ,$code);
$code = str_replace("&" ,"&" ,$code);
$code = str_replace("'" ,"'" ,$code);
$code = str_replace(""","\"",$code);
$code = str_replace(" "," " ,$code);
Works fine after adding the little fix. I also think it makes codes more readable, hence I am using it.
Even if it does not use your personal favorite colors, you can see the differences in Keywords, Strings,
Functions names, numbers etc. more easily.