koebeest
Legacy Member
Hij doet niks met deze code 
Dit is de pagina waar hij de tags moe zou laten werken maar dit doet hij dus niet. Hij toont gewoon [ code ]<?php echo"jbjjk"; ?>[/code]
Dit is de ubb
thx for the help
MOEH Koebeest

Dit is de pagina waar hij de tags moe zou laten werken maar dit doet hij dus niet. Hij toont gewoon [ code ]<?php echo"jbjjk"; ?>[/code]

PHP:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php include("eigen_ubb.php");
?>
<link rel="stylesheet" type="text/css" href="layout.css">
<?php include("eigen_config.php"); ?>
<?php $sql = "SELECT * FROM nieuws ORDER BY datum DESC LIMIT 0,10";
$resultaat = mysql_query($sql) or die ("query mislukt");
while ($rij = mysql_fetch_object($resultaat)){
$id = $rij->id;
$naam = htmlspecialchars($rij->naam);
$datum = htmlspecialchars($rij->datum);
$bericht = htmlspecialchars($rij->bericht);
$titel = htmlspecialchars($rij->titel);
ubb( $onthoud );
?>
<?php
echo"<table width=\"98%\" cellpadding=\"3\" cellspacing=\"0\" style=\"border: 1px solid #B1B183\">
<tr>
<td bgcolor=\"#B1B183\" style=\"border: 1px solid #B1B183\"><font size=\"1\"> <b>$titel</b> door $naam op $datum</font></td>
</tr>
<tr>
<td bgcolor=\"#FFFFFF\"><font size=\"1\" >$bericht</font></td>
</tr>
</br>
</table>";
}
?>
Dit is de ubb

PHP:
<?php
$GLOBALS[ "phphighlite" ] = array( "dummy" );
function ubb( $onhoud )
{
// [code] -> omzetten
$string = preg_replace( "_\[code\](.*?)\[/code\]_ise", "phphighlite_replace('\\1')", $string );
/* Dit stukje code zorgt voor de werkelijke ubb functies als bold en code en quote enz */
$text = preg_replace("/\[b\](.*?)\[\/b\]/si", "<b>\\1</b>", $text);
$text = preg_replace("/\[i\](.*?)\[\/i\]/si", "<i>\\1</i>", $text);
$text = preg_replace("/\[u\](.*?)\[\/u\]/si", "<u>\\1</u>", $text);
$text = preg_replace("/\[s\](.*?)\[\/s\]/si", "<s>\\1</s>", $text);
$text = preg_replace("/\[strong\](.*?)\[\/strong\]/si", "<strong>\\1</strong>", $text);
$text = preg_replace("/\[list\](.*?)\[\/list\]/si", "<ul>\\1</ul>", $text);
$text = preg_replace("/\[list1\](.*?)\[\/list1\]/si", "<li>\\1</li>", $text);
$text = preg_replace("/\[url=(.*?)\](.*?)\[\/url\]/si", "<a href=\"\\1\" target=\"_blank\">\\2</a>", $text);
$text = preg_replace("/\[url\](.*?)\[\/url\]/si", "<a href=\"\\1\" target=\"_blank\">\\1</a>", $text);
$text = preg_replace("/\[mail\](.*?)\[\/mail\]/si", "<a href=\"mailto:\\1\">\\1</a>", $text);
$text = preg_replace("/\[mail=(.*?)\](.*?)\[\/mail\]/si", "<a href=\"mailto:\\1\" target=\"_blank\">\\2</a>", $text);
/**
* NIET MEER NODIG!!
* $text = preg_replace("/\[code\](.*?)\[\/code\]/ise", "high('\\1')", $text);
*/
$text = preg_replace("/\[quote\](.*?)\[\/quote\]/ise", "quote('\\1')", $text);
$text = preg_replace("/\[off\](.*?)\[\/off\]/si", "<font size=\"3\" color=\"#CCCCCC\"><b>Off-topic</b><br><hr width=\"200\" align=\"left\" color=\"#000000\" size=\"0.2\">\\1<hr width=\"200\" align=\"left\" color=\"#000000\" size=\"0.2\"></font>", $text);
$text = preg_replace("/\[quote\](.*?)\[\/quote\]/is", "[...]</table>", $text);
/* Dit stukje code zorgt voor de smilies */
$text = str_replace(":D","<img src=smilies/biggrin2.gif></img>",$text);
$text = str_replace(":'(","<img src=smilies/cry2.gif></img>",$text);
$text = str_replace(":?","<img src=smilies/blink.gif></img>",$text);
$text = str_replace(":agent:","<img src=smilies/agent.gif></img>",$text);
$text = str_replace("8|","<img src=smilies/shades.gif></img>",$text);
$text = str_replace(":(","<img src=smilies/sad.gif></img>",$text);
$text = str_replace(":S","<img src=smilies/pinch.gif></img>",$text);
$text = str_replace(":O","<img src=smilies/w00t.gif></img>",$text);
$text = str_replace(":)","<img src=smilies/happy.gif></img>",$text);
$text = str_replace(":love:","<img src=smilies/love.gif></img>",$text);
$text = str_replace(":dance:","<img src=smilies/dance.gif></img>",$text);
$text = str_replace(":lol:","<img src=smilies/lol.gif></img>",$text);
$text = str_replace(":p","<img src=smilies/bleh.gif></img>",$text);
$text = str_replace(";)","<img src=smilies/wink.gif></img>",$text);
$text = nl2br($text);
$text = str_replace("fuck","f**k", $text );
$text = str_replace("shit","***", $text );
$text = str_replace("dick","***", $text );
$text = str_replace("suck","***", $text );
$text = str_replace("cum","***", $text );
$text = str_replace("blowjob","***", $text );
$text = str_replace("kut","***", $text );
$text = str_replace("lul","l*l", $text );
$text = str_replace("eikel","***", $text );
$text = str_replace("klootzak","***", $text );
$text = str_replace("dyke","***", $text );
$text = str_replace("asshole","***", $text );
$text = str_replace("hoer","***", $text );
$text = str_replace("slet","***", $text );
$text = str_replace("hoer","***", $text );
$text = str_replace("teef","***", $text );
$text = str_replace("bitch","***", $text );
$text = str_replace("nerd","***", $text );
$text = str_replace("breedreet","***", $text );
$text = str_replace("vetzak","***", $text );
$text = str_replace("dikzak","***", $text );
$text = str_replace("*****","zwarte man", $text );
$text = str_replace('[b]','<b>',$text);
$text = str_replace('[/b]','</b>',$text);
$text = str_replace('[u]','<u>',$text);
$text = str_replace('[/u]','</u>',$text);
$text = str_replace('[i]','<i>',$text);
$text = str_replace('[/i]','</i>',$text);
$text = str_replace('[s]','<s>',$text);
$text = str_replace('[/s]','</s>',$text);
$text = str_replace('[sub]','<sub>',$text);
$text = str_replace('[/sub]','</sub>',$text);
$text = str_replace('[sup]','<sup>',$text);
$text = str_replace('[/sup]','</sup>',$text);
$text = str_replace("[list]","<ul>",$text);
$text = str_replace("[/list]","</ul>",$text);
$text = str_replace("[*]","<li>",$text);
$text = str_replace('[br]','<br/>',$text);
// [code] -> weer omzetten
$text = preg_replace("_\[code\]([0-9])\[/code\]_ise", "phphighlite('\\1')", $text);
}
function phphighlite_replace($code) {
if(empty($code)) {
return "[code ] [/code ]";
} else {
array_push($GLOBALS['phphighlite'], $code);
return "[code ]".(count($GLOBALS['phphighlite'])-1)."[/code ]";
}
}
function phphighlite ($id){
/* Deze functie wordt aangeroepen als je [ code] en [/ code] gebruikt */
$text = $GLOBALS[ "phphighlite" ][ $id ];
$text = trim($text);
$out = "\n<table border=1 cellpadding=2 cellspacing=0 style=border-collapse:collapse; width=600>\n
<tr>\n<td valign=top bgcolor=#DDDDDD align=right>\n
<code style=\"color: #666666\">\n";
ob_start();
$data = explode("<br />", $text);
for($i=1; $i <= count($data); $i++){
$out .= $i."\n";
}
$out .= "</code>\n</td>\n<td width=100% bgcolor=#ffffff valign=\"top\">\n";
$text = str_replace("<br />", "", $text);
$text = stripslashes($text);
@highlight_string($text);
$out .= ob_get_contents();
ob_end_clean();
$out .= "</td></tr></table>";
return $out;
}
function quote ($text){
/*Deze code wordt gebruikt als je [ quote] en [/ quote] gebruikt */
$out = "<table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse:collapse;\" width=\"600\"><tr><td><b>Quote:</b></td></tr><tr><td bgcolor=\"#DDDDDD\"><blockquote class=\"quote\">";
$out .= $text;
$out .="</blockquote></td></tr></table>";
return($out);
}
?>
thx for the help
MOEH Koebeest


)