Ya, I did replaced instead of add.
Quote:
03-17-03 at 04:24 AM Matthew Lam said this in Post #153
*Bump*
|
PHP Code:
ob_start();
$oldlevel=error_reporting(0);
highlight_string($code);
error_reporting($oldlevel);
$buffer = ob_get_contents();
ob_end_clean();
if ($addedtags) {
$openingpos = strpos($buffer,'<?');
$closingpos = strrpos($buffer, '?');
$buffer=substr($buffer, 0, $openingpos).substr($buffer, $openingpos+5, $closingpos-($openingpos+5)).substr($buffer, $closingpos+5);
}
$buffer = str_replace(""", "\"", $buffer);
}
return "</normalfont><blockquote><pre><smallfont>PHP:</smallfont><hr>$buffer<hr></pre></blockquote><normalfont>";
}
// ###################### Start stripbrsfromcode #######################
function stripbrsfromcode($foundcode) {
$foundcode = str_replace("\\\"","\"",$foundcode);
return "</normalfont><blockquote><pre><smallfont>code:</smallfont><hr>" . str_replace("<br>", "", str_replace("<br />", "", $foundcode) ) . "<hr></pre></blockquote><normalfont>";
}
// ###################### Start createlists #######################
function createlists($foundlist, $type="") {
$type = iif(empty($type), $type, " type=\"$type\"");
$foundlist = str_replace("\\\"","\"",$foundlist);
if ($type) {
return "<ol$type>" . str_replace("[*]","<li>", $foundlist) . "</ol>";
} else {
return "<ul>" . str_replace("[*]","<li>", $foundlist) . "</ul>";
}
}
functions.php lines between 810 - 850..
thanks..