Vergleich global.php - 1.8.5 - 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'])
{
if(isset($mybb->cookies['mybbtheme']))
{
my_unsetcookie('mybbtheme');
}

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



















	// 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())
{
$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_setcookie('mybbtheme', $user['style']);
}

	}
}
// Cookied theme!

	}
}
// Cookied theme!

Zeile 155Zeile 173
	'printthread.php',
'moderation.php'
);

	'printthread.php',
'moderation.php'
);





if(in_array($current_page, $valid))
{
cache_forums();

if(in_array($current_page, $valid))
{
cache_forums();





	// If we're accessing a post, fetch the forum theme for it and if we're overriding it
if(isset($mybb->input['pid']) && THIS_SCRIPT != "polls.php")
{
$query = $db->simple_select("posts", "fid", "pid = '{$mybb->input['pid']}'", array("limit" => 1));

	// If we're accessing a post, fetch the forum theme for it and if we're overriding it
if(isset($mybb->input['pid']) && THIS_SCRIPT != "polls.php")
{
$query = $db->simple_select("posts", "fid", "pid = '{$mybb->input['pid']}'", array("limit" => 1));

		$fid = $db->fetch_field($query, 'fid');


		$fid = $db->fetch_field($query, 'fid');


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

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

Zeile 194Zeile 212
		{
$style = $forum_cache[$fid];
$load_from_forum = 1;

		{
$style = $forum_cache[$fid];
$load_from_forum = 1;

		}

		}

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

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

Zeile 204Zeile 222
	}
}
unset($valid);

	}
}
unset($valid);





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

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





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

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

{

{

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


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


// 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 349Zeile 386
	{
// 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

		{
$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
{
$theme['imglangdir'] = $theme['imgdir'];

Zeile 510Zeile 547
if($mybb->settings['portal'] == 1)
{
eval('$menu_portal = "'.$templates->get('header_menu_portal').'";');

if($mybb->settings['portal'] == 1)
{
eval('$menu_portal = "'.$templates->get('header_menu_portal').'";');

}

}


// See if there are any pending join requests for group leaders
$pending_joinrequests = '';


// See if there are any pending join requests for group leaders
$pending_joinrequests = '';

Zeile 529Zeile 566

$user['gid'] = (int)$user['gid'];
$gids .= ",'{$user['gid']}'";


$user['gid'] = (int)$user['gid'];
$gids .= ",'{$user['gid']}'";

	}


	}


	$query = $db->simple_select('joinrequests', 'COUNT(uid) as total', "gid IN ({$gids}) AND invite='0'");
$total_joinrequests = $db->fetch_field($query, 'total');


	$query = $db->simple_select('joinrequests', 'COUNT(uid) as total', "gid IN ({$gids}) AND invite='0'");
$total_joinrequests = $db->fetch_field($query, 'total');


Zeile 549Zeile 586
		eval('$pending_joinrequests = "'.$templates->get('global_pending_joinrequests').'";');
}
}

		eval('$pending_joinrequests = "'.$templates->get('global_pending_joinrequests').'";');
}
}





$unreadreports = '';
// This user is a moderator, super moderator or administrator
if($mybb->usergroup['cancp'] == 1 || ($mybb->user['ismoderator'] && $mybb->usergroup['canmodcp'] == 1 && $mybb->usergroup['canmanagereportedcontent'] == 1))

$unreadreports = '';
// This user is a moderator, super moderator or administrator
if($mybb->usergroup['cancp'] == 1 || ($mybb->user['ismoderator'] && $mybb->usergroup['canmodcp'] == 1 && $mybb->usergroup['canmanagereportedcontent'] == 1))

Zeile 569Zeile 606
			}

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

			}

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

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

Zeile 588Zeile 625
	else
{
$can_access_moderationqueue = false;

	else
{
$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 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 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);
}