Vergleich global.php - 1.8.0 - 1.8.5

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 17Zeile 17
// Load main MyBB core file which begins all of the magic
require_once $working_dir.'/inc/init.php';


// Load main MyBB core file which begins all of the magic
require_once $working_dir.'/inc/init.php';


$shutdown_queries = array();

$shutdown_queries = $shutdown_functions = array();


// Read the usergroups cache as well as the moderators cache
$groupscache = $cache->read('usergroups');


// Read the usergroups cache as well as the moderators cache
$groupscache = $cache->read('usergroups');

Zeile 131Zeile 131
// Cookied theme!
else if(!$mybb->user['uid'] && !empty($mybb->cookies['mybbtheme']))
{

// Cookied theme!
else if(!$mybb->user['uid'] && !empty($mybb->cookies['mybbtheme']))
{

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

	$mybb->user['style'] = (int)$mybb->cookies['mybbtheme'];

}

// This user has a custom theme set in their profile

}

// This user has a custom theme set in their profile

Zeile 361Zeile 361
}
else
{

}
else
{

    $img_directory = $theme['imgdir'];

	$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($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'];
}
}





    // 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
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) != '/')

{

{

	$theme['logo'] = $mybb->get_asset_url($theme['logo']);
}


	$theme['logo'] = $mybb->get_asset_url($theme['logo']);
}


Zeile 406Zeile 406
if(isset($templatelist))
{
$templatelist .= ',';

if(isset($templatelist))
{
$templatelist .= ',';

}

}

else
{
$templatelist = '';
}

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

else
{
$templatelist = '';
}

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

$templatelist .= ",global_pending_joinrequests,nav,nav_sep,nav_bit,nav_sep_active,nav_bit_active,footer_languageselect,footer_themeselect,header_welcomeblock_member_moderator,redirect,header_menu_calendar,nav_dropdown,footer_themeselector,task_image";
$templatelist .= ",global_boardclosed_warning,global_bannedwarning,error_inline,error_nopermission_loggedin,error_nopermission,debug_summary,header_quicksearch,header_menu_search,header_menu_portal,header_menu_memberlist,usercp_themeselector_option,smilie";


$templatelist .= ",global_pending_joinrequests,global_awaiting_activation,nav,nav_sep,nav_bit,nav_sep_active,nav_bit_active,footer_languageselect,footer_themeselect,header_welcomeblock_member_moderator,redirect,header_menu_calendar,nav_dropdown,footer_themeselector,task_image";
$templatelist .= ",global_boardclosed_warning,global_bannedwarning,error_inline,error_nopermission_loggedin,error_nopermission,debug_summary,header_quicksearch,header_menu_search,header_menu_portal,header_menu_memberlist,usercp_themeselector_option,smilie,global_board_offline_modal";
$templatelist .= ",video_dailymotion_embed,video_facebook_embed,video_liveleak_embed,video_metacafe_embed,video_myspacetv_embed,video_veoh_embed,video_vimeo_embed,video_yahoo_embed,video_youtube_embed";

$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 431Zeile 432
else
{
$lastvisit = $lang->lastvisit_never;

else
{
$lastvisit = $lang->lastvisit_never;

}


}


$plugins->run_hooks('global_intermediate');

// If the board is closed and we have a usergroup allowed to view the board when closed, then show board closed warning
$bbclosedwarning = '';
if($mybb->settings['boardclosed'] == 1 && $mybb->usergroup['canviewboardclosed'] == 1)

$plugins->run_hooks('global_intermediate');

// If the board is closed and we have a usergroup allowed to view the board when closed, then show board closed warning
$bbclosedwarning = '';
if($mybb->settings['boardclosed'] == 1 && $mybb->usergroup['canviewboardclosed'] == 1)

{

{

	eval('$bbclosedwarning = "'.$templates->get('global_boardclosed_warning').'";');
}


	eval('$bbclosedwarning = "'.$templates->get('global_boardclosed_warning').'";');
}


Zeile 453Zeile 454
	{
$admin_dir = $config['admin_dir'];
eval('$admincplink = "'.$templates->get('header_welcomeblock_member_admin').'";');

	{
$admin_dir = $config['admin_dir'];
eval('$admincplink = "'.$templates->get('header_welcomeblock_member_admin').'";');

	}

	}


if($mybb->usergroup['canmodcp'] == 1)
{


if($mybb->usergroup['canmodcp'] == 1)
{

Zeile 575Zeile 576
			{
// Get admin permissions
$adminperms = get_admin_permissions($mybb->user['uid']);

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

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

	else
{
$can_access_moderationqueue = false;

Zeile 606Zeile 607
			{
$unread = 0;
$query = $db->simple_select('reportedcontent', 'id3', "reportstatus='0' AND (type = 'post' OR type = '')");

			{
$unread = 0;
$query = $db->simple_select('reportedcontent', 'id3', "reportstatus='0' AND (type = 'post' OR type = '')");





				while($fid = $db->fetch_field($query, 'id3'))
{
if(is_moderator($fid, "canmanagereportedposts"))
{
++$unread;
}

				while($fid = $db->fetch_field($query, 'id3'))
{
if(is_moderator($fid, "canmanagereportedposts"))
{
++$unread;
}

				}
}

				}
}


if($unread > 0)
{
if($unread == 1)
{
$lang->unread_reports = $lang->unread_report;


if($unread > 0)
{
if($unread == 1)
{
$lang->unread_reports = $lang->unread_report;

				}

				}

				else
{
$lang->unread_reports = $lang->sprintf($lang->unread_reports, my_number_format($unread));

				else
{
$lang->unread_reports = $lang->sprintf($lang->unread_reports, my_number_format($unread));

Zeile 636Zeile 637
// Got a character set?
$charset = 'UTF-8';
if(isset($lang->settings['charset']) && $lang->settings['charset'])

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

{

{

	$charset = $lang->settings['charset'];
}


	$charset = $lang->settings['charset'];
}


Zeile 658Zeile 659
		{
$banlift = my_date($mybb->settings['dateformat'], $ban['lifted']) . $lang->comma . my_date($mybb->settings['timeformat'], $ban['lifted']);
}

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

	}


	}


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

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

Zeile 675Zeile 676
}

$lang->ajax_loading = str_replace("'", "\\'", $lang->ajax_loading);

}

$lang->ajax_loading = str_replace("'", "\\'", $lang->ajax_loading);





// Check if this user has a new private message.
$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->get_input('action') != "read"))

// Check if this user has a new private message.
$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->get_input('action') != "read"))

Zeile 697Zeile 698

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


$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 719Zeile 720
	eval('$pm_notice = "'.$templates->get('global_pm_alert').'";');
}


	eval('$pm_notice = "'.$templates->get('global_pm_alert').'";');
}


if($mybb->usergroup['cancp'] == 1)

if($mybb->settings['awactialert'] == 1 && $mybb->usergroup['cancp'] == 1)

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


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


	if(!empty($awaitingusers['users']))







	if(isset($awaitingusers['time']) && $awaitingusers['time'] + 86400 < TIME_NOW)
{
$cache->update_awaitingactivation();
$awaitingusers = $cache->read('awaitingactivation');
}

if(!empty($awaitingusers['users']))

	{
$awaitingusers = (int)$awaitingusers['users'];

	{
$awaitingusers = (int)$awaitingusers['users'];

	}
else
{
$awaitingusers = 0;
}


	}
else
{
$awaitingusers = 0;
}


	if($awaitingusers < 1)
{
$awaitingusers = 0;
}
else

	if($awaitingusers < 1)
{
$awaitingusers = 0;
}
else

	{

	{

		$awaitingusers = my_number_format($awaitingusers);
}

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

		$awaitingusers = my_number_format($awaitingusers);
}

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

		{

		{

			$awaiting_message = $lang->awaiting_message_single;

			$awaiting_message = $lang->awaiting_message_single;

		}

		}

		else

		else

		{

		{

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

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

 

if($admincplink)
{
$awaiting_message .= $lang->sprintf($lang->awaiting_message_link, $mybb->settings['bburl'], $admin_dir);
}


		eval('$awaitingusers = "'.$templates->get('global_awaiting_activation').'";');
}
else

		eval('$awaitingusers = "'.$templates->get('global_awaiting_activation').'";');
}
else

Zeile 820Zeile 833
// Are we showing the quick theme selection box?
$theme_select = $theme_options = '';
if($mybb->settings['showthemeselect'] != 0)

// Are we showing the quick theme selection box?
$theme_select = $theme_options = '';
if($mybb->settings['showthemeselect'] != 0)

{

{

	$theme_options = build_theme_select("theme", $mybb->user['style'], 0, '', false, true);

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

	$theme_options = build_theme_select("theme", $mybb->user['style'], 0, '', false, true);

if(!empty($theme_options))
{
$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(my_substr($mybb->settings['contactlink'], 0, 1) != '/' && my_substr($mybb->settings['contactlink'], 0, 7) != 'http://' && my_substr($mybb->settings['contactlink'], 0, 8) != 'https://' && my_substr($mybb->settings['contactlink'], 0, 7) != 'mailto:')


// 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(my_substr($mybb->settings['contactlink'], 0, 1) != '/' && my_substr($mybb->settings['contactlink'], 0, 7) != 'http://' && my_substr($mybb->settings['contactlink'], 0, 8) != 'https://' && my_substr($mybb->settings['contactlink'], 0, 7) != 'mailto:')

	{

	{

		$mybb->settings['contactlink'] = $mybb->settings['bburl'].'/'.$mybb->settings['contactlink'];
}


		$mybb->settings['contactlink'] = $mybb->settings['bburl'].'/'.$mybb->settings['contactlink'];
}


Zeile 862Zeile 875
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 885Zeile 898
if($mybb->settings['boardclosed'] == 1 && $mybb->usergroup['canviewboardclosed'] != 1 && !in_array($current_page, $closed_bypass) && (!is_array($closed_bypass[$current_page]) || !in_array($mybb->get_input('action'), $closed_bypass[$current_page])))
{
// Show error

if($mybb->settings['boardclosed'] == 1 && $mybb->usergroup['canviewboardclosed'] != 1 && !in_array($current_page, $closed_bypass) && (!is_array($closed_bypass[$current_page]) || !in_array($mybb->get_input('action'), $closed_bypass[$current_page])))
{
// Show error

 
	if(!$mybb->settings['boardclosed_reason'])
{
$mybb->settings['boardclosed_reason'] = $lang->boardclosed_reason;
}


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

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

	error($lang->error_boardclosed);












if(!$mybb->get_input('modal'))
{
error($lang->error_boardclosed);
}
else
{
$output = '';
eval('$output = "'.$templates->get('global_board_offline_modal', 1, 0).'";');
echo($output);
}

	exit;
}


	exit;
}


Zeile 931Zeile 959
	}
else
{

	}
else
{

		$condition = "uid = '".$mybb->get_input('referrer', 1)."'";

		$condition = "uid = '".$mybb->get_input('referrer', MyBB::INPUT_INT)."'";

	}

$query = $db->simple_select('users', 'uid', $condition, array('limit' => 1));

	}

$query = $db->simple_select('users', 'uid', $condition, array('limit' => 1));