PHP interesse |
|
in mijn textvak wordt $bericht geladen en alle tags smilies (dingen in de bb) beginnen daar ook mee
EDIT:
bericht vanuit de database opgeroepen
<tr class="rij1">
<td colspan="2">
<?php echo"$bericht"; ?>
</td>
</tr>
<tr class="rij1"> <td colspan="2"> </td> </tr>
ubb
<?php
$Smilies = array();
$Smilies[":)"] = "images/smilies/01.gif";
$Smilies[":("] = "images/smilies/02.gif";
$Smilies[";)"] = "images/smilies/03.gif";
$Smilies[":))"] = "images/smilies/04.gif";
$Smilies[";;)"] = "images/smilies/05.gif";
$Smilies["(?)"] = "images/smilies/06.gif";
$Smilies["(H)"] = "images/smilies/07.gif";
$Smilies[":$"] = "images/smilies/08.gif";
$Smilies[":P"] = "images/smilies/09.gif";
$Smilies["(K)"] = "images/smilies/10.gif";
$Smilies[":O"] = "images/smilies/11.gif";
$Smilies[":@"] = "images/smilies/12.gif";
$Smilies[":>"] = "images/smilies/13.gif";
$Smilies["(C)"] = "images/smilies/14.gif";
$Smilies[":S"] = "images/smilies/15.gif";
$Smilies["(6)"] = "images/smilies/16.gif";
$Smilies[":'("] = "images/smilies/17.gif";
$Smilies[":D"] = "images/smilies/18.gif";
$Smilies[":|"] = "images/smilies/19.gif";
$Smilies["/:)"] = "images/smilies/20.gif";
$Smilies["(A)"] = "images/smilies/21.gif";
$Smilies["B)"] = "images/smilies/22.gif";
$Smilies["(S)"] = "images/smilies/23.gif";
$Smilies["(Z)"] = "images/smilies/24.gif";
$Smilies["8("] = "images/smilies/25.gif";
$Smilies[":{"] = "images/smilies/26.gif";
$Smilies["(M)"] = "images/smilies/27.gif";
$Smilies["(N)"] = "images/smilies/28.gif";
$Smilies["(CL)"] = "images/smilies/29.gif";
$Smilies["(L)"] = "images/smilies/30.gif";
$Smilies[":(("] = "images/smilies/31.gif";
$Smilies["(D)"] = "images/smilies/32.gif";
$Smilies["(HM)"] = "images/smilies/33.gif";
$Smilies["(AU)"] = "images/smilies/34.gif";
$Smilies["(AP)"] = "images/smilies/35.gif";
$Smilies["(PI)"] = "images/smilies/36.gif";
$Smilies["(CO)"] = "images/smilies/37.gif";
$Smilies["(MO)"] = "images/smilies/38.gif";
$Smilies["(CH)"] = "images/smilies/39.gif";
$Smilies["(F)"] = "images/smilies/40.gif";
$Smilies["(LC)"] = "images/smilies/41.gif";
$Smilies["(AF)"] = "images/smilies/42.gif";
$Smilies["(PU)"] = "images/smilies/43.gif";
$Smilies["(CC)"] = "images/smilies/44.gif";
$Smilies["(LA)"] = "images/smilies/45.gif";
$Smilies["(SK)"] = "images/smilies/46.gif";
$Smilies["(GR)"] = "images/smilies/47.gif";
$Smilies["(AL)"] = "images/smilies/48.gif";
$Smilies["(LO)"] = "images/smilies/49.gif";
$Smilies["(KI)"] = "images/smilies/50.gif";
$Smilies["(P)"] = "images/smilies/51.gif";
$Smilies["(HP)"] = "images/smilies/52.gif";
$Smilies["($)"] = "images/smilies/53.gif";
$Smilies["(8)"] = "images/smilies/54.gif";
$Smilies["(PI)"] = "images/smilies/55.gif";
$Smilies["(B)"] = "images/smilies/56.gif";
$Smilies["(V)"] = "images/smilies/57.gif";
$Smilies["(X)"] = "images/smilies/58.gif";
$Smilies["(PA)"] = "images/smilies/59.gif";
$Smilies["(HU)"] = "images/smilies/60.gif";
$Smilies["(1)"] = "images/smilies/61.gif";
$Smilies["(2)"] = "images/smilies/62.gif";
$Smilies["(3)"] = "images/smilies/63.gif";
$Smilies["(%)"] = "images/smilies/64.gif";
function dehtmlspecialchars($bericht) {
$bericht = str_replace(""",'"',$bericht);
$bericht = str_replace("<",'<',$bericht);
$bericht = str_replace(">",'>',$bericht);
$bericht = str_replace("'","'",$bericht);
$bericht = str_replace("&",'&',$bericht);
return $bericht;
}
function Opmaak($bericht) {
global $Smilies;
while(list($code,$plaatje) = each($Smilies)) {
$bericht = str_replace($code,"<img alt='Smilie' src='$plaatje'/>",$bericht);
$bericht = str_replace(strtoupper($code),"<img alt='Smilie' src='$plaatje'/>",$bericht);
$bericht = str_replace(strtolower($code),"<img alt='Smilie' src='$plaatje'/>",$bericht);
}
reset($Smilies);
$bericht = eregi_replace("\[b\]","<b>",$bericht);
$bericht = eregi_replace("\[/b\]","</b>",$bericht);
$bericht = eregi_replace("\[i\]","<i>",$bericht);
$bericht = eregi_replace("\[/i\]","</i>",$bericht);
$bericht = eregi_replace("\[u\]","<u>",$bericht);
$bericht = eregi_replace("\[/u\]","</u>",$bericht);
$bericht = eregi_replace("\[s\]","<s>",$bericht);
$bericht = eregi_replace("\[/s\]","</s>",$bericht);
$bericht = eregi_replace("\[sup\]","<sup>",$bericht);
$bericht = eregi_replace("\[/sup\]","</sup>",$bericht);
$bericht = eregi_replace("\[sub\]","<sub>",$bericht);
$bericht = eregi_replace("\[/sub\]","</sub>",$bericht);
$bericht = preg_replace("/(\[email\])(.*)(\[\/email\])/U","<a href=\"mailto:\\2\"><u>\\2</u></a>", $bericht);
$bericht = preg_replace("/(\[img\])http:\/\/(.*)(\[\/img\])/U","<img border=0 src='http://\\2'>", $bericht);
$bericht = eregi_replace("\[url\][[:space:]]*(http://)?([^\\[]*)[[:space:]]*\[/url\]", "<a href=\"http://\\2\" target=\"_blank\"><u>http://\\2</u></a>", $bericht);
$bericht = eregi_replace("\[list\]","<ul>",$bericht);
$bericht = eregi_replace("\[/list\]","</ul>",$bericht);
$bericht = str_replace("[*]","<li>",$bericht);
$bericht = preg_replace("/\\[url=(http\:\/\/)?([^\\[]*)\\][[:space:]]*([^\\[]*)[[:space:]]*\\[\/url\\]/e", "URL('$2','$3')", $bericht);
$bericht = eregi_replace("\\[php=([^]]+)\\]", "<a href='http://www.php.net/\\1' target='_blank'><u>\\1 (PHP Manual)</u></a>", $bericht);
$bericht = eregi_replace("\\[google=([^]]+)\\]", "<a href='http://www.google.nl/search?q=\\1' target='_blank'><u>\\1 (Google)</u></a>", $bericht);
return $bericht;
}
?>
<?php $Smilies[":)"] = "images/smilies/01.gif"; $Smilies[":("] = "images/smilies/02.gif"; $Smilies[";)"] = "images/smilies/03.gif"; $Smilies[":))"] = "images/smilies/04.gif"; $Smilies[";;)"] = "images/smilies/05.gif"; $Smilies["(?)"] = "images/smilies/06.gif"; $Smilies["(H)"] = "images/smilies/07.gif"; $Smilies[":$"] = "images/smilies/08.gif"; $Smilies[":P"] = "images/smilies/09.gif"; $Smilies["(K)"] = "images/smilies/10.gif"; $Smilies[":O"] = "images/smilies/11.gif"; $Smilies[":@"] = "images/smilies/12.gif"; $Smilies[":>"] = "images/smilies/13.gif"; $Smilies["(C)"] = "images/smilies/14.gif"; $Smilies[":S"] = "images/smilies/15.gif"; $Smilies["(6)"] = "images/smilies/16.gif"; $Smilies[":'("] = "images/smilies/17.gif"; $Smilies[":D"] = "images/smilies/18.gif"; $Smilies[":|"] = "images/smilies/19.gif"; $Smilies["/:)"] = "images/smilies/20.gif"; $Smilies["(A)"] = "images/smilies/21.gif"; $Smilies["B)"] = "images/smilies/22.gif"; $Smilies["(S)"] = "images/smilies/23.gif"; $Smilies["(Z)"] = "images/smilies/24.gif"; $Smilies["8("] = "images/smilies/25.gif"; $Smilies[":{"] = "images/smilies/26.gif"; $Smilies["(M)"] = "images/smilies/27.gif"; $Smilies["(N)"] = "images/smilies/28.gif"; $Smilies["(CL)"] = "images/smilies/29.gif"; $Smilies["(L)"] = "images/smilies/30.gif"; $Smilies[":(("] = "images/smilies/31.gif"; $Smilies["(D)"] = "images/smilies/32.gif"; $Smilies["(HM)"] = "images/smilies/33.gif"; $Smilies["(AU)"] = "images/smilies/34.gif"; $Smilies["(AP)"] = "images/smilies/35.gif"; $Smilies["(PI)"] = "images/smilies/36.gif"; $Smilies["(CO)"] = "images/smilies/37.gif"; $Smilies["(MO)"] = "images/smilies/38.gif"; $Smilies["(CH)"] = "images/smilies/39.gif"; $Smilies["(F)"] = "images/smilies/40.gif"; $Smilies["(LC)"] = "images/smilies/41.gif"; $Smilies["(AF)"] = "images/smilies/42.gif"; $Smilies["(PU)"] = "images/smilies/43.gif"; $Smilies["(CC)"] = "images/smilies/44.gif"; $Smilies["(LA)"] = "images/smilies/45.gif"; $Smilies["(SK)"] = "images/smilies/46.gif"; $Smilies["(GR)"] = "images/smilies/47.gif"; $Smilies["(AL)"] = "images/smilies/48.gif"; $Smilies["(LO)"] = "images/smilies/49.gif"; $Smilies["(KI)"] = "images/smilies/50.gif"; $Smilies["(P)"] = "images/smilies/51.gif"; $Smilies["(HP)"] = "images/smilies/52.gif"; $Smilies["($)"] = "images/smilies/53.gif"; $Smilies["(8)"] = "images/smilies/54.gif"; $Smilies["(PI)"] = "images/smilies/55.gif"; $Smilies["(B)"] = "images/smilies/56.gif"; $Smilies["(V)"] = "images/smilies/57.gif"; $Smilies["(X)"] = "images/smilies/58.gif"; $Smilies["(PA)"] = "images/smilies/59.gif"; $Smilies["(HU)"] = "images/smilies/60.gif"; $Smilies["(1)"] = "images/smilies/61.gif"; $Smilies["(2)"] = "images/smilies/62.gif"; $Smilies["(3)"] = "images/smilies/63.gif"; $Smilies["(%)"] = "images/smilies/64.gif"; function dehtmlspecialchars($bericht) { return $bericht; } function Opmaak($bericht) { while(list($code,$plaatje) = each($Smilies)) { $bericht = str_replace($code,"<img alt='Smilie' src='$plaatje'/>",$bericht); } $bericht = preg_replace("/(\[email\])(.*)(\[\/email\])/U","<a href=\"mailto:\\2\"><u>\\2</u></a>", $bericht); $bericht = preg_replace("/(\[img\])http:\/\/(.*)(\[\/img\])/U","<img border=0 src='http://\\2'>", $bericht); $bericht = eregi_replace("\[url\][[:space:]]*(http://)?([^\\[]*)[[:space:]]*\[/url\]", "<a href=\"http://\\2\" target=\"_blank\"><u>http://\\2</u></a>", $bericht); $bericht = preg_replace("/\\[url=(http\:\/\/)?([^\\[]*)\\][[:space:]]*([^\\[]*)[[:space:]]*\\[\/url\\]/e", "URL('$2','$3')", $bericht); $bericht = eregi_replace("\\[php=([^]]+)\\]", "<a href='http://www.php.net/\\1' target='_blank'><u>\\1 (PHP Manual)</u></a>", $bericht); $bericht = eregi_replace("\\[google=([^]]+)\\]", "<a href='http://www.google.nl/search?q=\\1' target='_blank'><u>\\1 (Google)</u></a>", $bericht); return $bericht; } ?>
|