Проблем с BBCode

sksdesign

Registered
function bbcode($text){
$text=preg_replace("/\:\)/s", '<img src=images/emote/1.gif>',$text);
$text=preg_replace("/\;\)/s", '<img src=images/emote/2.gif>',$text);
$text=preg_replace("/\;\dd/s", '<img src=images/emote/3.gif>',$text);
$text=preg_replace("/\:\&/s", '<img src=images/emote/4.gif>',$text);
$text=preg_replace("/\:\(/s", '<img src=images/emote/5.gif>',$text);
$text=preg_replace("/\:\!/s", '<img src=images/emote/6.gif>',$text);
$text=preg_replace("/\:\P/s", '<img src=images/emote/7.gif>',$text);
$text=preg_replace("/\:\k/s", '<img src=images/emote/8.gif>',$text);
$text=preg_replace("/\:\S/s", '<img src=images/emote/9.gif>',$text);
$text=preg_replace("/\:\w/s", '<img src=images/emote/10.gif>',$text);
$text=preg_replace("/\:\@/s", '<img src=images/emote/11.gif>',$text);
$text=preg_replace("/\:\x/s", '<img src=images/emote/12.gif>',$text);
$text=preg_replace("/\:\|/s", '<img src=images/emote/13.gif>',$text);
$text=preg_replace("/\:\c/s", '<img src=images/emote/14.gif>',$text);
$text=preg_replace("/\:\l/s", '<img src=images/emote/15.gif>',$text);

$text=preg_replace("/\:\D/s", '<img src=images/emote/16.gif>',$text);
$text=preg_replace("/\;\(/s", '<img src=images/emote/17.gif>',$text);
$text=preg_replace("/\:\o/s", '<img src=images/emote/18.gif>',$text);
$text=preg_replace("/\:\b/s", '<img src=images/emote/19.gif>',$text);
$text=preg_replace("/\:\a/s", '<img src=images/emote/20.gif>',$text);

$text = nl2br($text);
return $text;
}
грешка:

Код:
Warning: preg_replace() [function.preg-replace]: No ending delimiter '/' found in C:\...\config.php on line 41

Warning: preg_replace() [function.preg-replace]: Compilation failed: \c at end of pattern at offset 2 in C:\....\config.php on line 48

Warning: preg_replace() [function.preg-replace]: Compilation failed: PCRE does not support \L, \l, \N, \U, or \u at offset 3 in C:\....\config.php on line 49


някой може ли да ми помогне :(
 
Пробвай с това:
Код:
function bbcode($text){
$text=preg_replace("/:\)/s", '<img src=images/emote/1.gif>',$text);
$text=preg_replace("/;\)/s", '<img src=images/emote/2.gif>',$text);
$text=preg_replace("/;dd/s", '<img src=images/emote/3.gif>',$text);
$text=preg_replace("/:&/s", '<img src=images/emote/4.gif>',$text);
$text=preg_replace("/:\(/s", '<img src=images/emote/5.gif>',$text);
$text=preg_replace("/:!/s", '<img src=images/emote/6.gif>',$text);
$text=preg_replace("/:P/s", '<img src=images/emote/7.gif>',$text);
$text=preg_replace("/:k/s", '<img src=images/emote/8.gif>',$text);
$text=preg_replace("/:S/s", '<img src=images/emote/9.gif>',$text);
$text=preg_replace("/:w/s", '<img src=images/emote/10.gif>',$text);
$text=preg_replace("/:@/s", '<img src=images/emote/11.gif>',$text);
$text=preg_replace("/:x/s", '<img src=images/emote/12.gif>',$text);
$text=preg_replace("/:\|/s", '<img src=images/emote/13.gif>',$text);
$text=preg_replace("/:c/s", '<img src=images/emote/14.gif>',$text);
$text=preg_replace("/:l/s", '<img src=images/emote/15.gif>',$text);
$text=preg_replace("/:D/s", '<img src=images/emote/16.gif>',$text);
$text=preg_replace("/;\(/s", '<img src=images/emote/17.gif>',$text);
$text=preg_replace("/:o/s", '<img src=images/emote/18.gif>',$text);
$text=preg_replace("/:b/s", '<img src=images/emote/19.gif>',$text);
$text=preg_replace("/:a/s", '<img src=images/emote/20.gif>',$text);

$text = nl2br($text);
return $text;
}
Ескейпват се следните знаци:
^ $ ( ) < > | \ { [ . * + ?
Тоест знаци със специално значение!
 

Back
Горе