Vergleich inc/functions.php - 1.6.7 - 1.6.10

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: functions.php 5765 2012-03-27 09:52:45Z Tomm $

 * $Id$

 */

/**

 */

/**

Zeile 47Zeile 47

if(my_strpos(getenv("REQUEST_URI"), "?"))
{


if(my_strpos(getenv("REQUEST_URI"), "?"))
{

				$debuglink = htmlspecialchars(getenv("REQUEST_URI")) . "&debug=1";

				$debuglink = htmlspecialchars_uni(getenv("REQUEST_URI")) . "&debug=1";

			}
else
{

			}
else
{

				$debuglink = htmlspecialchars(getenv("REQUEST_URI")) . "?debug=1";

				$debuglink = htmlspecialchars_uni(getenv("REQUEST_URI")) . "?debug=1";

			}

if($mybb->settings['gzipoutput'] != 0)

			}

if($mybb->settings['gzipoutput'] != 0)

Zeile 63Zeile 63
				$gzipen = "Disabled";
}


				$gzipen = "Disabled";
}


			if(function_exists("memory_get_usage"))







			$memory_usage = get_memory_usage();

if($memory_usage)
{
$memory_usage = " / Memory Usage: ".get_friendly_size($memory_usage);
}
else

			{

			{

				$memory_usage = " / Memory Usage: ".get_friendly_size(memory_get_peak_usage(true));

				$memory_usage = '';

			}

$other = "PHP version: $phpversion / Server Load: $serverload / GZip Compression: $gzipen";

			}

$other = "PHP version: $phpversion / Server Load: $serverload / GZip Compression: $gzipen";

Zeile 76Zeile 82
		if($mybb->debug_mode == true)
{
debug_page();

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

		}
}

		}
}


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


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

Zeile 113Zeile 119
	if(is_array($name) && method_exists($name[0], $name[1]))
{
$shutdown_functions["class_".get_class($name[0])."_".$name[1]] = array('function' => $name, 'arguments' => $arguments);

	if(is_array($name) && method_exists($name[0], $name[1]))
{
$shutdown_functions["class_".get_class($name[0])."_".$name[1]] = array('function' => $name, 'arguments' => $arguments);

		return true;

		return true;

	}
else if(!is_array($name) && function_exists($name))
{

	}
else if(!is_array($name) && function_exists($name))
{

Zeile 161Zeile 167
		{
require_once MYBB_ROOT."inc/db_".$config['database']['type'].".php";
switch($config['database']['type'])

		{
require_once MYBB_ROOT."inc/db_".$config['database']['type'].".php";
switch($config['database']['type'])

			{

			{

				case "sqlite":
$db = new DB_SQLite;
break;

				case "sqlite":
$db = new DB_SQLite;
break;

Zeile 184Zeile 190

// Cache object deconstructed? reconstruct
if(!is_object($cache))


// Cache object deconstructed? reconstruct
if(!is_object($cache))

	{

	{

		require_once MYBB_ROOT."inc/class_datacache.php";
$cache = new datacache;
$cache->cache();

		require_once MYBB_ROOT."inc/class_datacache.php";
$cache = new datacache;
$cache->cache();

	}

	}


// And finally.. plugins
if(!is_object($plugins) && !defined("NO_PLUGINS") && !($mybb->settings['no_plugins'] == 1))


// And finally.. plugins
if(!is_object($plugins) && !defined("NO_PLUGINS") && !($mybb->settings['no_plugins'] == 1))

Zeile 196Zeile 202
		require_once MYBB_ROOT."inc/class_plugins.php";
$plugins = new pluginSystem;
$plugins->load();

		require_once MYBB_ROOT."inc/class_plugins.php";
$plugins = new pluginSystem;
$plugins->load();

	}

	}


// We have some shutdown queries needing to be run
if(is_array($shutdown_queries))


// We have some shutdown queries needing to be run
if(is_array($shutdown_queries))

Zeile 256Zeile 262
	}

$plugins->run_hooks("send_mail_queue_end");

	}

$plugins->run_hooks("send_mail_queue_end");

}


}


/**
* Parses the contents of a page before outputting it.
*

/**
* Parses the contents of a page before outputting it.
*

Zeile 267Zeile 273
function parse_page($contents)
{
global $lang, $theme, $mybb, $htmldoctype, $archive_url, $error_handler;

function parse_page($contents)
{
global $lang, $theme, $mybb, $htmldoctype, $archive_url, $error_handler;





	$contents = str_replace('<navigation>', build_breadcrumb(1), $contents);
$contents = str_replace('<archive_url>', $archive_url, $contents);

if($htmldoctype)

	$contents = str_replace('<navigation>', build_breadcrumb(1), $contents);
$contents = str_replace('<archive_url>', $archive_url, $contents);

if($htmldoctype)

	{

	{

		$contents = $htmldoctype.$contents;
}
else
{
$contents = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n".$contents;

		$contents = $htmldoctype.$contents;
}
else
{
$contents = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n".$contents;

	}


	}


	$contents = str_replace("<html", "<html xmlns=\"http://www.w3.org/1999/xhtml\"", $contents); 

	$contents = str_replace("<html", "<html xmlns=\"http://www.w3.org/1999/xhtml\"", $contents); 





	if($lang->settings['rtl'] == 1)
{
$contents = str_replace("<html", "<html dir=\"rtl\"", $contents);

	if($lang->settings['rtl'] == 1)
{
$contents = str_replace("<html", "<html dir=\"rtl\"", $contents);

Zeile 290Zeile 296
	if($lang->settings['htmllang'])
{
$contents = str_replace("<html", "<html xml:lang=\"".$lang->settings['htmllang']."\" lang=\"".$lang->settings['htmllang']."\"", $contents);

	if($lang->settings['htmllang'])
{
$contents = str_replace("<html", "<html xml:lang=\"".$lang->settings['htmllang']."\" lang=\"".$lang->settings['htmllang']."\"", $contents);

	}

	}


if($error_handler->warnings)
{


if($error_handler->warnings)
{

Zeile 322Zeile 328

if(!$offset && $offset != '0')
{


if(!$offset && $offset != '0')
{

		if($mybb->user['uid'] != 0 && array_key_exists("timezone", $mybb->user))

		if(isset($mybb->user['uid']) && $mybb->user['uid'] != 0 && array_key_exists("timezone", $mybb->user))

		{
$offset = $mybb->user['timezone'];
$dstcorrection = $mybb->user['dst'];

		{
$offset = $mybb->user['timezone'];
$dstcorrection = $mybb->user['dst'];

		}

		}

		elseif(defined("IN_ADMINCP"))
{
$offset = $mybbadmin['timezone'];

		elseif(defined("IN_ADMINCP"))
{
$offset = $mybbadmin['timezone'];

Zeile 351Zeile 357

if($offset == "-")
{


if($offset == "-")
{

		$offset = 0;
}

if($adodb == true && function_exists('adodb_date'))
{

		$offset = 0;
}

if($adodb == true && function_exists('adodb_date'))
{

		$date = adodb_date($format, $stamp + ($offset * 3600));
}
else

		$date = adodb_date($format, $stamp + ($offset * 3600));
}
else

Zeile 546Zeile 552
	if(!$parentlist)
{
$parentlist = get_parent_list($fid);

	if(!$parentlist)
{
$parentlist = get_parent_list($fid);

	}

	}


$parentsexploded = explode(",", $parentlist);
$builtlist = "(";


$parentsexploded = explode(",", $parentlist);
$builtlist = "(";

Zeile 821Zeile 827
	if($mybb->settings['redirects'] == 1 && ($mybb->user['showredirect'] != 0 || !$mybb->user['uid']))
{
$url = str_replace("&amp;", "&", $url);

	if($mybb->settings['redirects'] == 1 && ($mybb->user['showredirect'] != 0 || !$mybb->user['uid']))
{
$url = str_replace("&amp;", "&", $url);

		$url = htmlspecialchars($url);

		$url = htmlspecialchars_uni($url);


eval("\$redirectpage = \"".$templates->get("redirect")."\";");
output_page($redirectpage);


eval("\$redirectpage = \"".$templates->get("redirect")."\";");
output_page($redirectpage);

Zeile 833Zeile 839

run_shutdown();



run_shutdown();


		if(my_substr($url, 0, 7) !== 'http://' && my_substr($url, 0, 8) !== 'https://')

		if(my_substr($url, 0, 7) !== 'http://' && my_substr($url, 0, 8) !== 'https://' && my_substr($url, 0, 1) !== '/')

		{
header("Location: {$mybb->settings['bburl']}/{$url}");

		{
header("Location: {$mybb->settings['bburl']}/{$url}");

		}

		}

		else
{
header("Location: {$url}");

		else
{
header("Location: {$url}");

Zeile 867Zeile 873
	$url = str_replace("&amp;", "&", $url);
$url = htmlspecialchars_uni($url);


	$url = str_replace("&amp;", "&", $url);
$url = htmlspecialchars_uni($url);


	$pages = ceil($count / $perpage);



	$pages = ceil($count / $perpage);

$prevpage = '';

	if($page > 1)

	if($page > 1)

	{

	{

		$prev = $page-1;
$page_url = fetch_page_url($url, $prev);
eval("\$prevpage = \"".$templates->get("multipage_prevpage")."\";");

		$prev = $page-1;
$page_url = fetch_page_url($url, $prev);
eval("\$prevpage = \"".$templates->get("multipage_prevpage")."\";");

Zeile 880Zeile 887
	if(!$mybb->settings['maxmultipagelinks'])
{
$mybb->settings['maxmultipagelinks'] = 5;

	if(!$mybb->settings['maxmultipagelinks'])
{
$mybb->settings['maxmultipagelinks'] = 5;

	}

	}


$from = $page-floor($mybb->settings['maxmultipagelinks']/2);
$to = $page+floor($mybb->settings['maxmultipagelinks']/2);


$from = $page-floor($mybb->settings['maxmultipagelinks']/2);
$to = $page+floor($mybb->settings['maxmultipagelinks']/2);

Zeile 906Zeile 913
		$to = $pages;
}


		$to = $pages;
}


 
	$start = '';

	if($from > 1)
{
if($from-1 == 1)

	if($from > 1)
{
if($from-1 == 1)

Zeile 917Zeile 925
		eval("\$start = \"".$templates->get("multipage_start")."\";");
}


		eval("\$start = \"".$templates->get("multipage_start")."\";");
}


 
	$mppage = '';

	for($i = $from; $i <= $to; ++$i)
{
$page_url = fetch_page_url($url, $i);

	for($i = $from; $i <= $to; ++$i)
{
$page_url = fetch_page_url($url, $i);

Zeile 937Zeile 946
		}
}


		}
}


 
	$end = '';

	if($to < $pages)
{
if($to+1 == $pages)

	if($to < $pages)
{
if($to+1 == $pages)

Zeile 948Zeile 958
		eval("\$end = \"".$templates->get("multipage_end")."\";");
}


		eval("\$end = \"".$templates->get("multipage_end")."\";");
}


 
	$nextpage = '';

	if($page < $pages)
{
$next = $page+1;
$page_url = fetch_page_url($url, $next);
eval("\$nextpage = \"".$templates->get("multipage_nextpage")."\";");
}

	if($page < $pages)
{
$next = $page+1;
$page_url = fetch_page_url($url, $next);
eval("\$nextpage = \"".$templates->get("multipage_nextpage")."\";");
}

 


	$lang->multipage_pages = $lang->sprintf($lang->multipage_pages, $pages);

if($breadcrumb == true)

	$lang->multipage_pages = $lang->sprintf($lang->multipage_pages, $pages);

if($breadcrumb == true)

Zeile 1237Zeile 1249

$groups = explode(",", $gid);



$groups = explode(",", $gid);


	if(!$fpermcache[$fid]) // This forum has no custom or inherited permissions so lets just return the group permissions

	if(empty($fpermcache[$fid])) // This forum has no custom or inherited permissions so lets just return the group permissions

	{
return $groupperms;
}

	{
return $groupperms;
}

Zeile 1588Zeile 1600
		$icon = $mybb->input['icon'];
}


		$icon = $mybb->input['icon'];
}


 
	$iconlist = '';

	$no_icons_checked = " checked=\"checked\"";
// read post icons from cache, and sort them accordingly
$posticons_cache = $cache->read("posticons");

	$no_icons_checked = " checked=\"checked\"";
// read post icons from cache, and sort them accordingly
$posticons_cache = $cache->read("posticons");

Zeile 1837Zeile 1850
	$returnload = trim($serverload[0]);

return $returnload;

	$returnload = trim($serverload[0]);

return $returnload;

 
}

/**
* Returns the amount of memory allocated to the script.
*
* @return int The amount of memory allocated to the script.
*/
function get_memory_usage()
{
if(function_exists('memory_get_peak_usage'))
{
return memory_get_peak_usage(true);
}
elseif(function_exists('memory_get_usage'))
{
return memory_get_usage(true);
}
return false;

}

/**

}

/**

Zeile 2019Zeile 2050
	update_forum_lastpost($fid);

$cache->update_forums();

	update_forum_lastpost($fid);

$cache->update_forums();

}


}


/**
* Update the last post information for a specific forum
*

/**
* Update the last post information for a specific forum
*

Zeile 2197Zeile 2228
 * @param int The thread ID
*/
function delete_thread($tid)

 * @param int The thread ID
*/
function delete_thread($tid)

{
global $moderation;

if(!is_object($moderation))
{

{
global $moderation;

if(!is_object($moderation))
{

		require_once MYBB_ROOT."inc/class_moderation.php";
$moderation = new Moderation;
}

return $moderation->delete_thread($tid);

		require_once MYBB_ROOT."inc/class_moderation.php";
$moderation = new Moderation;
}

return $moderation->delete_thread($tid);

}

/**

}

/**

 * Deletes a post from the database
*
* @param int The thread ID

 * Deletes a post from the database
*
* @param int The thread ID

Zeile 2245Zeile 2276
	global $forum_cache, $jumpfcache, $permissioncache, $mybb, $selecteddone, $forumjump, $forumjumpbits, $gobutton, $theme, $templates, $lang;

$pid = intval($pid);

	global $forum_cache, $jumpfcache, $permissioncache, $mybb, $selecteddone, $forumjump, $forumjumpbits, $gobutton, $theme, $templates, $lang;

$pid = intval($pid);

 
	$jumpsel['default'] = '';


if($permissions)
{


if($permissions)
{

Zeile 2254Zeile 2286
	if(!is_array($jumpfcache))
{
if(!is_array($forum_cache))

	if(!is_array($jumpfcache))
{
if(!is_array($forum_cache))

		{

		{

			cache_forums();
}

foreach($forum_cache as $fid => $forum)
{
if($forum['active'] != 0)

			cache_forums();
}

foreach($forum_cache as $fid => $forum)
{
if($forum['active'] != 0)

			{

			{

				$jumpfcache[$forum['pid']][$forum['disporder']][$forum['fid']] = $forum;
}
}

				$jumpfcache[$forum['pid']][$forum['disporder']][$forum['fid']] = $forum;
}
}

Zeile 2272Zeile 2304
		$permissioncache = forum_permissions();
}


		$permissioncache = forum_permissions();
}


	if(is_array($jumpfcache[$pid]))

	if(isset($jumpfcache[$pid]) && is_array($jumpfcache[$pid]))

	{
foreach($jumpfcache[$pid] as $main)
{
foreach($main as $forum)

	{
foreach($jumpfcache[$pid] as $main)
{
foreach($main as $forum)

			{

			{

				$perms = $permissioncache[$forum['fid']];

				$perms = $permissioncache[$forum['fid']];





				if($forum['fid'] != "0" && ($perms['canview'] != 0 || $mybb->settings['hideprivateforums'] == 0) && $forum['linkto'] == '' && ($forum['showinjump'] != 0 || $showall == true))
{
$optionselected = "";

if($selitem == $forum['fid'])

				if($forum['fid'] != "0" && ($perms['canview'] != 0 || $mybb->settings['hideprivateforums'] == 0) && $forum['linkto'] == '' && ($forum['showinjump'] != 0 || $showall == true))
{
$optionselected = "";

if($selitem == $forum['fid'])

					{

					{

						$optionselected = "selected=\"selected\"";
$selecteddone = 1;
}

						$optionselected = "selected=\"selected\"";
$selecteddone = 1;
}

Zeile 2300Zeile 2332
						$forumjumpbits .= build_forum_jump($forum['fid'], $selitem, 0, $newdepth, $showextras, $showall);
}
}

						$forumjumpbits .= build_forum_jump($forum['fid'], $selitem, 0, $newdepth, $showextras, $showall);
}
}

			}

			}

		}
}

if($addselect)
{
if(!$selecteddone)

		}
}

if($addselect)
{
if(!$selecteddone)

		{

		{

			if(!$selitem)
{
$selitem = "default";
}

			if(!$selitem)
{
$selitem = "default";
}





			$jumpsel[$selitem] = 'selected="selected"';

			$jumpsel[$selitem] = 'selected="selected"';

		}


		}


		if($showextras == 0)

		if($showextras == 0)

		{

		{

			$template = "special";
}
else
{
$template = "advanced";

			$template = "special";
}
else
{
$template = "advanced";

 

if(strpos(FORUM_URL, '.html') !== false)
{
$forum_link = "'".str_replace('{fid}', "'+this.options[this.selectedIndex].value+'", FORUM_URL)."'";
}
else
{
$forum_link = "'".str_replace('{fid}', "'+this.options[this.selectedIndex].value", FORUM_URL);
}

		}

eval("\$forumjump = \"".$templates->get("forumjump_".$template)."\";");

		}

eval("\$forumjump = \"".$templates->get("forumjump_".$template)."\";");

Zeile 2461Zeile 2502
			$string = str_replace("\"", "\\\"", $lang->$lang_string);
$editor_language .= "\t{$js_lang_string}: \"{$string}\"";


			$string = str_replace("\"", "\\\"", $lang->$lang_string);
$editor_language .= "\t{$js_lang_string}: \"{$string}\"";


			if($editor_lang_strings[$key+1])

			if(isset($editor_lang_strings[$key+1]))

			{
$editor_language .= ",";
}

			{
$editor_language .= ",";
}

Zeile 2523Zeile 2564
		{
reset($smiliecache);


		{
reset($smiliecache);


 
			$getmore = '';

			if($mybb->settings['smilieinsertertot'] >= $smiliecount)
{
$mybb->settings['smilieinsertertot'] = $smiliecount;

			if($mybb->settings['smilieinsertertot'] >= $smiliecount)
{
$mybb->settings['smilieinsertertot'] = $smiliecount;

Zeile 2863Zeile 2905
function get_reputation($reputation, $uid=0)
{
global $theme;

function get_reputation($reputation, $uid=0)
{
global $theme;

 

$display_reputation = '';


if($uid != 0)
{
$display_reputation = "<a href=\"reputation.php?uid={$uid}\">";


if($uid != 0)
{
$display_reputation = "<a href=\"reputation.php?uid={$uid}\">";

	}

$display_reputation .= "<strong class=\"";


	}

$display_reputation .= "<strong class=\"";


	if($reputation < 0)
{
$display_reputation .= "reputation_negative";

	if($reputation < 0)
{
$display_reputation .= "reputation_negative";

	}

	}

	elseif($reputation > 0)
{
$display_reputation .= "reputation_positive";

	elseif($reputation > 0)
{
$display_reputation .= "reputation_positive";

Zeile 2882Zeile 2926
	else
{
$display_reputation .= "reputation_neutral";

	else
{
$display_reputation .= "reputation_neutral";

	}

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

	}

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


if($uid != 0)
{


if($uid != 0)
{

Zeile 2892Zeile 2936
	}

return $display_reputation;

	}

return $display_reputation;

}


}


/**
* 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)
*

Zeile 2984Zeile 3028
 * @return string The friendly file size
*/
function get_friendly_size($size)

 * @return string The friendly file size
*/
function get_friendly_size($size)

{

{

	global $lang;

if(!is_numeric($size))

	global $lang;

if(!is_numeric($size))

Zeile 3006Zeile 3050
	elseif($size >= 1152921504606846976)
{
$size = my_number_format(round(($size / 1152921504606846976), 2))." ".$lang->size_eb;

	elseif($size >= 1152921504606846976)
{
$size = my_number_format(round(($size / 1152921504606846976), 2))." ".$lang->size_eb;

	}

	}

	// Petabyte (1024 Terabytes)
elseif($size >= 1125899906842624)
{

	// Petabyte (1024 Terabytes)
elseif($size >= 1125899906842624)
{

Zeile 3014Zeile 3058
	}
// Terabyte (1024 Gigabytes)
elseif($size >= 1099511627776)

	}
// Terabyte (1024 Gigabytes)
elseif($size >= 1099511627776)

	{

	{

		$size = my_number_format(round(($size / 1099511627776), 2))." ".$lang->size_tb;
}
// Gigabyte (1024 Megabytes)

		$size = my_number_format(round(($size / 1099511627776), 2))." ".$lang->size_tb;
}
// Gigabyte (1024 Megabytes)

Zeile 3075Zeile 3119
		{
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
{
$icon = str_replace("{theme}", $theme['imgdir'], $attachtypes[$ext]['icon']);

		else
{
$icon = str_replace("{theme}", $theme['imgdir'], $attachtypes[$ext]['icon']);

		}

		}

		return "<img src=\"{$icon}\" border=\"0\" alt=\".{$ext}\" />";
}
else

		return "<img src=\"{$icon}\" border=\"0\" alt=\".{$ext}\" />";
}
else

	{

	{

		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 3106Zeile 3150
 */
function get_unviewable_forums($only_readable_threads=false)
{

 */
function get_unviewable_forums($only_readable_threads=false)
{

	global $forum_cache, $permissioncache, $mybb, $unviewableforums, $unviewable, $templates, $forumpass;

$pid = intval($pid);

if(!$permissions)
{
$permissions = $mybb->usergroup;
}

	global $forum_cache, $permissioncache, $mybb, $unviewable, $templates, $forumpass;









if(!is_array($forum_cache))
{


if(!is_array($forum_cache))
{

Zeile 3172Zeile 3209
		}
}


		}
}


	return $unviewableforums;




	if(isset($unviewableforums))
{
return $unviewableforums;
}

}

/**

}

/**

Zeile 3196Zeile 3236
 * Build the breadcrumb navigation trail from the specified items
*
* @return The formatted breadcrumb navigation trail

 * Build the breadcrumb navigation trail from the specified items
*
* @return The formatted breadcrumb navigation trail

 */

 */

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

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

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

$i = 0;

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

$i = 0;

 
	$activesep = '';

	
if(is_array($navbits))
{

	
if(is_array($navbits))
{

Zeile 3219Zeile 3260
				else
{
$sep = "";

				else
{
$sep = "";

				}

				}

				
$multipage = null;
$multipage_dropdown = null;

				
$multipage = null;
$multipage_dropdown = null;

Zeile 3241Zeile 3282
				eval("\$nav .= \"".$templates->get("nav_bit")."\";");
}
}

				eval("\$nav .= \"".$templates->get("nav_bit")."\";");
}
}

	}


	}


	$navsize = count($navbits);
$navbit = $navbits[$navsize-1];


	$navsize = count($navbits);
$navbit = $navbits[$navsize-1];


Zeile 3264Zeile 3305
 * @param string The URL of the item to add
*/
function add_breadcrumb($name, $url="")

 * @param string The URL of the item to add
*/
function add_breadcrumb($name, $url="")

{
global $navbits;

{
global $navbits;


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


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

Zeile 3301Zeile 3342
		{
if($fid == $forumnav['fid'])
{

		{
if($fid == $forumnav['fid'])
{

				if($pforumcache[$forumnav['pid']])

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

				{
build_forum_breadcrumb($forumnav['pid']);
}

				{
build_forum_breadcrumb($forumnav['pid']);
}

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


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


				if(IN_ARCHIVE == 1)

				if(defined("IN_ARCHIVE"))

				{
// Set up link to forum in breadcrumb.
if($pforumcache[$fid][$forumnav['pid']]['type'] == 'f' || $pforumcache[$fid][$forumnav['pid']]['type'] == 'c')

				{
// Set up link to forum in breadcrumb.
if($pforumcache[$fid][$forumnav['pid']]['type'] == 'f' || $pforumcache[$fid][$forumnav['pid']]['type'] == 'c')

Zeile 3367Zeile 3408
	global $mybb;

// If the server OS is not Windows and not Apache or the PHP is running as a CGI or we have defined ARCHIVE_QUERY_STRINGS, use query strings - DIRECTORY_SEPARATOR checks if running windows

	global $mybb;

// If the server OS is not Windows and not Apache or the PHP is running as a CGI or we have defined ARCHIVE_QUERY_STRINGS, use query strings - DIRECTORY_SEPARATOR checks if running windows

	if((DIRECTORY_SEPARATOR == '\\' && is_numeric(stripos($_SERVER['SERVER_SOFTWARE'], "apache")) == false) || is_numeric(stripos(SAPI_NAME, "cgi")) !== false || defined("ARCHIVE_QUERY_STRINGS"))


	//if((DIRECTORY_SEPARATOR == '\\' && is_numeric(stripos($_SERVER['SERVER_SOFTWARE'], "apache")) == false) || is_numeric(stripos(SAPI_NAME, "cgi")) !== false || defined("ARCHIVE_QUERY_STRINGS"))
if($mybb->settings['seourls_archive'] == 1)

	{

	{

		$base_url = $mybb->settings['bburl']."/archive/index.php?";

		$base_url = $mybb->settings['bburl']."/archive/index.php/";

	}
else
{

	}
else
{

		$base_url = $mybb->settings['bburl']."/archive/index.php/";

		$base_url = $mybb->settings['bburl']."/archive/index.php?";

	}

switch($type)

	}

switch($type)

Zeile 3399Zeile 3441
 */
function debug_page()
{

 */
function debug_page()
{

	global $db, $debug, $templates, $templatelist, $mybb, $maintimer, $globaltime, $ptimer, $parsetime;

	global $db, $debug, $templates, $templatelist, $mybb, $maintimer, $globaltime, $ptimer, $parsetime, $lang;


$totaltime = $maintimer->totaltime;
$phptime = $maintimer->format($maintimer->totaltime - $db->query_time);


$totaltime = $maintimer->totaltime;
$phptime = $maintimer->format($maintimer->totaltime - $db->query_time);

Zeile 3464Zeile 3506
	echo "<td bgcolor=\"#FEFEFE\" width=\"25%\"><font face=\"Tahoma\" size=\"2\">".count($templates->cache)." (".intval(count(explode(",", $templatelist)))." Cached / ".intval(count($templates->uncached_templates))." Manually Loaded)</font></td>\n";
echo "</tr>\n";


	echo "<td bgcolor=\"#FEFEFE\" width=\"25%\"><font face=\"Tahoma\" size=\"2\">".count($templates->cache)." (".intval(count(explode(",", $templatelist)))." Cached / ".intval(count($templates->uncached_templates))." Manually Loaded)</font></td>\n";
echo "</tr>\n";


	if(function_exists("memory_get_usage"))


	$memory_usage = get_memory_usage();
if(!$memory_usage)

	{

	{

		$memory_usage = memory_get_peak_usage(true);
$memory_limit = @ini_get("memory_limit");
echo "<tr>\n";
echo "<td bgcolor=\"#EFEFEF\" width=\"25%\"><b><font face=\"Tahoma\" size=\"2\">Memory Usage:</font></b></td>\n";
echo "<td bgcolor=\"#FEFEFE\" width=\"25%\"><font face=\"Tahoma\" size=\"2\">".get_friendly_size($memory_usage)." ({$memory_usage} bytes)</font></td>\n";
echo "<td bgcolor=\"#EFEFEF\" width=\"25%\"><b><font face=\"Tahoma\" size=\"2\">Memory Limit:</font></b></td>\n";
echo "<td bgcolor=\"#FEFEFE\" width=\"25%\"><font face=\"Tahoma\" size=\"2\">{$memory_limit}</font></td>\n";
echo "</tr>\n";

		$memory_usage = $lang->unknown;








	}

	}

 
	else
{
$memory_usage = get_friendly_size($memory_usage)." ({$memory_usage} bytes)";
}
$memory_limit = @ini_get("memory_limit");
echo "<tr>\n";
echo "<td bgcolor=\"#EFEFEF\" width=\"25%\"><b><font face=\"Tahoma\" size=\"2\">Memory Usage:</font></b></td>\n";
echo "<td bgcolor=\"#FEFEFE\" width=\"25%\"><font face=\"Tahoma\" size=\"2\">{$memory_usage}</font></td>\n";
echo "<td bgcolor=\"#EFEFEF\" width=\"25%\"><b><font face=\"Tahoma\" size=\"2\">Memory Limit:</font></b></td>\n";
echo "<td bgcolor=\"#FEFEFE\" width=\"25%\"><font face=\"Tahoma\" size=\"2\">{$memory_limit}</font></td>\n";
echo "</tr>\n";


echo "</table>\n";



echo "</table>\n";


Zeile 3491Zeile 3538
	echo "<h2>Template Statistics</h2>\n";

if(count($templates->cache) > 0)

	echo "<h2>Template Statistics</h2>\n";

if(count($templates->cache) > 0)

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

Zeile 3554Zeile 3601
				$rids = implode($id, "','");
$rids = "'0','$rids'";
$db->update_query("reportedposts", array('reportstatus' => 1), "pid IN($rids) AND reportstatus='0'");

				$rids = implode($id, "','");
$rids = "'0','$rids'";
$db->update_query("reportedposts", array('reportstatus' => 1), "pid IN($rids) AND reportstatus='0'");

			}

			}

			break;
case "post":
$db->update_query("reportedposts", array('reportstatus' => 1), "pid='$id' AND reportstatus='0'");

			break;
case "post":
$db->update_query("reportedposts", array('reportstatus' => 1), "pid='$id' AND reportstatus='0'");

Zeile 3601Zeile 3648
	$hsecs = 60*60;
$msecs = 60;


	$hsecs = 60*60;
$msecs = 60;


	if($options['short'] == true)

	if(isset($options['short']))

	{
$lang_year = $lang->year_short;
$lang_years = $lang->years_short;

	{
$lang_year = $lang->year_short;
$lang_years = $lang->years_short;

Zeile 3686Zeile 3733
		$nicetime['days'] = $days.$lang_days;
}


		$nicetime['days'] = $days.$lang_days;
}


	if($options['hours'] !== false)

	if(!isset($options['hours']) || $options['hours'] !== false)

	{
if($hours == 1)
{

	{
if($hours == 1)
{

Zeile 3698Zeile 3745
		}
}


		}
}


	if($options['minutes'] !== false)

	if(!isset($options['minutes']) || $options['minutes'] !== false)

	{
if($minutes == 1)
{

	{
if($minutes == 1)
{

Zeile 3710Zeile 3757
		}
}


		}
}


	if($options['seconds'] !== false)

	if(!isset($options['seconds']) || $options['seconds'] !== false)

	{
if($seconds == 1)
{

	{
if($seconds == 1)
{

Zeile 3896Zeile 3943
		{
$ignore = array($ignore);
}

		{
$ignore = array($ignore);
}

		



		$form_html = "";

		$form_html = "";

		$field_parts = explode('&', $field_parts);


 
		if(!empty($mybb->input))

		if(!empty($mybb->input))

		{

		{

			foreach($mybb->input as $name => $value)
{
if(in_array($name, $ignore))

			foreach($mybb->input as $name => $value)
{
if(in_array($name, $ignore))

Zeile 3909Zeile 3954
					continue;
}


					continue;
}


				$form_html .= "<input type=\"hidden\" name=\"".htmlspecialchars((string)$name)."\" value=\"".htmlspecialchars((string)$value)."\" />\n";

				$form_html .= "<input type=\"hidden\" name=\"".htmlspecialchars_uni((string)$name)."\" value=\"".htmlspecialchars_uni((string)$value)."\" />\n";

			}
}


			}
}


Zeile 3918Zeile 3963
	else
{
if(isset($_SERVER['QUERY_STRING']))

	else
{
if(isset($_SERVER['QUERY_STRING']))

		{

		{

			$location .= "?".htmlspecialchars_uni($_SERVER['QUERY_STRING']);
}
else if(isset($_ENV['QUERY_STRING']))

			$location .= "?".htmlspecialchars_uni($_SERVER['QUERY_STRING']);
}
else if(isset($_ENV['QUERY_STRING']))

		{

		{

			$location .= "?".htmlspecialchars_uni($_ENV['QUERY_STRING']);
}


			$location .= "?".htmlspecialchars_uni($_ENV['QUERY_STRING']);
}


Zeile 3931Zeile 3976
			$post_array = array('action', 'fid', 'pid', 'tid', 'uid', 'eid');

foreach($post_array as $var)

			$post_array = array('action', 'fid', 'pid', 'tid', 'uid', 'eid');

foreach($post_array as $var)

			{

			{

				if(isset($_POST[$var]))

				if(isset($_POST[$var]))

				{

				{

					$addloc[] = urlencode($var).'='.urlencode($_POST[$var]);
}
}

					$addloc[] = urlencode($var).'='.urlencode($_POST[$var]);
}
}

Zeile 3943Zeile 3988
				if(strpos($location, "?") === false)
{
$location .= "?";

				if(strpos($location, "?") === false)
{
$location .= "?";

				}

				}

				else
{
$location .= "&amp;";

				else
{
$location .= "&amp;";

Zeile 3955Zeile 4000
		if(strlen($location) > 150)
{
$location = substr($location, 0, 150);

		if(strlen($location) > 150)
{
$location = substr($location, 0, 150);

		}

		}


return $location;
}


return $location;
}

Zeile 4027Zeile 4072
				if($theme['tid'] == $selected)
{
$sel = " selected=\"selected\"";

				if($theme['tid'] == $selected)
{
$sel = " selected=\"selected\"";

				}

				}


if($theme['pid'] != 0)
{


if($theme['pid'] != 0)
{

					$themeselect .= "<option value=\"".$theme['tid']."\"$sel>".$depth.$theme['name']."</option>";

					$themeselect .= "<option value=\"".$theme['tid']."\"$sel>".$depth.htmlspecialchars_uni($theme['name'])."</option>";

					$depthit = $depth."--";
}


					$depthit = $depth."--";
}


Zeile 4412Zeile 4457
    global $lang;

$string = preg_replace("#&\#([0-9]+);#", "-", $string);

    global $lang;

$string = preg_replace("#&\#([0-9]+);#", "-", $string);





    if(strtolower($lang->settings['charset']) == "utf-8")
{
// Get rid of any excess RTL and LTR override for they are the workings of the devil

    if(strtolower($lang->settings['charset']) == "utf-8")
{
// Get rid of any excess RTL and LTR override for they are the workings of the devil

Zeile 4434Zeile 4479
    }

return $string_length;

    }

return $string_length;

}

/**

}

/**

 * Cuts a string at a specified point, mb strings accounted for
*
* @param string The string to cut.

 * Cuts a string at a specified point, mb strings accounted for
*
* @param string The string to cut.

Zeile 4446Zeile 4491
 * @return int The cut part of the string.
*/
function my_substr($string, $start, $length="", $handle_entities = false)

 * @return int The cut part of the string.
*/
function my_substr($string, $start, $length="", $handle_entities = false)

{
if($handle_entities)
{

{
if($handle_entities)
{

		$string = unhtmlentities($string);
}
if(function_exists("mb_substr"))
{
if($length != "")

		$string = unhtmlentities($string);
}
if(function_exists("mb_substr"))
{
if($length != "")

		{

		{

			$cut_string = mb_substr($string, $start, $length);
}
else
{
$cut_string = mb_substr($string, $start);

			$cut_string = mb_substr($string, $start, $length);
}
else
{
$cut_string = mb_substr($string, $start);

		}

		}

	}
else
{
if($length != "")

	}
else
{
if($length != "")

		{

		{

			$cut_string = substr($string, $start, $length);
}
else
{
$cut_string = substr($string, $start);
}

			$cut_string = substr($string, $start, $length);
}
else
{
$cut_string = substr($string, $start);
}

	}

	}


if($handle_entities)
{


if($handle_entities)
{

Zeile 4508Zeile 4553
 * @param string What to look for (needle)
* @param int (optional) How much to offset
* @return int false on needle not found, integer position if found

 * @param string What to look for (needle)
* @param int (optional) How much to offset
* @return int false on needle not found, integer position if found

 */

 */

function my_strpos($haystack, $needle, $offset=0)
{
if($needle == '')

function my_strpos($haystack, $needle, $offset=0)
{
if($needle == '')

Zeile 4700Zeile 4745
 * @param int The forum id of the forum.
* @param int (Optional) The page number of the forum.
* @return string The url to the forum.

 * @param int The forum id of the forum.
* @param int (Optional) The page number of the forum.
* @return string The url to the forum.

 */

 */

function get_forum_link($fid, $page=0)
{
if($page > 0)

function get_forum_link($fid, $page=0)
{
if($page > 0)

Zeile 4712Zeile 4757
	else
{
$link = str_replace("{fid}", $fid, FORUM_URL);

	else
{
$link = str_replace("{fid}", $fid, FORUM_URL);

		return htmlspecialchars_uni($link);

		return htmlspecialchars_uni($link);

	}
}


	}
}


Zeile 4723Zeile 4768
 * @param int (Optional) The page number of the thread.
* @param string (Optional) The action we're performing (ex, lastpost, newpost, etc)
* @return string The url to the thread.

 * @param int (Optional) The page number of the thread.
* @param string (Optional) The action we're performing (ex, lastpost, newpost, etc)
* @return string The url to the thread.

 */

 */

function get_thread_link($tid, $page=0, $action='')
{
if($page > 1)

function get_thread_link($tid, $page=0, $action='')
{
if($page > 1)

Zeile 4753Zeile 4798
			$link = THREAD_URL;
}
$link = str_replace("{tid}", $tid, $link);

			$link = THREAD_URL;
}
$link = str_replace("{tid}", $tid, $link);

		return htmlspecialchars_uni($link);
}
}

/**

		return htmlspecialchars_uni($link);
}
}

/**

 * Build the post link.
*
* @param int The post ID of the post

 * Build the post link.
*
* @param int The post ID of the post

Zeile 4769Zeile 4814
	{
$link = str_replace("{tid}", $tid, THREAD_URL_POST);
$link = str_replace("{pid}", $pid, $link);

	{
$link = str_replace("{tid}", $tid, THREAD_URL_POST);
$link = str_replace("{pid}", $pid, $link);

		return htmlspecialchars_uni($link);

		return htmlspecialchars_uni($link);

	}
else
{

	}
else
{

Zeile 4780Zeile 4825

/**
* Build the event link.


/**
* Build the event link.

 *

 *

 * @param int The event ID of the event
* @return string The URL of the event
*/

 * @param int The event ID of the event
* @return string The URL of the event
*/

Zeile 4792Zeile 4837

/**
* Build the link to a specified date on the calendar


/**
* Build the link to a specified date on the calendar

 *
* @param int The ID of the calendar
* @param int The year

 *
* @param int The ID of the calendar
* @param int The year

 * @param int The month
* @param int The day (optional)
* @return string The URL of the calendar

 * @param int The month
* @param int The day (optional)
* @return string The URL of the calendar

Zeile 4806Zeile 4851
		$link = str_replace("{month}", $month, CALENDAR_URL_DAY);
$link = str_replace("{year}", $year, $link);
$link = str_replace("{day}", $day, $link);

		$link = str_replace("{month}", $month, CALENDAR_URL_DAY);
$link = str_replace("{year}", $year, $link);
$link = str_replace("{day}", $day, $link);

		$link = str_replace("{calendar}", $calendar, $link);

		$link = str_replace("{calendar}", $calendar, $link);

		return htmlspecialchars_uni($link);
}
else if($month > 0)

		return htmlspecialchars_uni($link);
}
else if($month > 0)

Zeile 4842Zeile 4887
	if($week < 0)
{
$week = str_replace('-', "n", $week);

	if($week < 0)
{
$week = str_replace('-', "n", $week);

	}

	}

	$link = str_replace("{week}", $week, CALENDAR_URL_WEEK);
$link = str_replace("{calendar}", $calendar, $link);
return htmlspecialchars_uni($link);

	$link = str_replace("{week}", $week, CALENDAR_URL_WEEK);
$link = str_replace("{calendar}", $calendar, $link);
return htmlspecialchars_uni($link);

Zeile 4866Zeile 4911
		return $mybb->user;
}
elseif(isset($user_cache[$uid]))

		return $mybb->user;
}
elseif(isset($user_cache[$uid]))

	{

	{

		return $user_cache[$uid];
}
else

		return $user_cache[$uid];
}
else

Zeile 4889Zeile 4934
{
global $cache;
static $forum_cache;

{
global $cache;
static $forum_cache;





	if(!isset($forum_cache) || is_array($forum_cache))
{
$forum_cache = $cache->read("forums");

	if(!isset($forum_cache) || is_array($forum_cache))
{
$forum_cache = $cache->read("forums");

Zeile 4933Zeile 4978
	if(isset($thread_cache[$tid]) && !$recache)
{
return $thread_cache[$tid];

	if(isset($thread_cache[$tid]) && !$recache)
{
return $thread_cache[$tid];

	}
else

	}
else

	{
$query = $db->simple_select("threads", "*", "tid='".intval($tid)."'");
$thread = $db->fetch_array($query);

if($thread)

	{
$query = $db->simple_select("threads", "*", "tid='".intval($tid)."'");
$thread = $db->fetch_array($query);

if($thread)

		{

		{

			$thread_cache[$tid] = $thread;
return $thread;

			$thread_cache[$tid] = $thread;
return $thread;

		}
else
{

		}
else
{

			$thread_cache[$tid] = false;
return false;
}

			$thread_cache[$tid] = false;
return false;
}

Zeile 4980Zeile 5025
		else
{
$post_cache[$pid] = false;

		else
{
$post_cache[$pid] = false;

			return false;
}
}
}


			return false;
}
}
}


/**
* Get inactivate forums.
*

/**
* Get inactivate forums.
*

Zeile 5034Zeile 5079
	if($mybb->settings['failedlogincount'] == 0)
{
return 1;

	if($mybb->settings['failedlogincount'] == 0)
{
return 1;

	}

	}

	// Note: Number of logins is defaulted to 1, because using 0 seems to clear cookie data. Not really a problem as long as we account for 1 being default.

	// Note: Number of logins is defaulted to 1, because using 0 seems to clear cookie data. Not really a problem as long as we account for 1 being default.





	// Use cookie if possible, otherwise use session

	// Use cookie if possible, otherwise use session

	// Session stops user clearing cookies to bypass the login
// Also use the greater of the two numbers present, stops people using scripts with altered cookie data to stay the same
$cookielogins = intval($mybb->cookies['loginattempts']);
$cookietime = $mybb->cookies['failedlogin'];

	// Find better solution to prevent clearing cookies
$loginattempts = 0;
$failedlogin = 0;






	if(empty($cookielogins) || $cookielogins < $session->logins)
{
$loginattempts = $session->logins;
}
else
{
$loginattempts = $cookielogins;
}

if(empty($cookietime) || $cookietime < $session->failedlogin)

	if(!empty($mybb->cookies['loginattempts']))










	{

	{

		$failedlogin = $session->failedlogin;

		$loginattempts = $mybb->cookies['loginattempts'];

	}

	}

	else



if(!empty($mybb->cookies['failedlogin']))

	{

	{

		$failedlogin = $cookietime;

		$failedlogin = $mybb->cookies['failedlogin'];

	}

// Work out if the user has had more than the allowed number of login attempts

	}

// Work out if the user has had more than the allowed number of login attempts

Zeile 5189Zeile 5225
	else
{
$mode = "w";

	else
{
$mode = "w";

	}

	}


$options = array(
"order_by" => "title",


$options = array(
"order_by" => "title",

Zeile 5248Zeile 5284
		$inquote = false;
$terms = explode("\"", $terms);
foreach($terms as $phrase)

		$inquote = false;
$terms = explode("\"", $terms);
foreach($terms as $phrase)

		{

		{

			$phrase = htmlspecialchars_uni($phrase);
if($phrase != "")
{
if($inquote)

			$phrase = htmlspecialchars_uni($phrase);
if($phrase != "")
{
if($inquote)

				{

				{

					$words[] = trim($phrase);
}
else
{
$split_words = preg_split("#\s{1,}#", $phrase, -1);
if(!is_array($split_words))

					$words[] = trim($phrase);
}
else
{
$split_words = preg_split("#\s{1,}#", $phrase, -1);
if(!is_array($split_words))

					{

					{

						continue;
}
foreach($split_words as $word)

						continue;
}
foreach($split_words as $word)

Zeile 5284Zeile 5320
		if(is_array($split_words))
{
foreach($split_words as $word)

		if(is_array($split_words))
{
foreach($split_words as $word)

			{

			{

				if(!$word || strlen($word) < $mybb->settings['minsearchword'])
{
continue;

				if(!$word || strlen($word) < $mybb->settings['minsearchword'])
{
continue;

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

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

			}
return true;
}
}


			}
return true;
}
}


	// Still here - good ip
return false;
}

	// Still here - good ip
return false;
}

Zeile 5668Zeile 5704
	{
return @implode("", @file($url));
}

	{
return @implode("", @file($url));
}

	else
{
return false;
}

	else
{
return false;
}

}

/**

}

/**

Zeile 5692Zeile 5728
	else
{
return true;

	else
{
return true;

	}
}

/**

	}
}

/**

 * Split a string based on the specified delimeter, ignoring said delimeter in escaped strings.
* Ex: the "quick brown fox" jumped, could return 1 => the, 2 => quick brown fox, 3 => jumped
*

 * Split a string based on the specified delimeter, ignoring said delimeter in escaped strings.
* Ex: the "quick brown fox" jumped, could return 1 => the, 2 => quick brown fox, 3 => jumped
*

Zeile 5766Zeile 5802
{
$ip_bits = explode(".", $ip);
$ip_string1 = $ip_string2 = "";

{
$ip_bits = explode(".", $ip);
$ip_string1 = $ip_string2 = "";





	if($ip == "*")

	if($ip == "*")

	{
return array(ip2long('0.0.0.0'), ip2long('255.255.255.255'));

	{
return array(my_ip2long('128.0.0.0'), my_ip2long('127.255.255.255'));

	}

if(strpos($ip, ".*") === false)

	}

if(strpos($ip, ".*") === false)

Zeile 5777Zeile 5813
		$ip = str_replace("*", "", $ip);
if(count($ip_bits) == 4)
{

		$ip = str_replace("*", "", $ip);
if(count($ip_bits) == 4)
{

			return ip2long($ip);

			return my_ip2long($ip);

		}
else

		}
else

		{
return array(ip2long($ip.".0"), ip2long($ip.".255"));

		{
return array(my_ip2long($ip.".0"), my_ip2long($ip.".255"));

		}
}
// Wildcard based IP provided

		}
}
// Wildcard based IP provided

Zeile 5802Zeile 5838
			}
$sep = ".";
}

			}
$sep = ".";
}

		return array(ip2long($ip_string1), ip2long($ip_string2));

		return array(my_ip2long($ip_string1), my_ip2long($ip_string2));

	}
}

	}
}


/**


/**

 * Fetch a list of ban times for a user account.
*
* @return array Array of ban times

 * Fetch a list of ban times for a user account.
*
* @return array Array of ban times

Zeile 5840Zeile 5876

$ban_times['---'] = $lang->permanent;
return $ban_times;


$ban_times['---'] = $lang->permanent;
return $ban_times;

}

/**

}

/**

 * Format a ban length in to a UNIX timestamp.
*
* @param string The ban length string

 * Format a ban length in to a UNIX timestamp.
*
* @param string The ban length string

Zeile 5866Zeile 5902

/**
* Expire old warnings in the database.


/**
* Expire old warnings in the database.

 *

 *

 */
function expire_warnings()
{

 */
function expire_warnings()
{

Zeile 6058Zeile 6094
	}

if(!is_array($bad_verify_files))

	}

if(!is_array($bad_verify_files))

	{

	{

		$bad_verify_files = array();
}


		$bad_verify_files = array();
}


Zeile 6252Zeile 6288
		0x0D => 1,
0x0B => 1,
0xAD => 1,

		0x0D => 1,
0x0B => 1,
0xAD => 1,

		0xC2 => array(0xA0 => 1,
0xAD => 1,
0xBF => 1,
0x81 => 1,
0x8D => 1,
0x90 => 1,
0x9D => 1,),

		0xA0 => 1,
0xAD => 1,
0xBF => 1,
0x81 => 1,
0x8D => 1,
0x90 => 1,
0x9D => 1,

		0xCC => array(0xB7 => 1, 0xB8 => 1), // \x{0337} or \x{0338}
0xE1 => array(0x85 => array(0x9F => 1, 0xA0 => 1)), // \x{115F} or \x{1160}
0xE2 => array(0x80 => array(0x80 => 1, 0x81 => 1, 0x82 => 1, 0x83 => 1, 0x84 => 1, 0x85 => 1, 0x86 => 1, 0x87 => 1, 0x88 => 1, 0x89 => 1, 0x8A => 1, 0x8B => 1, // \x{2000} to \x{200B}

		0xCC => array(0xB7 => 1, 0xB8 => 1), // \x{0337} or \x{0338}
0xE1 => array(0x85 => array(0x9F => 1, 0xA0 => 1)), // \x{115F} or \x{1160}
0xE2 => array(0x80 => array(0x80 => 1, 0x81 => 1, 0x82 => 1, 0x83 => 1, 0x84 => 1, 0x85 => 1, 0x86 => 1, 0x87 => 1, 0x88 => 1, 0x89 => 1, 0x8A => 1, 0x8B => 1, // \x{2000} to \x{200B}