aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/functions/bbcode.php
diff options
context:
space:
mode:
authornatec <natec@users.sourceforge.net>2001-03-21 07:17:11 +0000
committernatec <natec@users.sourceforge.net>2001-03-21 07:17:11 +0000
commitbf7ec7c8f01d84c6ed93474c4ac898acf9af3e6e (patch)
tree593e89e9080cf61655ae8164ea676d4244e0e5e1 /phpBB/functions/bbcode.php
parente4380fff1dff408fbad1e590d902c629865062f4 (diff)
downloadforums-bf7ec7c8f01d84c6ed93474c4ac898acf9af3e6e.tar
forums-bf7ec7c8f01d84c6ed93474c4ac898acf9af3e6e.tar.gz
forums-bf7ec7c8f01d84c6ed93474c4ac898acf9af3e6e.tar.bz2
forums-bf7ec7c8f01d84c6ed93474c4ac898acf9af3e6e.tar.xz
forums-bf7ec7c8f01d84c6ed93474c4ac898acf9af3e6e.zip
v2 BBcode now being used.. run bbcode_conversion.php to convert your database. It WILL make a backup posts_text table.
git-svn-id: file:///svn/phpbb/trunk@114 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/functions/bbcode.php')
-rw-r--r--phpBB/functions/bbcode.php25
1 files changed, 16 insertions, 9 deletions
diff --git a/phpBB/functions/bbcode.php b/phpBB/functions/bbcode.php
index 3c895f498a..48fd28c080 100644
--- a/phpBB/functions/bbcode.php
+++ b/phpBB/functions/bbcode.php
@@ -30,12 +30,12 @@ define("BBCODE_UID_LEN", 10);
* a thread. Assumes the message is already first-pass encoded, and has the required
* "[uid:...]" tag as the very first thing in the text.
*/
-function bbencode_second_pass(&$text)
+function bbencode_second_pass($text, $uid)
{
- $uid_tag_length = strpos($text, ']') + 1;
- $uid = substr($text, 5, BBCODE_UID_LEN);
- $text = substr($text, $uid_tag_length);
+ //$uid_tag_length = strpos($text, ']') + 1;
+ //$uid = substr($text, 5, BBCODE_UID_LEN);
+ //$text = substr($text, $uid_tag_length);
// pad it with a space so we can distinguish between FALSE and matching the 1st char (index 0).
// This is important; bbencode_quote(), bbencode_list(), and bbencode_code() all depend on it.
@@ -46,7 +46,7 @@ function bbencode_second_pass(&$text)
{
// Remove padding, return.
$text = substr($text, 1);
- return TRUE;
+ return $text;
}
// [CODE] and [/CODE] for posting code (HTML, PHP, C etc etc) in your posts.
@@ -108,18 +108,25 @@ function bbencode_second_pass(&$text)
// Remove our padding from the string..
$text = substr($text, 1);
- return TRUE;
+ return $text;
} // bbencode_second_pass()
-function bbencode_first_pass($text)
+function make_bbcode_uid()
{
// Unique ID for this message..
$uid = md5(uniqid(rand()));
$uid = substr($uid, 0, BBCODE_UID_LEN);
+ return $uid;
+}
+
+
+
+function bbencode_first_pass($text, $uid)
+{
// pad it with a space so we can distinguish between FALSE and matching the 1st char (index 0).
// This is important; bbencode_quote(), bbencode_list(), and bbencode_code() all depend on it.
$text = " " . $text;
@@ -156,7 +163,7 @@ function bbencode_first_pass($text)
$text = substr($text, 1);
// Add the uid tag to the start of the string..
- $text = '[uid=' . $uid . ']' . $text;
+ //$text = '[uid=' . $uid . ']' . $text;
return $text;
@@ -354,7 +361,7 @@ function bbencode_first_pass_pda($text, $uid, $open_tag, $close_tag, $close_tag_
* by this format: [code:1:$uid] ... [/code:1:$uid]
* Other tags are in this format: [code:$uid] ... [/code:$uid]
*/
-function bbencode_second_pass_code(&$text, $uid)
+function bbencode_second_pass_code($text, $uid)
{
$code_start_html = '<TABLE BORDER="0" ALIGN="CENTER" WIDTH="85%"><TR><TD><font size="-1">Code:</font><HR></TD></TR><TR><TD><FONT SIZE="-1"><PRE>';