J
Jens Vogelgesang
Guest
hallo ich habe folgendes script erstellt möchte jetzt aber das wenn man
eingibt das auch ein lachendes smilie erscheint was muss ich jetzt im script ändern?
CODE function txt2html($txt) {
$patterns = array ( "/(http\:\/\/[^\s]+)/i",
"/(ftp\:\/\/[^\s]+)/i",
"/(mailto\:([^\s]+))/i",
"/\:\)+/i",
"/\:\-\)+/i",
"/\;\)+/i",
"/\;\-\)+/i",
"/\:\|/i",
"/\:\-\|/i",
"/\:\(+/i",
"/\:\-\(+/i",
"/\*(.+)\*/i",
"/\_(.+)\_/i",
"/\r/i");
$replace = array ( "<a href=\"\\1\" target=\"_blank\">\\1</a>",
"<a href=\"\\1\" target=\"_blank\">\\1</a>",
"<a href=\"\\1\" target=\"_blank\">\\2</a>",
"<img src=\"img/sch1.gif\" width=\"50\" height=\"50\" alt=\":)\">",
"<img src=\"img/sch2.gif\" width=\"50\" height=\"50\" alt=\":-)\">",
"<img src=\"img/sch3.gif\" width=\"50\" height=\"50\" alt=\";)\">",
"<img src=\"img/sch4.gif\" width=\"50\" height=\"50\" alt=\";-)\">",
"<img src=\"img/sch5.gif\" width=\"50\" height=\"50\" alt=\":|\">",
"<img src=\"img/sch6.gif\" width=\"50\" height=\"50\" alt=\":-|\">",
"<img src=\"img/sch7.gif\" width=\"120\" height=\"100\" alt=\":(\">",
"<img src=\"img/sch8.gif\" width=\"50\" height=\"50\" alt=\":-(\">",
"<img src=\"img/sch9.gif\" width=\"50\" height=\"50\" alt=\":\">",
"<b>\\1</b>",
"<i>\\1</i>",
"<br>\n");
return preg_replace($patterns,$replace, $txt);
}
?>
Danke für eure hilfe
CODE function txt2html($txt) {
$patterns = array ( "/(http\:\/\/[^\s]+)/i",
"/(ftp\:\/\/[^\s]+)/i",
"/(mailto\:([^\s]+))/i",
"/\:\)+/i",
"/\:\-\)+/i",
"/\;\)+/i",
"/\;\-\)+/i",
"/\:\|/i",
"/\:\-\|/i",
"/\:\(+/i",
"/\:\-\(+/i",
"/\*(.+)\*/i",
"/\_(.+)\_/i",
"/\r/i");
$replace = array ( "<a href=\"\\1\" target=\"_blank\">\\1</a>",
"<a href=\"\\1\" target=\"_blank\">\\1</a>",
"<a href=\"\\1\" target=\"_blank\">\\2</a>",
"<img src=\"img/sch1.gif\" width=\"50\" height=\"50\" alt=\":)\">",
"<img src=\"img/sch2.gif\" width=\"50\" height=\"50\" alt=\":-)\">",
"<img src=\"img/sch3.gif\" width=\"50\" height=\"50\" alt=\";)\">",
"<img src=\"img/sch4.gif\" width=\"50\" height=\"50\" alt=\";-)\">",
"<img src=\"img/sch5.gif\" width=\"50\" height=\"50\" alt=\":|\">",
"<img src=\"img/sch6.gif\" width=\"50\" height=\"50\" alt=\":-|\">",
"<img src=\"img/sch7.gif\" width=\"120\" height=\"100\" alt=\":(\">",
"<img src=\"img/sch8.gif\" width=\"50\" height=\"50\" alt=\":-(\">",
"<img src=\"img/sch9.gif\" width=\"50\" height=\"50\" alt=\":\">",
"<b>\\1</b>",
"<i>\\1</i>",
"<br>\n");
return preg_replace($patterns,$replace, $txt);
}
?>
Danke für eure hilfe