Vergleich inc/functions.php - 1.6.0 - 1.6.1

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 958Zeile 958
 */
function fetch_page_url($url, $page)
{

 */
function fetch_page_url($url, $page)
{

	// If no page identifier is specified we tack it on to the end of the URL
if(strpos($url, "{page}") === false)











	if($page <= 1)
{
$find = array(
"-page-{page}",
"&amp;page={page}"
);

// Remove "Page 1" to the defacto URL
$url = str_replace($find, array("", ""), $url);
return $url;
}
else if(strpos($url, "{page}") === false)

	{

	{

 
		// If no page identifier is specified we tack it on to the end of the URL

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

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

Zeile 969Zeile 980
		{
$url .= "&amp;";
}

		{
$url .= "&amp;";
}

 


		$url .= "page=$page";
}
else
{
$url = str_replace("{page}", $page, $url);
}

		$url .= "page=$page";
}
else
{
$url = str_replace("{page}", $page, $url);
}

 


	return $url;
}


	return $url;
}


Zeile 1463Zeile 1476
				{
if(isset($modusers['users'][$uid]) && $modusers['users'][$uid]['mid'])
{

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

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

						return true;
}
}

						return true;
}
}

Zeile 1482Zeile 1500
				if($modperms[$action] == 1)
{
return true;

				if($modperms[$action] == 1)
{
return true;

				}

				}

				else
{
return false;

				else
{
return false;

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

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





	$listed = 0;
if($mybb->input['icon'])
{

	$listed = 0;
if($mybb->input['icon'])
{

Zeile 1512Zeile 1530
	$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 1525Zeile 1543
			$no_icons_checked = "";
}
else

			$no_icons_checked = "";
}
else

		{

		{

			$iconlist .= "<label><input type=\"radio\" name=\"icon\" value=\"".$dbicon['iid']."\" /> <img src=\"".$dbicon['path']."\" alt=\"".$dbicon['name']."\" /></label>";
}


			$iconlist .= "<label><input type=\"radio\" name=\"icon\" value=\"".$dbicon['iid']."\" /> <img src=\"".$dbicon['path']."\" alt=\"".$dbicon['name']."\" /></label>";
}


Zeile 1534Zeile 1552
		{
$iconlist .= "<br />";
$listed = 0;

		{
$iconlist .= "<br />";
$listed = 0;

		}
}

		}
}


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



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


Zeile 1553Zeile 1571
function my_setcookie($name, $value="", $expires="", $httponly=false)
{
global $mybb;

function my_setcookie($name, $value="", $expires="", $httponly=false)
{
global $mybb;





	if(!$mybb->settings['cookiepath'])
{
$mybb->settings['cookiepath'] = "/";

	if(!$mybb->settings['cookiepath'])
{
$mybb->settings['cookiepath'] = "/";

Zeile 1562Zeile 1580
	if($expires == -1)
{
$expires = 0;

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

	}

	}

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

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

Zeile 1570Zeile 1588
	else
{
$expires = TIME_NOW + intval($expires);

	else
{
$expires = TIME_NOW + intval($expires);

	}


	}


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

	$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 1580Zeile 1598
	$cookie = "Set-Cookie: {$mybb->settings['cookieprefix']}{$name}=".urlencode($value);

if($expires > 0)

	$cookie = "Set-Cookie: {$mybb->settings['cookieprefix']}{$name}=".urlencode($value);

if($expires > 0)

	{

	{

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

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

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

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

	{

	{

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

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

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

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

	}


	}


	if($httponly == true)
{
$cookie .= "; HttpOnly";

	if($httponly == true)
{
$cookie .= "; HttpOnly";

Zeile 1606Zeile 1624

/**
* Unset a cookie set by MyBB.


/**
* Unset a cookie set by MyBB.

 *

 *

 * @param string The cookie identifier.
*/
function my_unsetcookie($name)

 * @param string The cookie identifier.
*/
function my_unsetcookie($name)

Zeile 1637Zeile 1655

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



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


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

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

	{
return $cookie[$id];
}

	{
return $cookie[$id];
}

Zeile 1660Zeile 1678
	
$cookie = $mybb->cookies['mybb'];
$newcookie = unserialize($cookie[$name]);

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

 

if(!is_array($newcookie))
{
// Burnt / malformed cookie - reset
$newcookie = array();
}


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

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

Zeile 1676Zeile 1701
function get_server_load()
{
global $lang;

function get_server_load()
{
global $lang;


$serverload = array();



$serverload = array();


	// DIRECTORY_SEPARATOR checks if running windows
if(DIRECTORY_SEPARATOR != '\\')
{

	// DIRECTORY_SEPARATOR checks if running windows
if(DIRECTORY_SEPARATOR != '\\')
{

Zeile 1749Zeile 1774

$counters = array('numthreads','numunapprovedthreads','numposts','numunapprovedposts','numusers');
$update = array();


$counters = array('numthreads','numunapprovedthreads','numposts','numunapprovedposts','numusers');
$update = array();

	foreach($counters as $counter)

	foreach($counters as $counter)

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

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

Zeile 1834Zeile 1859
			if(substr($changes[$counter], 0, 1) == "+" || substr($changes[$counter], 0, 1) == "-")
{
$update_query[$counter] = $forum[$counter] + $changes[$counter];

			if(substr($changes[$counter], 0, 1) == "+" || substr($changes[$counter], 0, 1) == "-")
{
$update_query[$counter] = $forum[$counter] + $changes[$counter];

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

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


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

// Less than 0? That's bad
if(!$update_query[$counter])
{
$update_query[$counter] = 0;
}
}
}


	// Only update if we're actually doing something
if(count($update_query) > 0)
{

	// Only update if we're actually doing something
if(count($update_query) > 0)
{

Zeile 1943Zeile 1968
		"lastposteruid" => intval($lastpost['lastposteruid']),
"lastposttid" => intval($lastpost['tid']),
"lastpostsubject" => $db->escape_string($lastpost['subject'])

		"lastposteruid" => intval($lastpost['lastposteruid']),
"lastposttid" => intval($lastpost['tid']),
"lastpostsubject" => $db->escape_string($lastpost['subject'])

	);


	);


	$db->update_query("forums", $updated_forum, "fid='{$fid}'");
}


	$db->update_query("forums", $updated_forum, "fid='{$fid}'");
}


Zeile 2041Zeile 2066
	if(!$lastpost['username'])
{
$lastpost['username'] = $lastpost['postusername'];

	if(!$lastpost['username'])
{
$lastpost['username'] = $lastpost['postusername'];

	}


	}


	if(!$lastpost['dateline'])
{
$lastpost['username'] = $firstpost['username'];

	if(!$lastpost['dateline'])
{
$lastpost['username'] = $firstpost['username'];

Zeile 2073Zeile 2098
function update_thread_count($tid)
{
die("Deprecated function call: update_thread_count");

function update_thread_count($tid)
{
die("Deprecated function call: update_thread_count");

}

}

function update_thread_attachment_count($tid)
{
die("Deprecated function call: update_thread_attachment_count");

function update_thread_attachment_count($tid)
{
die("Deprecated function call: update_thread_attachment_count");

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

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

{
global $moderation;

if(!is_object($moderation))
{
require_once MYBB_ROOT."inc/class_moderation.php";
$moderation = new Moderation;

{
global $moderation;

if(!is_object($moderation))
{
require_once MYBB_ROOT."inc/class_moderation.php";
$moderation = new Moderation;

	}

return $moderation->delete_thread($tid);

	}

return $moderation->delete_thread($tid);

}

/**

}

/**

 * Deletes a post from the database
*
* @param int The thread ID
*/
function delete_post($pid, $tid="")

 * Deletes a post from the database
*
* @param int The thread ID
*/
function delete_post($pid, $tid="")

{

{

	global $moderation;

if(!is_object($moderation))

	global $moderation;

if(!is_object($moderation))

Zeile 2133Zeile 2158
	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);





	if($permissions)

	if($permissions)

	{

	{

		$permissions = $mybb->usergroup;
}

if(!is_array($jumpfcache))

		$permissions = $mybb->usergroup;
}

if(!is_array($jumpfcache))

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

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


foreach($forum_cache as $fid => $forum)
{


foreach($forum_cache as $fid => $forum)
{

Zeile 2292Zeile 2317
 * @return string The MyCode inserter
*/
function build_mycode_inserter($bind="message")

 * @return string The MyCode inserter
*/
function build_mycode_inserter($bind="message")

{

{

	global $db, $mybb, $theme, $templates, $lang, $plugins;

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

	global $db, $mybb, $theme, $templates, $lang, $plugins;

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

Zeile 2489Zeile 2514
	if($mybb->user['additionalgroups'])
{
$exp = explode(",", $mybb->user['additionalgroups']);

	if($mybb->user['additionalgroups'])
{
$exp = explode(",", $mybb->user['additionalgroups']);





		// Because we like apostrophes...
$imps = array();
foreach($exp as $group)

		// Because we like apostrophes...
$imps = array();
foreach($exp as $group)

Zeile 2509Zeile 2534
	{
case "pgsql":
case "sqlite":

	{
case "pgsql":
case "sqlite":

			$whereforum = "";
if($fid != 'all')
{

			$whereforum = "";
if($fid != 'all')
{

				$whereforum = " AND (','||forums||',' LIKE '%,{$fid},%' OR ','||forums||',' LIKE '%,-1,%' OR forums='')";

				$whereforum = " AND (','||forums||',' LIKE '%,{$fid},%' OR ','||forums||',' LIKE '%,-1,%' OR forums='')";

			}

$query = $db->query("
SELECT pid, prefix
FROM ".TABLE_PREFIX."threadprefixes

			}

$query = $db->query("
SELECT pid, prefix
FROM ".TABLE_PREFIX."threadprefixes

				WHERE ({$extra_sql}','||groups||',' LIKE '%,{$mybb->user['usergroup']},%' OR ','||groups||',' LIKE '%,-1,%' OR groups='')
{$whereforum}
");

				WHERE ({$extra_sql}','||groups||',' LIKE '%,{$mybb->user['usergroup']},%' OR ','||groups||',' LIKE '%,-1,%' OR groups='')
{$whereforum}
");

Zeile 2535Zeile 2560
				WHERE ({$extra_sql}CONCAT(',',groups,',') LIKE '%,{$mybb->user['usergroup']},%' OR CONCAT(',',groups,',') LIKE '%,-1,%' OR groups='')
{$whereforum}
");

				WHERE ({$extra_sql}CONCAT(',',groups,',') LIKE '%,{$mybb->user['usergroup']},%' OR CONCAT(',',groups,',') LIKE '%,-1,%' OR groups='')
{$whereforum}
");

	}

$prefixselect = "";


	}

$prefixselect = "";


	if($db->num_rows($query) > 0)
{
$multipleselect = "";

	if($db->num_rows($query) > 0)
{
$multipleselect = "";

Zeile 2945Zeile 2970
		$permissioncache = forum_permissions();
}


		$permissioncache = forum_permissions();
}


 
	$password_forums = array();

	foreach($forum_cache as $fid => $forum)
{
if($permissioncache[$forum['fid']])

	foreach($forum_cache as $fid => $forum)
{
if($permissioncache[$forum['fid']])

Zeile 2963Zeile 2989
			if($mybb->cookies['forumpass'][$forum['fid']] != md5($mybb->user['uid'].$forum['password']))
{
$pwverified = 0;

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

 
			}

$password_forums[$forum['fid']] = $forum['password'];
}
else
{
// Check parents for passwords
$parents = explode(",", $forum['parentlist']);
foreach($parents as $parent)
{
if(isset($password_forums[$parent]) && $mybb->cookies['forumpass'][$parent] != md5($mybb->user['uid'].$password_forums[$parent]))
{
$pwverified = 0;
}

			}
}


			}
}


Zeile 2986Zeile 3026
 * @param string The date format to use
* @param int The year of the date
* @return string The correct date format

 * @param string The date format to use
* @param int The year of the date
* @return string The correct date format

 */

 */

function fix_mktime($format, $year)
{
// Our little work around for the date < 1970 thing.

function fix_mktime($format, $year)
{
// Our little work around for the date < 1970 thing.

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

$i = 0;

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

$i = 0;

	

	

	if(is_array($navbits))
{
reset($navbits);

	if(is_array($navbits))
{
reset($navbits);

Zeile 3024Zeile 3064
				else
{
$sep = "";

				else
{
$sep = "";

				}


				}


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

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

Zeile 3053Zeile 3093
	}

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

	}

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

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


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


	return $donenav;
}


	return $donenav;
}


Zeile 3145Zeile 3185
 * Resets the breadcrumb navigation to the first item, and clears the rest
*/
function reset_breadcrumb()

 * Resets the breadcrumb navigation to the first item, and clears the rest
*/
function reset_breadcrumb()

{

{

	global $navbits;

$newnav[0]['name'] = $navbits[0]['name'];

	global $navbits;

$newnav[0]['name'] = $navbits[0]['name'];

Zeile 3173Zeile 3213
		$base_url = $mybb->settings['bburl']."/archive/index.php?";
}
else

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

	{

	{

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


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


Zeile 3184Zeile 3224
			break;
case "announcement":
$url = "{$base_url}announcement-{$id}.html";

			break;
case "announcement":
$url = "{$base_url}announcement-{$id}.html";

			break;

			break;

		case "forum":
$url = "{$base_url}forum-{$id}.html";
break;
default:
$url = $mybb->settings['bburl']."/archive/index.php";

		case "forum":
$url = "{$base_url}forum-{$id}.html";
break;
default:
$url = $mybb->settings['bburl']."/archive/index.php";

	}


	}


	return $url;
}


	return $url;
}


Zeile 3325Zeile 3365
 * Outputs the correct page headers.
*/
function send_page_headers()

 * Outputs the correct page headers.
*/
function send_page_headers()

{
global $mybb;


{
global $mybb;


	if($mybb->settings['nocacheheaders'] == 1 && $mybb->settings['standardheaders'] != 1)
{
header("Expires: Sat, 1 Jan 2000 01:00:00 GMT");

	if($mybb->settings['nocacheheaders'] == 1 && $mybb->settings['standardheaders'] != 1)
{
header("Expires: Sat, 1 Jan 2000 01:00:00 GMT");

Zeile 3350Zeile 3390
	switch($type)
{
case "posts":

	switch($type)
{
case "posts":

			if(is_array($id))
{
$rids = implode($id, "','");

			if(is_array($id))
{
$rids = implode($id, "','");

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

				$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;

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

		case "threads":
if(is_array($id))
{

		case "threads":
if(is_array($id))
{

Zeile 3377Zeile 3417
		case "all":
$db->update_query("reportedposts", array('reportstatus' => 1), "reportstatus='0'");
break;

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

	}

	}


$arguments = array('id' => $id, 'type' => $type);
$plugins->run_hooks("mark_reports", $arguments);


$arguments = array('id' => $id, 'type' => $type);
$plugins->run_hooks("mark_reports", $arguments);

Zeile 3524Zeile 3564
	}

if(is_array($nicetime))

	}

if(is_array($nicetime))

	{

	{

		return implode(", ", $nicetime);
}
}

/**
* Select an alternating row colour based on the previous call to this function

		return implode(", ", $nicetime);
}
}

/**
* Select an alternating row colour based on the previous call to this function

 *

 *

 * @param int 1 to reset the row to trow1.
* @return string trow1 or trow2 depending on the previous call
*/

 * @param int 1 to reset the row to trow1.
* @return string trow1 or trow2 depending on the previous call
*/

Zeile 3542Zeile 3582
	if($alttrow == "trow1" && !$reset)
{
$trow = "trow2";

	if($alttrow == "trow1" && !$reset)
{
$trow = "trow2";

	}
else

	}
else

	{
$trow = "trow1";

	{
$trow = "trow1";

	}

$alttrow = $trow;


	}

$alttrow = $trow;


	return $trow;
}


	return $trow;
}


Zeile 3562Zeile 3602
function join_usergroup($uid, $joingroup)
{
global $db, $mybb;

function join_usergroup($uid, $joingroup)
{
global $db, $mybb;





	if($uid == $mybb->user['uid'])
{
$user = $mybb->user;

	if($uid == $mybb->user['uid'])
{
$user = $mybb->user;

Zeile 3574Zeile 3614
	}

// Build the new list of additional groups for this user and make sure they're in the right format

	}

// Build the new list of additional groups for this user and make sure they're in the right format

	$usergroups = "";

	$usergroups = "";

	$usergroups = $user['additionalgroups'].",".$joingroup;
$groupslist = "";
$groups = explode(",", $usergroups);

	$usergroups = $user['additionalgroups'].",".$joingroup;
$groupslist = "";
$groups = explode(",", $usergroups);

Zeile 3590Zeile 3630
				$donegroup[$gid] = 1;
}
}

				$donegroup[$gid] = 1;
}
}

	}


	}


	// What's the point in updating if they're the same?
if($groupslist != $user['additionalgroups'])
{
$db->update_query("users", array('additionalgroups' => $groupslist), "uid='".intval($uid)."'");
return true;

	// What's the point in updating if they're the same?
if($groupslist != $user['additionalgroups'])
{
$db->update_query("users", array('additionalgroups' => $groupslist), "uid='".intval($uid)."'");
return true;

	}

	}

	else
{
return false;
}
}

	else
{
return false;
}
}





/**
* Remove a user from a specific additional user group
*

/**
* Remove a user from a specific additional user group
*

Zeile 3615Zeile 3655
	global $db, $mybb, $cache;

if($uid == $mybb->user['uid'])

	global $db, $mybb, $cache;

if($uid == $mybb->user['uid'])

	{

	{

		$user = $mybb->user;

		$user = $mybb->user;

	}

	}

	else
{
$query = $db->simple_select("users", "*", "uid='".intval($uid)."'");
$user = $db->fetch_array($query);

	else
{
$query = $db->simple_select("users", "*", "uid='".intval($uid)."'");
$user = $db->fetch_array($query);

	}


	}


	$groupslist = "";
$usergroups = "";
$usergroups = $user['additionalgroups'].",";

	$groupslist = "";
$usergroups = "";
$usergroups = $user['additionalgroups'].",";

Zeile 3721Zeile 3761
		if(isset($_SERVER['QUERY_STRING']))
{
$location .= "?".htmlspecialchars_uni($_SERVER['QUERY_STRING']);

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

		}

		}

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

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

		}

		}

		
if((isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == "POST") || (isset($_ENV['REQUEST_METHOD']) && $_ENV['REQUEST_METHOD'] == "POST"))
{

		
if((isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == "POST") || (isset($_ENV['REQUEST_METHOD']) && $_ENV['REQUEST_METHOD'] == "POST"))
{

Zeile 3736Zeile 3776
				if(isset($_POST[$var]))
{
$addloc[] = urlencode($var).'='.urlencode($_POST[$var]);

				if(isset($_POST[$var]))
{
$addloc[] = urlencode($var).'='.urlencode($_POST[$var]);

				}
}

				}
}

	
if(isset($addloc) && is_array($addloc))
{

	
if(isset($addloc) && is_array($addloc))
{

Zeile 3752Zeile 3792
				$location .= implode("&amp;", $addloc);
}
}

				$location .= implode("&amp;", $addloc);
}
}

	







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


		return $location;
}
}

		return $location;
}
}

Zeile 3869Zeile 3914
 * @return int The formatted number.
*/
function my_number_format($number)

 * @return int The formatted number.
*/
function my_number_format($number)

{

{

	global $mybb;

	global $mybb;





	if($number == "-")
{
return $number;

	if($number == "-")
{
return $number;

	}


	}


	if(is_int($number))
{
return number_format($number, 0, $mybb->settings['decpoint'], $mybb->settings['thousandssep']);
}
else

	if(is_int($number))
{
return number_format($number, 0, $mybb->settings['decpoint'], $mybb->settings['thousandssep']);
}
else

	{

	{

		$parts = explode('.', $number);

if(isset($parts[1]))
{
$decimals = my_strlen($parts[1]);

		$parts = explode('.', $number);

if(isset($parts[1]))
{
$decimals = my_strlen($parts[1]);

		}

		}

		else
{
$decimals = 0;

		else
{
$decimals = 0;

Zeile 3906Zeile 3951
	static $use_iconv;

if(!isset($charset))

	static $use_iconv;

if(!isset($charset))

	{

	{

		$charset = my_strtolower($lang->settings['charset']);
}


		$charset = my_strtolower($lang->settings['charset']);
}


Zeile 3918Zeile 3963
	if(!isset($use_iconv))
{
$use_iconv = function_exists("iconv");

	if(!isset($use_iconv))
{
$use_iconv = function_exists("iconv");

	}

	}

	
if(!isset($use_mb))
{

	
if(!isset($use_mb))
{

Zeile 3931Zeile 3976
		{
$from_charset = $lang->settings['charset'];
$to_charset = "UTF-8";

		{
$from_charset = $lang->settings['charset'];
$to_charset = "UTF-8";

		}

		}

		else
{
$from_charset = "UTF-8";

		else
{
$from_charset = "UTF-8";

Zeile 3956Zeile 4001
		{
return utf8_decode($str);
}

		{
return utf8_decode($str);
}

	}

	}

	else
{
return $str;

	else
{
return $str;

Zeile 3968Zeile 4013
 *
* @param string The string to be word wrapped
* @return string The word wraped string

 *
* @param string The string to be word wrapped
* @return string The word wraped string

 */

 */

function my_wordwrap($message)
{
global $mybb;

function my_wordwrap($message)
{
global $mybb;

Zeile 3981Zeile 4026
		{
$new_message = preg_replace("#(?>[^\s&/<>\"\\-\.\[\]]{{$mybb->settings['wordwrap']}})#", "$0&#8203;", $message);
}

		{
$new_message = preg_replace("#(?>[^\s&/<>\"\\-\.\[\]]{{$mybb->settings['wordwrap']}})#", "$0&#8203;", $message);
}

		

		

		$new_message = convert_through_utf8($new_message, false);

return $new_message;

		$new_message = convert_through_utf8($new_message, false);

return $new_message;

Zeile 4005Zeile 4050
	for($i = 1969; $i >= $year; $i--)
{
$j = get_bdays($i);

	for($i = 1969; $i >= $year; $i--)
{
$j = get_bdays($i);





		for($k = 11; $k >= 0; $k--)
{
$l = ($k + 1);

		for($k = 11; $k >= 0; $k--)
{
$l = ($k + 1);

Zeile 4017Zeile 4062
				if($i == $year && $l == $month && $m == $day)
{
return $h;

				if($i == $year && $l == $month && $m == $day)
{
return $h;

				}

				}


if($h == 0)
{


if($h == 0)
{

Zeile 4101Zeile 4146
		'Y',
'j',
'S',

		'Y',
'j',
'S',

		'l',

 
		'F',

		'F',

 
		'l',

		'M',
);


		'M',
);


Zeile 4114Zeile 4159
		$by,
($bd[0] == 0 ? my_substr($bd, 1) : $bd),
($bd == 1 || $bd == 21 || $bd == 31 ? 'st' : ($bd == 2 || $bd == 22 ? 'nd' : ($bd == 3 || $bd == 23 ? 'rd' : 'th'))),

		$by,
($bd[0] == 0 ? my_substr($bd, 1) : $bd),
($bd == 1 || $bd == 21 || $bd == 31 ? 'st' : ($bd == 2 || $bd == 22 ? 'nd' : ($bd == 3 || $bd == 23 ? 'rd' : 'th'))),

		$wd,

 
		$bmonth[$bm-1],

		$bmonth[$bm-1],

 
		$wd,

		($bm == 9 ? my_substr($bmonth[$bm-1], 0, 4) :  my_substr($bmonth[$bm-1], 0, 3)),
);


		($bm == 9 ? my_substr($bmonth[$bm-1], 0, 4) :  my_substr($bmonth[$bm-1], 0, 3)),
);


Zeile 4935Zeile 4980
	{
$uid_string = " AND uid != '".intval($uid)."'";
}

	{
$uid_string = " AND uid != '".intval($uid)."'";
}

	$query = $db->simple_select("users", "COUNT(email) as emails", "email = '".$db->escape_string(my_strtolower($email))."'{$uid_string}");

	$query = $db->simple_select("users", "COUNT(email) as emails", "email = '".$db->escape_string($email)."'{$uid_string}");

	
if($db->fetch_field($query, "emails") > 0)
{

	
if($db->fetch_field($query, "emails") > 0)
{