Onbekend |
|
Hoi
Bij dit script werkt de enter niet als ik hem bij de ubb codes gebruik
<?php
/* highlight scriptje */
function phphighlite($code) {
if (floor(phpversion())<4) {
$return = $code;
} else {
$code = str_replace("<br>", "", $code);
$code = str_replace("<br />", "", $code);
$code = str_replace(">", ">", $code);
$code = str_replace("<", "<", $code);
$code = str_replace("&", "&", $code);
$code = str_replace('$', '\$', $code);
$code = str_replace('\n', '\\\\n', $code);
$code = str_replace('\r', '\\\\r', $code);
$code = str_replace('\t', '\\\\t', $code);
$code = str_replace('"', '"', $code);
$code = stripslashes($code);
$code = trim($code);
$code = str_replace("<br /><br />", "", $code);
$regels = explode("\n", $code);
$aantal = count($regels) +1;
$aantalr = count($regels);
ob_start();
$oldlevel=error_reporting(0);
highlight_string($code);
error_reporting($oldlevel);
$code = ob_get_contents();
ob_end_clean();
$return .= "<center>";
$return .= "<div align='center'>";
$return .= "<table class='tekst' cellspacing='0' cellpadding='3' border='0' style='border-collapse: collapse; border-right: 1px solid #808080; border-top: 1px solid #808080; border-left: 1px solid #808080; border-bottom: 1px solid #808080' width='670' bgcolor='#D6D6D6'>\n";
$return .= "<tr>\n";
$return .= "<td width='2%' style='border-collapse: collapse'><font color='black'><b>Code</b></td><td width='740' align='right' style='border-collapse: collapse'><font color='black'>(".$aantalr." regels)</font></td>\n";
$return .= "</tr>\n";
$return .= "</table>\n";
$return .= "<!-- code table -->\n";
$return .= "<table align='center' cellspacing='0' cellpadding='0' border='0' >\n";
$return .= "<tr>\n";
$return .= "<td>\n";
$return .= "<table align='center' cellspacing='0' cellpadding='3' border='0' width='670' bgcolor='#D6D6D6' style='border-collapse: collapse; border: 1px solid; border-color: #808080; border-top; 0px solid'>\n";
$return .= "<tr>\n";
$return .= "<td width='1' valign='top' align='left' style='font-family: Courier New; font-size: 11px; border-right: 1px solid #808080'>\n<font color='black'>";
for($i = "1"; $i < $aantal; $i++)
{
$return .= $i."<br />";
}
$return .= "</td>\n";
$return .= "<td valign='top' bgcolor='#FFFFFF'>\n";
$return .= "<table cellspacing='0' cellpadding='0' border='0' width='95%' style='table-layout: fixed;'>\n";
$return .= "<tr>\n";
$return .= "<td nowrap valign='top' style='font-family: Courier New; font-size: 11px'>\n";
$return .= "\n";
$return .= "".$code."\n";
$return .= "\n";
$return .= "</td>\n";
$return .= "</tr>\n";
$return .= "</table>\n";
$return .= "</td></tr></table>\n";
$return .= "</td></tr></table><br />\n";
$return .= "</center></div>";
$return = str_replace(""", "\"", $return);
}
return $return;
}
?>
<?php /* highlight scriptje */ function phphighlite($code) { $return = $code; } else { $aantal = count($regels) +1; $aantalr = count($regels); $return .= "<center>"; $return .= "<div align='center'>"; $return .= "<table class='tekst' cellspacing='0' cellpadding='3' border='0' style='border-collapse: collapse; border-right: 1px solid #808080; border-top: 1px solid #808080; border-left: 1px solid #808080; border-bottom: 1px solid #808080' width='670' bgcolor='#D6D6D6'>\n"; $return .= "<tr>\n"; $return .= "<td width='2%' style='border-collapse: collapse'><font color='black'><b>Code</b></td><td width='740' align='right' style='border-collapse: collapse'><font color='black'>(".$aantalr." regels)</font></td>\n"; $return .= "</tr>\n"; $return .= "</table>\n"; $return .= "<!-- code table -->\n"; $return .= "<table align='center' cellspacing='0' cellpadding='0' border='0' >\n"; $return .= "<tr>\n"; $return .= "<td>\n"; $return .= "<table align='center' cellspacing='0' cellpadding='3' border='0' width='670' bgcolor='#D6D6D6' style='border-collapse: collapse; border: 1px solid; border-color: #808080; border-top; 0px solid'>\n"; $return .= "<tr>\n"; $return .= "<td width='1' valign='top' align='left' style='font-family: Courier New; font-size: 11px; border-right: 1px solid #808080'>\n<font color='black'>"; for($i = "1"; $i < $aantal; $i++) { $return .= $i."<br />"; } $return .= "</td>\n"; $return .= "<td valign='top' bgcolor='#FFFFFF'>\n"; $return .= "<table cellspacing='0' cellpadding='0' border='0' width='95%' style='table-layout: fixed;'>\n"; $return .= "<tr>\n"; $return .= "<td nowrap valign='top' style='font-family: Courier New; font-size: 11px'>\n"; $return .= "\n"; $return .= "".$code."\n"; $return .= "\n"; $return .= "</td>\n"; $return .= "</tr>\n"; $return .= "</table>\n"; $return .= "</td></tr></table>\n"; $return .= "</td></tr></table><br />\n"; $return .= "</center></div>"; } return $return; } ?>
En de ubb is
$bericht = eregi_replace("\\[url=([^\\[]*)\\]([^\\[]*)\\[/url\\]","<a href=file://1 target=_blank>\\2</a>",$bericht);
$bericht = eregi_replace("\\[url=([^\\[]*)\\]([^\\[]*)\\[/url\\]","<a href=file://1 target=_blank>\\2</a>",$bericht);
Alvast bedankt
|