Vergleich inc/functions.php - 1.6.12 - 1.6.16

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 21Zeile 21

$contents = parse_page($contents);
$totaltime = $maintimer->stop();


$contents = parse_page($contents);
$totaltime = $maintimer->stop();

 
	$contents = $plugins->run_hooks("pre_output_page", $contents);


if($mybb->usergroup['cancp'] == 1)
{


if($mybb->usergroup['cancp'] == 1)
{

Zeile 83Zeile 84
			$other = "PHP version: $phpversion / Server Load: $serverload / GZip Compression: $gzipen";
$debugstuff = "Generated in $totaltime seconds ($percentphp% PHP / $percentsql% ".$database_server.")<br />SQL Queries: $db->query_count / Global Parsing Time: $globaltime$memory_usage<br />$other<br />[<a href=\"$debuglink\" target=\"_blank\">advanced details</a>]<br />";
$contents = str_replace("<debugstuff>", $debugstuff, $contents);

			$other = "PHP version: $phpversion / Server Load: $serverload / GZip Compression: $gzipen";
$debugstuff = "Generated in $totaltime seconds ($percentphp% PHP / $percentsql% ".$database_server.")<br />SQL Queries: $db->query_count / Global Parsing Time: $globaltime$memory_usage<br />$other<br />[<a href=\"$debuglink\" target=\"_blank\">advanced details</a>]<br />";
$contents = str_replace("<debugstuff>", $debugstuff, $contents);

		}

		}


if($mybb->debug_mode == true)
{


if($mybb->debug_mode == true)
{

Zeile 92Zeile 93
	}

$contents = str_replace("<debugstuff>", "", $contents);

	}

$contents = str_replace("<debugstuff>", "", $contents);

	$contents = $plugins->run_hooks("pre_output_page", $contents);

 

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


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

Zeile 743Zeile 743
		"location2" => 0
);


		"location2" => 0
);


	$db->update_query("sessions", $noperm_array, "sid='{$session->sid}'", 1);

	$db->update_query("sessions", $noperm_array, "sid='{$session->sid}'");


if($mybb->input['ajax'])
{


if($mybb->input['ajax'])
{

Zeile 1466Zeile 1466

$mod_cache = $cache->read("moderators");



$mod_cache = $cache->read("moderators");


	foreach($mod_cache as $fid => $forum)

	foreach($mod_cache as $forumid => $forum)

	{

	{

		if(!is_array($forum) || !in_array($fid, $parentslist))

		if(!is_array($forum) || !in_array($forumid, $parentslist))

		{
// No perms or we're not after this forum
continue;

		{
// No perms or we're not after this forum
continue;

Zeile 1549Zeile 1549
	$user_perms = user_permissions($uid);
if($user_perms['issupermod'] == 1)
{

	$user_perms = user_permissions($uid);
if($user_perms['issupermod'] == 1)
{

 
		if($fid)
{
$forumpermissions = forum_permissions($fid);
if($forumpermissions['canview'] && $forumpermissions['canviewthreads'] && !$forumpermissions['canonlyviewownthreads'])
{
return true;
}
return false;
}

		return true;
}
else

		return true;
}
else

Zeile 1561Zeile 1570
				foreach($modcache as $modusers)
{
if(isset($modusers['users'][$uid]) && $modusers['users'][$uid]['mid'])

				foreach($modcache as $modusers)
{
if(isset($modusers['users'][$uid]) && $modusers['users'][$uid]['mid'])

					{

					{

						return true;
}
elseif(isset($modusers['usergroups'][$user_perms['gid']]))
{
// Moderating usergroup
return true;

						return true;
}
elseif(isset($modusers['usergroups'][$user_perms['gid']]))
{
// Moderating usergroup
return true;

					}
}
}

					}
}
}

			return false;
}
else
{
$modperms = get_moderator_permissions($fid, $uid);

			return false;
}
else
{
$modperms = get_moderator_permissions($fid, $uid);





			if(!$action && $modperms)
{
return true;

			if(!$action && $modperms)
{
return true;

Zeile 1592Zeile 1601
					return false;
}
}

					return false;
}
}

		}
}
}


		}
}
}


/**
* Generate a list of the posticons.
*

/**
* Generate a list of the posticons.
*

Zeile 1648Zeile 1657
	eval("\$posticons = \"".$templates->get("posticons")."\";");

return $posticons;

	eval("\$posticons = \"".$templates->get("posticons")."\";");

return $posticons;

}


}


/**
* MyBB setcookie() wrapper.
*

/**
* MyBB setcookie() wrapper.
*

Zeile 1670Zeile 1679
	if($expires == -1)
{
$expires = 0;

	if($expires == -1)
{
$expires = 0;

	}

	}

	elseif($expires == "" || $expires == null)

	elseif($expires == "" || $expires == null)

	{

	{

		$expires = TIME_NOW + (60*60*24*365); // Make the cookie expire in a years time

		$expires = TIME_NOW + (60*60*24*365); // Make the cookie expire in a years time

	}
else
{

	}
else
{

		$expires = TIME_NOW + intval($expires);
}

$mybb->settings['cookiepath'] = str_replace(array("\n","\r"), "", $mybb->settings['cookiepath']);
$mybb->settings['cookiedomain'] = str_replace(array("\n","\r"), "", $mybb->settings['cookiedomain']);
$mybb->settings['cookieprefix'] = str_replace(array("\n","\r", " "), "", $mybb->settings['cookieprefix']);

		$expires = TIME_NOW + intval($expires);
}

$mybb->settings['cookiepath'] = str_replace(array("\n","\r"), "", $mybb->settings['cookiepath']);
$mybb->settings['cookiedomain'] = str_replace(array("\n","\r"), "", $mybb->settings['cookiedomain']);
$mybb->settings['cookieprefix'] = str_replace(array("\n","\r", " "), "", $mybb->settings['cookieprefix']);





	// Versions of PHP prior to 5.2 do not support HttpOnly cookies and IE is buggy when specifying a blank domain so set the cookie manually
$cookie = "Set-Cookie: {$mybb->settings['cookieprefix']}{$name}=".urlencode($value);

if($expires > 0)
{
$cookie .= "; expires=".@gmdate('D, d-M-Y H:i:s \\G\\M\\T', $expires);

	// Versions of PHP prior to 5.2 do not support HttpOnly cookies and IE is buggy when specifying a blank domain so set the cookie manually
$cookie = "Set-Cookie: {$mybb->settings['cookieprefix']}{$name}=".urlencode($value);

if($expires > 0)
{
$cookie .= "; expires=".@gmdate('D, d-M-Y H:i:s \\G\\M\\T', $expires);

	}

	}


if(!empty($mybb->settings['cookiepath']))


if(!empty($mybb->settings['cookiepath']))

	{

	{

		$cookie .= "; path={$mybb->settings['cookiepath']}";
}


		$cookie .= "; path={$mybb->settings['cookiepath']}";
}


Zeile 1703Zeile 1712
	}

if($httponly == true)

	}

if($httponly == true)

	{

	{

		$cookie .= "; HttpOnly";
}

		$cookie .= "; HttpOnly";
}





	$mybb->cookies[$name] = $value;

header($cookie, false);

	$mybb->cookies[$name] = $value;

header($cookie, false);

}

/**

}

/**

 * Unset a cookie set by MyBB.

 * Unset a cookie set by MyBB.

 *
* @param string The cookie identifier.

 *
* @param string The cookie identifier.

 */
function my_unsetcookie($name)
{

 */
function my_unsetcookie($name)
{

Zeile 1729Zeile 1738

/**
* Get the contents from a serialised cookie array.


/**
* Get the contents from a serialised cookie array.

 *
* @param string The cookie identifier.

 *
* @param string The cookie identifier.

 * @param int The cookie content id.
* @return array|boolean The cookie id's content array or false when non-existent.
*/
function my_get_array_cookie($name, $id)
{
global $mybb;

 * @param int The cookie content id.
* @return array|boolean The cookie id's content array or false when non-existent.
*/
function my_get_array_cookie($name, $id)
{
global $mybb;





	if(!isset($mybb->cookies['mybb'][$name]))
{
return false;

	if(!isset($mybb->cookies['mybb'][$name]))
{
return false;

	}

	}


$cookie = my_unserialize($mybb->cookies['mybb'][$name]);



$cookie = my_unserialize($mybb->cookies['mybb'][$name]);


Zeile 1757Zeile 1766

/**
* Set a serialised cookie array.


/**
* Set a serialised cookie array.

 *

 *

 * @param string The cookie identifier.
* @param int The cookie content id.
* @param string The value to set the cookie to.

 * @param string The cookie identifier.
* @param int The cookie content id.
* @param string The value to set the cookie to.

 */

 */

function my_set_array_cookie($name, $id, $value, $expires="")
{
global $mybb;

$cookie = $mybb->cookies['mybb'];
$newcookie = my_unserialize($cookie[$name]);

function my_set_array_cookie($name, $id, $value, $expires="")
{
global $mybb;

$cookie = $mybb->cookies['mybb'];
$newcookie = my_unserialize($cookie[$name]);





	$newcookie[$id] = $value;
$newcookie = serialize($newcookie);
my_setcookie("mybb[$name]", addslashes($newcookie), $expires);

	$newcookie[$id] = $value;
$newcookie = serialize($newcookie);
my_setcookie("mybb[$name]", addslashes($newcookie), $expires);

Zeile 1785Zeile 1794
 */
function my_unserialize($data)
{

 */
function my_unserialize($data)
{

 
	// Do no unserialize objects
if(substr($data, 0, 1) == 'O')
{
return array();
}


	$array = unserialize($data);

if(!is_array($array))

	$array = unserialize($data);

if(!is_array($array))

Zeile 2761Zeile 2776
	}

$prefixselect = "";

	}

$prefixselect = "";

	$multipleselect = "";

 
	if($multiple != 0)
{

	if($multiple != 0)
{

		$multipleselect = " multiple=\"multiple\" size=\"5\"";





		$prefixselect = "<select name=\"threadprefix[]\" multiple=\"multiple\" size=\"5\">\n";
}
else
{
$prefixselect = "<select name=\"threadprefix\">\n";

	}

	}


$prefixselect = "<select name=\"threadprefix\"{$multipleselect}>\n";

 

if($multiple == 1)
{


if($multiple == 1)
{

Zeile 2810Zeile 2826
 * @param string The string to encode
* @param int The level (1-9) to encode at
* @return string The encoded string

 * @param string The string to encode
* @param int The level (1-9) to encode at
* @return string The encoded string

 */

 */

function gzip_encode($contents, $level=1)
{
if(function_exists("gzcompress") && function_exists("crc32") && !headers_sent() && !(ini_get('output_buffering') && my_strpos(' '.ini_get('output_handler'), 'ob_gzhandler')))
{
$httpaccept_encoding = '';

function gzip_encode($contents, $level=1)
{
if(function_exists("gzcompress") && function_exists("crc32") && !headers_sent() && !(ini_get('output_buffering') && my_strpos(' '.ini_get('output_handler'), 'ob_gzhandler')))
{
$httpaccept_encoding = '';





		if(isset($_SERVER['HTTP_ACCEPT_ENCODING']))
{
$httpaccept_encoding = $_SERVER['HTTP_ACCEPT_ENCODING'];

		if(isset($_SERVER['HTTP_ACCEPT_ENCODING']))
{
$httpaccept_encoding = $_SERVER['HTTP_ACCEPT_ENCODING'];

		}


		}


		if(my_strpos(" ".$httpaccept_encoding, "x-gzip"))
{
$encoding = "x-gzip";

		if(my_strpos(" ".$httpaccept_encoding, "x-gzip"))
{
$encoding = "x-gzip";

Zeile 2854Zeile 2870
	}

return $contents;

	}

return $contents;

}

}


/**
* Log the actions of a moderator.


/**
* Log the actions of a moderator.

Zeile 2938Zeile 2954
	else
{
$display_reputation .= "reputation_neutral";

	else
{
$display_reputation .= "reputation_neutral";

	}

$display_reputation .= "\">{$reputation}</strong>";


	}

$display_reputation .= "\">{$reputation}</strong>";


	if($uid != 0)
{
$display_reputation .= "</a>";

	if($uid != 0)
{
$display_reputation .= "</a>";

Zeile 2952Zeile 2968

/**
* Fetch a color coded version of a warning level (based on it's percentage)


/**
* Fetch a color coded version of a warning level (based on it's percentage)

 *

 *

 * @param int The warning level (percentage of 100)
* @return string Formatted warning level
*/

 * @param int The warning level (percentage of 100)
* @return string Formatted warning level
*/

Zeile 2963Zeile 2979
		return "<span class=\"high_warning\">{$level}%</span>";
}
else if($level >= 50)

		return "<span class=\"high_warning\">{$level}%</span>";
}
else if($level >= 50)

	{

	{

		return "<span class=\"moderate_warning\">{$level}%</span>";
}
else if($level >= 25)
{
return "<span class=\"low_warning\">{$level}%</span>";

		return "<span class=\"moderate_warning\">{$level}%</span>";
}
else if($level >= 25)
{
return "<span class=\"low_warning\">{$level}%</span>";

	}

	}

	else
{
return $level."%";

	else
{
return $level."%";

Zeile 2985Zeile 3001
{
global $mybb, $plugins;


{
global $mybb, $plugins;


	$ip = 0;

if(!preg_match("#^(10|172\.16|192\.168)\.#", $_SERVER['REMOTE_ADDR']))

	$ip = 0;

if(!preg_match("#^(10|172\.(1[6-9]|2[0-9]|3[0-1])|192\.168)\.#", $_SERVER['REMOTE_ADDR']))

	{
$ip = $_SERVER['REMOTE_ADDR'];
}

if($mybb->settings['ip_forwarded_check'])

	{
$ip = $_SERVER['REMOTE_ADDR'];
}

if($mybb->settings['ip_forwarded_check'])

	{

	{

		if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))
{
preg_match_all("#[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}#s", $_SERVER['HTTP_X_FORWARDED_FOR'], $addresses);

		if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))
{
preg_match_all("#[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}#s", $_SERVER['HTTP_X_FORWARDED_FOR'], $addresses);

Zeile 3004Zeile 3020
		}

if(is_array($addresses[0]))

		}

if(is_array($addresses[0]))

		{

		{

			foreach($addresses[0] as $key => $val)
{

			foreach($addresses[0] as $key => $val)
{

				if(!preg_match("#^(10|172\.16|192\.168)\.#", $val))

				if(!preg_match("#^(10|172\.(1[6-9]|2[0-9]|3[0-1])|192\.168)\.#", $val))

				{
$ip = $val;
break;
}
}

				{
$ip = $val;
break;
}
}

		}
}


		}
}


	if(!$ip)
{
if(isset($_SERVER['HTTP_CLIENT_IP']))

	if(!$ip)
{
if(isset($_SERVER['HTTP_CLIENT_IP']))

Zeile 3031Zeile 3047
	}

return $ip;

	}

return $ip;

}

}


/**
* Fetch the friendly size (GB, MB, KB, B) for a specified file size.


/**
* Fetch the friendly size (GB, MB, KB, B) for a specified file size.

Zeile 3042Zeile 3058
function get_friendly_size($size)
{
global $lang;

function get_friendly_size($size)
{
global $lang;





	if(!is_numeric($size))
{
return $lang->na;

	if(!is_numeric($size))
{
return $lang->na;

Zeile 3075Zeile 3091
	}
// Gigabyte (1024 Megabytes)
elseif($size >= 1073741824)

	}
// Gigabyte (1024 Megabytes)
elseif($size >= 1073741824)

	{

	{

		$size = my_number_format(round(($size / 1073741824), 2))." ".$lang->size_gb;
}
// Megabyte (1024 Kilobytes)

		$size = my_number_format(round(($size / 1073741824), 2))." ".$lang->size_gb;
}
// Megabyte (1024 Kilobytes)

Zeile 3118Zeile 3134
	$ext = my_strtolower($ext);

if($attachtypes[$ext]['icon'])

	$ext = my_strtolower($ext);

if($attachtypes[$ext]['icon'])

	{

	{

		if(defined("IN_ADMINCP"))

		if(defined("IN_ADMINCP"))

		{

		{

			$icon = str_replace("{theme}", "", $attachtypes[$ext]['icon']);
if(my_substr($icon, 0, 1) != "/" && my_substr($icon, 0, 7) != "http://")
{

			$icon = str_replace("{theme}", "", $attachtypes[$ext]['icon']);
if(my_substr($icon, 0, 1) != "/" && my_substr($icon, 0, 7) != "http://")
{

Zeile 3131Zeile 3147
		{
global $change_dir;
$icon = $change_dir."/".str_replace("{theme}", $theme['imgdir'], $attachtypes[$ext]['icon']);

		{
global $change_dir;
$icon = $change_dir."/".str_replace("{theme}", $theme['imgdir'], $attachtypes[$ext]['icon']);

		}

		}

		else

		else

		{

		{

			$icon = str_replace("{theme}", $theme['imgdir'], $attachtypes[$ext]['icon']);
}
return "<img src=\"{$icon}\" border=\"0\" alt=\".{$ext}\" />";

			$icon = str_replace("{theme}", $theme['imgdir'], $attachtypes[$ext]['icon']);
}
return "<img src=\"{$icon}\" border=\"0\" alt=\".{$ext}\" />";

Zeile 3143Zeile 3159
		if(defined("IN_ADMINCP"))
{
$theme['imgdir'] = "../images";

		if(defined("IN_ADMINCP"))
{
$theme['imgdir'] = "../images";

		}

		}

		else if(defined("IN_PORTAL"))
{
global $change_dir;

		else if(defined("IN_PORTAL"))
{
global $change_dir;

Zeile 3167Zeile 3183
	if(!is_array($forum_cache))
{
cache_forums();

	if(!is_array($forum_cache))
{
cache_forums();

	}

	}


if(!is_array($permissioncache))
{


if(!is_array($permissioncache))
{

Zeile 3191Zeile 3207
		if($forum['password'] != "")
{
if($mybb->cookies['forumpass'][$forum['fid']] != md5($mybb->user['uid'].$forum['password']))

		if($forum['password'] != "")
{
if($mybb->cookies['forumpass'][$forum['fid']] != md5($mybb->user['uid'].$forum['password']))

			{

			{

				$pwverified = 0;
}


				$pwverified = 0;
}


Zeile 3215Zeile 3231
			if($unviewableforums)
{
$unviewableforums .= ",";

			if($unviewableforums)
{
$unviewableforums .= ",";

			}

			}


$unviewableforums .= "'".$forum['fid']."'";
}


$unviewableforums .= "'".$forum['fid']."'";
}

Zeile 3240Zeile 3256
	// -2 idea provided by Matt Light (http://www.mephex.com)
$format = str_replace("Y", $year, $format);
$format = str_replace("y", my_substr($year, -2), $format);

	// -2 idea provided by Matt Light (http://www.mephex.com)
$format = str_replace("Y", $year, $format);
$format = str_replace("y", my_substr($year, -2), $format);





	return $format;
}


	return $format;
}


Zeile 3252Zeile 3268
function build_breadcrumb()
{
global $nav, $navbits, $templates, $theme, $lang, $mybb;

function build_breadcrumb()
{
global $nav, $navbits, $templates, $theme, $lang, $mybb;





	eval("\$navsep = \"".$templates->get("nav_sep")."\";");

$i = 0;

	eval("\$navsep = \"".$templates->get("nav_sep")."\";");

$i = 0;

Zeile 3278Zeile 3294
				$multipage_dropdown = null;
if(!empty($navbit['multipage']))
{

				$multipage_dropdown = null;
if(!empty($navbit['multipage']))
{

 
					if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1)
{
$mybb->settings['threadsperpage'] = 20;
}


					$multipage = multipage($navbit['multipage']['num_threads'], $mybb->settings['threadsperpage'], $navbit['multipage']['current_page'], $navbit['multipage']['url'], true);
if($multipage)
{

					$multipage = multipage($navbit['multipage']['num_threads'], $mybb->settings['threadsperpage'], $navbit['multipage']['current_page'], $navbit['multipage']['url'], true);
if($multipage)
{

Zeile 3312Zeile 3333

/**
* Add a breadcrumb menu item to the list.


/**
* Add a breadcrumb menu item to the list.

 *

 *

 * @param string The name of the item to add
* @param string The URL of the item to add
*/

 * @param string The name of the item to add
* @param string The URL of the item to add
*/

Zeile 3323Zeile 3344
	$navsize = count($navbits);
$navbits[$navsize]['name'] = $name;
$navbits[$navsize]['url'] = $url;

	$navsize = count($navbits);
$navbits[$navsize]['name'] = $name;
$navbits[$navsize]['url'] = $url;

}

}


/**
* Build the forum breadcrumb nagiation (the navigation to a specific forum including all parent forums)


/**
* Build the forum breadcrumb nagiation (the navigation to a specific forum including all parent forums)

Zeile 3345Zeile 3366
		foreach($forum_cache as $key => $val)
{
$pforumcache[$val['fid']][$val['pid']] = $val;

		foreach($forum_cache as $key => $val)
{
$pforumcache[$val['fid']][$val['pid']] = $val;

		}
}


		}
}


	if(is_array($pforumcache[$fid]))
{
foreach($pforumcache[$fid] as $key => $forumnav)

	if(is_array($pforumcache[$fid]))
{
foreach($pforumcache[$fid] as $key => $forumnav)

Zeile 3357Zeile 3378
				if(!empty($pforumcache[$forumnav['pid']]))
{
build_forum_breadcrumb($forumnav['pid']);

				if(!empty($pforumcache[$forumnav['pid']]))
{
build_forum_breadcrumb($forumnav['pid']);

				}


				}


				$navsize = count($navbits);
// Convert & to &amp;
$navbits[$navsize]['name'] = preg_replace("#&(?!\#[0-9]+;)#si", "&amp;", $forumnav['name']);

				$navsize = count($navbits);
// Convert & to &amp;
$navbits[$navsize]['name'] = preg_replace("#&(?!\#[0-9]+;)#si", "&amp;", $forumnav['name']);

Zeile 3406Zeile 3427

unset($GLOBALS['navbits']);
$GLOBALS['navbits'] = $newnav;


unset($GLOBALS['navbits']);
$GLOBALS['navbits'] = $newnav;

}

/**

}

/**

 * Builds a URL to an archive mode page
*
* @param string The type of page (thread|announcement|forum)

 * Builds a URL to an archive mode page
*
* @param string The type of page (thread|announcement|forum)

Zeile 3469Zeile 3490
	if($mybb->settings['gzipoutput'] != 0)
{
$gzipen = "Enabled";

	if($mybb->settings['gzipoutput'] != 0)
{
$gzipen = "Enabled";

	}

	}

	else
{
$gzipen = "Disabled";

	else
{
$gzipen = "Disabled";

Zeile 3492Zeile 3513
	echo "<td bgcolor=\"#FEFEFE\" width=\"25%\"><font face=\"Tahoma\" size=\"2\">$totaltime seconds</font></td>\n";
echo "<td bgcolor=\"#EFEFEF\" width=\"25%\"><b><font face=\"Tahoma\" size=\"2\">No. DB Queries:</font></b></td>\n";
echo "<td bgcolor=\"#FEFEFE\" width=\"25%\"><font face=\"Tahoma\" size=\"2\">$db->query_count</font></td>\n";

	echo "<td bgcolor=\"#FEFEFE\" width=\"25%\"><font face=\"Tahoma\" size=\"2\">$totaltime seconds</font></td>\n";
echo "<td bgcolor=\"#EFEFEF\" width=\"25%\"><b><font face=\"Tahoma\" size=\"2\">No. DB Queries:</font></b></td>\n";
echo "<td bgcolor=\"#FEFEFE\" width=\"25%\"><font face=\"Tahoma\" size=\"2\">$db->query_count</font></td>\n";

	echo "</tr>\n";
echo "<tr>\n";

	echo "</tr>\n";
echo "<tr>\n";

	echo "<td bgcolor=\"#EFEFEF\" width=\"25%\"><b><font face=\"Tahoma\" size=\"2\">PHP Processing Time:</font></b></td>\n";
echo "<td bgcolor=\"#FEFEFE\" width=\"25%\"><font face=\"Tahoma\" size=\"2\">$phptime seconds ($percentphp%)</font></td>\n";
echo "<td bgcolor=\"#EFEFEF\" width=\"25%\"><b><font face=\"Tahoma\" size=\"2\">DB Processing Time:</font></b></td>\n";

	echo "<td bgcolor=\"#EFEFEF\" width=\"25%\"><b><font face=\"Tahoma\" size=\"2\">PHP Processing Time:</font></b></td>\n";
echo "<td bgcolor=\"#FEFEFE\" width=\"25%\"><font face=\"Tahoma\" size=\"2\">$phptime seconds ($percentphp%)</font></td>\n";
echo "<td bgcolor=\"#EFEFEF\" width=\"25%\"><b><font face=\"Tahoma\" size=\"2\">DB Processing Time:</font></b></td>\n";

Zeile 3504Zeile 3525
	echo "<td bgcolor=\"#FEFEFE\" width=\"25%\"><font face=\"Tahoma\" size=\"2\">{$mybb->config['database']['type']}, xml</font></td>\n";
echo "<td bgcolor=\"#EFEFEF\" width=\"25%\"><b><font face=\"Tahoma\" size=\"2\">Global.php Processing Time:</font></b></td>\n";
echo "<td bgcolor=\"#FEFEFE\" width=\"25%\"><font face=\"Tahoma\" size=\"2\">$globaltime seconds</font></td>\n";

	echo "<td bgcolor=\"#FEFEFE\" width=\"25%\"><font face=\"Tahoma\" size=\"2\">{$mybb->config['database']['type']}, xml</font></td>\n";
echo "<td bgcolor=\"#EFEFEF\" width=\"25%\"><b><font face=\"Tahoma\" size=\"2\">Global.php Processing Time:</font></b></td>\n";
echo "<td bgcolor=\"#FEFEFE\" width=\"25%\"><font face=\"Tahoma\" size=\"2\">$globaltime seconds</font></td>\n";

	echo "</tr>\n";
echo "<tr>\n";

	echo "</tr>\n";
echo "<tr>\n";

	echo "<td bgcolor=\"#EFEFEF\" width=\"25%\"><b><font face=\"Tahoma\" size=\"2\">PHP Version:</font></b></td>\n";
echo "<td bgcolor=\"#FEFEFE\" width=\"25%\"><font face=\"Tahoma\" size=\"2\">$phpversion</font></td>\n";
echo "<td bgcolor=\"#EFEFEF\" width=\"25%\"><b><font face=\"Tahoma\" size=\"2\">Server Load:</font></b></td>\n";

	echo "<td bgcolor=\"#EFEFEF\" width=\"25%\"><b><font face=\"Tahoma\" size=\"2\">PHP Version:</font></b></td>\n";
echo "<td bgcolor=\"#FEFEFE\" width=\"25%\"><font face=\"Tahoma\" size=\"2\">$phpversion</font></td>\n";
echo "<td bgcolor=\"#EFEFEF\" width=\"25%\"><b><font face=\"Tahoma\" size=\"2\">Server Load:</font></b></td>\n";

Zeile 3554Zeile 3575
		echo "<table style=\"background-color: #666;\" width=\"95%\" cellpadding=\"4\" cellspacing=\"1\" align=\"center\">\n";
echo "<tr>\n";
echo "<td style=\"background-color: #ccc;\"><strong>Templates Used (Loaded for this Page) - ".count($templates->cache)." Total</strong></td>\n";

		echo "<table style=\"background-color: #666;\" width=\"95%\" cellpadding=\"4\" cellspacing=\"1\" align=\"center\">\n";
echo "<tr>\n";
echo "<td style=\"background-color: #ccc;\"><strong>Templates Used (Loaded for this Page) - ".count($templates->cache)." Total</strong></td>\n";

		echo "</tr>\n";

		echo "</tr>\n";

		echo "<tr>\n";
echo "<td style=\"background: #fff;\">".implode(", ", array_keys($templates->cache))."</td>\n";
echo "</tr>\n";

		echo "<tr>\n";
echo "<td style=\"background: #fff;\">".implode(", ", array_keys($templates->cache))."</td>\n";
echo "</tr>\n";

Zeile 3577Zeile 3598
	echo "</body>";
echo "</html>";
exit;

	echo "</body>";
echo "</html>";
exit;

}


}


/**
* Outputs the correct page headers.
*/

/**
* Outputs the correct page headers.
*/

Zeile 3602Zeile 3623
 * @param string The type of item the above IDs are for - post, posts, thread, threads, forum, all
*/
function mark_reports($id, $type="post")

 * @param string The type of item the above IDs are for - post, posts, thread, threads, forum, all
*/
function mark_reports($id, $type="post")

{

{

	global $db, $cache, $plugins;

switch($type)

	global $db, $cache, $plugins;

switch($type)

Zeile 3891Zeile 3912
	if(is_array($groups))
{
foreach($groups as $gid)

	if(is_array($groups))
{
foreach($groups as $gid)

		{

		{

			if(trim($gid) != "" && $leavegroup != $gid && !$donegroup[$gid])
{
$groupslist .= $comma.$gid;

			if(trim($gid) != "" && $leavegroup != $gid && !$donegroup[$gid])
{
$groupslist .= $comma.$gid;

Zeile 5435Zeile 5456
		// Make regular expression * match
$banned_username['filter'] = str_replace('\*', '(.*)', preg_quote($banned_username['filter'], '#'));
if(preg_match("#(^|\b){$banned_username['filter']}($|\b)#i", $username))

		// Make regular expression * match
$banned_username['filter'] = str_replace('\*', '(.*)', preg_quote($banned_username['filter'], '#'));
if(preg_match("#(^|\b){$banned_username['filter']}($|\b)#i", $username))

		{
// Updating last use

		{
// Updating last use

			if($update_lastuse == true)
{
$db->update_query("banfilters", array("lastuse" => TIME_NOW), "fid='{$banned_username['fid']}'");

			if($update_lastuse == true)
{
$db->update_query("banfilters", array("lastuse" => TIME_NOW), "fid='{$banned_username['fid']}'");

Zeile 5629Zeile 5650
		foreach($post_data as $key => $val)
{
$post_body .= '&'.urlencode($key).'='.urlencode($val);

		foreach($post_data as $key => $val)
{
$post_body .= '&'.urlencode($key).'='.urlencode($val);

		}

		}

		$post_body = ltrim($post_body, '&');
}


		$post_body = ltrim($post_body, '&');
}


Zeile 5731Zeile 5752
 */
function is_super_admin($uid)
{

 */
function is_super_admin($uid)
{

	global $mybb;

$mybb->config['super_admins'] = str_replace(" ", "", $mybb->config['super_admins']);
if(my_strpos(",{$mybb->config['super_admins']},", ",{$uid},") === false)
{






	static $super_admins;

if(!isset($super_admins))
{
global $mybb;
$super_admins = str_replace(" ", "", $mybb->config['super_admins']);
}

if(my_strpos(",{$super_admins},", ",{$uid},") === false)
{

		return false;

		return false;

	}

	}

	else

	else

	{

	{

		return true;
}

		return true;
}

 
}

/**
* Prevents super administrators being selected in a SELECT.
*
* @param boolean Prefix with an AND?
* @param string The prefix to add to uid when used in a JOIN (e.g. SELECTing users u would mean using 'u' in this argument).
* @return string An addition to the WHERE statement
*/
function not_super_admins($use_and = false, $uid_prefix = '')
{
static $super_admins;

if(!isset($super_admins))
{
global $mybb, $db;
$super_admins = $db->escape_string(str_replace(" ", "", $mybb->config['super_admins']));
}

if($super_admins)
{
$sql_where = '';
if($use_and)
{
$sql_where .= ' AND ';
}

if($uid_prefix != '')
{
$sql_where .= $uid_prefix.'.';
}

$sql_where .= "uid NOT IN({$super_admins})";

return $sql_where;
}
return '';

}

/**

}

/**

Zeile 6209Zeile 6272
function secure_seed_rng($count=8)
{
$output = '';

function secure_seed_rng($count=8)
{
$output = '';


// Try the unix/linux method
if(@is_readable('/dev/urandom') && ($handle = @fopen('/dev/urandom', 'rb')))




















	// DIRECTORY_SEPARATOR checks if running windows
if(DIRECTORY_SEPARATOR != '\\')
{
// Unix/Linux
// Use OpenSSL when available
if(function_exists('openssl_random_pseudo_bytes'))
{
$output = openssl_random_pseudo_bytes($count);
}
// Try mcrypt
elseif(function_exists('mcrypt_create_iv'))
{
$output = mcrypt_create_iv($count, MCRYPT_DEV_URANDOM);
}
// Try /dev/urandom
elseif(@is_readable('/dev/urandom') && ($handle = @fopen('/dev/urandom', 'rb')))
{
$output = @fread($handle, $count);
@fclose($handle);
}
}
else

	{

	{

		$output = @fread($handle, $count);
@fclose($handle);
























		// Windows
// Use OpenSSL when available
// PHP <5.3.4 had a bug which makes that function unusable on Windows
if(function_exists('openssl_random_pseudo_bytes') && version_compare(PHP_VERSION, '5.3.4', '>='))
{
$output = openssl_random_pseudo_bytes($count);
}
// Try mcrypt
elseif(function_exists('mcrypt_create_iv'))
{
$output = mcrypt_create_iv($count, MCRYPT_RAND);
}
// Try Windows CAPICOM before using our own generator
elseif(class_exists('COM'))
{
try
{
$CAPI_Util = new COM('CAPICOM.Utilities.1');
if(is_callable(array($CAPI_Util, 'GetRandom')))
{
$output = $CAPI_Util->GetRandom($count, 0);
}
} catch (Exception $e) {
}
}

	}

// Didn't work? Do we still not have enough bytes? Use our own (less secure) rng generator

	}

// Didn't work? Do we still not have enough bytes? Use our own (less secure) rng generator