Vergleich inc/functions.php - 1.8.0 - 1.8.1

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 1386Zeile 1386
	{
if(!empty($groupscache[$gid]))
{

	{
if(!empty($groupscache[$gid]))
{

 
			$level_permissions = $fpermcache[$fid][$gid];


			// If our permissions arn't inherited we need to figure them out
if(empty($fpermcache[$fid][$gid]))
{

			// If our permissions arn't inherited we need to figure them out
if(empty($fpermcache[$fid][$gid]))
{

Zeile 1401Zeile 1403
							break;
}
}

							break;
}
}

				}
}
else
{
$level_permissions = $fpermcache[$fid][$gid];

				}





			}

// If we STILL don't have forum permissions we use the usergroup itself

			}

// If we STILL don't have forum permissions we use the usergroup itself

Zeile 1455Zeile 1453
	$showform = true;

if(!is_array($forum_cache))

	$showform = true;

if(!is_array($forum_cache))

	{

	{

		$forum_cache = cache_forums();
if(!$forum_cache)
{
return false;

		$forum_cache = cache_forums();
if(!$forum_cache)
{
return false;

		}
}


		}
}


	// Loop through each of parent forums to ensure we have a password for them too
if(isset($forum_cache[$fid]['parentlist']))
{

	// Loop through each of parent forums to ensure we have a password for them too
if(isset($forum_cache[$fid]['parentlist']))
{

Zeile 1470Zeile 1468
		rsort($parents);
}
if(!empty($parents))

		rsort($parents);
}
if(!empty($parents))

	{

	{

		foreach($parents as $parent_id)
{
if($parent_id == $fid || $parent_id == $pid)

		foreach($parents as $parent_id)
{
if($parent_id == $fid || $parent_id == $pid)

Zeile 1486Zeile 1484
	}

if(!empty($forum_cache[$fid]['password']))

	}

if(!empty($forum_cache[$fid]['password']))

	{

	{

		$password = $forum_cache[$fid]['password'];
if(isset($mybb->input['pwverify']) && $pid == 0)
{
if($password == $mybb->get_input('pwverify'))
{
my_setcookie("forumpass[$fid]", md5($mybb->user['uid'].$mybb->get_input('pwverify')), null, true);

		$password = $forum_cache[$fid]['password'];
if(isset($mybb->input['pwverify']) && $pid == 0)
{
if($password == $mybb->get_input('pwverify'))
{
my_setcookie("forumpass[$fid]", md5($mybb->user['uid'].$mybb->get_input('pwverify')), null, true);

				$showform = false;
}

				$showform = false;
}

			else
{
eval("\$pwnote = \"".$templates->get("forumdisplay_password_wrongpass")."\";");

			else
{
eval("\$pwnote = \"".$templates->get("forumdisplay_password_wrongpass")."\";");

Zeile 1502Zeile 1500
			}
}
else

			}
}
else

		{

		{

			if(!$mybb->cookies['forumpass'][$fid] || ($mybb->cookies['forumpass'][$fid] && md5($mybb->user['uid'].$password) != $mybb->cookies['forumpass'][$fid]))
{
$showform = true;

			if(!$mybb->cookies['forumpass'][$fid] || ($mybb->cookies['forumpass'][$fid] && md5($mybb->user['uid'].$password) != $mybb->cookies['forumpass'][$fid]))
{
$showform = true;

Zeile 1519Zeile 1517
	}

if($showform)

	}

if($showform)

	{
if($pid)
{

	{
if($pid)
{

			header("Location: ".$mybb->settings['bburl']."/".get_forum_link($fid));
}
else

			header("Location: ".$mybb->settings['bburl']."/".get_forum_link($fid));
}
else

Zeile 1720Zeile 1718
					return false;
}
}

					return false;
}
}

		}

		}

	}
}


	}
}


Zeile 1728Zeile 1726
 * Generate a list of the posticons.
*
* @return string The template of posticons.

 * Generate a list of the posticons.
*
* @return string The template of posticons.

 */

 */

function get_post_icons()
{
global $mybb, $cache, $icon, $theme, $templates, $lang;

function get_post_icons()
{
global $mybb, $cache, $icon, $theme, $templates, $lang;

Zeile 1736Zeile 1734
	if(isset($mybb->input['icon']))
{
$icon = $mybb->get_input('icon');

	if(isset($mybb->input['icon']))
{
$icon = $mybb->get_input('icon');

	}

	}


$iconlist = '';
$no_icons_checked = " checked=\"checked\"";


$iconlist = '';
$no_icons_checked = " checked=\"checked\"";

Zeile 1744Zeile 1742
	$posticons_cache = $cache->read("posticons");
$posticons = array();
foreach($posticons_cache as $posticon)

	$posticons_cache = $cache->read("posticons");
$posticons = array();
foreach($posticons_cache as $posticon)

	{

	{

		$posticons[$posticon['name']] = $posticon;
}
krsort($posticons);

		$posticons[$posticon['name']] = $posticon;
}
krsort($posticons);

Zeile 1769Zeile 1767
	}

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

	}

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





	return $posticons;
}


	return $posticons;
}


Zeile 1786Zeile 1784
	global $mybb;

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

	global $mybb;

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

	{

	{

		$mybb->settings['cookiepath'] = "/";
}


		$mybb->settings['cookiepath'] = "/";
}


Zeile 1801Zeile 1799
	else
{
$expires = TIME_NOW + (int)$expires;

	else
{
$expires = TIME_NOW + (int)$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']);

	$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']);

Zeile 1818Zeile 1816
	if(!empty($mybb->settings['cookiepath']))
{
$cookie .= "; path={$mybb->settings['cookiepath']}";

	if(!empty($mybb->settings['cookiepath']))
{
$cookie .= "; path={$mybb->settings['cookiepath']}";

	}

	}


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


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

Zeile 1833Zeile 1831
	$mybb->cookies[$name] = $value;

header($cookie, false);

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

header($cookie, false);

}

/**

}

/**

 * Unset a cookie set by MyBB.
*
* @param string The cookie identifier.

 * Unset a cookie set by MyBB.
*
* @param string The cookie identifier.

Zeile 1843Zeile 1841
function my_unsetcookie($name)
{
global $mybb;

function my_unsetcookie($name)
{
global $mybb;





	$expires = -3600;
my_setcookie($name, "", $expires);

	$expires = -3600;
my_setcookie($name, "", $expires);





	unset($mybb->cookies[$name]);
}

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

	unset($mybb->cookies[$name]);
}

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

 *

 *

 * @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.

 * @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.

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

if(is_array($cookie) && isset($cookie[$id]))

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

if(is_array($cookie) && isset($cookie[$id]))

	{

	{

		return $cookie[$id];

		return $cookie[$id];

	}

	}

	else
{
return 0;

	else
{
return 0;

	}
}


	}
}


/**
* Set a serialised cookie array.
*

/**
* Set a serialised cookie array.
*

Zeile 1885Zeile 1883
 * @param int The cookie content id.
* @param string The value to set the cookie to.
* @param int The timestamp of the expiry date.

 * @param int The cookie content id.
* @param string The value to set the cookie to.
* @param int The timestamp of the expiry date.

 */

 */

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

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

Zeile 1894Zeile 1892
	if(isset($cookie[$name]))
{
$newcookie = my_unserialize($cookie[$name]);

	if(isset($cookie[$name]))
{
$newcookie = my_unserialize($cookie[$name]);

	}

	}

	else
{
$newcookie = array();

	else
{
$newcookie = array();

Zeile 1919Zeile 1917
	$array = unserialize($data);

if(!is_array($array))

	$array = unserialize($data);

if(!is_array($array))

	{

	{

		$array = array();
}


		$array = array();
}


Zeile 1934Zeile 1932
function get_server_load()
{
global $mybb, $lang;

function get_server_load()
{
global $mybb, $lang;





	$serverload = array();

// DIRECTORY_SEPARATOR checks if running windows

	$serverload = array();

// DIRECTORY_SEPARATOR checks if running windows

Zeile 1954Zeile 1952
		if(!is_numeric($serverload[0]))
{
if($mybb->safemode)

		if(!is_numeric($serverload[0]))
{
if($mybb->safemode)

			{
return $lang->unknown;
}


			{
return $lang->unknown;
}


			// Suhosin likes to throw a warning if exec is disabled then die - weird
if($func_blacklist = @ini_get('suhosin.executor.func.blacklist'))

			// Suhosin likes to throw a warning if exec is disabled then die - weird
if($func_blacklist = @ini_get('suhosin.executor.func.blacklist'))

			{
if(strpos(",".$func_blacklist.",", 'exec') !== false)
{
return $lang->unknown;
}
}

			{
if(strpos(",".$func_blacklist.",", 'exec') !== false)
{
return $lang->unknown;
}
}

			// PHP disabled functions?
if($func_blacklist = @ini_get('disable_functions'))
{

			// PHP disabled functions?
if($func_blacklist = @ini_get('disable_functions'))
{

Zeile 1973Zeile 1971
				{
return $lang->unknown;
}

				{
return $lang->unknown;
}

			}

			}


$load = @exec("uptime");
$load = explode("load average: ", $load);


$load = @exec("uptime");
$load = explode("load average: ", $load);

Zeile 1981Zeile 1979
			if(!is_array($serverload))
{
return $lang->unknown;

			if(!is_array($serverload))
{
return $lang->unknown;

			}
}
}
else
{
return $lang->unknown;

			}
}
}
else
{
return $lang->unknown;

	}

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

	}

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

Zeile 2065Zeile 2063
	{
if(array_key_exists($counter, $changes))
{

	{
if(array_key_exists($counter, $changes))
{

 
			if(substr($changes[$counter], 0, 2) == "+-")
{
$changes[$counter] = substr($changes[$counter], 1);
}

			// Adding or subtracting from previous value?
if(substr($changes[$counter], 0, 1) == "+" || substr($changes[$counter], 0, 1) == "-")
{

			// Adding or subtracting from previous value?
if(substr($changes[$counter], 0, 1) == "+" || substr($changes[$counter], 0, 1) == "-")
{

Zeile 2078Zeile 2080
						{
$new_stats[$counter] = "+{$new_stats[$counter]}";
}

						{
$new_stats[$counter] = "+{$new_stats[$counter]}";
}

					}

					}

					// Less than 0? That's bad
elseif($new_stats[$counter] < 0)
{
$new_stats[$counter] = 0;
}

					// Less than 0? That's bad
elseif($new_stats[$counter] < 0)
{
$new_stats[$counter] = 0;
}

				}
}

				}
}

			else
{
$new_stats[$counter] = $changes[$counter];

			else
{
$new_stats[$counter] = $changes[$counter];

Zeile 2099Zeile 2101
	}

if(!$force)

	}

if(!$force)

	{

	{

		$stats_changes = array_merge($stats, $new_stats); // Overwrite changed values
return;
}

// Fetch latest user if the user count is changing
if(array_key_exists('numusers', $changes))

		$stats_changes = array_merge($stats, $new_stats); // Overwrite changed values
return;
}

// Fetch latest user if the user count is changing
if(array_key_exists('numusers', $changes))

	{

	{

		$query = $db->simple_select("users", "uid, username", "", array('order_by' => 'regdate', 'order_dir' => 'DESC', 'limit' => 1));
$lastmember = $db->fetch_array($query);
$new_stats['lastuid'] = $lastmember['uid'];

		$query = $db->simple_select("users", "uid, username", "", array('order_by' => 'regdate', 'order_dir' => 'DESC', 'limit' => 1));
$lastmember = $db->fetch_array($query);
$new_stats['lastuid'] = $lastmember['uid'];

Zeile 2118Zeile 2120
		if(is_array($stats))
{
$stats = array_merge($stats, $new_stats); // Overwrite changed values

		if(is_array($stats))
{
$stats = array_merge($stats, $new_stats); // Overwrite changed values

		}
else

		}
else

		{
$stats = $new_stats;
}

		{
$stats = $new_stats;
}

Zeile 2160Zeile 2162
	{
if(array_key_exists($counter, $changes))
{

	{
if(array_key_exists($counter, $changes))
{

 
			if(substr($changes[$counter], 0, 2) == "+-")
{
$changes[$counter] = substr($changes[$counter], 1);
}

			// Adding or subtracting from previous value?
if(substr($changes[$counter], 0, 1) == "+" || substr($changes[$counter], 0, 1) == "-")
{

			// Adding or subtracting from previous value?
if(substr($changes[$counter], 0, 1) == "+" || substr($changes[$counter], 0, 1) == "-")
{

Zeile 2169Zeile 2175
				}
}
else

				}
}
else

			{

			{

				$update_query[$counter] = $changes[$counter];
}


				$update_query[$counter] = $changes[$counter];
}


Zeile 2185Zeile 2191
	if(count($update_query) > 0)
{
$db->update_query("forums", $update_query, "fid='".(int)$fid."'");

	if(count($update_query) > 0)
{
$db->update_query("forums", $update_query, "fid='".(int)$fid."'");

	}

	}


// Guess we should update the statistics too?
$new_stats = array();


// Guess we should update the statistics too?
$new_stats = array();

Zeile 2193Zeile 2199
	{
$threads_diff = $update_query['threads'] - $forum['threads'];
if($threads_diff > -1)

	{
$threads_diff = $update_query['threads'] - $forum['threads'];
if($threads_diff > -1)

		{

		{

			$new_stats['numthreads'] = "+{$threads_diff}";

			$new_stats['numthreads'] = "+{$threads_diff}";

		}

		}

		else
{
$new_stats['numthreads'] = "{$threads_diff}";

		else
{
$new_stats['numthreads'] = "{$threads_diff}";

		}
}


		}
}


	if(array_key_exists('unapprovedthreads', $update_query))
{
$unapprovedthreads_diff = $update_query['unapprovedthreads'] - $forum['unapprovedthreads'];
if($unapprovedthreads_diff > -1)
{
$new_stats['numunapprovedthreads'] = "+{$unapprovedthreads_diff}";

	if(array_key_exists('unapprovedthreads', $update_query))
{
$unapprovedthreads_diff = $update_query['unapprovedthreads'] - $forum['unapprovedthreads'];
if($unapprovedthreads_diff > -1)
{
$new_stats['numunapprovedthreads'] = "+{$unapprovedthreads_diff}";

		}
else

		}
else

		{
$new_stats['numunapprovedthreads'] = "{$unapprovedthreads_diff}";
}

		{
$new_stats['numunapprovedthreads'] = "{$unapprovedthreads_diff}";
}

Zeile 2225Zeile 2231
		else
{
$new_stats['numposts'] = "{$posts_diff}";

		else
{
$new_stats['numposts'] = "{$posts_diff}";

		}
}

		}
}


if(array_key_exists('unapprovedposts', $update_query))
{


if(array_key_exists('unapprovedposts', $update_query))
{

Zeile 2234Zeile 2240
		if($unapprovedposts_diff > -1)
{
$new_stats['numunapprovedposts'] = "+{$unapprovedposts_diff}";

		if($unapprovedposts_diff > -1)
{
$new_stats['numunapprovedposts'] = "+{$unapprovedposts_diff}";

		}

		}

		else
{
$new_stats['numunapprovedposts'] = "{$unapprovedposts_diff}";

		else
{
$new_stats['numunapprovedposts'] = "{$unapprovedposts_diff}";

Zeile 2251Zeile 2257
		else
{
$new_stats['numdeletedposts'] = "{$deletedposts_diff}";

		else
{
$new_stats['numdeletedposts'] = "{$deletedposts_diff}";

		}
}

		}
}


if(array_key_exists('deletedthreads', $update_query))
{


if(array_key_exists('deletedthreads', $update_query))
{

Zeile 2326Zeile 2332
	{
if(array_key_exists($counter, $changes))
{

	{
if(array_key_exists($counter, $changes))
{

 
			if(substr($changes[$counter], 0, 2) == "+-")
{
$changes[$counter] = substr($changes[$counter], 1);
}

			// Adding or subtracting from previous value?
if(substr($changes[$counter], 0, 1) == "+" || substr($changes[$counter], 0, 1) == "-")
{

			// Adding or subtracting from previous value?
if(substr($changes[$counter], 0, 1) == "+" || substr($changes[$counter], 0, 1) == "-")
{

Zeile 2452Zeile 2462
	{
if(array_key_exists($counter, $changes))
{

	{
if(array_key_exists($counter, $changes))
{

 
			if(substr($changes[$counter], 0, 2) == "+-")
{
$changes[$counter] = substr($changes[$counter], 1);
}

			// Adding or subtracting from previous value?
if(substr($changes[$counter], 0, 1) == "+" || substr($changes[$counter], 0, 1) == "-")
{

			// Adding or subtracting from previous value?
if(substr($changes[$counter], 0, 1) == "+" || substr($changes[$counter], 0, 1) == "-")
{

Zeile 2733Zeile 2747
	{
$max_dimensions = $mybb->settings['maxavatardims'];
}

	{
$max_dimensions = $mybb->settings['maxavatardims'];
}

 

$avatar_width_height = '';


if($dimensions)
{
$dimensions = explode("|", $dimensions);


if($dimensions)
{
$dimensions = explode("|", $dimensions);





		if($dimensions[0] && $dimensions[1])
{
list($max_width, $max_height) = explode('x', $max_dimensions);

		if($dimensions[0] && $dimensions[1])
{
list($max_width, $max_height) = explode('x', $max_dimensions);





			if($dimensions[0] > $max_width || $dimensions[1] > $max_height)
{
require_once MYBB_ROOT."inc/functions_image.php";

			if($dimensions[0] > $max_width || $dimensions[1] > $max_height)
{
require_once MYBB_ROOT."inc/functions_image.php";

Zeile 2764Zeile 2780
}

/**

}

/**

 * Build the javascript based MyCode inserter




 * Build the javascript based MyCode inserter.
*
* @param string $bind The ID of the textarea to bind to. Defaults to "message".
* @param bool $smilies Whether to include smilies. Defaults to true.

 *
* @return string The MyCode inserter
*/

 *
* @return string The MyCode inserter
*/

Zeile 2883Zeile 2902

if(!$smiliecache)
{


if(!$smiliecache)
{

					if(!is_array($smilie_cache))

					if(!isset($smilie_cache) || !is_array($smilie_cache))

					{
$smilie_cache = $cache->read("smilies");
}

					{
$smilie_cache = $cache->read("smilies");
}

Zeile 2915Zeile 2934
						$smilie['find'] = $finds[0];

$find = htmlspecialchars_uni($smilie['find']);

						$smilie['find'] = $finds[0];

$find = htmlspecialchars_uni($smilie['find']);

						$image = htmlspecialchars_uni($smilie['image']);


						$image = $mybb->get_asset_url($smilie['image']);
$image = htmlspecialchars_uni($image);

						if($i < $mybb->settings['smilieinsertertot'])
{
$dropdownsmilies .= '"'.$find.'": "'.$image.'",';

						if($i < $mybb->settings['smilieinsertertot'])
{
$dropdownsmilies .= '"'.$find.'": "'.$image.'",';

Zeile 3067Zeile 3087
					// Only show the first text to replace in the box
$temp = explode("\n", $smilie['find']); // assign to temporary variable for php 5.3 compatibility
$smilie['find'] = $temp[0];

					// Only show the first text to replace in the box
$temp = explode("\n", $smilie['find']); // assign to temporary variable for php 5.3 compatibility
$smilie['find'] = $temp[0];

					



					$find = htmlspecialchars_uni($smilie['find']);

$onclick = ' onclick="MyBBEditor.insertText(\' '.$smilie['find'].' \');"';

					$find = htmlspecialchars_uni($smilie['find']);

$onclick = ' onclick="MyBBEditor.insertText(\' '.$smilie['find'].' \');"';

Zeile 3094Zeile 3114
			eval("\$clickablesmilies = \"".$templates->get("smilieinsert")."\";");
}
else

			eval("\$clickablesmilies = \"".$templates->get("smilieinsert")."\";");
}
else

		{

		{

			$clickablesmilies = "";
}
}

			$clickablesmilies = "";
}
}

Zeile 3122Zeile 3142
		if($pid > 0 && is_array($prefixes_cache[$pid]))
{
return $prefixes_cache[$pid];

		if($pid > 0 && is_array($prefixes_cache[$pid]))
{
return $prefixes_cache[$pid];

		}

return $prefixes_cache;

		}

return $prefixes_cache;

	}

$prefix_cache = $cache->read("threadprefixes");

	}

$prefix_cache = $cache->read("threadprefixes");

Zeile 3295Zeile 3315
	// Go through each of our prefixes and decide which ones we can use
$prefixes = array();
foreach($prefix_cache as $prefix)

	// Go through each of our prefixes and decide which ones we can use
$prefixes = array();
foreach($prefix_cache as $prefix)

	{

	{

		if($prefix['forums'] != "-1")
{
// Decide whether this prefix can be used in our forum
$forums = explode(",", $prefix['forums']);

		if($prefix['forums'] != "-1")
{
// Decide whether this prefix can be used in our forum
$forums = explode(",", $prefix['forums']);





			if(in_array($fid, $forums))
{
// This forum can use this prefix!

			if(in_array($fid, $forums))
{
// This forum can use this prefix!

Zeile 3312Zeile 3332
			// This prefix is for anybody to use...
$prefixes[$prefix['pid']] = $prefix;
}

			// This prefix is for anybody to use...
$prefixes[$prefix['pid']] = $prefix;
}

	}


	}


	if(empty($prefixes))
{
return false;

	if(empty($prefixes))
{
return false;

	}

	}





	$prefixselect = $prefixselect_prefix = '';

$default_selected = '';
if((int)$selected_pid == 0)
{
$default_selected = " selected=\"selected\"";









	$default_selected = array();
$selected_pid = (int)$selected_pid;

if($selected_pid == 0)
{
$default_selected['all'] = ' selected="selected"';
}
else if($selected_pid == -1)
{
$default_selected['none'] = ' selected="selected"';
}
else if($selected_pid == -2)
{
$default_selected['any'] = ' selected="selected"';

	}

foreach($prefixes as $prefix)

	}

foreach($prefixes as $prefix)

Zeile 3332Zeile 3360
		$selected = '';
if($prefix['pid'] == $selected_pid)
{

		$selected = '';
if($prefix['pid'] == $selected_pid)
{

			$selected = " selected=\"selected\"";

			$selected = ' selected="selected"';

		}

$prefix['prefix'] = htmlspecialchars_uni($prefix['prefix']);

		}

$prefix['prefix'] = htmlspecialchars_uni($prefix['prefix']);

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

		eval('$prefixselect_prefix .= "'.$templates->get("forumdisplay_threadlist_prefixes_prefix").'";');

	}


	}


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

	eval('$prefixselect = "'.$templates->get("forumdisplay_threadlist_prefixes").'";');

	return $prefixselect;
}


	return $prefixselect;
}


Zeile 3418Zeile 3446
		$tid = (int)$data['tid'];
unset($data['tid']);
}

		$tid = (int)$data['tid'];
unset($data['tid']);
}

	



	$pid = 0;
if(isset($data['pid']))
{

	$pid = 0;
if(isset($data['pid']))
{

Zeile 3526Zeile 3554
	$ip = $_SERVER['REMOTE_ADDR'];

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

	$ip = $_SERVER['REMOTE_ADDR'];

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

	{

	{

		$addresses = array();

if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$addresses = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);

		$addresses = array();

if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$addresses = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);

		}

		}

		elseif(isset($_SERVER['HTTP_X_REAL_IP']))
{
$addresses = explode(',', $_SERVER['HTTP_X_REAL_IP']);

		elseif(isset($_SERVER['HTTP_X_REAL_IP']))
{
$addresses = explode(',', $_SERVER['HTTP_X_REAL_IP']);

		}


		}


		if(is_array($addresses))
{
foreach($addresses as $val)

		if(is_array($addresses))
{
foreach($addresses as $val)

Zeile 3568Zeile 3596
	}

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 3693Zeile 3721
			if(my_substr($icon, 0, 1) != "/" && my_substr($icon, 0, 7) != "http://")
{
$icon = "../".$icon;

			if(my_substr($icon, 0, 1) != "/" && my_substr($icon, 0, 7) != "http://")
{
$icon = "../".$icon;

			}

			}

		}
elseif(defined("IN_PORTAL"))
{

		}
elseif(defined("IN_PORTAL"))
{

Zeile 3777Zeile 3805
			$password_forums[$forum['fid']] = $forum['password'];
}
else

			$password_forums[$forum['fid']] = $forum['password'];
}
else

		{

		{

			// Check parents for passwords
$parents = explode(",", $forum['parentlist']);
foreach($parents as $parent)

			// Check parents for passwords
$parents = explode(",", $forum['parentlist']);
foreach($parents as $parent)

Zeile 3786Zeile 3814
				{
$pwverified = 0;
}

				{
$pwverified = 0;
}

			}
}


			}
}


		if($perms['canview'] == 0 || $pwverified == 0 || ($only_readable_threads == true && $perms['canviewthreads'] == 0))
{
if($unviewableforums)

		if($perms['canview'] == 0 || $pwverified == 0 || ($only_readable_threads == true && $perms['canviewthreads'] == 0))
{
if($unviewableforums)

Zeile 3798Zeile 3826

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


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

	}

	}


if(isset($unviewableforums))
{


if(isset($unviewableforums))
{

Zeile 3819Zeile 3847
	// -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 3845Zeile 3873
			if(isset($navbits[$key+1]))
{
if(isset($navbits[$key+2]))

			if(isset($navbits[$key+1]))
{
if(isset($navbits[$key+2]))

				{

				{

					$sep = $navsep;
}
else

					$sep = $navsep;
}
else

Zeile 3861Zeile 3889
					{
$mybb->settings['threadsperpage'] = 20;
}

					{
$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 4593Zeile 4621
			foreach($post_array as $var)
{
if(isset($_POST[$var]))

			foreach($post_array as $var)
{
if(isset($_POST[$var]))

				{

				{

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

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

Zeile 5659Zeile 5687
		$fields = array_merge((array)$options['fields'], $fields);
}


		$fields = array_merge((array)$options['fields'], $fields);
}


	$fields = array_flip($fields);

$query = $db->simple_select('users', implode(',', array_keys($fields)), $sqlwhere, array('limit' => 1));

	$query = $db->simple_select('users', implode(',', array_unique($fields)), $sqlwhere, array('limit' => 1));




if(isset($options['exists']))
{


if(isset($options['exists']))
{

Zeile 7788Zeile 7814
 *
* @param string $username The username that the user was using.
* @param string $email The email address the user was using.

 *
* @param string $username The username that the user was using.
* @param string $email The email address the user was using.

 * @param string $ip_address THe IP addres of the user.

 * @param string $ip_address The IP addres of the user.

 * @param array  $data     An array of extra data to go with the block (eg: confidence rating).
* @return bool Whether the action was logged successfully.
*/

 * @param array  $data     An array of extra data to go with the block (eg: confidence rating).
* @return bool Whether the action was logged successfully.
*/

Zeile 7804Zeile 7830
	if(!$ip_address)
{
$ip_address = get_ip();

	if(!$ip_address)
{
$ip_address = get_ip();

		$session->packedip;

 
	}

$ip_address = my_inet_pton($ip_address);

	}

$ip_address = my_inet_pton($ip_address);

Zeile 7817Zeile 7842
		'data'      => $db->escape_string(@serialize($data)),
);


		'data'      => $db->escape_string(@serialize($data)),
);


	return (bool)$db->insert_array('spamlog', $insert_array);

	return (bool)$db->insert_query('spamlog', $insert_array);

}

}