Vergleich global.php - 1.6.9 - 1.6.11

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 61Zeile 61
$mybb->post_code = generate_post_check();

// Set and load the language

$mybb->post_code = generate_post_check();

// Set and load the language

if($mybb->input['language'] && $lang->language_exists($mybb->input['language']) && verify_post_check($mybb->input['my_post_key'], true))

if(!empty($mybb->input['language']) && $lang->language_exists($mybb->input['language']) && verify_post_check($mybb->input['my_post_key'], true))

{
$mybb->settings['bblanguage'] = $mybb->input['language'];
// If user is logged in, update their language selection with the new one

{
$mybb->settings['bblanguage'] = $mybb->input['language'];
// If user is logged in, update their language selection with the new one

Zeile 82Zeile 82
	$mybb->user['language'] = $mybb->settings['bblanguage'];
}
// Cookied language!

	$mybb->user['language'] = $mybb->settings['bblanguage'];
}
// Cookied language!

else if(!$mybb->user['uid'] && $mybb->cookies['mybblang'] && $lang->language_exists($mybb->cookies['mybblang']))

else if(!$mybb->user['uid'] && !empty($mybb->cookies['mybblang']) && $lang->language_exists($mybb->cookies['mybblang']))

{
$mybb->settings['bblanguage'] = $mybb->cookies['mybblang'];
}

{
$mybb->settings['bblanguage'] = $mybb->cookies['mybblang'];
}

Zeile 95Zeile 95
$lang->set_language($mybb->settings['bblanguage']);
$lang->load("global");
$lang->load("messages");

$lang->set_language($mybb->settings['bblanguage']);
$lang->load("global");
$lang->load("messages");

 
$newpmmsg = '';


// Run global_start plugin hook now that the basics are set up
$plugins->run_hooks("global_start");


// Run global_start plugin hook now that the basics are set up
$plugins->run_hooks("global_start");

Zeile 133Zeile 134
	cache_forums();

// If we're accessing a post, fetch the forum theme for it and if we're overriding it

	cache_forums();

// If we're accessing a post, fetch the forum theme for it and if we're overriding it

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

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

	{
$query = $db->simple_select("posts", "fid", "pid = '".intval($mybb->input['pid'])."'", array("limit" => 1));
$fid = $db->fetch_field($query, "fid");

	{
$query = $db->simple_select("posts", "fid", "pid = '".intval($mybb->input['pid'])."'", array("limit" => 1));
$fid = $db->fetch_field($query, "fid");

Zeile 144Zeile 145
			$load_from_forum = 1;
}
}

			$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($mybb->input['tid'])

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

	{
$query = $db->simple_select("threads", "fid", "tid = '".intval($mybb->input['tid'])."'", array("limit" => 1));
$fid = $db->fetch_field($query, "fid");

	{
$query = $db->simple_select("threads", "fid", "tid = '".intval($mybb->input['tid'])."'", array("limit" => 1));
$fid = $db->fetch_field($query, "fid");

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

// Fetch all necessary stylesheets

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

// Fetch all necessary stylesheets

 
$stylesheets = '';

$theme['stylesheets'] = unserialize($theme['stylesheets']);
$stylesheet_scripts = array("global", basename($_SERVER['PHP_SELF']));
foreach($stylesheet_scripts as $stylesheet_script)
{
$stylesheet_actions = array("global");

$theme['stylesheets'] = unserialize($theme['stylesheets']);
$stylesheet_scripts = array("global", basename($_SERVER['PHP_SELF']));
foreach($stylesheet_scripts as $stylesheet_script)
{
$stylesheet_actions = array("global");

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

	if(!empty($mybb->input['action']))
{

		$stylesheet_actions[] = $mybb->input['action'];
}
// Load stylesheets for global actions and the current action

		$stylesheet_actions[] = $mybb->input['action'];
}
// Load stylesheets for global actions and the current action

Zeile 224Zeile 225
			continue;
}


			continue;
}


		if($theme['stylesheets'][$stylesheet_script][$stylesheet_action])

		if(!empty($theme['stylesheets'][$stylesheet_script][$stylesheet_action]))

		{
// Actually add the stylesheets to the list
foreach($theme['stylesheets'][$stylesheet_script][$stylesheet_action] as $page_stylesheet)
{

		{
// Actually add the stylesheets to the list
foreach($theme['stylesheets'][$stylesheet_script][$stylesheet_action] as $page_stylesheet)
{

				if($already_loaded[$page_stylesheet])

				if(!empty($already_loaded[$page_stylesheet]))

				{
continue;
}

				{
continue;
}

Zeile 245Zeile 246
{
// If a language directory for the current language exists within the theme - we use it
if(!empty($mybb->user['language']))

{
// If a language directory for the current language exists within the theme - we use it
if(!empty($mybb->user['language']))

	{
$theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->user['language'];
}
else

	{
$theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->user['language'];
}
else

	{
// Check if a custom language directory exists for this theme
if(!empty($mybb->settings['bblanguage']))

	{
// Check if a custom language directory exists for this theme
if(!empty($mybb->settings['bblanguage']))

		{
$theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->settings['bblanguage'];
}
// Otherwise, the image language directory is the same as the language directory for the theme
else

		{
$theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->settings['bblanguage'];
}
// Otherwise, the image language directory is the same as the language directory for the theme
else

		{
$theme['imglangdir'] = $theme['imgdir'];
}

		{
$theme['imglangdir'] = $theme['imgdir'];
}

Zeile 265Zeile 266
else
{
if(!@is_dir($theme['imgdir']))

else
{
if(!@is_dir($theme['imgdir']))

	{

	{

		$theme['imgdir'] = "images";
}


		$theme['imgdir'] = "images";
}


Zeile 282Zeile 283
			$theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->settings['bblanguage'];
}
// Otherwise, the image language directory is the same as the language directory for the theme

			$theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->settings['bblanguage'];
}
// Otherwise, the image language directory is the same as the language directory for the theme

		else
{

		else
{

			$theme['imglangdir'] = $theme['imgdir'];
}
}

			$theme['imglangdir'] = $theme['imgdir'];
}
}

Zeile 300Zeile 301
{
$templatelist .= ',';
}

{
$templatelist .= ',';
}

$templatelist .= "css,headerinclude,header,footer,gobutton,htmldoctype,header_welcomeblock_member,header_welcomeblock_guest,header_welcomeblock_member_admin,global_pm_alert,global_unreadreports,";

$templatelist .= "headerinclude,header,footer,gobutton,htmldoctype,header_welcomeblock_member,header_welcomeblock_guest,header_welcomeblock_member_admin,global_pm_alert,global_unreadreports";

$templatelist .= ",global_pending_joinrequests,nav,nav_sep,nav_bit,nav_sep_active,nav_bit_active,footer_languageselect,header_welcomeblock_member_moderator,redirect,error";

$templatelist .= ",global_pending_joinrequests,nav,nav_sep,nav_bit,nav_sep_active,nav_bit_active,footer_languageselect,header_welcomeblock_member_moderator,redirect,error";

 
$templatelist .= ",global_boardclosed_warning,global_bannedwarning,error_inline,error_nopermission_loggedin,error_nopermission";

$templates->cache($db->escape_string($templatelist));

// Set the current date and time now
$datenow = my_date($mybb->settings['dateformat'], TIME_NOW, '', false);
$timenow = my_date($mybb->settings['timeformat'], TIME_NOW);

$templates->cache($db->escape_string($templatelist));

// Set the current date and time now
$datenow = my_date($mybb->settings['dateformat'], TIME_NOW, '', false);
$timenow = my_date($mybb->settings['timeformat'], TIME_NOW);

$lang->welcome_current_time = $lang->sprintf($lang->welcome_current_time, $datenow.', '.$timenow);

$lang->welcome_current_time = $lang->sprintf($lang->welcome_current_time, $datenow . $lang->comma . $timenow);


// Format the last visit date of this user appropriately
if(isset($mybb->user['lastvisit']))


// Format the last visit date of this user appropriately
if(isset($mybb->user['lastvisit']))

{
$lastvisit = my_date($mybb->settings['dateformat'], $mybb->user['lastvisit']) . ', ' . my_date($mybb->settings['timeformat'], $mybb->user['lastvisit']);
}


{
$lastvisit = my_date($mybb->settings['dateformat'], $mybb->user['lastvisit']) . $lang->comma . my_date($mybb->settings['timeformat'], $mybb->user['lastvisit']);
}


// Otherwise, they've never visited before
else
{
$lastvisit = $lang->lastvisit_never;

// Otherwise, they've never visited before
else
{
$lastvisit = $lang->lastvisit_never;

}


}


// If the board is closed and we have an Administrator, show board closed warning
$bbclosedwarning = '';
if($mybb->settings['boardclosed'] == 1 && $mybb->usergroup['cancp'] == 1)

// If the board is closed and we have an Administrator, show board closed warning
$bbclosedwarning = '';
if($mybb->settings['boardclosed'] == 1 && $mybb->usergroup['cancp'] == 1)

Zeile 354Zeile 356
	eval("\$welcomeblock = \"".$templates->get("header_welcomeblock_member")."\";");
}
// Otherwise, we have a guest

	eval("\$welcomeblock = \"".$templates->get("header_welcomeblock_member")."\";");
}
// Otherwise, we have a guest

else

else

{
switch($mybb->settings['username_method'])
{

{
switch($mybb->settings['username_method'])
{

Zeile 479Zeile 481
$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.

if($mybb->user['pmnotice'] == 2 && $mybb->user['pms_unread'] > 0 && $mybb->settings['enablepms'] != 0 && $mybb->usergroup['canusepms'] != 0 && $mybb->usergroup['canview'] != 0 && ($current_page != "private.php" || $mybb->input['action'] != "read"))


$pm_notice = '';
if(isset($mybb->user['pmnotice']) && $mybb->user['pmnotice'] == 2 && $mybb->user['pms_unread'] > 0 && $mybb->settings['enablepms'] != 0 && $mybb->usergroup['canusepms'] != 0 && $mybb->usergroup['canview'] != 0 && ($current_page != "private.php" || $mybb->input['action'] != "read"))

{
if(!$parser)
{

{
if(!$parser)
{

Zeile 554Zeile 557
}

// Are we showing the quick language selection box?

}

// Are we showing the quick language selection box?

$lang_select = '';

$lang_select = $lang_options = '';

if($mybb->settings['showlanguageselect'] != 0)
{
$languages = $lang->get_languages();
foreach($languages as $key => $language)

if($mybb->settings['showlanguageselect'] != 0)
{
$languages = $lang->get_languages();
foreach($languages as $key => $language)

	{

	{

		$language = htmlspecialchars_uni($language);
// Current language matches
if($lang->language == $key)

		$language = htmlspecialchars_uni($language);
// Current language matches
if($lang->language == $key)

Zeile 575Zeile 578
	$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?

// DST Auto detection enabled?

 
$auto_dst_detection = '';

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

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

Zeile 627Zeile 631

// Load Limiting
if($mybb->usergroup['cancp'] != 1 && $mybb->settings['load'] > 0 && ($load = get_server_load()) && $load != $lang->unknown && $load > $mybb->settings['load'])


// Load Limiting
if($mybb->usergroup['cancp'] != 1 && $mybb->settings['load'] > 0 && ($load = get_server_load()) && $load != $lang->unknown && $load > $mybb->settings['load'])

{

{

	// User is not an administrator and the load limit is higher than the limit, show an error
error($lang->error_loadlimit);
}

	// User is not an administrator and the load limit is higher than the limit, show an error
error($lang->error_loadlimit);
}

Zeile 636Zeile 640
if(!$mybb->user['uid'] && $mybb->settings['usereferrals'] == 1 && (isset($mybb->input['referrer']) || isset($mybb->input['referrername'])))
{
if(isset($mybb->input['referrername']))

if(!$mybb->user['uid'] && $mybb->settings['usereferrals'] == 1 && (isset($mybb->input['referrer']) || isset($mybb->input['referrername'])))
{
if(isset($mybb->input['referrername']))

	{

	{

		$condition = "username='".$db->escape_string($mybb->input['referrername'])."'";
}
else

		$condition = "username='".$db->escape_string($mybb->input['referrername'])."'";
}
else

Zeile 693Zeile 697
}

// work out which items the user has collapsed

}

// work out which items the user has collapsed

$colcookie = $mybb->cookies['collapsed'];

$colcookie = empty($mybb->cookies['collapsed']) ? false : $mybb->cookies['collapsed'];


// set up collapsable items (to automatically show them us expanded)


// set up collapsable items (to automatically show them us expanded)

 
$collapsed = array('boardstats' => '', 'boardstats_e' => '', 'quickreply' => '', 'quickreply_e' => '');
$collapsedimg = $collapsed;


if($colcookie)
{
$col = explode("|", $colcookie);

if($colcookie)
{
$col = explode("|", $colcookie);