Hey allemaal,
In mijn ubb systeem zit een fout, als je in een code vak met [code ][/code] dan '<?php en ?>' neer zet dan leest hij die als een echte tag. Ik weet niet wat er fout is want na mijn weten klopt alles gewoon.
Ubb code:
PHP
<?php
function bbhtml2($bericht) {
// Code
$GLOBALS['phphighlite'] = array("dummy");
$bericht = preg_replace("_<\?(.*?)\?>_ise","phphighlite_replace('<? \\1 ?>')",$bericht);
// HTML wegwerken
$bericht = htmlspecialchars($bericht);
// Enters maken
$bericht = nl2br($bericht);
// URLs met tags maken
$bericht = preg_replace("#\[url\](http|ftp)(.+?)\[/url\]#is","<a href=\"\\1\\2\" target=\"_blank\">\\1\\2</a>",$bericht);
$bericht = preg_replace("#\[url\](mailto:)(.+?)\[/url]#is","<a href=\"\\1\\2\" target=\"_blank\">\\2</a>",$bericht);
$bericht = preg_replace("#\[mail\](.+?)\[/mail\]#is","\\1",$bericht);
$bericht = preg_replace("#\[url\](.+?)\[/url\]#is","<a href=\"http://\\1\" target=\"_blank\">\\1</a>",$bericht);
$bericht = preg_replace("#\[url=(http|ftp|mailto)(.+?)\](.+?)\[/url\]#is","<a href=\"\\1\\2\" target=\"_blank\">\\3</a>",$bericht);
$bericht = preg_replace("#\[url=(.+?)\](.+?)\[/url\]#is","<a href=\"http://\\1\" target=\"_blank\">\\2</a>",$bericht);
// Emails
$bericht = preg_replace("_\[email](.*)\[/email\]_si", '<a href="mailto://$1">$1</a>', $bericht);
$bericht = preg_replace("_\[email=(.*)\](.*?)\[/email\]_si", '<a href="mailto:$1">$2</a>', $bericht);
// Automatische emails
$bericht = preg_replace('#(^|[ \n\r\t])(([a-z0-9\-_]{1,}(\.?)){1,}@([a-z0-9\-]{1,}(\.?)){1,}[a-z]{2,5})#si', '\\1<a href="mailto:\\2">\\2</a>', $bericht);
// Automatisch URLs
$bericht = eregi_replace("(^|[ \n\r\t])((http(s?)://)(www\.)?([a-z0-9_-]+(\.[a-z0-9_-]+)+)(/[^/ \n\r]*)*)","\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $bericht);
$bericht = eregi_replace("(^|[ \n\r\t])((ftp://)(www\.)?([a-z0-9_-]+(\.[a-z0-9_-]+)+)(/[^/ \n\r]*)*)","\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $bericht);
$bericht = eregi_replace("([a-z_-][a-z0-9\._-]*@[a-z0-9_-]+(\.[a-z0-9_-]+)+)","<a href=\"mailto:\\1\">\\1</a>", $bericht);
$bericht = eregi_replace("(^|[ \n\r\t])(www\.([a-z0-9_-]+(\.[a-z0-9_-]+)+)(/[^/ \n\r]*)*)","\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $bericht);
$bericht = eregi_replace("(^|[ \n\r\t])(ftp\.([a-z0-9_-]+(\.[a-z0-9_-]+)+)(/[^/ \n\r]*)*)","\\1<a href=\"ftp://\\2\" target=\"_blank\">\\2</a>", $bericht);
// Cursief
$bericht = preg_replace("#\[i\](.+?)\[/i\]#is","<i>\\1</i>",$bericht);
// Onderstreept
$bericht = preg_replace("#\[u\](.+?)\[/u\]#is","<u>\\1</u>",$bericht);
// Vetgedrukt
$bericht = preg_replace("#\[b\](.+?)\[/b\]#is","<b>\\1</b>",$bericht);
// Doorstreept
$bericht = preg_replace("#\[s\](.+?)\[/s\]#is","<s>\\1</s>",$bericht);
// Quote
$bericht = preg_replace("#\[quote\](.+?)\[/quote\]#is","<blockquote><small><b>Quote:</b></small><br /> \\1</blockquote>",$bericht);
$bericht = preg_replace("#\[quote=(.+?)\](.+?)\[/quote\]#is","<blockquote><small><b>Quote door \\1:</b></small><br /> \\2</blockquote>",$bericht);
// Plaatjes
$bericht = preg_replace("#\[img\](http)(.+?)\[/img\]#is","<img src=\"\\1\\2\" alt=\"De afbeelding kon niet geladen worden!\" />",$bericht);
$bericht = preg_replace("#\[img\](.+?)\[/img\]#is","<img src=\"http://\\1\" alt=\"De afbeelding kon niet geladen worden!\" />",$bericht);
// Kleur
$bericht = preg_replace("#\[kleur=(.+?)\](.+?)\[/kleur\]#is","<font color=\"\\1\">\\2</font>",$bericht);
// Tekst type
$bericht = preg_replace("#\[lettertype=(.+?)\](.+?)\[/lettertype\]#is","<font face=\"\\1\">\\2</font>",$bericht);
// Grootte
$bericht = preg_replace("#\[size=(.+?)\](.+?)\[/size\]#is","<font size=\"\\1\">\\2</font>",$bericht);
// Alle fonts
$bericht = preg_replace("#\[font grootte=(.+?)\ kleur=(.+?)\ lettertype=(.+?)\](.+?)\[/font\]#is","<font size=\\1 color=\\2 face=\\3>//4</font>",$bericht);
// Bewegen
$bericht = preg_replace("#\[move\](.+?)\[/move\]#is","<marquee>\\1</marquee>",$bericht);
// Knipperen
$bericht = preg_replace("_\[blink\](.*?)\[/blink\]_si", '<blink>$1</blink>', $bericht);
// Youtube video
$bericht = preg_replace('_\[youtube\].*?(v=|v/)(.+?)(&.*?|/.*?)?\[/youtube\]_is', '[media]$2[/media]', $bericht);
$bericht = preg_replace('_\[youtube\]([a-z0-9-]+?)\[/youtube\]_is', '<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/$1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/$1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>', $bericht);
// Video
$bericht = preg_replace("#\[video\](.+?)\[/video\]#is","<iframe width=\"500\" height=\"315\" src=\"http://www.youtube.com/embed/\\1\" frameborder=\"0\" allowfullscreen></iframe>",$bericht);
// Smileys
$bericht = str_replace(" :)"," <img src=\"/images/smilies/smiley.png\" alt=\"Smilie\" />",$bericht);
$bericht = str_replace(" 8|"," <img src=\"/images/smilies/smiley-eek.png\" alt=\"Smilie\" />",$bericht);
$bericht = str_replace(" :o"," <img src=\"/images/smilies/smiley-surprise.png\" alt=\"Smilie\" />",$bericht);
$bericht = str_replace(" ;)"," <img src=\"/images/smilies/smiley-wink.png\" alt=\"Smilie\" />",$bericht);
$bericht = str_replace(" :P"," <img src=\"/images/smilies/smiley-razz.png\" alt=\"Smilie\" />",$bericht);
$bericht = str_replace(" :D"," <img src=\"/images/smilies/smiley-grin.png\" alt=\"Smilie\" />",$bericht);
$bericht = str_replace(" 8)"," <img src=\"/images/smilies/smiley-cool.png\" alt=\"Smilie\" />",$bericht);
$bericht = str_replace(" *-)"," <img src=\"/images/smilies/smiley-roll.png\" alt=\"Smilie\" />",$bericht);
$bericht = str_replace(" :?"," <img src=\"/images/smilies/smiley-confuse.png\" alt=\"Smilie\" />",$bericht);
$bericht = str_replace(" :@"," <img src=\"/images/smilies/smiley-mad.png\" alt=\"Smilie\" />",$bericht);
$bericht = str_replace(" :("," <img src=\"/images/smilies/smiley-sad.png\" alt=\"Smilie\" />",$bericht);
$bericht = str_replace(" :|"," <img src=\"/images/smilies/smiley-neutral.png\" alt=\"Smilie\" />",$bericht);
$bericht = str_replace(" :/"," <img src=\"/images/smilies/smiley-lol.png\" alt=\"Smilie\" />",$bericht);
$bericht = str_replace(" |-)"," <img src=\"/images/smilies/smiley-yell.png\" alt=\"Smilie\" />",$bericht);
$bericht = str_replace(" :G"," <img src=\"/images/smilies/smiley-mr-green.png\" alt=\"Smilie\" />",$bericht);
$bericht = str_replace(" ;("," <img src=\"/images/smilies/smiley-cry.png\" alt=\"Smilie\" />",$bericht);
// Scheld worden censuur
$bericht = str_replace("fuck","<i>*censuur*</i>",$bericht);
$bericht = str_replace("shit","<i>*censuur*</i>",$bericht);
$bericht = str_replace("dick","<i>*censuur*</i>",$bericht);
$bericht = str_replace("suck","<i>*censuur*</i>",$bericht);
$bericht = str_replace("blowjob","<i>*censuur*</i>",$bericht);
$bericht = str_replace("pik","<i>*censuur*</i>",$bericht);
$bericht = str_replace("kut","<i>*censuur*</i>",$bericht);
$bericht = str_replace("lul","<i>*censuur*</i>",$bericht);
$bericht = str_replace("eikel","<i>*censuur*</i>",$bericht);
$bericht = str_replace("klootzak","<i>*censuur*</i>",$bericht);
$bericht = str_replace("dyke","<i>*censuur*</i>",$bericht);
$bericht = str_replace("asshole","<i>*censuur*</i>",$bericht);
$bericht = str_replace("hoer","<i>*censuur*</i>",$bericht);
$bericht = str_replace("slet","<i>*censuur*</i>",$bericht);
$bericht = str_replace("teef","<i>*censuur*</i>",$bericht);
$bericht = str_replace("bitch","<i>*censuur*</i>",$bericht);
$bericht = str_replace("kanker","<i>*censuur*</i>",$bericht);
$bericht = str_replace("kenker","<i>*censuur*</i>",$bericht);
$bericht = str_replace("tering","<i>*censuur*</i>",$bericht);
// Centreren
$bericht = preg_replace("#\[center\](.+?)\[/center\]#is","<div style=\"width: 565px; text-align: center;\">\\1</div>",$bericht);
// Spolier
$bericht = preg_replace('#\[spoiler\](.+?)\[/spoiler\]#sie',"'<div class=\"Spoiler\"><a onclick=\"javascript:ShowHide(\'spoil_'.md5('Bekijk de spoiler').'\');\" />Bekijk de spoiler</a><div class=\"Block\"><div id=\"spoil_'.md5('Bekijk de spoiler').'\" class=\"SpoilerTekst\">'.stripslashes('\\1').'</div></div></div>'",$bericht);
// Code en php
$bericht = preg_replace_callback("_\[code\](.*?)\[/code\]_is", "customHighlight", $bericht);
return $bericht;
}
// De code systeem
function customHighlight($code){
$code = highlight_string(htmlspecialchars_decode(strip_tags($code[1])), true);
$code = str_replace('\"', '"', $code);
$code = str_replace("?>", "<span style=\"color: #0000BB\">?></span>", $code);
$aLines = explode("<br />", $code);
$iLines = count($aLines);
$output = "<br /><div style=\"width: 116%;\"><b>PHP code</b><br /><div class=\"codesysteem\">";
for($i = 1; $i <= $iLines; $i++){
$output .= $i ."<br />";
}
$output .= "</div><div style=\"float: left;overflow-x: scroll;overflow: auto;display: block;width:80%;\">\n$code\n</div><div style=\"clear:left;\"></div></div>";
return $output;
}
?>
Toon Meer
Alvast bedankt;)
Met vriendelijke groeten,
Mentimjojo