Vergleich inc/functions_post.php - 1.03 - 1.17

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 97Zeile 97
		$message = preg_replace("#\[list=(a|A|i|I|1)\](.*?)\[/list\]#esi", "dolist('$2', '$1')", $message);
}


		$message = preg_replace("#\[list=(a|A|i|I|1)\](.*?)\[/list\]#esi", "dolist('$2', '$1')", $message);
}


	if($allowimgcode)

	if($allowimgcode != "no")

	{

	{

		$message = preg_replace("#\[img\]([a-z]+?://){1}(.+?)\[/img\]#i", "<img src=\"$1$2\" border=\"0\" alt=\"\" />", $message);
$message = preg_replace("#\[img=([0-9]{1,3})x([0-9]{1,3})\]([a-z]+?://){1}(.+?)\[/img\]#i", "<img src=\"$3$4\" style=\"border: 0; width: $1; height: $2;\" alt=\"\" />", $message);

		$message = preg_replace("#\[img\](https?://([^<>\"']+?))\[/img\]#i", "<img src=\"$1\" border=\"0\" alt=\"\" />", $message);
$message = preg_replace("#\[img=([0-9]{1,3})x([0-9]{1,3})\](https?://([^<>\"']+?))\[/img\]#i", "<img src=\"$3\" style=\"border: 0; width: $1px; height: $2px;\" alt=\"\" />", $message);

	}
$message = doautourl($message);
/* Used to be <hr size="1"> but users should get the chance to set the size in their CSS */

	}
$message = doautourl($message);
/* Used to be <hr size="1"> but users should get the chance to set the size in their CSS */

Zeile 130Zeile 130
{
global $lang;
$message = preg_replace('#^/me (.*)$#im', "<span style=\"color: red;\">* $username \\1</span>", $message);

{
global $lang;
$message = preg_replace('#^/me (.*)$#im', "<span style=\"color: red;\">* $username \\1</span>", $message);

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

	$message = preg_replace('#^/slap (.*)#iem', "'<span style=\"color: red;\">* $username $lang->slaps '.str_replace('<br />', '', '\\1').' $lang->with_trout</span><br />'", $message);
return $message;
}

	$message = preg_replace('#^/slap (.*)#iem', "'<span style=\"color: red;\">* $username $lang->slaps '.str_replace('<br />', '', '\\1').' $lang->with_trout</span><br />'", $message);
return $message;
}

Zeile 186Zeile 187
		reset($smiliecache);
foreach($smiliecache as $sid => $smilie)
{

		reset($smiliecache);
foreach($smiliecache as $sid => $smilie)
{

			$message = str_replace($smilie['find'], "<img src=\"".$url.$smilie['image']."\" align=\"middle\" border=\"0\" alt=\"".$smilie['name']."\" />", $message);

			$message = str_replace($smilie['find'], "<img src=\"".$url.$smilie['image']."\" style=\"vertical-align: middle;\" border=\"0\" alt=\"".$smilie['name']."\" />", $message);

		}
}
return $message;

		}
}
return $message;

Zeile 203Zeile 204

function doshorturl($url, $name="")
{


function doshorturl($url, $name="")
{

 
	// attempt to make a bit of sense out of their url if they dont type it properly
if(!preg_match("#[a-z0-9]+://#i", $url))
{
$url = "http://".$url;
}

	$fullurl = $url;

	$fullurl = $url;

	// attempt to make a bit of sense out of their url if they dont type it properly
if(strpos($url, "www.") === 0)
{
$fullurl = "http://".$fullurl;
}
if(strpos($url, "ftp.") === 0)
{
$fullurl = "ftp://".$fullurl;
}
if(strpos($fullurl, "://") === false)
{
$fullurl = "http://".$fullurl;
}

 
	if(!$name)

	if(!$name)

	{

	{

		$name = $url;
}
$name = stripslashes($name);
$url = stripslashes($url);
$fullurl = stripslashes($fullurl);
if($name == $url)

		$name = $url;
}
$name = stripslashes($name);
$url = stripslashes($url);
$fullurl = stripslashes($fullurl);
if($name == $url)

	{

	{

		if(strlen($url) > 55)
{
$name = substr($url, 0, 40)."...".substr($url, -10);

		if(strlen($url) > 55)
{
$name = substr($url, 0, 40)."...".substr($url, -10);

Zeile 240Zeile 233
	{
$name = $email;
}

	{
$name = $email;
}

	if(preg_match("/^(.+)@[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>";

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

 
	}
else
{
return $name;

	}
}


	}
}






function doquotes($message)
{
global $lang;

function doquotes($message)
{
global $lang;

Zeile 259Zeile 256
					 "<div class=\"quote_header\">$lang->quote</div><div class=\"quote_body\">$1</div>\n");

while (preg_match($pattern[0], $message) or preg_match($pattern[1], $message))

					 "<div class=\"quote_header\">$lang->quote</div><div class=\"quote_body\">$1</div>\n");

while (preg_match($pattern[0], $message) or preg_match($pattern[1], $message))

	{

	{

		$message = preg_replace($pattern, $replace, $message);
}
$message = str_replace("<div class=\"quote_body\"><br />", "<div class=\"quote_body\">", $message);
$message = str_replace("<br /></div>", "</div>", $message);

		$message = preg_replace($pattern, $replace, $message);
}
$message = str_replace("<div class=\"quote_body\"><br />", "<div class=\"quote_body\">", $message);
$message = str_replace("<br /></div>", "</div>", $message);

 
	// Remove [attachment=x] from quoted posts.
//$message = preg_replace("#\[attachment=([0-9]+?)\]#i", "", $message);

	return $message;
}


	return $message;
}


Zeile 291Zeile 290
	}
$pattern = array("#\[code\](.*?)#si",
"#\[\/code\]#si");

	}
$pattern = array("#\[code\](.*?)#si",
"#\[\/code\]#si");





	$replace = array("<div class=\"code_header\">$lang->code</div><div class=\"code_body\">",
"</div>\n");


	$replace = array("<div class=\"code_header\">$lang->code</div><div class=\"code_body\">",
"</div>\n");


Zeile 324Zeile 323
	if(preg_match("/\A[\s]*\>\?/", strrev($str)) === 0)
{
$str = $str."\n?>";

	if(preg_match("/\A[\s]*\>\?/", strrev($str)) === 0)
{
$str = $str."\n?>";

	}

	}

	
if(substr(phpversion(), 0, 1) >= 4)
{

	
if(substr(phpversion(), 0, 1) >= 4)
{

Zeile 332Zeile 331
		@highlight_string($str);
$code = ob_get_contents();
ob_end_clean();

		@highlight_string($str);
$code = ob_get_contents();
ob_end_clean();

	}

	}

	else
{
$code = $str;
}

if(preg_match("/\A[\s]*\<\?/", $original) === 0)

	else
{
$code = $str;
}

if(preg_match("/\A[\s]*\<\?/", $original) === 0)

	{
$code = substr_replace($code, "", strpos($code, "&lt;?php"), strlen("&lt;?php"));
$code = strrev(substr_replace(strrev($code), "", strpos(strrev($code), strrev("?&gt;")), strlen("?&gt;")));
$code = str_replace('<br />', '', $code);
}





    {
$code = substr_replace($code, "", strpos($code, "&lt;?php"), strlen("&lt;?php"));
$code = str_replace('<br />', '', $code);
}

if(preg_match("/\A[\s]*\>\?/", strrev($original)) === 0)
{
$code = strrev(substr_replace(strrev($code), "", strpos(strrev($code), strrev("?&gt;")), strlen("?&gt;")));
}

	
// Get rid of other useless code and linebreaks
$code = str_replace("<code><font color=\"#000000\">\n", '', $code);

	
// Get rid of other useless code and linebreaks
$code = str_replace("<code><font color=\"#000000\">\n", '', $code);

Zeile 351Zeile 354
	$code = str_replace("</font>\n</code>", '', $code);

// Send back the code all nice and pretty

	$code = str_replace("</font>\n</code>", '', $code);

// Send back the code all nice and pretty

	return "</p><div class=\"code_header\">$lang->php_code</div><div class=\"code_body\">".$code."</div><p>";

	return "<p><div class=\"code_header\">$lang->php_code</div><div class=\"code_body\">".$code."</div></p>";

}

function makepostbit($post, $pmprevann=0)

}

function makepostbit($post, $pmprevann=0)