Vergleich inc/class_parser.php - 1.8.7 - 1.8.8

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 87Zeile 87
	 * @var int
*/
public $list_count;

	 * @var int
*/
public $list_count;

 

/**
* Whether or not should a <br /> with clear: both be added at the end of the parsed message
*
* @access public
* @var boolean
*/
public $clear_needed = false;


/**
* Parses a message with the specified options.


/**
* Parses a message with the specified options.

Zeile 98Zeile 106
	function parse_message($message, $options=array())
{
global $plugins, $mybb;

	function parse_message($message, $options=array())
{
global $plugins, $mybb;






$this->clear_needed = false;


		// Set base URL for parsing smilies
$this->base_url = $mybb->settings['bburl'];


		// Set base URL for parsing smilies
$this->base_url = $mybb->settings['bburl'];


Zeile 107Zeile 117
			if(my_substr($this->base_url, my_strlen($this->base_url) -1) != "/")
{
$this->base_url = $this->base_url."/";

			if(my_substr($this->base_url, my_strlen($this->base_url) -1) != "/")
{
$this->base_url = $this->base_url."/";

			}
}

			}
}


// Set the options
$this->options = $options;


// Set the options
$this->options = $options;

Zeile 128Zeile 138
		if(!empty($this->options['filter_cdata']))
{
$message = $this->parse_cdata($message);

		if(!empty($this->options['filter_cdata']))
{
$message = $this->parse_cdata($message);

		}

		}


// If MyCode needs to be replaced, first filter out [code] and [php] tags.
if(!empty($this->options['allow_mycode']) && $mybb->settings['allowcodemycode'] == 1)


// If MyCode needs to be replaced, first filter out [code] and [php] tags.
if(!empty($this->options['allow_mycode']) && $mybb->settings['allowcodemycode'] == 1)

Zeile 161Zeile 171
		{
global $lang;


		{
global $lang;


			$message = preg_replace('#(>|^|\r|\n)/me ([^\r\n<]*)#i', "\\1<span style=\"color: red;\">* {$this->options['me_username']} \\2</span>", $message);
$message = preg_replace('#(>|^|\r|\n)/slap ([^\r\n<]*)#i', "\\1<span style=\"color: red;\">* {$this->options['me_username']} {$lang->slaps} \\2 {$lang->with_trout}</span>", $message);

			$message = preg_replace('#(>|^|\r|\n)/me ([^\r\n<]*)#i', "\\1<span style=\"color: red;\" class=\"mycode_me\">* {$this->options['me_username']} \\2</span>", $message);
$message = preg_replace('#(>|^|\r|\n)/slap ([^\r\n<]*)#i', "\\1<span style=\"color: red;\" class=\"mycode_slap\">* {$this->options['me_username']} {$lang->slaps} \\2 {$lang->with_trout}</span>", $message);

		}

// If we can, parse smilies
if(!empty($this->options['allow_smilies']))
{
$message = $this->parse_smilies($message, $this->options['allow_html']);

		}

// If we can, parse smilies
if(!empty($this->options['allow_smilies']))
{
$message = $this->parse_smilies($message, $this->options['allow_html']);

		}


		}


		// Replace MyCode if requested.
if(!empty($this->options['allow_mycode']))
{

		// Replace MyCode if requested.
if(!empty($this->options['allow_mycode']))
{

Zeile 210Zeile 220
		}

if(!isset($this->options['nl2br']) || $this->options['nl2br'] != 0)

		}

if(!isset($this->options['nl2br']) || $this->options['nl2br'] != 0)

		{

		{

			$message = nl2br($message);
// Fix up new lines and block level elements
$message = preg_replace("#(</?(?:html|head|body|div|p|form|table|thead|tbody|tfoot|tr|td|th|ul|ol|li|div|p|blockquote|cite|hr)[^>]*>)\s*<br />#i", "$1", $message);
$message = preg_replace("#(&nbsp;)+(</?(?:html|head|body|div|p|form|table|thead|tbody|tfoot|tr|td|th|ul|ol|li|div|p|blockquote|cite|hr)[^>]*>)#i", "$2", $message);

			$message = nl2br($message);
// Fix up new lines and block level elements
$message = preg_replace("#(</?(?:html|head|body|div|p|form|table|thead|tbody|tfoot|tr|td|th|ul|ol|li|div|p|blockquote|cite|hr)[^>]*>)\s*<br />#i", "$1", $message);
$message = preg_replace("#(&nbsp;)+(</?(?:html|head|body|div|p|form|table|thead|tbody|tfoot|tr|td|th|ul|ol|li|div|p|blockquote|cite|hr)[^>]*>)#i", "$2", $message);

 
		}

if($this->clear_needed)
{
$message .= '<br class="clear" />';

		}

$message = $plugins->run_hooks("parse_message_end", $message);

		}

$message = $plugins->run_hooks("parse_message_end", $message);

Zeile 250Zeile 265
		$standard_count = $callback_count = $nestable_count = 0;

if($mybb->settings['allowbasicmycode'] == 1)

		$standard_count = $callback_count = $nestable_count = 0;

if($mybb->settings['allowbasicmycode'] == 1)

		{

		{

			$standard_mycode['b']['regex'] = "#\[b\](.*?)\[/b\]#si";

			$standard_mycode['b']['regex'] = "#\[b\](.*?)\[/b\]#si";

			$standard_mycode['b']['replacement'] = "<span style=\"font-weight: bold;\">$1</span>";

			$standard_mycode['b']['replacement'] = "<span style=\"font-weight: bold;\" class=\"mycode_b\">$1</span>";


$standard_mycode['u']['regex'] = "#\[u\](.*?)\[/u\]#si";


$standard_mycode['u']['regex'] = "#\[u\](.*?)\[/u\]#si";

			$standard_mycode['u']['replacement'] = "<span style=\"text-decoration: underline;\">$1</span>";

			$standard_mycode['u']['replacement'] = "<span style=\"text-decoration: underline;\" class=\"mycode_u\">$1</span>";


$standard_mycode['i']['regex'] = "#\[i\](.*?)\[/i\]#si";


$standard_mycode['i']['regex'] = "#\[i\](.*?)\[/i\]#si";

			$standard_mycode['i']['replacement'] = "<span style=\"font-style: italic;\">$1</span>";

			$standard_mycode['i']['replacement'] = "<span style=\"font-style: italic;\" class=\"mycode_i\">$1</span>";


$standard_mycode['s']['regex'] = "#\[s\](.*?)\[/s\]#si";


$standard_mycode['s']['regex'] = "#\[s\](.*?)\[/s\]#si";

			$standard_mycode['s']['replacement'] = "<del>$1</del>";

			$standard_mycode['s']['replacement'] = "<span style=\"text-decoration: line-through;\" class=\"mycode_s\">$1</span>";


$standard_mycode['hr']['regex'] = "#\[hr\]#si";


$standard_mycode['hr']['regex'] = "#\[hr\]#si";

			$standard_mycode['hr']['replacement'] = "<hr />";

			$standard_mycode['hr']['replacement'] = "<hr class=\"mycode_hr\" />";


++$standard_count;
}


++$standard_count;
}

Zeile 312Zeile 327
		}

if($mybb->settings['allowcolormycode'] == 1)

		}

if($mybb->settings['allowcolormycode'] == 1)

		{
$nestable_mycode['color']['regex'] = "#\[color=([a-zA-Z]*|\#?[\da-fA-F]{3}|\#?[\da-fA-F]{6})](.*?)\[/color\]#si";
$nestable_mycode['color']['replacement'] = "<span style=\"color: $1;\">$2</span>";

++$nestable_count;

		{
$nestable_mycode['color']['regex'] = "#\[color=([a-zA-Z]*|\#?[\da-fA-F]{3}|\#?[\da-fA-F]{6})](.*?)\[/color\]#si";
$nestable_mycode['color']['replacement'] = "<span style=\"color: $1;\" class=\"mycode_color\">$2</span>";

++$nestable_count;

		}

if($mybb->settings['allowsizemycode'] == 1)
{
$nestable_mycode['size']['regex'] = "#\[size=(xx-small|x-small|small|medium|large|x-large|xx-large)\](.*?)\[/size\]#si";

		}

if($mybb->settings['allowsizemycode'] == 1)
{
$nestable_mycode['size']['regex'] = "#\[size=(xx-small|x-small|small|medium|large|x-large|xx-large)\](.*?)\[/size\]#si";

			$nestable_mycode['size']['replacement'] = "<span style=\"font-size: $1;\">$2</span>";

			$nestable_mycode['size']['replacement'] = "<span style=\"font-size: $1;\" class=\"mycode_size\">$2</span>";


$callback_mycode['size_int']['regex'] = "#\[size=([0-9\+\-]+?)\](.*?)\[/size\]#si";
$callback_mycode['size_int']['replacement'] = array($this, 'mycode_handle_size_callback');


$callback_mycode['size_int']['regex'] = "#\[size=([0-9\+\-]+?)\](.*?)\[/size\]#si";
$callback_mycode['size_int']['replacement'] = array($this, 'mycode_handle_size_callback');

Zeile 334Zeile 349
		if($mybb->settings['allowfontmycode'] == 1)
{
$nestable_mycode['font']['regex'] = "#\[font=([a-z0-9 ,\-_'\"]+)\](.*?)\[/font\]#si";

		if($mybb->settings['allowfontmycode'] == 1)
{
$nestable_mycode['font']['regex'] = "#\[font=([a-z0-9 ,\-_'\"]+)\](.*?)\[/font\]#si";

			$nestable_mycode['font']['replacement'] = "<span style=\"font-family: $1;\">$2</span>";

++$nestable_count;
}


			$nestable_mycode['font']['replacement'] = "<span style=\"font-family: $1;\" class=\"mycode_font\">$2</span>";

++$nestable_count;
}


		if($mybb->settings['allowalignmycode'] == 1)
{
$nestable_mycode['align']['regex'] = "#\[align=(left|center|right|justify)\](.*?)\[/align\]#si";

		if($mybb->settings['allowalignmycode'] == 1)
{
$nestable_mycode['align']['regex'] = "#\[align=(left|center|right|justify)\](.*?)\[/align\]#si";

			$nestable_mycode['align']['replacement'] = "<div style=\"text-align: $1;\">$2</div>";

			$nestable_mycode['align']['replacement'] = "<div style=\"text-align: $1;\" class=\"mycode_align\">$2</div>";


++$nestable_count;
}


++$nestable_count;
}

Zeile 418Zeile 433
		$message = $this->mycode_auto_url($message);

$message = str_replace('$', '&#36;', $message);

		$message = $this->mycode_auto_url($message);

$message = str_replace('$', '&#36;', $message);





		// Replace the rest
if($this->mycode_cache['standard_count'] > 0)
{

		// Replace the rest
if($this->mycode_cache['standard_count'] > 0)
{

Zeile 466Zeile 481
		if(!empty($this->options['allow_imgcode']))
{
$message = preg_replace_callback("#\[img\](\r\n?|\n?)(https?://([^<>\"']+?))\[/img\]#is", array($this, 'mycode_parse_img_callback1'), $message);

		if(!empty($this->options['allow_imgcode']))
{
$message = preg_replace_callback("#\[img\](\r\n?|\n?)(https?://([^<>\"']+?))\[/img\]#is", array($this, 'mycode_parse_img_callback1'), $message);

			$message = preg_replace_callback("#\[img=([0-9]{1,3})x([0-9]{1,3})\](\r\n?|\n?)(https?://([^<>\"']+?))\[/img\]#is", array($this, 'mycode_parse_img_callback2'), $message);
$message = preg_replace_callback("#\[img align=([a-z]+)\](\r\n?|\n?)(https?://([^<>\"']+?))\[/img\]#is", array($this, 'mycode_parse_img_callback3'), $message);
$message = preg_replace_callback("#\[img=([0-9]{1,3})x([0-9]{1,3}) align=([a-z]+)\](\r\n?|\n?)(https?://([^<>\"']+?))\[/img\]#is", array($this, 'mycode_parse_img_callback4'), $message);

			$message = preg_replace_callback("#\[img=([1-9][0-9]*)x([1-9][0-9]*)\](\r\n?|\n?)(https?://([^<>\"']+?))\[/img\]#is", array($this, 'mycode_parse_img_callback2'), $message);
$message = preg_replace_callback("#\[img align=(left|right)\](\r\n?|\n?)(https?://([^<>\"']+?))\[/img\]#is", array($this, 'mycode_parse_img_callback3'), $message);
$message = preg_replace_callback("#\[img=([1-9][0-9]*)x([1-9][0-9]*) align=(left|right)\](\r\n?|\n?)(https?://([^<>\"']+?))\[/img\]#is", array($this, 'mycode_parse_img_callback4'), $message);

		}
else
{
$message = preg_replace_callback("#\[img\](\r\n?|\n?)(https?://([^<>\"']+?))\[/img\]#is", array($this, 'mycode_parse_img_disabled_callback1'), $message);

		}
else
{
$message = preg_replace_callback("#\[img\](\r\n?|\n?)(https?://([^<>\"']+?))\[/img\]#is", array($this, 'mycode_parse_img_disabled_callback1'), $message);

			$message = preg_replace_callback("#\[img=([0-9]{1,3})x([0-9]{1,3})\](\r\n?|\n?)(https?://([^<>\"']+?))\[/img\]#is", array($this, 'mycode_parse_img_disabled_callback2'), $message);
$message = preg_replace_callback("#\[img align=([a-z]+)\](\r\n?|\n?)(https?://([^<>\"']+?))\[/img\]#is", array($this, 'mycode_parse_img_disabled_callback3'), $message);
$message = preg_replace_callback("#\[img=([0-9]{1,3})x([0-9]{1,3}) align=([a-z]+)\](\r\n?|\n?)(https?://([^<>\"']+?))\[/img\]#is", array($this, 'mycode_parse_img_disabled_callback4'), $message);

			$message = preg_replace_callback("#\[img=([1-9][0-9]*)x([1-9][0-9]*)\](\r\n?|\n?)(https?://([^<>\"']+?))\[/img\]#is", array($this, 'mycode_parse_img_disabled_callback2'), $message);
$message = preg_replace_callback("#\[img align=(left|right)\](\r\n?|\n?)(https?://([^<>\"']+?))\[/img\]#is", array($this, 'mycode_parse_img_disabled_callback3'), $message);
$message = preg_replace_callback("#\[img=([1-9][0-9]*)x([1-9][0-9]*) align=(left|right)\](\r\n?|\n?)(https?://([^<>\"']+?))\[/img\]#is", array($this, 'mycode_parse_img_disabled_callback4'), $message);

		}

// Convert videos when allow.

		}

// Convert videos when allow.

Zeile 649Zeile 664
	}

/**

	}

/**

 	 * Attempts to move any javascript references in the specified message.

	 * Attempts to move any javascript references in the specified message.

	 *
* @param string The message to be parsed.
* @return string The parsed message.

	 *
* @param string The message to be parsed.
* @return string The parsed message.

Zeile 676Zeile 691
	*/
function mycode_handle_size($size, $text)
{

	*/
function mycode_handle_size($size, $text)
{

		$size = (int)$size+10;








		global $templates;

$size = (int)$size;

if($size < 1)
{
$size = 1;
}


if($size > 50)
{
$size = 50;
}



if($size > 50)
{
$size = 50;
}


		$text = "<span style=\"font-size: {$size}pt;\">".str_replace("\'", "'", $text)."</span>";

		$text = str_replace("\'", "'", $text);





		return $text;


		eval("\$mycode_size = \"".$templates->get("mycode_size_int", 1, 0)."\";");
return $mycode_size;

	}

/**

	}

/**

Zeile 716Zeile 739

if($text_only == false)
{


if($text_only == false)
{

			$replace = "<blockquote><cite>$lang->quote</cite>$1</blockquote>\n";

			$replace = "<blockquote class=\"mycode_quote\"><cite>$lang->quote</cite>$1</blockquote>\n";

			$replace_callback = array($this, 'mycode_parse_post_quotes_callback1');
}
else

			$replace_callback = array($this, 'mycode_parse_post_quotes_callback1');
}
else

Zeile 814Zeile 837
		{
$username = my_substr($username, 0, my_strlen($username)-1);
}

		{
$username = my_substr($username, 0, my_strlen($username)-1);
}

		



		if(!empty($this->options['allow_html']))

		if(!empty($this->options['allow_html']))

		{

		{

			$username = htmlspecialchars_uni($username);

			$username = htmlspecialchars_uni($username);

		}

		}


if($text_only)


if($text_only)

		{

		{

			return "\n{$username} {$lang->wrote}{$date}\n--\n{$message}\n--\n";
}
else

			return "\n{$username} {$lang->wrote}{$date}\n--\n{$message}\n--\n";
}
else

		{

		{

			$span = "";
if(!$delete_quote)
{
$span = "<span>{$date}</span>";
}

			$span = "";
if(!$delete_quote)
{
$span = "<span>{$date}</span>";
}


return "<blockquote><cite>{$span}{$username} {$lang->wrote}{$linkback}</cite>{$message}</blockquote>\n";
}
}

/**
* Parses quotes with post id and/or dateline.
*



eval("\$mycode_quote = \"".$templates->get("mycode_quote_post", 1, 0)."\";");
return $mycode_quote;
}
}

/**
* Parses quotes with post id and/or dateline.
*

	* @param array $matches Matches.
* @return string The parsed message.
*/

	* @param array $matches Matches.
* @return string The parsed message.
*/

Zeile 849Zeile 873

/**
* Parses quotes with post id and/or dateline.


/**
* Parses quotes with post id and/or dateline.

	*

	*

	* @param array $matches Matches.
* @return string The parsed message.
*/

	* @param array $matches Matches.
* @return string The parsed message.
*/

Zeile 867Zeile 891
	*/
function mycode_parse_code($code, $text_only=false)
{

	*/
function mycode_parse_code($code, $text_only=false)
{

		global $lang;

		global $lang, $templates;


if($text_only == true)
{


if($text_only == true)
{

Zeile 890Zeile 914
		$code = str_replace("\t", '&nbsp;&nbsp;&nbsp;&nbsp;', $code);
$code = str_replace(" ", '&nbsp;&nbsp;', $code);


		$code = str_replace("\t", '&nbsp;&nbsp;&nbsp;&nbsp;', $code);
$code = str_replace(" ", '&nbsp;&nbsp;', $code);


		return "<div class=\"codeblock\">\n<div class=\"title\">".$lang->code."\n</div><div class=\"body\" dir=\"ltr\"><code>".$code."</code></div></div>\n";


		eval("\$mycode_code = \"".$templates->get("mycode_code", 1, 0)."\";");
return $mycode_code;

	}

/**

	}

/**

Zeile 910Zeile 935
	* @param string $str The message to be parsed
* @param boolean $bare_return Whether or not it should return it as pre-wrapped in a div or not.
* @param boolean $text_only Are we formatting as text?

	* @param string $str The message to be parsed
* @param boolean $bare_return Whether or not it should return it as pre-wrapped in a div or not.
* @param boolean $text_only Are we formatting as text?

	* @return string The parsed message.

	* @return string The parsed message.

	*/
function mycode_parse_php($str, $bare_return = false, $text_only = false)
{

	*/
function mycode_parse_php($str, $bare_return = false, $text_only = false)
{

		global $lang;


		global $lang, $templates;


		if($text_only == true)
{
return "\n{$lang->php_code}\n--\n$str\n--\n";

		if($text_only == true)
{
return "\n{$lang->php_code}\n--\n$str\n--\n";

		}


		}


		// Clean the string before parsing except tab spaces.
$str = preg_replace('#^(\t*)(\n|\r|\0|\x0B| )*#', '\\1', $str);
$str = rtrim($str);

		// Clean the string before parsing except tab spaces.
$str = preg_replace('#^(\t*)(\n|\r|\0|\x0B| )*#', '\\1', $str);
$str = rtrim($str);

Zeile 930Zeile 955
		if(empty($original))
{
return;

		if(empty($original))
{
return;

		}

		}


// See if open and close tags are provided.
$added_open_tag = false;


// See if open and close tags are provided.
$added_open_tag = false;

Zeile 980Zeile 1005
		}

// Send back the code all nice and pretty

		}

// Send back the code all nice and pretty

		return "<div class=\"codeblock phpcodeblock\"><div class=\"title\">$lang->php_code\n</div><div class=\"body\">".$code."</div></div>\n";


		eval("\$mycode_php = \"".$templates->get("mycode_php", 1, 0)."\";");
return $mycode_php;

	}

/**

	}

/**

Zeile 1003Zeile 1029
	*/
function mycode_parse_url($url, $name="")
{

	*/
function mycode_parse_url($url, $name="")
{

 
		global $templates;

		if(!preg_match("#^[a-z0-9]+://#i", $url))
{
$url = "http://".$url;

		if(!preg_match("#^[a-z0-9]+://#i", $url))
{
$url = "http://".$url;

Zeile 1030Zeile 1057

$nofollow = '';
if(!empty($this->options['nofollow_on']))


$nofollow = '';
if(!empty($this->options['nofollow_on']))

		{

		{

			$nofollow = " rel=\"nofollow\"";
}

			$nofollow = " rel=\"nofollow\"";
}





		// Fix some entities in URLs
$entities = array('$' => '%24', '&#36;' => '%24', '^' => '%5E', '`' => '%60', '[' => '%5B', ']' => '%5D', '{' => '%7B', '}' => '%7D', '"' => '%22', '<' => '%3C', '>' => '%3E', ' ' => '%20');
$url = str_replace(array_keys($entities), array_values($entities), $url);

		// Fix some entities in URLs
$entities = array('$' => '%24', '&#36;' => '%24', '^' => '%5E', '`' => '%60', '[' => '%5B', ']' => '%5D', '{' => '%7B', '}' => '%7D', '"' => '%22', '<' => '%3C', '>' => '%3E', ' ' => '%20');
$url = str_replace(array_keys($entities), array_values($entities), $url);





		$name = preg_replace("#&amp;\#([0-9]+);#si", "&#$1;", $name); // Fix & but allow unicode

		$name = preg_replace("#&amp;\#([0-9]+);#si", "&#$1;", $name); // Fix & but allow unicode

		$link = "<a href=\"$url\" target=\"_blank\"{$nofollow}>$name</a>";
return $link;



eval("\$mycode_url = \"".$templates->get("mycode_url", 1, 0)."\";");
return $mycode_url;

	}

/**

	}

/**

Zeile 1071Zeile 1099
			$matches[2] = '';
}
return $this->mycode_parse_url($matches[1], $matches[2]);

			$matches[2] = '';
}
return $this->mycode_parse_url($matches[1], $matches[2]);

	}

/**

	}

/**

	 * Parses IMG MyCode.
*
* @param string $url The URL to the image

	 * Parses IMG MyCode.
*
* @param string $url The URL to the image

Zeile 1083Zeile 1111
	 */
function mycode_parse_img($url, $dimensions=array(), $align='')
{

	 */
function mycode_parse_img($url, $dimensions=array(), $align='')
{

		global $lang;

		global $lang, $templates;

		$url = trim($url);
$url = str_replace("\n", "", $url);
$url = str_replace("\r", "", $url);

		$url = trim($url);
$url = str_replace("\n", "", $url);
$url = str_replace("\r", "", $url);

Zeile 1096Zeile 1124
		$css_align = '';
if($align == "right")
{

		$css_align = '';
if($align == "right")
{

			$css_align = " style=\"float: right;\"";

			$css_align = ' style="float: right;"';

		}
else if($align == "left")
{

		}
else if($align == "left")
{

			$css_align = " style=\"float: left;\"";

			$css_align = ' style="float: left;"';

		}

		}

		$alt = basename($url);

 




 
		if($align)
{
$this->clear_needed = true;
}

$alt = basename($url);

		$alt = htmlspecialchars_decode($alt);
if(my_strlen($alt) > 55)
{
$alt = my_substr($alt, 0, 40).'...'.my_substr($alt, -10);

		$alt = htmlspecialchars_decode($alt);
if(my_strlen($alt) > 55)
{
$alt = my_substr($alt, 0, 40).'...'.my_substr($alt, -10);

		}

		}

		$alt = htmlspecialchars_uni($alt);

$alt = $lang->sprintf($lang->posted_image, $alt);

		$alt = htmlspecialchars_uni($alt);

$alt = $lang->sprintf($lang->posted_image, $alt);

 
		$width = $height = '';

		if(isset($dimensions[0]) && $dimensions[0] > 0 && isset($dimensions[1]) && $dimensions[1] > 0)
{

		if(isset($dimensions[0]) && $dimensions[0] > 0 && isset($dimensions[1]) && $dimensions[1] > 0)
{

			return "<img src=\"{$url}\" width=\"{$dimensions[0]}\" height=\"{$dimensions[1]}\" border=\"0\" alt=\"{$alt}\"{$css_align} />";


			$width = " width=\"{$dimensions[0]}\"";
$height = " height=\"{$dimensions[1]}\"";

		}

		}

		else
{
return "<img src=\"{$url}\" border=\"0\" alt=\"{$alt}\"{$css_align} />";
}
}

 




	/**
* Parses IMG MyCode.
*
* @param array $matches Matches.
* @return string Image code.
*/
function mycode_parse_img_callback1($matches)
{
return $this->mycode_parse_img($matches[2]);





		eval("\$mycode_img = \"".$templates->get("mycode_img", 1, 0)."\";");
return $mycode_img;
}

/**
* Parses IMG MyCode.
*
* @param array $matches Matches.
* @return string Image code.
*/
function mycode_parse_img_callback1($matches)
{
return $this->mycode_parse_img($matches[2]);

	}

/**

	}

/**

Zeile 1140Zeile 1174
	 * @return string Image code.
*/
function mycode_parse_img_callback2($matches)

	 * @return string Image code.
*/
function mycode_parse_img_callback2($matches)

	{

	{

		return $this->mycode_parse_img($matches[4], array($matches[1], $matches[2]));

		return $this->mycode_parse_img($matches[4], array($matches[1], $matches[2]));

	}

/**
* Parses IMG MyCode.

	}

/**
* Parses IMG MyCode.

	 *
* @param array $matches Matches.
* @return string Image code.

	 *
* @param array $matches Matches.
* @return string Image code.

Zeile 1157Zeile 1191

/**
* Parses IMG MyCode.


/**
* Parses IMG MyCode.

	 *

	 *

	 * @param array $matches Matches.
* @return string Image code.
*/

	 * @param array $matches Matches.
* @return string Image code.
*/

Zeile 1193Zeile 1227
	function mycode_parse_img_disabled_callback1($matches)
{
return $this->mycode_parse_img_disabled($matches[2]);

	function mycode_parse_img_disabled_callback1($matches)
{
return $this->mycode_parse_img_disabled($matches[2]);

	}

/**
* Parses IMG MyCode disabled.
*
* @param array $matches Matches.
* @return string Image code.
*/

	}

/**
* Parses IMG MyCode disabled.
*
* @param array $matches Matches.
* @return string Image code.
*/

	function mycode_parse_img_disabled_callback2($matches)

	function mycode_parse_img_disabled_callback2($matches)

	{

	{

		return $this->mycode_parse_img_disabled($matches[4]);
}


		return $this->mycode_parse_img_disabled($matches[4]);
}


Zeile 1215Zeile 1249
	function mycode_parse_img_disabled_callback3($matches)
{
return $this->mycode_parse_img_disabled($matches[3]);

	function mycode_parse_img_disabled_callback3($matches)
{
return $this->mycode_parse_img_disabled($matches[3]);

	}

/**

	}

/**

	 * Parses IMG MyCode disabled.
*
* @param array $matches Matches.

	 * Parses IMG MyCode disabled.
*
* @param array $matches Matches.

Zeile 1236Zeile 1270
	* @return string The built-up email link.
*/
function mycode_parse_email($email, $name="")

	* @return string The built-up email link.
*/
function mycode_parse_email($email, $name="")

	{



	{
global $templates;


		if(!$name)

		if(!$name)

		{

		{

			$name = $email;

			$name = $email;

		}

		}

		if(preg_match("/^([a-zA-Z0-9-_\+\.]+?)@[a-zA-Z0-9-]+\.[a-zA-Z0-9\.-]+$/si", $email))

		if(preg_match("/^([a-zA-Z0-9-_\+\.]+?)@[a-zA-Z0-9-]+\.[a-zA-Z0-9\.-]+$/si", $email))

		{
return "<a href=\"mailto:$email\">".$name."</a>";
}

		{
$email = $email;
}

		elseif(preg_match("/^([a-zA-Z0-9-_\+\.]+?)@[a-zA-Z0-9-]+\.[a-zA-Z0-9\.-]+\?(.*?)$/si", $email))
{

		elseif(preg_match("/^([a-zA-Z0-9-_\+\.]+?)@[a-zA-Z0-9-]+\.[a-zA-Z0-9\.-]+\?(.*?)$/si", $email))
{

			return "<a href=\"mailto:".htmlspecialchars_uni($email)."\">".$name."</a>";
}
else
{
return $email;

			$email = htmlspecialchars_uni($email);





		}

		}

 

eval("\$mycode_email = \"".$templates->get("mycode_email", 1, 0)."\";");
return $mycode_email;

	}

/**

	}

/**

Zeile 1296Zeile 1331
		if($parsed_url['fragment'])
{
$fragments = explode("&", $parsed_url['fragment']);

		if($parsed_url['fragment'])
{
$fragments = explode("&", $parsed_url['fragment']);

		}

$queries = explode("&", $parsed_url['query']);


		}

$queries = explode("&", $parsed_url['query']);


		$input = array();
foreach($queries as $query)
{

		$input = array();
foreach($queries as $query)
{

Zeile 1398Zeile 1433
		$id = htmlspecialchars_uni($id);

eval("\$video_code = \"".$templates->get("video_{$video}_embed")."\";");

		$id = htmlspecialchars_uni($id);

eval("\$video_code = \"".$templates->get("video_{$video}_embed")."\";");



 
		return $video_code;
}


		return $video_code;
}


Zeile 1520Zeile 1554

if($type)
{


if($type)
{

			$list = "\n<ol type=\"$type\">$message</ol>\n";

			$list = "\n<ol type=\"$type\" class=\"mycode_list\">$message</ol>\n";

		}
else
{

		}
else
{

			$list = "<ul>$message</ul>\n";

			$list = "<ul class=\"mycode_list\">$message</ul>\n";

		}
$list = preg_replace("#<(ol type=\"$type\"|ul)>\s*</li>#", "<$1>", $list);
return $list;

		}
$list = preg_replace("#<(ol type=\"$type\"|ul)>\s*</li>#", "<$1>", $list);
return $list;

Zeile 1649Zeile 1683

$find = array(
"#\[(b|u|i|s|url|email|color|img)\](.*?)\[/\\1\]#is",


$find = array(
"#\[(b|u|i|s|url|email|color|img)\](.*?)\[/\\1\]#is",

			"#\[img=([0-9]{1,3})x([0-9]{1,3})\](\r\n?|\n?)(https?://([^<>\"']+?))\[/img\]#is",

			"#\[img=([1-9][0-9]*)x([1-9][0-9]*)\](\r\n?|\n?)(https?://([^<>\"']+?))\[/img\]#is",

			"#\[url=([a-z]+?://)([^\r\n\"<]+?)\](.+?)\[/url\]#si",
"#\[url=([^\r\n\"<&\(\)]+?)\](.+?)\[/url\]#si",
);

			"#\[url=([a-z]+?://)([^\r\n\"<]+?)\](.+?)\[/url\]#si",
"#\[url=([^\r\n\"<&\(\)]+?)\](.+?)\[/url\]#si",
);