Warning: Delimiter must not be alphanumeric or backslash in abstaende.php on line 108
der Code dort :
$text = preg_replace($hack,$code,$text);
Was ist da falsch ??
Naja und hier die ganze Funktion :
function checkJBBTag($text, $user, $userClass) {
// JBB Code Konfiguration auslesen
include ('mysqlvar.php');
$db = mysql_connect($dbserver,$dbuser,$dbpass);
mysql_select_db($dbname,$db);
$query = "SELECT * FROM config";
$result = mysql_query($query,$db);
if(!$result) {
die("Ein Fehler ist aufgetreten: Es konnte nicht auf die Board Konfiguration zugegriffen werden. Falls dieser Fehler weiterhin besteht kontaktieren sie bitte den Administrator.");
}
$configdaten = mysql_fetch_array($result);
if($configdaten{"generalCode"} != "on") {
return $text;
}
if($configdaten{"codeTag"} == "on") {
$hack[0] = "\[code\](*.?)\[/code\]";
$code[0] = "\n<br><!--zitat-->\n<table border='0' cellpadding='0' cellspacing='0'>\n".
"<tr><td colspan='2'><img src='bilder/klara.gif' width='400' height='1'></td></tr>".
"<tr>\n\t<td><img src='bilder/klara.gif' width='10' height='1'></td><td><img src='bilder/klara.gif' width='400' height='1'></td>\n</tr>\n".
"<tr>\n\t<td class='forentitle' colspan='2'>CODE:</td>\n</tr>\n".
"<tr><td colspan='2' background='bilder/strichel.gif'><img src='bilder/klara.gif' width='1' height='1'></td></tr>".
"<tr valign='top'>\n".
"\t<td><img src='bilder/klara.gif' width='1' height='1'></td>".
"\t<td >".
"<b class='code'>\\1</b></td>\n</tr>\n".
"<tr><td colspan='2'><img src='bilder/klara.gif' width='1' height='10'></td></tr>".
"<tr><td colspan='2' background='bilder/strichel.gif'><img src='bilder/klara.gif' width='1' height='1'></td></tr>".
"</table>\n<!--endZitat-->\n";
}
if($configdaten{"quoteTag"} == "on") {
$hack[count($hack)] = "\[quote\](*.?)\[/quote\]";
$code[count($code)] = "\n<br><!--zitat-->\n<table border='0' cellpadding='0' cellspacing='0'>\n".
"<tr><td colspan='2'><img src='bilder/klara.gif' width='400' height='1'></td></tr>".
"<tr>\n\t<td><img src='bilder/klara.gif' width='10' height='1'></td><td><img src='bilder/klara.gif' width='400' height='1'></td>\n</tr>\n".
"<tr>\n\t<td class='forentitle' colspan='2'>Zitat:</td>\n</tr>\n".
"<tr>\n\t<td colspan='2' background='bilder/strichel.gif'><img src='bilder/klara.gif' width='1' height='1'></td>\n</tr>\n".
"<tr valign='top'>\n".
"\t<td><img src='bilder/klara.gif' width='1' height='1'></td>\n".
"\t<td class=\"zitat\">\\1</td>\n</tr>\n".
"<tr><td colspan='2'><img src='bilder/klara.gif' width='1' height='10'></td></tr>".
"<tr><td colspan='2' background='bilder/strichel.gif'><img src='bilder/klara.gif' width='1' height='1'></td></tr>".
"</table>\n<!--endZitat-->\n";
}
if($configdaten{"boldTag"} == "on") {
$hack[count($hack)] = "\[b\](*.?)\[/b\]";
$code[count($code)] = "<b style='color: #000066'>\\1</b>";
}
if($configdaten{"italicTag"} == "on") {
$hack[count($hack)] = "\[i\](*.?)\[/i\]";
$code[count($code)] = "<i>\\1</i>";
}
if($configdaten{"editTag"} == "on") {
$hack[count($hack)] = "\[edit\](*.?)\[/i\]";
$code[count($code)] = "\n<br>\n<table border='0' cellpadding='0' cellspacing='0'>\n".
"<tr>\n\t<td><img alt=\"\" src='bilder/klara.gif' width='13' height='10'></td>\n\t<td><img src='bilder/klara.gif' width='400' height='10'></td>\n</tr>".
"\n<tr valign=\"top\">\n\t<td class='editedText' rowspan=\"2\"><img src=\"bilder/edited.gif\" width=8 height=19 alt=\"LALALA\" border=\"0\"></td></tr>".
"\n<tr>\n\t<td class=\"editedText\">".
"\\1</td>\n</tr>".
"\n</table>\n\n";
}
$hack[count($hack)] = "\[stillEdit\](*.?)\[/stillEdit\]";
$code[count($code)] = "<!-- edit -->\\1<!-- edit -->";
$hack[count($hack)] = "\[user\](*.?)\[/user\]";
$code[count($code)] = "<b class=\"user\" style=\"font-size: 10px; font-style:normal;\"> \\1</b><br>";
if($configdaten{"imgTag"} == "on") {
$hack[count($hack)] = "\[img\](*.?)\[/img\]";
$code[count($code)] = "<img src=\"\\1\" border=\"0\"><br>";
$hack[count($hack)] = "\[bild\](*.?)\[/bild\]";
$code[count($code)] = "<img src=\"\\1\" border=\"0\"><br>";
}
if($configdaten{"urlTag"} == "on") {
$hack[count($hack)] = "\[url\](.*?)\[/url\]";
$code[count($code)] = "<!-- JBB URL Code --><a href=\"\\1\">\\1</a><!-- JBB URL Code -->";
$hack[count($hack)] = "\[url=(.*?)\](.*?)\[/url\]";
$code[count($code)] = "<!-- JBB URL Code --><a href=\"\\1\">\\2</a><!-- JBB URL Code -->";
}
if($configdaten{"autolink"} == "on") {
$hack[count($hack)] = "http://(.*?) ";
$code[count($code)] = "<!-- JBB URL Auto-Linker --><a href=\"http://\\1\">http://\\1</a> <!-- JBB URL Auto-Linker -->";
$hack[count($hack)] = " www.(.*?) ";
$code[count($code)] = "<!-- JBB URL Auto-Linker --><a href=\"http://www.\\1\">http://www.\\1</a> <!-- JBB URL Auto-Linker -->";
}
if($configdaten{"emailTag"} == "on") {
$hack[count($hack)] = "\[email\](.*?)\[/email\]";
$code[count($code)] = "<!-- JBB eMail --><a href=\"mailto:\\1\">\\1</a><!-- JBB eMail -->";
$hack[count($hack)] = "\[email=(.*?)\](.*?)\[/email\]";
$code[count($code)] = "<!-- JBB eMail --><a href=\"mailto:\\1\">\\2</a><!-- JBB eMail -->";
}
//echo "<input type=\"text\" value=\"$hacks\">";
$text = preg_replace($hack,$code,$text);
}
der Code dort :
$text = preg_replace($hack,$code,$text);
Was ist da falsch ??
Naja und hier die ganze Funktion :
function checkJBBTag($text, $user, $userClass) {
// JBB Code Konfiguration auslesen
include ('mysqlvar.php');
$db = mysql_connect($dbserver,$dbuser,$dbpass);
mysql_select_db($dbname,$db);
$query = "SELECT * FROM config";
$result = mysql_query($query,$db);
if(!$result) {
die("Ein Fehler ist aufgetreten: Es konnte nicht auf die Board Konfiguration zugegriffen werden. Falls dieser Fehler weiterhin besteht kontaktieren sie bitte den Administrator.");
}
$configdaten = mysql_fetch_array($result);
if($configdaten{"generalCode"} != "on") {
return $text;
}
if($configdaten{"codeTag"} == "on") {
$hack[0] = "\[code\](*.?)\[/code\]";
$code[0] = "\n<br><!--zitat-->\n<table border='0' cellpadding='0' cellspacing='0'>\n".
"<tr><td colspan='2'><img src='bilder/klara.gif' width='400' height='1'></td></tr>".
"<tr>\n\t<td><img src='bilder/klara.gif' width='10' height='1'></td><td><img src='bilder/klara.gif' width='400' height='1'></td>\n</tr>\n".
"<tr>\n\t<td class='forentitle' colspan='2'>CODE:</td>\n</tr>\n".
"<tr><td colspan='2' background='bilder/strichel.gif'><img src='bilder/klara.gif' width='1' height='1'></td></tr>".
"<tr valign='top'>\n".
"\t<td><img src='bilder/klara.gif' width='1' height='1'></td>".
"\t<td >".
"<b class='code'>\\1</b></td>\n</tr>\n".
"<tr><td colspan='2'><img src='bilder/klara.gif' width='1' height='10'></td></tr>".
"<tr><td colspan='2' background='bilder/strichel.gif'><img src='bilder/klara.gif' width='1' height='1'></td></tr>".
"</table>\n<!--endZitat-->\n";
}
if($configdaten{"quoteTag"} == "on") {
$hack[count($hack)] = "\[quote\](*.?)\[/quote\]";
$code[count($code)] = "\n<br><!--zitat-->\n<table border='0' cellpadding='0' cellspacing='0'>\n".
"<tr><td colspan='2'><img src='bilder/klara.gif' width='400' height='1'></td></tr>".
"<tr>\n\t<td><img src='bilder/klara.gif' width='10' height='1'></td><td><img src='bilder/klara.gif' width='400' height='1'></td>\n</tr>\n".
"<tr>\n\t<td class='forentitle' colspan='2'>Zitat:</td>\n</tr>\n".
"<tr>\n\t<td colspan='2' background='bilder/strichel.gif'><img src='bilder/klara.gif' width='1' height='1'></td>\n</tr>\n".
"<tr valign='top'>\n".
"\t<td><img src='bilder/klara.gif' width='1' height='1'></td>\n".
"\t<td class=\"zitat\">\\1</td>\n</tr>\n".
"<tr><td colspan='2'><img src='bilder/klara.gif' width='1' height='10'></td></tr>".
"<tr><td colspan='2' background='bilder/strichel.gif'><img src='bilder/klara.gif' width='1' height='1'></td></tr>".
"</table>\n<!--endZitat-->\n";
}
if($configdaten{"boldTag"} == "on") {
$hack[count($hack)] = "\[b\](*.?)\[/b\]";
$code[count($code)] = "<b style='color: #000066'>\\1</b>";
}
if($configdaten{"italicTag"} == "on") {
$hack[count($hack)] = "\[i\](*.?)\[/i\]";
$code[count($code)] = "<i>\\1</i>";
}
if($configdaten{"editTag"} == "on") {
$hack[count($hack)] = "\[edit\](*.?)\[/i\]";
$code[count($code)] = "\n<br>\n<table border='0' cellpadding='0' cellspacing='0'>\n".
"<tr>\n\t<td><img alt=\"\" src='bilder/klara.gif' width='13' height='10'></td>\n\t<td><img src='bilder/klara.gif' width='400' height='10'></td>\n</tr>".
"\n<tr valign=\"top\">\n\t<td class='editedText' rowspan=\"2\"><img src=\"bilder/edited.gif\" width=8 height=19 alt=\"LALALA\" border=\"0\"></td></tr>".
"\n<tr>\n\t<td class=\"editedText\">".
"\\1</td>\n</tr>".
"\n</table>\n\n";
}
$hack[count($hack)] = "\[stillEdit\](*.?)\[/stillEdit\]";
$code[count($code)] = "<!-- edit -->\\1<!-- edit -->";
$hack[count($hack)] = "\[user\](*.?)\[/user\]";
$code[count($code)] = "<b class=\"user\" style=\"font-size: 10px; font-style:normal;\"> \\1</b><br>";
if($configdaten{"imgTag"} == "on") {
$hack[count($hack)] = "\[img\](*.?)\[/img\]";
$code[count($code)] = "<img src=\"\\1\" border=\"0\"><br>";
$hack[count($hack)] = "\[bild\](*.?)\[/bild\]";
$code[count($code)] = "<img src=\"\\1\" border=\"0\"><br>";
}
if($configdaten{"urlTag"} == "on") {
$hack[count($hack)] = "\[url\](.*?)\[/url\]";
$code[count($code)] = "<!-- JBB URL Code --><a href=\"\\1\">\\1</a><!-- JBB URL Code -->";
$hack[count($hack)] = "\[url=(.*?)\](.*?)\[/url\]";
$code[count($code)] = "<!-- JBB URL Code --><a href=\"\\1\">\\2</a><!-- JBB URL Code -->";
}
if($configdaten{"autolink"} == "on") {
$hack[count($hack)] = "http://(.*?) ";
$code[count($code)] = "<!-- JBB URL Auto-Linker --><a href=\"http://\\1\">http://\\1</a> <!-- JBB URL Auto-Linker -->";
$hack[count($hack)] = " www.(.*?) ";
$code[count($code)] = "<!-- JBB URL Auto-Linker --><a href=\"http://www.\\1\">http://www.\\1</a> <!-- JBB URL Auto-Linker -->";
}
if($configdaten{"emailTag"} == "on") {
$hack[count($hack)] = "\[email\](.*?)\[/email\]";
$code[count($code)] = "<!-- JBB eMail --><a href=\"mailto:\\1\">\\1</a><!-- JBB eMail -->";
$hack[count($hack)] = "\[email=(.*?)\](.*?)\[/email\]";
$code[count($code)] = "<!-- JBB eMail --><a href=\"mailto:\\1\">\\2</a><!-- JBB eMail -->";
}
//echo "<input type=\"text\" value=\"$hacks\">";
$text = preg_replace($hack,$code,$text);
}
Kommentar