Vergleich global.php - 1.6.7 - 1.6.18

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: global.php 5736 2011-12-29 19:56:07Z ralgith $

 * $Id$

 */

$working_dir = dirname(__FILE__);

 */

$working_dir = dirname(__FILE__);

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']) && 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 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 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 186Zeile 197
// Fetch the theme to load from the database
$query = $db->simple_select("themes", "name, tid, properties, stylesheets", $loadstyle, array('limit' => 1));
$theme = $db->fetch_array($query);

// Fetch the theme to load from the database
$query = $db->simple_select("themes", "name, tid, properties, stylesheets", $loadstyle, array('limit' => 1));
$theme = $db->fetch_array($query);





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

Zeile 194Zeile 205
	if($load_from_forum == 1)
{
$db->update_query("forums", array("style" => 0), "style='{$style['style']}'");

	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
else if($load_from_user == 1)
{

	// Missing theme was from a user, run a query to set any users using the theme to the default
else if($load_from_user == 1)
{

Zeile 207Zeile 218
$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)

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

{

{

	$stylesheet_actions = array("global");

	$stylesheet_actions = array("global");

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

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

	{
$stylesheet_actions[] = $mybb->input['action'];
}

	{
$stylesheet_actions[] = $mybb->input['action'];
}

Zeile 224Zeile 236
			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 300Zeile 312
{
$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

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

// Set the current date and time now

Zeile 413Zeile 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)
{
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")."\";");
}








































	// 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']))
{
// 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)
{
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")."\";");
}
}

}

// Got a character set?
if($lang->settings['charset'])
{
$charset = $lang->settings['charset'];

}

// Got a character set?
if($lang->settings['charset'])
{
$charset = $lang->settings['charset'];

}

}

// If not, revert to UTF-8
else
{

// If not, revert to UTF-8
else
{

Zeile 465Zeile 517
		$reason = htmlspecialchars_uni($ban['reason']);
}
if(empty($reason))

		$reason = htmlspecialchars_uni($ban['reason']);
}
if(empty($reason))

	{

	{

		$reason = $lang->unknown;
}
if(empty($banlift))

		$reason = $lang->unknown;
}
if(empty($banlift))

Zeile 479Zeile 531
$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)
{
require_once MYBB_ROOT.'inc/class_parser.php';
$parser = new postParser;
}


	$query = $db->query("
SELECT pm.subject, pm.pmid, fu.username AS fromusername, fu.uid AS fromuid
FROM ".TABLE_PREFIX."privatemessages pm

	$query = $db->query("
SELECT pm.subject, pm.pmid, fu.username AS fromusername, fu.uid AS fromuid
FROM ".TABLE_PREFIX."privatemessages pm

Zeile 489Zeile 548
		ORDER BY pm.dateline DESC
LIMIT 1
");

		ORDER BY pm.dateline DESC
LIMIT 1
");

 


	$pm = $db->fetch_array($query);

	$pm = $db->fetch_array($query);

 
	$pm['subject'] = $parser->parse_badwords($pm['subject']);

	
if($pm['fromuid'] == 0)

	
if($pm['fromuid'] == 0)

	{

	{

		$pm['fromusername'] = $lang->mybb_engine;
$user_text = $pm['fromusername'];

		$pm['fromusername'] = $lang->mybb_engine;
$user_text = $pm['fromusername'];

	}
else
{

	}
else
{

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


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


Zeile 546Zeile 607
}

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

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

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

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

		{

		{

			$lang_options .= "<option value=\"{$key}\" selected=\"selected\">&nbsp;&nbsp;&nbsp;{$language}</option>\n";
}
else

			$lang_options .= "<option value=\"{$key}\" selected=\"selected\">&nbsp;&nbsp;&nbsp;{$language}</option>\n";
}
else

Zeile 570Zeile 631
}

// 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 685Zeile 747
}

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