Vergleich global.php - 1.4.1 - 1.4.14

  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 4098 2008-08-10 03:18:01Z chris $

 * $Id: global.php 4430 2009-08-22 23:27:11Z RyanGordon $

 */

 */









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

// Read the usergroups cache as well as the moderators cache
$groupscache = $cache->read("usergroups");

$shutdown_queries = array();

// Read the usergroups cache as well as the moderators cache
$groupscache = $cache->read("usergroups");





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

Zeile 27Zeile 33
if(!defined('THIS_SCRIPT'))
{
define('THIS_SCRIPT', '');

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

}

$current_page = my_strtolower(basename(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 68Zeile 74
	else
{
my_setcookie("mybblang", $mybb->settings['bblanguage']);

	else
{
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 89Zeile 96
$plugins->run_hooks("global_start");

if(function_exists('mb_internal_encoding') && !empty($lang->settings['charset']))

$plugins->run_hooks("global_start");

if(function_exists('mb_internal_encoding') && !empty($lang->settings['charset']))

{

{

	@mb_internal_encoding($lang->settings['charset']);
}


	@mb_internal_encoding($lang->settings['charset']);
}


Zeile 120Zeile 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.*
FROM ".TABLE_PREFIX."forums f
LEFT JOIN ".TABLE_PREFIX."posts p ON(f.fid=p.fid)
WHERE p.pid='".intval($mybb->input['pid'])."'

	{
$query = $db->query("
SELECT f.style, f.overridestyle, p.*
FROM ".TABLE_PREFIX."forums f
LEFT JOIN ".TABLE_PREFIX."posts p ON(f.fid=p.fid)
WHERE p.pid='".intval($mybb->input['pid'])."'

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

$load_from_forum = 1;

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

$load_from_forum = 1;

	}

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

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

Zeile 149Zeile 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 194Zeile 201
	// Attempt to load the master or any other theme if the master is not available
$query = $db->simple_select("themes", "name, tid, properties, stylesheets", "", array("order_by" => "tid", "limit" => 1));
$theme = $db->fetch_array($query);

	// Attempt to load the master or any other theme if the master is not available
$query = $db->simple_select("themes", "name, tid, properties, stylesheets", "", array("order_by" => "tid", "limit" => 1));
$theme = $db->fetch_array($query);

}

}

$theme = @array_merge($theme, unserialize($theme['properties']));

// Fetch all necessary stylesheets

$theme = @array_merge($theme, unserialize($theme['properties']));

// Fetch all necessary stylesheets

Zeile 407Zeile 414
	if($pm['fromuid'] == 0)
{
$pm['fromusername'] = 'MyBB Engine';

	if($pm['fromuid'] == 0)
{
$pm['fromusername'] = 'MyBB Engine';

 
		$user_text = $pm['fromusername'];

	}

	}

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

	else


	{

	{

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






		$user_text = build_profile_link($pm['fromusername'], $pm['fromuid']);
}

if($mybb->user['pms_unread'] == 1)
{
$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 425Zeile 437
eval("\$gobutton = \"".$templates->get("gobutton")."\";");
eval("\$htmldoctype = \"".$templates->get("htmldoctype", 1, 0)."\";");
eval("\$header = \"".$templates->get("header")."\";");

eval("\$gobutton = \"".$templates->get("gobutton")."\";");
eval("\$htmldoctype = \"".$templates->get("htmldoctype", 1, 0)."\";");
eval("\$header = \"".$templates->get("header")."\";");





$copy_year = my_date("Y", TIME_NOW);

// Are we showing version numbers in the footer?

$copy_year = my_date("Y", TIME_NOW);

// Are we showing version numbers in the footer?

Zeile 440Zeile 452

// Check to see if we have any tasks to run
if($mybb->settings['taskscron'] != 1)


// Check to see if we have any tasks to run
if($mybb->settings['taskscron'] != 1)

{

{

	$task_cache = $cache->read("tasks");
if(!$task_cache['nextrun'])
{

	$task_cache = $cache->read("tasks");
if(!$task_cache['nextrun'])
{

Zeile 453Zeile 465
	else
{
$task_image = '';

	else
{
$task_image = '';

	}
}


	}
}


// Are we showing the quick language selection box?
$lang_select = '';
if($mybb->settings['showlanguageselect'] != 0)

// Are we showing the quick language selection box?
$lang_select = '';
if($mybb->settings['showlanguageselect'] != 0)

Zeile 478Zeile 490
	$lang_redirect_url = get_current_location(true, 'language');

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

	$lang_redirect_url = get_current_location(true, 'language');

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

}


}


// DST Auto detection enabled?
if($mybb->user['uid'] > 0 && $mybb->user['dstcorrection'] == 2)
{
$auto_dst_detection = "<script type=\"text/javascript\">if(MyBB) { Event.observe(window, 'load', function() { MyBB.detectDSTChange('".($mybb->user['timezone']+$mybb->user['dst'])."'); }); }</script>\n";

// DST Auto detection enabled?
if($mybb->user['uid'] > 0 && $mybb->user['dstcorrection'] == 2)
{
$auto_dst_detection = "<script type=\"text/javascript\">if(MyBB) { Event.observe(window, 'load', function() { MyBB.detectDSTChange('".($mybb->user['timezone']+$mybb->user['dst'])."'); }); }</script>\n";

}


}


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

// Add our main parts to the navigation

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

// Add our main parts to the navigation

Zeile 499Zeile 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>";