From 05fef4cd88030e04f233b332a8e32057fb57d5e4 Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Fri, 15 Oct 2010 19:21:59 -0400 Subject: Backported [nosmilies] from Layout 8 --- includes/bbcode.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'includes/bbcode.php') diff --git a/includes/bbcode.php b/includes/bbcode.php index a7bb247..b83e403 100755 --- a/includes/bbcode.php +++ b/includes/bbcode.php @@ -58,9 +58,10 @@ class BBCode $this->bbcodes['thumb'] = 'Image'; $this->bbcodes['thumb2'] = 'Image'; $this->bbcodes['thumb3'] = 'Image'; - $this->bbcodes['project'] = '{CONTENT}'; + $this->bbcodes['project'] = '{CONTENT}'; $this->bbcodes['hr'] = '
'; $this->bbcodes2['audio'] = '

Click to download: {CONTENT}

'; + $this->bbcodes['nosmilies'] = '{CONTENT}'; $this->init = true; } @@ -85,11 +86,16 @@ class BBCode $to_parse = substr_replace($to_parse, $otag, $bbpos, strlen($name) + 2); $to_parse = substr_replace($to_parse, $ctag, strpos(substr($to_parse, $bbpos), '[/' . $name . ']') + $bbpos, strlen($name) + 3); - if (strpos($this->bbcodes[$name], '
') !== -1)
+				if (strpos($this->bbcodes[$name], '
') !== FALSE)
 				{
 					$to_parse = substr_replace($to_parse, str_replace('[br]', '', substr($to_parse, strpos($to_parse, $otag) + strlen($otag), strpos($to_parse, $ctag) - (strpos($to_parse, $otag) + strlen($otag)))), strpos($to_parse, $otag) + strlen($otag), strpos($to_parse, $ctag) - (strpos($to_parse, $otag) + strlen($otag)));
 				}
 
+				if ($name == 'nosmilies')
+				{
+					$to_parse = preg_replace('/\[emoticon\](..)\[\/emoticon\]/', '\1', $to_parse);
+				}
+
 				$value = str_replace('{CONTENT}', '\1', $value);
 				$to_parse = preg_replace('/\[' . $name . ':' . $bbcode_uid . '\](.*)\[\/' . $name . ':' . $bbcode_uid . '\]/', $value, $to_parse);
 			}
-- 
cgit 1.4.1