Vergleich global.php - 1.6.11 - 1.6.17

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 134Zeile 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(!empty($mybb->input['pid']))

	if(!empty($mybb->input['pid']) && THIS_SCRIPT != "polls.php")

	{
$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 157Zeile 157
			$load_from_forum = 1;
}
}

			$load_from_forum = 1;
}
}

 
	// If we're accessing poll results, fetch the forum theme for it and if we're overriding it
else if(!empty($mybb->input['pid']) && THIS_SCRIPT == "polls.php")
{
$query = $db->simple_select("threads", "fid", "poll = '".intval($mybb->input['pid'])."'", array("limit" => 1));
$fid = $db->fetch_field($query, "fid");





 
		if($fid)
{
$style = $forum_cache[$fid];
$load_from_forum = 1;
}
}

	// We have a forum id - simply load the theme from it
else if($mybb->input['fid'])
{

	// We have a forum id - simply load the theme from it
else if($mybb->input['fid'])
{

Zeile 169Zeile 180

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

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

Zeile 189Zeile 200

// No theme was found - we attempt to load the master or any other theme
if(!$theme['tid'])


// No theme was found - we attempt to load the master or any other theme
if(!$theme['tid'])

{

{

	// 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 221Zeile 232
	foreach($stylesheet_actions as $stylesheet_action)
{
if(!$stylesheet_action)

	foreach($stylesheet_actions as $stylesheet_action)
{
if(!$stylesheet_action)

		{
continue;

		{
continue;

		}

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

		}

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

Zeile 253Zeile 264
	{
// 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'];
}

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

	}
}
else

Zeile 268Zeile 279
	if(!@is_dir($theme['imgdir']))
{
$theme['imgdir'] = "images";

	if(!@is_dir($theme['imgdir']))
{
$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($theme['imgdir'].'/'.$mybb->user['language']))


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

	{

	{

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

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

Zeile 286Zeile 297
		else
{
$theme['imglangdir'] = $theme['imgdir'];

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

		}
}
}

		}
}
}


// Theme logo - is it a relative URL to the forum root? Append bburl
if(!preg_match("#^(\.\.?(/|$)|([a-z0-9]+)://)#i", $theme['logo']) && substr($theme['logo'], 0, 1) != "/")


// Theme logo - is it a relative URL to the forum root? Append bburl
if(!preg_match("#^(\.\.?(/|$)|([a-z0-9]+)://)#i", $theme['logo']) && substr($theme['logo'], 0, 1) != "/")

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

// 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 . $lang->comma . $timenow);

$lang->welcome_current_time = $lang->sprintf($lang->welcome_current_time, $datenow.', '.$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']) . $lang->comma . my_date($mybb->settings['timeformat'], $mybb->user['lastvisit']);

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

}

// Otherwise, they've never visited before

}

// Otherwise, they've never visited before

Zeile 415Zeile 426

$unreadreports = '';
// This user is a moderator, super moderator or administrator


$unreadreports = '';
// This user is a moderator, super moderator or administrator

if($mybb->usergroup['cancp'] == 1 || $mybb->user['ismoderator'] && $mybb->usergroup['canmodcp'])

if($mybb->usergroup['cancp'] == 1 || ($mybb->user['ismoderator'] && $mybb->usergroup['canmodcp']))

{

{

	// Read the reported posts cache
$reported = $cache->read("reportedposts");

// 0 or more reported posts currently exist
if($reported['unread'] > 0)

	// Only worth checking if we are here because we have ACP permissions and the other condition fails
if($mybb->usergroup['cancp'] == 1 && !($mybb->user['ismoderator'] && $mybb->usergroup['canmodcp']))




	{

	{

		if($reported['unread'] == 1)








































		// First we check if the user's a super admin: if yes, we don't care about permissions
$can_access_moderationqueue = true;
$is_super_admin = is_super_admin($recipient['uid']);
if(!$is_super_admin)
{
// Include admin functions
if(!file_exists(MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions.php"))
{
$can_access_moderationqueue = false;
}

require_once MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions.php";

// Verify if we have permissions to access forum-moderation_queue
require_once MYBB_ROOT.$mybb->config['admin_dir']."/modules/forum/module_meta.php";
if(function_exists("forum_admin_permissions"))
{
// Get admin permissions
$adminperms = get_admin_permissions($mybb->user['uid']);

$permissions = forum_admin_permissions();
if(array_key_exists('moderation_queue', $permissions['permissions']) && $adminperms['forum']['moderation_queue'] != 1)
{
$can_access_moderationqueue = false;
}
}
}
}
else
{
$can_access_moderationqueue = false;
}

if($can_access_moderationqueue || ($mybb->user['ismoderator'] && $mybb->usergroup['canmodcp']))
{
// Read the reported posts cache
$reported = $cache->read("reportedposts");

// 0 or more reported posts currently exist
if($reported['unread'] > 0)

		{

		{

			$lang->unread_reports = $lang->unread_report;
}
else
{
$lang->unread_reports = $lang->sprintf($lang->unread_reports, $reported['unread']);





			if($reported['unread'] == 1)
{
$lang->unread_reports = $lang->unread_report;
}
else
{
$lang->unread_reports = $lang->sprintf($lang->unread_reports, $reported['unread']);
}
eval("\$unreadreports = \"".$templates->get("global_unreadreports")."\";");

		}

		}

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

 
	}
}


	}
}