Vergleich global.php - 1.4.0 - 1.4.16

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * $Id: global.php 4001 2008-07-08 22:34:00Z Tikitiki $

 * $Id: global.php 5379 2011-02-21 11:06:42Z Tomm $

 */

 */

 
 
$working_dir = dirname(__FILE__);
if(!$working_dir)
{
$working_dir = '.';
}


// Load main MyBB core file which begins all of the magic


// Load main MyBB core file which begins all of the magic

require_once "./inc/init.php";

require_once $working_dir."/inc/init.php";


$shutdown_queries = array();



$shutdown_queries = array();


Zeile 19Zeile 25

// If the groups cache doesn't exist, update it and re-read it
if(!is_array($groupscache))


// If the groups cache doesn't exist, update it and re-read it
if(!is_array($groupscache))

{

{

	$cache->update_usergroups();
$groupscache = $cache->read("usergroups");
}


	$cache->update_usergroups();
$groupscache = $cache->read("usergroups");
}


$current_page = my_strtolower(basename($_SERVER['PHP_SELF']));







if(!defined('THIS_SCRIPT'))
{
define('THIS_SCRIPT', '');
}

$current_page = my_strtolower(basename(THIS_SCRIPT));



// Send page headers - don't send no-cache headers for attachment.php
if($current_page != "attachment.php")


// Send page headers - don't send no-cache headers for attachment.php
if($current_page != "attachment.php")

Zeile 63Zeile 75
	{
my_setcookie("mybblang", $mybb->settings['bblanguage']);
}

	{
my_setcookie("mybblang", $mybb->settings['bblanguage']);
}

 
	$mybb->user['language'] = $mybb->settings['bblanguage'];

}
// Cookied language!
else if($mybb->cookies['mybblang'] && $lang->language_exists($mybb->cookies['mybblang']))

}
// Cookied language!
else if($mybb->cookies['mybblang'] && $lang->language_exists($mybb->cookies['mybblang']))

Zeile 114Zeile 127
if(in_array($current_page, $valid))
{
// If we're accessing a post, fetch the forum theme for it and if we're overriding it

if(in_array($current_page, $valid))
{
// If we're accessing a post, fetch the forum theme for it and if we're overriding it

	if(isset($mybb->input['pid']))

	if($mybb->input['pid'])

	{
$query = $db->query("
SELECT f.style, f.overridestyle, p.*

	{
$query = $db->query("
SELECT f.style, f.overridestyle, p.*

Zeile 129Zeile 142
	}

// We have a thread id and a forum id, we can easily fetch the theme for this forum

	}

// We have a thread id and a forum id, we can easily fetch the theme for this forum

	else if(isset($mybb->input['tid']))
{

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

		$query = $db->query("
SELECT f.style, f.overridestyle, t.*
FROM ".TABLE_PREFIX."forums f

		$query = $db->query("
SELECT f.style, f.overridestyle, t.*
FROM ".TABLE_PREFIX."forums f

Zeile 143Zeile 156
	}

// We have a forum id - simply load the theme from it

	}

// We have a forum id - simply load the theme from it

	else if(isset($mybb->input['fid']))

	else if($mybb->input['fid'])

	{
cache_forums();
$style = $forum_cache[intval($mybb->input['fid'])];

	{
cache_forums();
$style = $forum_cache[intval($mybb->input['fid'])];

Zeile 154Zeile 167

// From all of the above, a theme was found
if(isset($style['style']) && $style['style'] > 0)


// From all of the above, a theme was found
if(isset($style['style']) && $style['style'] > 0)

{

{

	// This theme is forced upon the user, overriding their selection
if($style['overridestyle'] == 1 || !isset($mybb->user['style']))
{
$loadstyle = "tid='".intval($style['style'])."'";

	// This theme is forced upon the user, overriding their selection
if($style['overridestyle'] == 1 || !isset($mybb->user['style']))
{
$loadstyle = "tid='".intval($style['style'])."'";

	}
}


	}
}


// After all of that no theme? Load the board default
if(empty($loadstyle))
{

// After all of that no theme? Load the board default
if(empty($loadstyle))
{

Zeile 190Zeile 203
	$theme = $db->fetch_array($query);
}
$theme = @array_merge($theme, unserialize($theme['properties']));

	$theme = $db->fetch_array($query);
}
$theme = @array_merge($theme, unserialize($theme['properties']));





// Fetch all necessary stylesheets
$theme['stylesheets'] = unserialize($theme['stylesheets']);
$stylesheet_scripts = array("global", basename($_SERVER['PHP_SELF']));

// Fetch all necessary stylesheets
$theme['stylesheets'] = unserialize($theme['stylesheets']);
$stylesheet_scripts = array("global", basename($_SERVER['PHP_SELF']));

Zeile 368Zeile 381
		else 
{
$banlift = $lang->banned_lifted_never;

		else 
{
$banlift = $lang->banned_lifted_never;

		}

		}

		$reason = htmlspecialchars_uni($ban['reason']);
}
if(empty($reason))

		$reason = htmlspecialchars_uni($ban['reason']);
}
if(empty($reason))

	{

	{

		$reason = $lang->unknown;
}
if(empty($banlift))

		$reason = $lang->unknown;
}
if(empty($banlift))

Zeile 382Zeile 395
	// Display a nice warning to the user
eval("\$bannedwarning = \"".$templates->get("global_bannedwarning")."\";");
}

	// Display a nice warning to the user
eval("\$bannedwarning = \"".$templates->get("global_bannedwarning")."\";");
}





$lang->ajax_loading = str_replace("'", "\\'", $lang->ajax_loading);

// Check if this user has a new private message.

$lang->ajax_loading = str_replace("'", "\\'", $lang->ajax_loading);

// Check if this user has a new private message.

Zeile 397Zeile 410
		LIMIT 1
");
$pm = $db->fetch_array($query);

		LIMIT 1
");
$pm = $db->fetch_array($query);

 
	
if($pm['fromuid'] == 0)
{
$pm['fromusername'] = 'MyBB Engine';
$user_text = $pm['fromusername'];
}
else
{
$user_text = build_profile_link($pm['fromusername'], $pm['fromuid']);
}


	if($mybb->user['pms_unread'] == 1)
{

	if($mybb->user['pms_unread'] == 1)
{

		$privatemessage_text = $lang->sprintf($lang->newpm_notice_one, get_profile_link($pm['fromuid']), $pm['fromusername'], $pm['pmid'], $pm['subject']);

		$privatemessage_text = $lang->sprintf($lang->newpm_notice_one, $user_text, $pm['pmid'], htmlspecialchars_uni($pm['subject']));

	}
else
{

	}
else
{

		$privatemessage_text = $lang->sprintf($lang->newpm_notice_multiple, $mybb->user['pms_unread'], get_profile_link($pm['fromuid']), $pm['fromusername'], $pm['pmid'], $pm['subject']);

		$privatemessage_text = $lang->sprintf($lang->newpm_notice_multiple, $mybb->user['pms_unread'], $user_text, $pm['pmid'], htmlspecialchars_uni($pm['subject']));

	}
eval("\$pm_notice = \"".$templates->get("global_pm_alert")."\";");
}

	}
eval("\$pm_notice = \"".$templates->get("global_pm_alert")."\";");
}

Zeile 487Zeile 511
// Check banned ip addresses
if(is_banned_ip($session->ipaddress, true))
{

// Check banned ip addresses
if(is_banned_ip($session->ipaddress, true))
{

	$db->delete_query("sessions", "ip='".$db->escape_string($session->ipaddress)."' OR uid='{$mybb->user['uid']}'");








	if ($mybb->user['uid'])
{
$db->delete_query("sessions", "ip='".$db->escape_string($session->ipaddress)."' OR uid='{$mybb->user['uid']}'");
}
else
{
$db->delete_query("sessions", "ip='".$db->escape_string($session->ipaddress)."'");
}

	error($lang->error_banned);
}

	error($lang->error_banned);
}

 

$closed_bypass = array(
"member.php" => array(
"login",
"do_login",
"logout",
),
"captcha.php",
);


// If the board is closed, the user is not an administrator and they're not trying to login, show the board closed message


// If the board is closed, the user is not an administrator and they're not trying to login, show the board closed message

if($mybb->settings['boardclosed'] == 1 && $mybb->usergroup['cancp'] != 1 && !($current_page == "member.php" && ($mybb->input['action'] == "login" || $mybb->input['action'] == "do_login" || $mybb->input['action'] == "logout")))

if($mybb->settings['boardclosed'] == 1 && $mybb->usergroup['cancp'] != 1 && !in_array($current_page, $closed_bypass) && (!is_array($closed_bypass[$current_page]) || !in_array($mybb->input['action'], $closed_bypass[$current_page])))

{
// Show error
$lang->error_boardclosed .= "<blockquote>{$mybb->settings['boardclosed_reason']}</blockquote>";

{
// Show error
$lang->error_boardclosed .= "<blockquote>{$mybb->settings['boardclosed_reason']}</blockquote>";