Vergleich inc/functions.php - 1.8.0 - 1.8.3

  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]))
{
$parents = explode(',', $forum_cache[$fid]['parentlist']);
rsort($parents);
if(!empty($parents))

			// If our permissions arn't inherited we need to figure them out
if(empty($fpermcache[$fid][$gid]))
{
$parents = explode(',', $forum_cache[$fid]['parentlist']);
rsort($parents);
if(!empty($parents))

				{

				{

					foreach($parents as $parent_id)
{
if(!empty($fpermcache[$parent_id][$gid]))

					foreach($parents as $parent_id)
{
if(!empty($fpermcache[$parent_id][$gid]))

Zeile 1402Zeile 1404
						}
}
}

						}
}
}

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

 
			}

// If we STILL don't have forum permissions we use the usergroup itself
if(empty($level_permissions))
{
$level_permissions = $groupscache[$gid];

			}

// If we STILL don't have forum permissions we use the usergroup itself
if(empty($level_permissions))
{
$level_permissions = $groupscache[$gid];

			}

			}


foreach($level_permissions as $permission => $access)
{


foreach($level_permissions as $permission => $access)
{

Zeile 1420Zeile 1418
				{
$current_permissions[$permission] = $access;
}

				{
$current_permissions[$permission] = $access;
}

			}


			}


			if($level_permissions["canview"] && empty($level_permissions["canonlyviewownthreads"]))
{
$only_view_own_threads = 0;
}
}

			if($level_permissions["canview"] && empty($level_permissions["canonlyviewownthreads"]))
{
$only_view_own_threads = 0;
}
}

	}


	}


	// Figure out if we can view more than our own threads
if($only_view_own_threads == 0)
{

	// Figure out if we can view more than our own threads
if($only_view_own_threads == 0)
{

Zeile 1453Zeile 1451
	global $mybb, $header, $footer, $headerinclude, $theme, $templates, $lang, $forum_cache;

$showform = true;

	global $mybb, $header, $footer, $headerinclude, $theme, $templates, $lang, $forum_cache;

$showform = true;





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

	if(!is_array($forum_cache))
{
$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']))
{
$parents = explode(',', $forum_cache[$fid]['parentlist']);
rsort($parents);


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

	}

	}

	if(!empty($parents))
{
foreach($parents as $parent_id)

	if(!empty($parents))
{
foreach($parents as $parent_id)

Zeile 1476Zeile 1474
			if($parent_id == $fid || $parent_id == $pid)
{
continue;

			if($parent_id == $fid || $parent_id == $pid)
{
continue;

			}


			}


			if($forum_cache[$parent_id]['password'] != "")
{
check_forum_password($parent_id, $fid);

			if($forum_cache[$parent_id]['password'] != "")
{
check_forum_password($parent_id, $fid);

			}
}
}


			}
}
}


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

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

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

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

				$showform = true;
}
}

				$showform = true;
}
}

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

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

Zeile 1516Zeile 1514
	else
{
$showform = false;

	else
{
$showform = false;

	}

if($showform)
{
if($pid)

	}

if($showform)
{
if($pid)

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

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

Zeile 1529Zeile 1527
			$_SERVER['REQUEST_URI'] = htmlspecialchars_uni($_SERVER['REQUEST_URI']);
eval("\$pwform = \"".$templates->get("forumdisplay_password")."\";");
output_page($pwform);

			$_SERVER['REQUEST_URI'] = htmlspecialchars_uni($_SERVER['REQUEST_URI']);
eval("\$pwform = \"".$templates->get("forumdisplay_password")."\";");
output_page($pwform);

		}

		}

		exit;
}
}

		exit;
}
}

Zeile 1553Zeile 1551
	}

if($uid == 0)

	}

if($uid == 0)

	{

	{

		return false;
}


		return false;
}


Zeile 1570Zeile 1568
	// Get user groups
$perms = array();
$user = get_user($uid);

	// Get user groups
$perms = array();
$user = get_user($uid);





	$groups = array($user['usergroup']);

if(!empty($user['additionalgroups']))

	$groups = array($user['usergroup']);

if(!empty($user['additionalgroups']))

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

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

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

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

	{

	{

		if(!is_array($forum) || !in_array($forumid, $parentslist))
{
// No perms or we're not after this forum

		if(!is_array($forum) || !in_array($forumid, $parentslist))
{
// No perms or we're not after this forum

Zeile 1720Zeile 1718
					return false;
}
}

					return false;
}
}

		}

		}

	}
}


	}
}


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\"";
// read post icons from cache, and sort them accordingly

	$iconlist = '';
$no_icons_checked = " checked=\"checked\"";
// read post icons from cache, and sort them accordingly

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 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 int The cookie content id.
* @return array|boolean The cookie id's content array or false when non-existent.
*/

Zeile 1862Zeile 1860
	global $mybb;

if(!isset($mybb->cookies['mybb'][$name]))

	global $mybb;

if(!isset($mybb->cookies['mybb'][$name]))

	{

	{

		return false;
}


		return false;
}


Zeile 1875Zeile 1873
	else
{
return 0;

	else
{
return 0;

	}
}

/**

	}
}

/**

 * Set a serialised cookie array.
*
* @param string The cookie identifier.

 * Set a serialised cookie array.
*
* @param string The cookie identifier.

Zeile 1903Zeile 1901
	$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);





	// Make sure our current viarables are up-to-date as well
$mybb->cookies['mybb'][$name] = $newcookie;
}

	// Make sure our current viarables are up-to-date as well
$mybb->cookies['mybb'][$name] = $newcookie;
}

Zeile 1916Zeile 1914
 */
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))

	{

	{

		$array = array();
}


		$array = array();
}


Zeile 1934Zeile 1938
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 1958
		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 1977
				{
return $lang->unknown;
}

				{
return $lang->unknown;
}

			}

			}


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


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

Zeile 1981Zeile 1985
			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 2069
	{
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 2086
						{
$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 2107
	}

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 2126
		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 2168
	{
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 2181
				}
}
else

				}
}
else

			{

			{

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


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


Zeile 2185Zeile 2197
	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 2205
	{
$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 2237
		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 2246
		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 2263
		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 2338
	{
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 2468
	{
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 2753
	{
$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 2786
}

/**

}

/**

 * 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 2908

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 2940
						$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 3093
					// 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 3120
			eval("\$clickablesmilies = \"".$templates->get("smilieinsert")."\";");
}
else

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

		{

		{

			$clickablesmilies = "";
}
}

			$clickablesmilies = "";
}
}

Zeile 3122Zeile 3148
		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 3321
	// 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 3338
			// 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 3366
		$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 3452
		$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 3560
	$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 3602
	}

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 3727
			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 3811
			$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 3820
				{
$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 3832

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


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

	}

	}


if(isset($unviewableforums))
{


if(isset($unviewableforums))
{

Zeile 3819Zeile 3853
	// -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 3879
			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 3895
					{
$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 4627
			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 5693
		$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 7820
 *
* @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 7836
	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 7848
		'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);

}

}