From bf7ec7c8f01d84c6ed93474c4ac898acf9af3e6e Mon Sep 17 00:00:00 2001
From: natec <natec@users.sourceforge.net>
Date: Wed, 21 Mar 2001 07:17:11 +0000
Subject: 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
---
 phpBB/functions/bbcode.php | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

(limited to 'phpBB/functions/bbcode.php')

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>';
-- 
cgit v1.2.1