From: Andreas K. <la...@us...> - 2002-10-28 12:34:42
|
Update of /cvsroot/pn-modules/PN_phpBB_14/html/modules/phpBB_14 In directory usw-pr-cvs1:/tmp/cvs-serv31866/PN_phpBB_14/html/modules/phpBB_14 Modified Files: functions.php Log Message: fixed bbcode Index: functions.php =================================================================== RCS file: /cvsroot/pn-modules/PN_phpBB_14/html/modules/phpBB_14/functions.php,v retrieving revision 1.128 retrieving revision 1.129 diff -C2 -d -r1.128 -r1.129 *** functions.php 24 Aug 2002 20:45:09 -0000 1.128 --- functions.php 28 Oct 2002 12:34:39 -0000 1.129 *************** *** 885,902 **** function phpbb_insert_bbcodeicons() { ! global $url_images, $ModName; $message = "<br><br>"; $message .= "<font class=\"pn-normal\">"._PHPBB_USEBBCODE."</font><br><br>"; ! $message .= "<A href=\"javascript: x()\" onClick=\"DoPrompt('url');\"><IMG src=\"$url_images/BBCode/b_url.gif\" width=\"68\" height=\"16\" border=\"0\" alt=\""._PHPBB_BBCODE_WEBADDRESS."\"></A>\n"; ! $message .= "<A href=\"javascript: x()\" onClick=\"DoPrompt('email');\"><IMG src=\"$url_images/BBCode/b_email.gif\" width=\"68\" height=\"16\" border=\"0\" alt=\""._PHPBB_BBCODE_EMAILADDRESS."\"></A>\n"; ! $message .= "<A href=\"javascript: x()\" onClick=\"DoPrompt('image');\"><IMG src=\"$url_images/BBCode/b_image.gif\" width=\"68\" height=\"16\" border=\"0\" alt=\""._PHPBB_BBCODE_WEBIMAGE."\"></A>\n"; ! $message .= "<A href=\"javascript: x()\" onClick=\"DoPrompt('bold');\"><IMG src=\"$url_images/BBCode/b_bold.gif\" width=\"68\" height=\"16\" border=\"0\" alt=\""._PHPBB_BBCODE_BOLD_TEXT."\"></A>\n"; ! $message .= "<A href=\"javascript: x()\" onClick=\"DoPrompt('italic');\"><IMG src=\"$url_images/BBCode/b_italic.gif\" width=\"68\" height=\"16\" border=\"0\" alt=\""._PHPBB_BBCODE_ITALIC_TEXT."\"></A>\n"; ! $message .= "<br/>\n"; ! $message .= "<A href=\"javascript: x()\" onClick=\"DoPrompt('quote');\"><IMG src=\"$url_images/BBCode/b_quote.gif\" width=\"68\" height=\"16\" border=\"0\" alt=\""._PHPBB_BBCODE_QUOTE."\"></A>\n"; ! $message .= "<A href=\"javascript: x()\" onClick=\"DoPrompt('code');\"><IMG src=\"$url_images/BBCode/b_code.gif\" width=\"68\" height=\"16\" border=\"0\" alt=\""._PHPBB_BBCODE_CODE."\"></A>\n"; ! $message .= "<A href=\"javascript: x()\" onClick=\"DoPrompt('listopen');\"><IMG src=\"$url_images/BBCode/b_listopen.gif\" width=\"68\" height=\"16\" border=\"0\" alt=\""._PHPBB_BBCODE_LIST_OPEN."\"></A>\n"; ! $message .= "<A href=\"javascript: x()\" onClick=\"DoPrompt('listitem');\"><IMG src=\"$url_images/BBCode/b_listitem.gif\" width=\"68\" height=\"16\" border=\"0\" alt=\""._PHPBB_BBCODE_LIST_ITEM."\"></A>\n"; ! $message .= "<A href=\"javascript: x()\" onClick=\"DoPrompt('listclose');\"><IMG src=\"$url_images/BBCode/b_listclose.gif\" width=\"68\" height=\"16\" border=\"0\" alt=\""._PHPBB_BBCODE_LIST_CLOSE."\"></A>\n"; return $message; } --- 885,904 ---- function phpbb_insert_bbcodeicons() { ! global $url_images, $ModName; $message = "<br><br>"; $message .= "<font class=\"pn-normal\">"._PHPBB_USEBBCODE."</font><br><br>"; ! $message .= "<A href=\"javascript: x()\" onClick=\"DoPrompt('url');\">"._PHPBB_BBCODE_URL."</A>\n"; ! $message .= "<A href=\"javascript: x()\" onClick=\"DoPrompt('email');\">"._PHPBB_BBCODE_EMAIL."</A>\n"; ! $message .= "<A href=\"javascript: x()\" onClick=\"DoPrompt('image');\">"._PHPBB_BBCODE_IMAGE."</A>\n"; ! $message .= "<A href=\"javascript: x()\" onClick=\"DoPrompt('bold');\">"._PHPBB_BBCODE_BOLD."</A> ! \n"; ! $message .= "<A href=\"javascript: x()\" onClick=\"DoPrompt('italic');\">"._PHPBB_BBCODE_ITALIC."</A>\n"; ! $message .= "<br/> ! \n"; ! $message .= "<A href=\"javascript: x()\" onClick=\"DoPrompt('quote');\">"._PHPBB_BBCODE_QUOTE."</A>\n"; ! $message .= "<A href=\"javascript: x()\" onClick=\"DoPrompt('code');\">"._PHPBB_BBCODE_CODE."</A>\n"; ! $message .= "<A href=\"javascript: x()\" onClick=\"DoPrompt('listopen');\">"._PHPBB_BBCODE_OPEN."</A>\n"; ! $message .= "<A href=\"javascript: x()\" onClick=\"DoPrompt('listitem');\">"._PHPBB_BBCODE_LIST."</A>\n"; ! $message .= "<A href=\"javascript: x()\" onClick=\"DoPrompt('listclose');\">"._PHPBB_BBCODE_CLOSE."</A>\n"; return $message; } *************** *** 1157,1164 **** // Undo [code] ! $message = preg_replace("#<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class=\"pn-sub\">Code:</font><HR></TD></TR><TR><TD><FONT class=\"pn-sub\"><PRE>(.*?)</PRE></FONT></TD></TR><TR><TD><HR></TD></TR></TABLE><!-- BBCode End -->#s", "[code]\\1[/code]", $message); // Undo [quote] ! $message = preg_replace("#<!-- BBCode Quote Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class=\"pn-sub\">Quote:</font><HR></TD></TR><TR><TD><FONT class=\"pn-sub\"><BLOCKQUOTE>(.*?)</BLOCKQUOTE></FONT></TD></TR><TR><TD><HR></TD></TR></TABLE><!-- BBCode Quote End -->#s", "[quote]\\1[/quote]", $message); // Undo [b] and [i] --- 1159,1166 ---- // Undo [code] ! $message = preg_replace("#<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD>Code:<HR></TD></TR><TR><TD><PRE>(.*?)</PRE></TD></TR><TR><TD><HR></TD></TR></TABLE><!-- BBCode End -->#s", "[code]\\1[/code]", $message); // Undo [quote] ! $message = preg_replace("#<!-- BBCode Quote Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD>Quote:<HR></TD></TR><TR><TD><BLOCKQUOTE>(.*?)</BLOCKQUOTE></TD></TR><TR><TD><HR></TD></TR></TABLE><!-- BBCode Quote End -->#s", "[quote]\\1[/quote]", $message); // Undo [b] and [i] *************** *** 1174,1177 **** --- 1176,1180 ---- // Undo [img] $message = preg_replace("#<!-- BBCode Start --><IMG SRC=\"http://(.*?)\"><!-- BBCode End -->#s", "[img]http://\\1[/img]", $message); + //$message = preg_replace("#<!-- BBCode Start --><IMG SRC=\"(.*?)\"><!-- BBCode End -->#s", "[img]\\1[/img]", $message); // Undo lists (unordered/ordered) *************** *** 1210,1220 **** { $currMatchTextBefore = preg_quote($matches[1][$i]); ! //$currMatchTextAfter = htmlspecialchars($matches[1][$i]); ! $currMatchTextAfter = $matches[1][$i]; ! $message = preg_replace("#\[code\]$currMatchTextBefore\[/code\]#si", "<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class=\"pn-sub\">Code:</font><HR></TD></TR><TR><TD><FONT class=\"pn-sub\"><PRE>$currMatchTextAfter</PRE></FONT></TD></TR><TR><TD><HR></TD></TR></TABLE><!-- BBCode End -->", $message); } // [QUOTE] and [/QUOTE] for posting replies with quote, or just for quoting stuff. ! $message = preg_replace("#\[quote\](.*?)\[/quote]#si", "<!-- BBCode Quote Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class=\"pn-sub\">Quote:</font><HR></TD></TR><TR><TD><FONT class=\"pn-sub\"><BLOCKQUOTE>\\1</BLOCKQUOTE></FONT></TD></TR><TR><TD><HR></TD></TR></TABLE><!-- BBCode Quote End -->", $message); // [b] and [/b] for bolding text. --- 1213,1222 ---- { $currMatchTextBefore = preg_quote($matches[1][$i]); ! $currMatchTextAfter = pnVarPrepHTMLDisplay($matches[1][$i]); ! $message = preg_replace("#\[code\]$currMatchTextBefore\[/code\]#si", "<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD>Code:<HR></TD></TR><TR><TD><PRE>$currMatchTextAfter</PRE></TD></TR><TR><TD><HR></TD></TR></TABLE><!-- BBCode End -->", $message); } // [QUOTE] and [/QUOTE] for posting replies with quote, or just for quoting stuff. ! $message = preg_replace("#\[quote\](.*?)\[/quote]#si", "<!-- BBCode Quote Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD>Quote:<HR></TD></TR><TR><TD><BLOCKQUOTE>\\1</BLOCKQUOTE></TD></TR><TR><TD><HR></TD></TR></TABLE><!-- BBCode Quote End -->", $message); // [b] and [/b] for bolding text. *************** *** 1235,1238 **** --- 1237,1242 ---- // [img]image_url_here[/img] code.. $message = preg_replace("#\[img\](http://)?(.*?)\[/img\]#si", "<!-- BBCode Start --><IMG SRC=\"http://\\2\"><!-- BBCode End -->", $message); + // $message = preg_replace("#\[img\](.*?)\[/img\]#si", "<!-- BBCode Start --><IMG SRC=\"\\1\"><!-- BBCode End -->", $message); + // unordered list code.. |