Vergleich global.php - 1.8.12 - 1.8.19

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 13Zeile 13
{
$working_dir = '.';
}

{
$working_dir = '.';
}

 

$shutdown_queries = $shutdown_functions = array();


// 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 = $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 27Zeile 27
{
$cache->update_usergroups();
$groupscache = $cache->read('usergroups');

{
$cache->update_usergroups();
$groupscache = $cache->read('usergroups');

}

if(!defined('THIS_SCRIPT'))
{
define('THIS_SCRIPT', '');
}

$current_page = my_strtolower(basename(THIS_SCRIPT));


}

$current_page = my_strtolower(basename(THIS_SCRIPT));







// Send page headers - don't send no-cache headers for attachment.php
if($current_page != 'attachment.php')
{

// Send page headers - don't send no-cache headers for attachment.php
if($current_page != 'attachment.php')
{

Zeile 84Zeile 79
else if(!$mybb->user['uid'] && !empty($mybb->cookies['mybblang']) && $lang->language_exists($mybb->cookies['mybblang']))
{
$mybb->settings['bblanguage'] = $mybb->cookies['mybblang'];

else if(!$mybb->user['uid'] && !empty($mybb->cookies['mybblang']) && $lang->language_exists($mybb->cookies['mybblang']))
{
$mybb->settings['bblanguage'] = $mybb->cookies['mybblang'];

}

}

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

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

{

{

	$mybb->settings['bblanguage'] = 'english';

	$mybb->settings['bblanguage'] = 'english';

}

}


// Load language
$lang->set_language($mybb->settings['bblanguage']);
$lang->load('global');
$lang->load('messages');


// Load language
$lang->set_language($mybb->settings['bblanguage']);
$lang->load('global');
$lang->load('messages');

 

// Wipe lockout cookie if enough time has passed
if($mybb->cookies['lockoutexpiry'] && $mybb->cookies['lockoutexpiry'] < TIME_NOW)
{
my_unsetcookie('lockoutexpiry');
}


// 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 114Zeile 115
	// Set up user handler.
require_once MYBB_ROOT.'inc/datahandlers/user.php';
$userhandler = new UserDataHandler('update');

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

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

Zeile 131Zeile 132

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


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

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

Zeile 145Zeile 146
			my_setcookie('mybbtheme', $user['style']);
}
}

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

}

}

// 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'] = (int)$mybb->cookies['mybbtheme'];
}


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


// This user has a custom theme set in their profile
if(isset($mybb->user['style']) && (int)$mybb->user['style'] != 0)
{

// This user has a custom theme set in their profile
if(isset($mybb->user['style']) && (int)$mybb->user['style'] != 0)
{

Zeile 451Zeile 452

$templatelist .= "headerinclude,header,footer,gobutton,htmldoctype,header_welcomeblock_member,header_welcomeblock_member_user,header_welcomeblock_member_moderator,header_welcomeblock_member_admin,error";
$templatelist .= ",global_pending_joinrequests,global_awaiting_activation,nav,nav_sep,nav_bit,nav_sep_active,nav_bit_active,footer_languageselect,footer_themeselect,global_unreadreports,footer_contactus";


$templatelist .= "headerinclude,header,footer,gobutton,htmldoctype,header_welcomeblock_member,header_welcomeblock_member_user,header_welcomeblock_member_moderator,header_welcomeblock_member_admin,error";
$templatelist .= ",global_pending_joinrequests,global_awaiting_activation,nav,nav_sep,nav_bit,nav_sep_active,nav_bit_active,footer_languageselect,footer_themeselect,global_unreadreports,footer_contactus";

$templatelist .= ",global_boardclosed_warning,global_bannedwarning,error_inline,error_nopermission_loggedin,error_nopermission,global_pm_alert,header_menu_search,header_menu_portal,redirect,footer_languageselect_option";
$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,debug_summary";
$templatelist .= ",smilieinsert_row,smilieinsert_row_empty,smilieinsert,smilieinsert_getmore,smilieinsert_smilie,global_board_offline_modal,footer_themeselector,task_image,usercp_themeselector_option";

$templatelist .= ",global_boardclosed_warning,global_bannedwarning,error_inline,error_inline_item,error_nopermission_loggedin,error_nopermission,global_pm_alert,header_menu_search,header_menu_portal,redirect,footer_languageselect_option";
$templatelist .= ",video_dailymotion_embed,video_facebook_embed,video_liveleak_embed,video_metacafe_embed,video_myspacetv_embed,video_mixer_embed,video_vimeo_embed,video_yahoo_embed,video_youtube_embed,debug_summary";
$templatelist .= ",smilieinsert_row,smilieinsert_row_empty,smilieinsert,smilieinsert_getmore,smilieinsert_smilie,global_board_offline_modal,footer_themeselector,task_image,usercp_themeselector_option,php_warnings";

$templatelist .= ",mycode_code,mycode_email,mycode_img,mycode_php,mycode_quote_post,mycode_size_int,mycode_url,global_no_permission_modal,global_boardclosed_reason,nav_dropdown,global_remote_avatar_notice";

$templatelist .= ",mycode_code,mycode_email,mycode_img,mycode_php,mycode_quote_post,mycode_size_int,mycode_url,global_no_permission_modal,global_boardclosed_reason,nav_dropdown,global_remote_avatar_notice";

$templatelist .= ",header_welcomeblock_member_pms,header_welcomeblock_member_search,header_welcomeblock_guest,header_menu_calendar,header_menu_memberlist,global_dst_detection,header_quicksearch,smilie";


$templatelist .= ",header_welcomeblock_member_pms,header_welcomeblock_member_search,header_welcomeblock_guest,header_welcomeblock_guest_login_modal,header_welcomeblock_guest_login_modal_lockout";
$templatelist .= ",header_menu_calendar,header_menu_memberlist,global_dst_detection,header_quicksearch,smilie";

$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 544Zeile 546
			$login_username = $lang->login_username;
break;
}

			$login_username = $lang->login_username;
break;
}

	eval('$welcomeblock = "'.$templates->get('header_welcomeblock_guest').'";');
}



















if($mybb->cookies['lockoutexpiry'])
{
$secsleft = (int)($mybb->cookies['lockoutexpiry'] - TIME_NOW);
$hoursleft = floor($secsleft / 3600);
$minsleft = floor(($secsleft / 60) % 60);
$secsleft = floor($secsleft % 60);

$lang->failed_login_wait = $lang->sprintf($lang->failed_login_wait, $hoursleft, $minsleft, $secsleft);

eval('$loginform = "'.$templates->get('header_welcomeblock_guest_login_modal_lockout').'";');
}
else
{
eval('$loginform = "'.$templates->get('header_welcomeblock_guest_login_modal').'";');
}

eval('$welcomeblock = "'.$templates->get('header_welcomeblock_guest').'";');
}


// Display menu links and quick search if user has permission
$menu_search = $menu_memberlist = $menu_portal = $menu_calendar = $quicksearch = '';
if($mybb->usergroup['cansearch'] == 1)


// Display menu links and quick search if user has permission
$menu_search = $menu_memberlist = $menu_portal = $menu_calendar = $quicksearch = '';
if($mybb->usergroup['cansearch'] == 1)

{

{

	eval('$menu_search = "'.$templates->get('header_menu_search').'";');
eval('$quicksearch = "'.$templates->get('header_quicksearch').'";');
}

	eval('$menu_search = "'.$templates->get('header_menu_search').'";');
eval('$quicksearch = "'.$templates->get('header_quicksearch').'";');
}

Zeile 561Zeile 580
}

if($mybb->settings['enablecalendar'] == 1 && $mybb->usergroup['canviewcalendar'] == 1)

}

if($mybb->settings['enablecalendar'] == 1 && $mybb->usergroup['canviewcalendar'] == 1)

{

{

	eval('$menu_calendar = "'.$templates->get('header_menu_calendar').'";');
}


	eval('$menu_calendar = "'.$templates->get('header_menu_calendar').'";');
}


Zeile 576Zeile 595
if($mybb->user['uid'] != 0 && is_array($groupleaders) && array_key_exists($mybb->user['uid'], $groupleaders))
{
$groupleader = $groupleaders[$mybb->user['uid']];

if($mybb->user['uid'] != 0 && is_array($groupleaders) && array_key_exists($mybb->user['uid'], $groupleaders))
{
$groupleader = $groupleaders[$mybb->user['uid']];

 
	$showjoinnotice = false;


$gids = "'0'";
foreach($groupleader as $user)


$gids = "'0'";
foreach($groupleader as $user)

Zeile 586Zeile 606
		}

$user['gid'] = (int)$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');

if($total_joinrequests > 0)
{
if($total_joinrequests == 1)
{
$lang->pending_joinrequests = $lang->pending_joinrequest;
}
else
{
$total_joinrequests = my_number_format($total_joinrequests);
$lang->pending_joinrequests = $lang->sprintf($lang->pending_joinrequests, $total_joinrequests);
}

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










if(!empty($groupscache[$user['gid']]['joinable']) && $groupscache[$user['gid']]['joinable'] == 1)
{
$showjoinnotice = true;
$gids .= ",'{$user['gid']}'";
}
}

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

if($total_joinrequests > 0)
{
if($total_joinrequests == 1)
{
$lang->pending_joinrequests = $lang->pending_joinrequest;
}
else
{
$total_joinrequests = my_number_format($total_joinrequests);
$lang->pending_joinrequests = $lang->sprintf($lang->pending_joinrequests, $total_joinrequests);
}

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

	}
}


	}
}


Zeile 672Zeile 700
					{
++$unread;
}

					{
++$unread;
}

				}

				}

			}

if($unread > 0)

			}

if($unread > 0)

Zeile 706Zeile 734
	// Fetch details on their ban
$query = $db->simple_select('banned', '*', "uid = '{$mybb->user['uid']}'", array('limit' => 1));
$ban = $db->fetch_array($query);

	// Fetch details on their ban
$query = $db->simple_select('banned', '*', "uid = '{$mybb->user['uid']}'", array('limit' => 1));
$ban = $db->fetch_array($query);





	if($ban['uid'])
{
// Format their ban lift date and reason appropriately

	if($ban['uid'])
{
// Format their ban lift date and reason appropriately

Zeile 715Zeile 743

if($ban['lifted'] > 0)
{


if($ban['lifted'] > 0)
{

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

			$banlift = my_date('normal', $ban['lifted']);

		}
}


		}
}


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

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

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

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

	{

	{

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

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

	}
else
{

	}
else
{

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

if($mybb->user['pms_unread'] == 1)

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

if($mybb->user['pms_unread'] == 1)

	{

	{

		$privatemessage_text = $lang->sprintf($lang->newpm_notice_one, $user_text, $mybb->settings['bburl'], $pm['pmid'], htmlspecialchars_uni($pm['subject']));
}
else
{
$privatemessage_text = $lang->sprintf($lang->newpm_notice_multiple, $mybb->user['pms_unread'], $user_text, $mybb->settings['bburl'], $pm['pmid'], htmlspecialchars_uni($pm['subject']));

		$privatemessage_text = $lang->sprintf($lang->newpm_notice_one, $user_text, $mybb->settings['bburl'], $pm['pmid'], htmlspecialchars_uni($pm['subject']));
}
else
{
$privatemessage_text = $lang->sprintf($lang->newpm_notice_multiple, $mybb->user['pms_unread'], $user_text, $mybb->settings['bburl'], $pm['pmid'], htmlspecialchars_uni($pm['subject']));

	}

	}

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


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


Zeile 798Zeile 826
	if(!empty($awaitingusers['users']))
{
$awaitingusers = (int)$awaitingusers['users'];

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

	}
else
{
$awaitingusers = 0;
}

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

	}
else
{
$awaitingusers = 0;
}

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

		$awaitingusers = my_number_format($awaitingusers);
}


		$awaitingusers = my_number_format($awaitingusers);
}


Zeile 842Zeile 870
eval('$gobutton = "'.$templates->get('gobutton').'";');
eval('$htmldoctype = "'.$templates->get('htmldoctype', 1, 0).'";');
eval('$header = "'.$templates->get('header').'";');

eval('$gobutton = "'.$templates->get('gobutton').'";');
eval('$htmldoctype = "'.$templates->get('htmldoctype', 1, 0).'";');
eval('$header = "'.$templates->get('header').'";');





$copy_year = my_date('Y', TIME_NOW);

// Are we showing version numbers in the footer?

$copy_year = my_date('Y', TIME_NOW);

// Are we showing version numbers in the footer?

Zeile 850Zeile 878
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 = '';
$task_cache = $cache->read('tasks');
if(!$task_cache['nextrun'])
{
$task_cache['nextrun'] = TIME_NOW;

// Check to see if we have any tasks to run
$task_image = '';
$task_cache = $cache->read('tasks');
if(!$task_cache['nextrun'])
{
$task_cache['nextrun'] = TIME_NOW;

}


}


if($task_cache['nextrun'] <= TIME_NOW)
{
eval("\$task_image = \"".$templates->get("task_image")."\";");

if($task_cache['nextrun'] <= TIME_NOW)
{
eval("\$task_image = \"".$templates->get("task_image")."\";");

Zeile 893Zeile 921
			{
$selected = '';
}

			{
$selected = '';
}





			eval('$lang_options .= "'.$templates->get('footer_languageselect_option').'";');
}


			eval('$lang_options .= "'.$templates->get('footer_languageselect_option').'";');
}


Zeile 944Zeile 972

// Set the link to the archive.
$archive_url = build_archive_link();


// Set the link to the archive.
$archive_url = build_archive_link();





// Check banned ip addresses
if(is_banned_ip($session->ipaddress, true))
{

// Check banned ip addresses
if(is_banned_ip($session->ipaddress, true))
{

Zeile 966Zeile 994
		'logout',
),
'captcha.php',

		'logout',
),
'captcha.php',

 
	'contact.php',

);

// If the board is closed, the user is not an administrator and they're not trying to login, show the board closed message

);

// If the board is closed, the user is not an administrator and they're not trying to login, show the board closed message

Zeile 978Zeile 1007
	}

eval('$reason = "'.$templates->get('global_boardclosed_reason').'";');

	}

eval('$reason = "'.$templates->get('global_boardclosed_reason').'";');

	$lang->error_boardclosed .= $reason;

	$lang->error_boardclosed .= $reason;


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


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

Zeile 1008Zeile 1037
		'resetpassword',
),
'captcha.php',

		'resetpassword',
),
'captcha.php',

 
	'contact.php',

);

// If the board forces user to login/register, and the user is a guest, show the force login message

);

// If the board forces user to login/register, and the user is a guest, show the force login message

Zeile 1043Zeile 1073
	if($referrer['uid'])
{
my_setcookie('mybb[referrer]', $referrer['uid']);

	if($referrer['uid'])
{
my_setcookie('mybb[referrer]', $referrer['uid']);

	}
}

	}
}


$output = '';
$notallowed = false;


$output = '';
$notallowed = false;

Zeile 1078Zeile 1108
		if(!$mybb->get_input('modal'))
{
error_no_permission();

		if(!$mybb->get_input('modal'))
{
error_no_permission();

		}

		}

		else
{
eval('$output = "'.$templates->get('global_no_permission_modal', 1, 0).'";');

		else
{
eval('$output = "'.$templates->get('global_no_permission_modal', 1, 0).'";');

Zeile 1095Zeile 1125
	if(THIS_SCRIPT != 'usercp.php' || THIS_SCRIPT == 'usercp.php' && $mybb->get_input('action') != 'email' && $mybb->get_input('action') != 'do_email')
{
redirect('usercp.php?action=email');

	if(THIS_SCRIPT != 'usercp.php' || THIS_SCRIPT == 'usercp.php' && $mybb->get_input('action') != 'email' && $mybb->get_input('action') != 'do_email')
{
redirect('usercp.php?action=email');

	}

	}

	else if($mybb->request_method != 'post')

	else if($mybb->request_method != 'post')

	{

	{

		$banned_email_error = inline_error(array($lang->banned_email_warning));

		$banned_email_error = inline_error(array($lang->banned_email_warning));

	}
}


	}
}


// work out which items the user has collapsed
$colcookie = '';
if(!empty($mybb->cookies['collapsed']))

// work out which items the user has collapsed
$colcookie = '';
if(!empty($mybb->cookies['collapsed']))

{

{

	$colcookie = $mybb->cookies['collapsed'];
}


	$colcookie = $mybb->cookies['collapsed'];
}


// set up collapsable items (to automatically show them us expanded)
$collapsed = array('boardstats' => '', 'boardstats_e' => '', 'quickreply' => '', 'quickreply_e' => '');
$collapsedimg = $collapsed;


$collapse = $collapsed = $collapsedimg = array();




if($colcookie)
{

if($colcookie)
{

	$col = explode("|", $colcookie);
if(!is_array($col))
{
$col[0] = $colcookie; // only one item
}
unset($collapsed);
foreach($col as $key => $val)

	// Preserve and don't unset $collapse, will be needed globally throughout many pages
$collapse = explode("|", $colcookie);
foreach($collapse as $val)





	{
$ex = $val."_e";
$co = $val."_c";

	{
$ex = $val."_e";
$co = $val."_c";