MyBB Community Forums

Full Version: MyBB Syntax Highlighter v1.1 Problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,

I installed the plugin but unfortunately there is no output. It is only shown me in the post Sun

[shcode=php]if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}

function mwsshcode_info() {
return array(
"name" => "MWS Syntax Highlighter",
"description" => "[shcode=python][/shcode] SyntaxHighlighter is an open source Java Script client side code syntax highlighter..",
"website" => "http://alexgorbatchev.com/SyntaxHighlighter/",
"author" => "MaRZoCHi",
"authorsite" => "http://www.marzochi.ws",
"version" => "1.1",
"compatibility" => "14*,16*",
"guid" => "8036c90522d8e7d1b30caa08b218c2e7"
);
}

$plugins->add_hook("parse_message", "mwsshcode_run");[/shcode]

Where there is the problem and how can we fix it?
On line 183.
$text = str_replace ( "\n", " ", $text);

You can add replacement for special characters.
Example for : [,=,]
-----------------------------------------------------
$text = str_replace ( "[", "[", $text);
$text = str_replace ( "=", "=", $text);
$text = str_replace ( "]", "]", $text);

or

You must add backslash your message.
Example :

[shcode=php]

bla bla
\[shcode\=python\]import os\[\/shcode\]

[/shcode]


Best regards.