aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/bbcode.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2004-09-04 19:32:23 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2004-09-04 19:32:23 +0000
commit57b188b7afa66b68ef75ee69bc06cd8f14b3fed1 (patch)
tree676d8f5348e2c790664127dd651774543bd9bf75 /phpBB/includes/bbcode.php
parent68d73caefcf084f5f523ee7a47b84112dedd4e21 (diff)
downloadforums-57b188b7afa66b68ef75ee69bc06cd8f14b3fed1.tar
forums-57b188b7afa66b68ef75ee69bc06cd8f14b3fed1.tar.gz
forums-57b188b7afa66b68ef75ee69bc06cd8f14b3fed1.tar.bz2
forums-57b188b7afa66b68ef75ee69bc06cd8f14b3fed1.tar.xz
forums-57b188b7afa66b68ef75ee69bc06cd8f14b3fed1.zip
my turn to break the forum (and at least pm's are no longer working - will not last long). HARRRR
git-svn-id: file:///svn/phpbb/trunk@4978 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/bbcode.php')
-rw-r--r--phpBB/includes/bbcode.php26
1 files changed, 23 insertions, 3 deletions
diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php
index 144dafbb30..f9b8fcbce3 100644
--- a/phpBB/includes/bbcode.php
+++ b/phpBB/includes/bbcode.php
@@ -11,6 +11,9 @@
//
// -------------------------------------------------------------
+// BBCODE - able to be used standalone
+//
+
class bbcode
{
var $bbcode_uid = '';
@@ -18,6 +21,8 @@ class bbcode
var $bbcode_cache = array();
var $bbcode_template = array();
+ var $bbcodes = array();
+
var $template_bitfield = 0;
var $template_filename = '';
@@ -30,14 +35,14 @@ class bbcode
}
}
- function bbcode_second_pass(&$message, $bbcode_uid = '', $bbcode_bitfield = FALSE)
+ function bbcode_second_pass(&$message, $bbcode_uid = '', $bbcode_bitfield = false)
{
if ($bbcode_uid)
{
$this->bbcode_uid = $bbcode_uid;
}
- if ($bbcode_bitfield !== FALSE)
+ if ($bbcode_bitfield !== false)
{
$this->bbcode_bitfield = $bbcode_bitfield;
// Init those added with a new bbcode_bitfield (already stored codes will not get parsed again)
@@ -371,6 +376,8 @@ class bbcode
function bbcode_tpl_replace($tpl_name, $tpl)
{
+ global $user;
+
static $replacements = array(
'quote_username_open' => array('{USERNAME}' => '$1'),
'color' => array('{COLOR}' => '$1', '{TEXT}' => '$2'),
@@ -458,7 +465,19 @@ class bbcode
$code = str_replace("\t", '&nbsp; &nbsp;', $code);
$code = str_replace(' ', '&nbsp; ', $code);
$code = str_replace(' ', ' &nbsp;', $code);
- $code = preg_replace('#<!\-\- s(.*?) \-\-><img src="\{SMILE_PATH\}\/.*? \/><!\-\- s\1 \-\->#', '\1', $code);
+
+ $match = array(
+ '#<!\-\- e \-\-><a href="mailto:(.*?)">.*?</a><!\-\- e \-\->#',
+ '#<!\-\- m \-\-><a href="(.*?)" target="_blank">.*?</a><!\-\- m \-\->#',
+ '#<!\-\- w \-\-><a href="http:\/\/(.*?)" target="_blank">.*?</a><!\-\- w \-\->#',
+ '#<!\-\- l \-\-><a href="(.*?)" target="_blank">.*?</a><!\-\- l \-\->#',
+ '#<!\-\- s(.*?) \-\-><img src="\{SMILE_PATH\}\/.*? \/><!\-\- s\1 \-\->#',
+ '#^[\n]#'
+ );
+
+ $replace = array('\1', '\1', '\1', '\1', '\1', '');
+
+ $code = preg_replace($match, $replace, $code);
}
$code = $this->bbcode_tpl('code_open') . $code . $this->bbcode_tpl('code_close');
@@ -466,4 +485,5 @@ class bbcode
return $code;
}
}
+
?> \ No newline at end of file