The
Geshi project works well with phpBB and it have AHK support now. I suppose this forum should have been better with code highlighting.
1. copy files to
./{FORUM_ROOT}/includes/geshi.php
./{FORUM_ROOT}/includes/geshi/*.*
2. open ./{FORUM_ROOT}/includes/bbcode.php and change this function:
Code:
function bbcode_second_pass_code($type, $code)
{
$code = str_replace('\"', '"', $code);
// edited by jb (nebler.org)
if( !include_once( 'geshi.php' ) ) {
echo 'geshi nem elerheto!';
} else {
$astr_to = array('<', '>', '[', ']', '.', ':','"');
$astr_from = array('<', '>', '[', ']', '.', ':','"');
$code = str_replace($astr_from, $astr_to, $code);
//itt termeszetesen azt add meg defaultnak, ami neked kell
$geshi = new GeSHi( $code, $type==""?"autohotkey":$type );
$geshi->set_header_type(GESHI_HEADER_NONE);
$code = $geshi->parse_code();
$code = str_replace( '<br />', '', $code );
}
$code = $this->bbcode_tpl('code_open') . $code . $this->bbcode_tpl('code_close');
return $code;
}
3. Open ./{FORUM_ROOT}/includes/message_parser.php , change this function.
Code:
function bbcode_parse_code($stx, &$code)
{
// edited by jb (nebler.org)
if( strlen( $stx ) > 0 ) {
return "[code=$stx:" . $this->bbcode_uid . ']' . $code . '[/code:' . $this->bbcode_uid . ']';
} else {
return '[code:' . $this->bbcode_uid . ']' . $this->bbcode_specialchars($code) . '[/code:' . $this->bbcode_uid . ']';
}
}
Usage
Code:
.. program ..
or with these parameters the default highlightning is ahk.