Antonn schreef:Dat werkt niet, nu veranderd hij heel de zin.$bericht = str_ireplace($code, *SMILEY=>.$output_smile, $post);Eerdere citaten tonen
Sanderc schreef:Oke bedanktEerdere citaten tonen
Fireiscool schreef:En bij de ip bans gewoon een tabel aanmaken en dan kijken of het in de database staat?Eerdere citaten tonen
Sanderc schreef:Dus bij 0 blijven ze wel in de database staan (geen herbruikbare naam dus)?
Ip bans een aparte tabel voor ja
toevoeging op 2 juni 2013, 1539:
Ik ben trouwens bezig met een UBB scriptje, maar ik loop op een fout, namelijk, hij replaced het niet?[COLOR= #0000BB]<?php $smileys[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR] [COLOR= #DD0000]:)[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #DD0000]blij[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]:D[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #DD0000]lach[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]:([/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #DD0000]sip[/COLOR] [COLOR= #007700]);[/COLOR] [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"POST"[/COLOR][COLOR= #007700]) {[/COLOR] [COLOR= #0000BB]$post[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]post[/COLOR][COLOR= #007700]];[/COLOR] [URL="http://www.php.net/foreach"]foreach[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$smileys[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$code[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$output_smile[/COLOR][COLOR= #007700]) {[/COLOR] [COLOR= #0000BB]$bericht[/COLOR] [COLOR= #007700]=[/COLOR] str_ireplace[COLOR= #007700]([/COLOR][COLOR= #0000BB]$code[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]*SMILEY=>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$output_smile[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$post[/COLOR][COLOR= #007700]); }[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$bericht[/COLOR][COLOR= #007700]; }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR] ?> <form method="post" action="#"> <input type="text" name="post"> <input type="submit" value="UBB"> </form> [COLOR= #0000BB]<?php[/COLOR] [COLOR= #007700]}[/COLOR] ?>
hier kan je testen;
http://jbnfcommunity.net/ubb.php
=>
$bericht = str_ireplace($post, $code, *SMILEY=>.$output_smile);
Je kan trouwens ook meteen een hele array gebruiken, dat gaat veel sneller. Dan hoef je geen loop.
str_replace(Hi!, array(
,
), array(smiley1, smiley2))
Stel dat ik lol
typDan vervangt hij alles + hij zegt altijd dat het smiley sip is...
39:
), array(smiley1, smiley2))


