Vergleich global.php - 1.8.24 - 1.8.38

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 91Zeile 91
$lang->load('messages');

// Wipe lockout cookie if enough time has passed

$lang->load('messages');

// Wipe lockout cookie if enough time has passed

if($mybb->cookies['lockoutexpiry'] && $mybb->cookies['lockoutexpiry'] < TIME_NOW)

if(isset($mybb->cookies['lockoutexpiry']) && $mybb->cookies['lockoutexpiry'] < TIME_NOW)

{
my_unsetcookie('lockoutexpiry');
}

{
my_unsetcookie('lockoutexpiry');
}

Zeile 183Zeile 183
	if(isset($mybb->input['pid']) && THIS_SCRIPT != "polls.php")
{
$query = $db->simple_select("posts", "fid", "pid = '{$mybb->input['pid']}'", array("limit" => 1));

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

 




		if($fid)

		if($db->num_rows($query) > 0 && $fid = $db->fetch_field($query, 'fid'))

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

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

Zeile 195Zeile 194
	else if(isset($mybb->input['tid']))
{
$query = $db->simple_select('threads', 'fid', "tid = '{$mybb->input['tid']}'", array('limit' => 1));

	else if(isset($mybb->input['tid']))
{
$query = $db->simple_select('threads', 'fid', "tid = '{$mybb->input['tid']}'", array('limit' => 1));

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

 




		if($fid)

		if($db->num_rows($query) > 0 && $fid = $db->fetch_field($query, 'fid'))

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

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

Zeile 207Zeile 205
	else if(isset($mybb->input['pid']) && THIS_SCRIPT == "polls.php")
{
$query = $db->query("SELECT t.fid FROM ".TABLE_PREFIX."polls p INNER JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) WHERE p.pid = '{$mybb->input['pid']}' LIMIT 1");

	else if(isset($mybb->input['pid']) && THIS_SCRIPT == "polls.php")
{
$query = $db->query("SELECT t.fid FROM ".TABLE_PREFIX."polls p INNER JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) WHERE p.pid = '{$mybb->input['pid']}' LIMIT 1");

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

 




		if($fid)

		if($db->num_rows($query) > 0 && $fid = $db->fetch_field($query, 'fid'))

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

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

Zeile 248Zeile 245
	$query = $db->simple_select('themes', 'name, tid, properties, stylesheets, allowedgroups', $loadstyle, array('limit' => 1));
$theme = $db->fetch_array($query);


	$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($theme && !$load_from_forum && !is_member($theme['allowedgroups']) && $theme['allowedgroups'] != 'all')

	{
if($load_from_user == 1)
{

	{
if($load_from_user == 1)
{

Zeile 336Zeile 333
				else
{
$stylesheet_url = $mybb->get_asset_url($page_stylesheet);

				else
{
$stylesheet_url = $mybb->get_asset_url($page_stylesheet);

 
					if (file_exists(MYBB_ROOT.$page_stylesheet))
{
$stylesheet_url .= "?t=".filemtime(MYBB_ROOT.$page_stylesheet);
}

				}

if($mybb->settings['minifycss'])

				}

if($mybb->settings['minifycss'])

Zeile 363Zeile 364
	}
}
unset($actions);

	}
}
unset($actions);





$css_php_script_stylesheets = array();

if(!empty($theme_stylesheets) && is_array($theme['disporder']))

$css_php_script_stylesheets = array();

if(!empty($theme_stylesheets) && is_array($theme['disporder']))

Zeile 391Zeile 392
		));

$stylesheets .= "<link type=\"text/css\" rel=\"stylesheet\" href=\"{$sheet}\" />\n";

		));

$stylesheets .= "<link type=\"text/css\" rel=\"stylesheet\" href=\"{$sheet}\" />\n";

}

}


// Are we linking to a remote theme server?
if(my_validate_url($theme['imgdir']))
{
// If a language directory for the current language exists within the theme - we use it
if(!empty($mybb->user['language']))


// Are we linking to a remote theme server?
if(my_validate_url($theme['imgdir']))
{
// If a language directory for the current language exists within the theme - we use it
if(!empty($mybb->user['language']))

	{

	{

		$theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->user['language'];
}
else
{
// Check if a custom language directory exists for this theme
if(!empty($mybb->settings['bblanguage']))

		$theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->user['language'];
}
else
{
// 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

Zeile 445Zeile 446
		else
{
$theme['imglangdir'] = $theme['imgdir'];

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

Zeile 460Zeile 461

// Load Main Templates and Cached Templates
if(isset($templatelist))


// Load Main Templates and Cached Templates
if(isset($templatelist))

{

{

	$templatelist .= ',';
}
else

	$templatelist .= ',';
}
else

Zeile 501Zeile 502
if($mybb->settings['boardclosed'] == 1 && $mybb->usergroup['canviewboardclosed'] == 1)
{
eval('$bbclosedwarning = "'.$templates->get('global_boardclosed_warning').'";');

if($mybb->settings['boardclosed'] == 1 && $mybb->usergroup['canviewboardclosed'] == 1)
{
eval('$bbclosedwarning = "'.$templates->get('global_boardclosed_warning').'";');

}


}


// Prepare the main templates for use
$admincplink = $modcplink = $usercplink = '';


// Prepare the main templates for use
$admincplink = $modcplink = $usercplink = '';


Zeile 530Zeile 531
	$lang->welcome_back = $lang->sprintf($lang->welcome_back, build_profile_link(htmlspecialchars_uni($mybb->user['username']), $mybb->user['uid']), $lastvisit);

$buddylink = $searchlink = $pmslink = '';

	$lang->welcome_back = $lang->sprintf($lang->welcome_back, build_profile_link(htmlspecialchars_uni($mybb->user['username']), $mybb->user['uid']), $lastvisit);

$buddylink = $searchlink = $pmslink = '';





	if(!empty($mybb->user['buddylist']))

	if(!empty($mybb->user['buddylist']))

	{

	{

		eval('$buddylink = "' . $templates->get('header_welcomeblock_member_buddy') . '";');

		eval('$buddylink = "' . $templates->get('header_welcomeblock_member_buddy') . '";');

	}


	}


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

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

	{

	{

		eval('$searchlink = "'.$templates->get('header_welcomeblock_member_search').'";');
}


		eval('$searchlink = "'.$templates->get('header_welcomeblock_member_search').'";');
}


Zeile 545Zeile 546
	if($mybb->settings['enablepms'] != 0 && $mybb->usergroup['canusepms'] == 1)
{
$lang->welcome_pms_usage = $lang->sprintf($lang->welcome_pms_usage, my_number_format($mybb->user['pms_unread']), my_number_format($mybb->user['pms_total']));

	if($mybb->settings['enablepms'] != 0 && $mybb->usergroup['canusepms'] == 1)
{
$lang->welcome_pms_usage = $lang->sprintf($lang->welcome_pms_usage, my_number_format($mybb->user['pms_unread']), my_number_format($mybb->user['pms_total']));





		eval('$pmslink = "'.$templates->get('header_welcomeblock_member_pms').'";');
}


		eval('$pmslink = "'.$templates->get('header_welcomeblock_member_pms').'";');
}


Zeile 557Zeile 558
	switch($mybb->settings['username_method'])
{
case 0:

	switch($mybb->settings['username_method'])
{
case 0:

			$login_username = $lang->login_username;
break;

			$login_username = $lang->login_username;
break;

		case 1:
$login_username = $lang->login_username1;
break;

		case 1:
$login_username = $lang->login_username1;
break;

Zeile 570Zeile 571
			break;
}


			break;
}


	if($mybb->cookies['lockoutexpiry'])

	if(!empty($mybb->cookies['lockoutexpiry']))

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

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

Zeile 587Zeile 588
	}

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

	}

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)
{
eval('$menu_search = "'.$templates->get('header_menu_search').'";');
eval('$quicksearch = "'.$templates->get('header_quicksearch').'";');

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

}


}


if($mybb->settings['enablememberlist'] == 1 && $mybb->usergroup['canviewmemberlist'] == 1)
{
eval('$menu_memberlist = "'.$templates->get('header_menu_memberlist').'";');

if($mybb->settings['enablememberlist'] == 1 && $mybb->usergroup['canviewmemberlist'] == 1)
{
eval('$menu_memberlist = "'.$templates->get('header_menu_memberlist').'";');

}


}


if($mybb->settings['enablecalendar'] == 1 && $mybb->usergroup['canviewcalendar'] == 1)
{
eval('$menu_calendar = "'.$templates->get('header_menu_calendar').'";');

if($mybb->settings['enablecalendar'] == 1 && $mybb->usergroup['canviewcalendar'] == 1)
{
eval('$menu_calendar = "'.$templates->get('header_menu_calendar').'";');

Zeile 626Zeile 627
		if($user['canmanagerequests'] != 1)
{
continue;

		if($user['canmanagerequests'] != 1)
{
continue;

		}

$user['gid'] = (int)$user['gid'];

		}

$user['gid'] = (int)$user['gid'];


if(!empty($groupscache[$user['gid']]['type']) && $groupscache[$user['gid']]['type'] == 4)
{


if(!empty($groupscache[$user['gid']]['type']) && $groupscache[$user['gid']]['type'] == 4)
{

Zeile 650Zeile 651
			}
else
{

			}
else
{

				$total_joinrequests = my_number_format($total_joinrequests);
$lang->pending_joinrequests = $lang->sprintf($lang->pending_joinrequests, $total_joinrequests);

				$lang->pending_joinrequests = $lang->sprintf($lang->pending_joinrequests, my_number_format($total_joinrequests));


			}

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

			}

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





$modnotice = '';
$moderation_queue = array();

$modnotice = '';
$moderation_queue = array();

 
$can_access_moderationqueue = false;


// This user is a moderator, super moderator or administrator


// This user is a moderator, super moderator or administrator

if($mybb->settings['reportmethod'] == "db" && ($mybb->usergroup['cancp'] == 1 || ($mybb->user['ismoderator'] && $mybb->usergroup['canmodcp'] == 1 && $mybb->usergroup['canmanagereportedcontent'] == 1)))

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

{
// 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'] == 1 && $mybb->usergroup['canmanagereportedcontent'] == 1))

{
// 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'] == 1 && $mybb->usergroup['canmanagereportedcontent'] == 1))

Zeile 672Zeile 673
		$can_access_moderationqueue = true;
$is_super_admin = is_super_admin($mybb->user['uid']);
if(!$is_super_admin)

		$can_access_moderationqueue = true;
$is_super_admin = is_super_admin($mybb->user['uid']);
if(!$is_super_admin)

		{

		{

			// Include admin functions
if(!file_exists(MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions.php"))
{

			// Include admin functions
if(!file_exists(MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions.php"))
{

Zeile 697Zeile 698
		}
}
else

		}
}
else

	{
$can_access_moderationqueue = false;
}

	{
$can_access_moderationqueue = false;
}


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


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

Zeile 725Zeile 726
					{
++$unread;
}

					{
++$unread;
}

				}
}

				}
}


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


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

				{

				{

					$lang->unread_reports = $lang->unread_report;

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

				



				eval('$moderation_queue[] = "'.$templates->get('global_unreadreports', 1, 0).'";');

				eval('$moderation_queue[] = "'.$templates->get('global_unreadreports', 1, 0).'";');

			}

			}

		}
}
}

		}
}
}

Zeile 781Zeile 782
			}

eval('$moderation_queue[] = "'.$templates->get('global_modqueue', 1, 0).'";');

			}

eval('$moderation_queue[] = "'.$templates->get('global_modqueue', 1, 0).'";');

		}
}
}


		}
}
}


if(!empty($moderation_queue))
{
$moderation_queue_last = array_pop($moderation_queue);

if(!empty($moderation_queue))
{
$moderation_queue_last = array_pop($moderation_queue);

Zeile 889Zeile 890
}

$remote_avatar_notice = '';

}

$remote_avatar_notice = '';

if(($mybb->user['avatartype'] === 'remote' || $mybb->user['avatartype'] === 'gravatar') && !$mybb->settings['allowremoteavatars'])

if(isset($mybb->user['avatartype']) && ($mybb->user['avatartype'] === 'remote' || $mybb->user['avatartype'] === 'gravatar') && !$mybb->settings['allowremoteavatars'])

{
eval('$remote_avatar_notice = "'.$templates->get('global_remote_avatar_notice').'";');
}


{
eval('$remote_avatar_notice = "'.$templates->get('global_remote_avatar_notice').'";');
}


 
$awaitingusers = '';

if($mybb->settings['awactialert'] == 1 && $mybb->usergroup['cancp'] == 1)
{
$awaitingusers = $cache->read('awaitingactivation');

if($mybb->settings['awactialert'] == 1 && $mybb->usergroup['cancp'] == 1)
{
$awaitingusers = $cache->read('awaitingactivation');

Zeile 1021Zeile 1023
$theme_select = $theme_options = '';
if($mybb->settings['showthemeselect'] != 0)
{

$theme_select = $theme_options = '';
if($mybb->settings['showthemeselect'] != 0)
{

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










	if(isset($mybb->user['style']))
{
$selected = $mybb->user['style'];
}
else
{
$selected = -1;
}

$theme_options = build_theme_select("theme", $selected, 0, '', false, true);


if(!empty($theme_options))
{


if(!empty($theme_options))
{

Zeile 1091Zeile 1102
);

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

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









if(
$mybb->settings['boardclosed'] == 1 &&
$mybb->usergroup['canviewboardclosed'] != 1 &&
!in_array($current_page, $closed_bypass) &&
!(
isset($closed_bypass[$current_page]) &&
in_array($mybb->get_input('action'), $closed_bypass[$current_page])
)
)

{
// Show error
if(!$mybb->settings['boardclosed_reason'])

{
// Show error
if(!$mybb->settings['boardclosed_reason'])

Zeile 1134Zeile 1153
);

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

if($mybb->settings['forcelogin'] == 1 && $mybb->user['uid'] == 0 && !in_array($current_page, $force_bypass) && (!is_array($force_bypass[$current_page]) || !in_array($mybb->get_input('action'), $force_bypass[$current_page])))









if(
$mybb->settings['forcelogin'] == 1 &&
$mybb->user['uid'] == 0 &&
!in_array($current_page, $force_bypass) &&
!(
isset($force_bypass[$current_page]) &&
in_array($mybb->get_input('action'), $force_bypass[$current_page])
)
)

{
// Show error
error_no_permission();

{
// Show error
error_no_permission();

Zeile 1163Zeile 1190
	$query = $db->simple_select('users', 'uid', $condition, array('limit' => 1));
$referrer = $db->fetch_array($query);


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


	if($referrer['uid'])

	if($referrer)

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

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

Zeile 1215Zeile 1242
// If they are, redirect them to change it
if($mybb->user['uid'] && is_banned_email($mybb->user['email']) && $mybb->settings['emailkeep'] != 1)
{

// If they are, redirect them to change it
if($mybb->user['uid'] && is_banned_email($mybb->user['email']) && $mybb->settings['emailkeep'] != 1)
{

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




	if(
!(THIS_SCRIPT == 'usercp.php' && in_array($mybb->get_input('action'), array('email', 'do_email'))) &&
!(THIS_SCRIPT == 'member.php' && $mybb->get_input('action') == 'activate')
)

	{
redirect('usercp.php?action=email');
}

	{
redirect('usercp.php?action=email');
}

Zeile 1226Zeile 1256
}

// work out which items the user has collapsed

}

// work out which items the user has collapsed

$colcookie = '';


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


if(!empty($mybb->cookies['collapsed']))

if(!empty($mybb->cookies['collapsed']))

{

{

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

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

}

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

 




if($colcookie)
{

 
	// Preserve and don't unset $collapse, will be needed globally throughout many pages
$collapse = explode("|", $colcookie);
foreach($collapse as $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";
$collapsed[$co] = "display: show;";
$collapsed[$ex] = "display: none;";

		$collapsed[$val."_e"] = "display: none;";




		$collapsedimg[$val] = "_collapsed";
$collapsedthead[$val] = " thead_collapsed";
}

		$collapsedimg[$val] = "_collapsed";
$collapsedthead[$val] = " thead_collapsed";
}