Vergleich global.php - 1.8.4 - 1.8.6

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 111Zeile 111
// The user used our new quick theme changer
if(isset($mybb->input['theme']) && verify_post_check($mybb->get_input('my_post_key'), true))
{

// The user used our new quick theme changer
if(isset($mybb->input['theme']) && verify_post_check($mybb->get_input('my_post_key'), true))
{

	$mybb->user['style'] = $mybb->get_input('theme');
// If user is logged in, update their theme selection with the new one
if($mybb->user['uid'])













	// Set up user handler.
require_once MYBB_ROOT.'inc/datahandlers/user.php';
$userhandler = new UserDataHandler('update');

$user = array(
'uid' => $mybb->user['uid'],
'style' => $mybb->get_input('theme', MyBB::INPUT_INT),
'usergroup' => $mybb->user['usergroup'],
'additionalgroups' => $mybb->user['additionalgroups']
);

$userhandler->set_data($user);

// validate_user verifies the style if it is set in the data array.
if($userhandler->validate_user())

	{

	{

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














		$mybb->user['style'] = $user['style'];

// If user is logged in, update their theme selection with the new one
if($mybb->user['uid'])
{
if(isset($mybb->cookies['mybbtheme']))
{
my_unsetcookie('mybbtheme');
}

$userhandler->update_user();
}
// Guest = cookie
else

		{

		{

			my_unsetcookie('mybbtheme');

			my_setcookie('mybbtheme', $user['style']);

		}

		}


$db->update_query('users', array('style' => (int)$mybb->user['style']), "uid = '{$mybb->user['uid']}'");
}
// Guest = cookie
else
{
my_setcookie('mybbtheme', $mybb->get_input('theme'));

 
	}
}
// Cookied theme!

	}
}
// Cookied theme!

Zeile 224Zeile 242
}

// Fetch the theme to load from the cache

}

// Fetch the theme to load from the cache

 
if($loadstyle != "def='1'")
{
$query = $db->simple_select('themes', 'name, tid, properties, stylesheets, allowedgroups', $loadstyle, array('limit' => 1));
$theme = $db->fetch_array($query);

if(isset($theme['tid']) && !$load_from_forum && !is_member($theme['allowedgroups']) && $theme['allowedgroups'] != 'all')
{
if($load_from_user == 1)
{
$db->update_query('users', array('style' => 0), "style='{$mybb->user['style']}' AND uid='{$mybb->user['uid']}'");
}

if(isset($mybb->cookies['mybbtheme']))
{
my_unsetcookie('mybbtheme');
}

$loadstyle = "def='1'";
}
}


if($loadstyle == "def='1'")
{
if(!$cache->read('default_theme'))
{
$cache->update_default_theme();
}

if($loadstyle == "def='1'")
{
if(!$cache->read('default_theme'))
{
$cache->update_default_theme();
}

 


	$theme = $cache->read('default_theme');

	$theme = $cache->read('default_theme');

}
else
{
$query = $db->simple_select('themes', 'name, tid, properties, stylesheets', $loadstyle, array('limit' => 1));
$theme = $db->fetch_array($query);


$load_from_forum = $load_from_user = 0;




}

// No theme was found - we attempt to load the master or any other theme

}

// No theme was found - we attempt to load the master or any other theme

Zeile 243Zeile 280
{
// Missing theme was from a forum, run a query to set any forums using the theme to the default
if($load_from_forum == 1)

{
// Missing theme was from a forum, run a query to set any forums using the theme to the default
if($load_from_forum == 1)

	{

	{

		$db->update_query('forums', array('style' => 0), "style = '{$style['style']}'");
}
// Missing theme was from a user, run a query to set any users using the theme to the default

		$db->update_query('forums', array('style' => 0), "style = '{$style['style']}'");
}
// Missing theme was from a user, run a query to set any users using the theme to the default

Zeile 280Zeile 317
		{
continue;
}

		{
continue;
}





		if(!empty($theme['stylesheets'][$stylesheet_script][$stylesheet_action]))
{
// Actually add the stylesheets to the list

		if(!empty($theme['stylesheets'][$stylesheet_script][$stylesheet_action]))
{
// Actually add the stylesheets to the list

Zeile 289Zeile 326
				if(!empty($already_loaded[$page_stylesheet]))
{
continue;

				if(!empty($already_loaded[$page_stylesheet]))
{
continue;

				}

				}


if(strpos($page_stylesheet, 'css.php') !== false)


if(strpos($page_stylesheet, 'css.php') !== false)

				{

				{

					$stylesheet_url = $mybb->settings['bburl'] . '/' . $page_stylesheet;
}
else
{
$stylesheet_url = $mybb->get_asset_url($page_stylesheet);

					$stylesheet_url = $mybb->settings['bburl'] . '/' . $page_stylesheet;
}
else
{
$stylesheet_url = $mybb->get_asset_url($page_stylesheet);

				}

				}


if($mybb->settings['minifycss'])
{


if($mybb->settings['minifycss'])
{

Zeile 321Zeile 358

$already_loaded[$page_stylesheet] = 1;
}


$already_loaded[$page_stylesheet] = 1;
}

		}
}
}

		}
}
}

unset($actions);

if(!empty($theme_stylesheets))

unset($actions);

if(!empty($theme_stylesheets))

Zeile 331Zeile 368
	foreach($theme['disporder'] as $style_name => $order)
{
if(!empty($theme_stylesheets[$style_name]))

	foreach($theme['disporder'] as $style_name => $order)
{
if(!empty($theme_stylesheets[$style_name]))

		{

		{

			$stylesheets .= $theme_stylesheets[$style_name];

			$stylesheets .= $theme_stylesheets[$style_name];

		}
}
}

		}
}
}


// Are we linking to a remote theme server?
if(my_substr($theme['imgdir'], 0, 7) == 'http://' || my_substr($theme['imgdir'], 0, 8) == 'https://')
{
// If a language directory for the current language exists within the theme - we use it


// Are we linking to a remote theme server?
if(my_substr($theme['imgdir'], 0, 7) == 'http://' || my_substr($theme['imgdir'], 0, 8) == 'https://')
{
// If a language directory for the current language exists within the theme - we use it

	if(!empty($mybb->user['language']))


































	if(!empty($mybb->user['language']))
{
$theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->user['language'];
}
else
{
// 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'];
}
}
}
else
{
$img_directory = $theme['imgdir'];

if($mybb->settings['usecdn'] && !empty($mybb->settings['cdnpath']))
{
$img_directory = rtrim($mybb->settings['cdnpath'], '/') . '/' . ltrim($theme['imgdir'], '/');
}

if(!@is_dir($img_directory))
{
$theme['imgdir'] = 'images';
}

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

	{
$theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->user['language'];
}
else
{
// Check if a custom language directory exists for this theme

	{
$theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->user['language'];
}
else
{
// Check if a custom language directory exists for this theme

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

		if(is_dir($img_directory.'/'.$mybb->settings['bblanguage']))

		{
$theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->settings['bblanguage'];
}

		{
$theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->settings['bblanguage'];
}

Zeile 358Zeile 428
			$theme['imglangdir'] = $theme['imgdir'];
}
}

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

}
else
{
$img_directory = $theme['imgdir'];

if($mybb->settings['usecdn'] && !empty($mybb->settings['cdnpath']))
{
$img_directory = rtrim($mybb->settings['cdnpath'], '/') . '/' . ltrim($theme['imgdir'], '/');
}

if(!@is_dir($img_directory))
{
$theme['imgdir'] = 'images';
}

// If a language directory for the current language exists within the theme - we use it
if(!empty($mybb->user['language']) && is_dir($img_directory.'/'.$mybb->user['language']))
{
$theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->user['language'];
}
else
{
// Check if a custom language directory exists for this theme
if(is_dir($img_directory.'/'.$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'];
}
}

 




    $theme['imgdir'] = $mybb->get_asset_url($theme['imgdir']);
$theme['imglangdir'] = $mybb->get_asset_url($theme['imglangdir']);

	$theme['imgdir'] = $mybb->get_asset_url($theme['imgdir']);
$theme['imglangdir'] = $mybb->get_asset_url($theme['imglangdir']);

}

// Theme logo - is it a relative URL to the forum root? Append bburl

}

// Theme logo - is it a relative URL to the forum root? Append bburl

Zeile 589Zeile 626
	{
$can_access_moderationqueue = false;
}

	{
$can_access_moderationqueue = false;
}

	



	if($can_access_moderationqueue || ($mybb->user['ismoderator'] && $mybb->usergroup['canmodcp'] == 1 && $mybb->usergroup['canmanagereportedcontent'] == 1))
{
// Read the reported content cache

	if($can_access_moderationqueue || ($mybb->user['ismoderator'] && $mybb->usergroup['canmodcp'] == 1 && $mybb->usergroup['canmanagereportedcontent'] == 1))
{
// Read the reported content cache

Zeile 724Zeile 761
{
$awaitingusers = $cache->read('awaitingactivation');


{
$awaitingusers = $cache->read('awaitingactivation');


	if(isset($awaitingusers['time']) && $awaitingusers['time'] < TIME_NOW + 86400)

	if(isset($awaitingusers['time']) && $awaitingusers['time'] + 86400 < TIME_NOW)

	{
$cache->update_awaitingactivation();
$awaitingusers = $cache->read('awaitingactivation');

	{
$cache->update_awaitingactivation();
$awaitingusers = $cache->read('awaitingactivation');

Zeile 747Zeile 784
	{
$awaitingusers = my_number_format($awaitingusers);
}

	{
$awaitingusers = my_number_format($awaitingusers);
}

	



	if($awaitingusers > 0)
{
if($awaitingusers == 1)

	if($awaitingusers > 0)
{
if($awaitingusers == 1)

Zeile 757Zeile 794
		else
{
$awaiting_message = $lang->sprintf($lang->awaiting_message_plural, $awaitingusers);

		else
{
$awaiting_message = $lang->sprintf($lang->awaiting_message_plural, $awaitingusers);

		}

		}


if($admincplink)
{


if($admincplink)
{

Zeile 771Zeile 808
		$awaitingusers = '';
}
}

		$awaitingusers = '';
}
}





// Set up some of the default templates
eval('$headerinclude = "'.$templates->get('headerinclude').'";');
eval('$gobutton = "'.$templates->get('gobutton').'";');

// Set up some of the default templates
eval('$headerinclude = "'.$templates->get('headerinclude').'";');
eval('$gobutton = "'.$templates->get('gobutton').'";');

Zeile 785Zeile 822
if($mybb->settings['showvernum'] == 1)
{
$mybbversion = ' '.$mybb->version;

if($mybb->settings['showvernum'] == 1)
{
$mybbversion = ' '.$mybb->version;

}

}


// Check to see if we have any tasks to run
$task_image = '';


// Check to see if we have any tasks to run
$task_image = '';

Zeile 840Zeile 877
	{
$theme_redirect_url = get_current_location(true, 'theme');
eval('$theme_select = "'.$templates->get('footer_themeselect').'";');

	{
$theme_redirect_url = get_current_location(true, 'theme');
eval('$theme_select = "'.$templates->get('footer_themeselect').'";');

	}
}


	}
}


// If we use the contact form, show 'Contact Us' link when appropriate
$contact_us = '';
if(($mybb->settings['contactlink'] == "contact.php" && $mybb->settings['contact'] == 1 && ($mybb->settings['contact_guests'] != 1 && $mybb->user['uid'] == 0 || $mybb->user['uid'] > 0)) || $mybb->settings['contactlink'] != "contact.php")

// If we use the contact form, show 'Contact Us' link when appropriate
$contact_us = '';
if(($mybb->settings['contactlink'] == "contact.php" && $mybb->settings['contact'] == 1 && ($mybb->settings['contact_guests'] != 1 && $mybb->user['uid'] == 0 || $mybb->user['uid'] > 0)) || $mybb->settings['contactlink'] != "contact.php")

Zeile 853Zeile 890
	}

eval('$contact_us = "'.$templates->get('footer_contactus').'";');

	}

eval('$contact_us = "'.$templates->get('footer_contactus').'";');

}


}


// DST Auto detection enabled?
$auto_dst_detection = '';
if($mybb->user['uid'] > 0 && $mybb->user['dstcorrection'] == 2)

// DST Auto detection enabled?
$auto_dst_detection = '';
if($mybb->user['uid'] > 0 && $mybb->user['dstcorrection'] == 2)

Zeile 875Zeile 912
if(is_banned_ip($session->ipaddress, true))
{
if($mybb->user['uid'])

if(is_banned_ip($session->ipaddress, true))
{
if($mybb->user['uid'])

    {

	{

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

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

    }
else
{

	}
else
{

		$db->delete_query('sessions', "ip = ".$db->escape_binary($session->packedip));

		$db->delete_query('sessions', "ip = ".$db->escape_binary($session->packedip));

    }

	}

	error($lang->error_banned);
}


	error($lang->error_banned);
}


Zeile 905Zeile 942

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



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


	if(!$mybb->get_input('modal')) 

	if(!$mybb->get_input('modal'))

	{
error($lang->error_boardclosed);
}

	{
error($lang->error_boardclosed);
}