Vergleich global.php - 1.8.20 - 1.8.24

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 206Zeile 206
	// If we're accessing poll results, fetch the forum theme for it and if we're overriding it
else if(isset($mybb->input['pid']) && THIS_SCRIPT == "polls.php")
{

	// If we're accessing poll results, fetch the forum theme for it and if we're overriding it
else if(isset($mybb->input['pid']) && THIS_SCRIPT == "polls.php")
{

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

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

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

if($fid)

Zeile 473Zeile 473
$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_showteamlink,footer_themeselector,task_image,usercp_themeselector_option,php_warnings";

$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_showteamlink,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 .= ",header_welcomeblock_member_pms,header_welcomeblock_member_search,header_welcomeblock_guest,header_welcomeblock_guest_login_modal,header_welcomeblock_guest_login_modal_lockout";

$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,global_modqueue,global_modqueue_notice";
$templatelist .= ",header_welcomeblock_member_buddy,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,modal,modal_button";
$templates->cache($db->escape_string($templatelist));


$templatelist .= ",header_menu_calendar,header_menu_memberlist,global_dst_detection,header_quicksearch,smilie,modal,modal_button";
$templates->cache($db->escape_string($templatelist));


Zeile 529Zeile 529
	// Format the welcome back message
$lang->welcome_back = $lang->sprintf($lang->welcome_back, build_profile_link(htmlspecialchars_uni($mybb->user['username']), $mybb->user['uid']), $lastvisit);


	// Format the welcome back message
$lang->welcome_back = $lang->sprintf($lang->welcome_back, build_profile_link(htmlspecialchars_uni($mybb->user['username']), $mybb->user['uid']), $lastvisit);


	$searchlink = '';







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

if(!empty($mybb->user['buddylist']))
{
eval('$buddylink = "' . $templates->get('header_welcomeblock_member_buddy') . '";');
}


	if($mybb->usergroup['cansearch'] == 1)
{
eval('$searchlink = "'.$templates->get('header_welcomeblock_member_search').'";');

	if($mybb->usergroup['cansearch'] == 1)
{
eval('$searchlink = "'.$templates->get('header_welcomeblock_member_search').'";');

	}


	}


	// Tell the user their PM usage

	// Tell the user their PM usage

	$pmslink = '';

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

Zeile 552Zeile 557
	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 566Zeile 571
	}

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

	}

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

	{

	{

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

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

Zeile 582Zeile 587
	}

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)


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

}


}


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

}


}


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 = '';
$groupleaders = $cache->read('groupleaders');

// See if there are any pending join requests for group leaders
$pending_joinrequests = '';
$groupleaders = $cache->read('groupleaders');

Zeile 619Zeile 624
	foreach($groupleader as $user)
{
if($user['canmanagerequests'] != 1)

	foreach($groupleader as $user)
{
if($user['canmanagerequests'] != 1)

		{

		{

			continue;

			continue;

		}

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

if(!empty($groupscache[$user['gid']]['joinable']) && $groupscache[$user['gid']]['joinable'] == 1)

		}

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

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

		{
$showjoinnotice = true;
$gids .= ",'{$user['gid']}'";

		{
$showjoinnotice = true;
$gids .= ",'{$user['gid']}'";

Zeile 638Zeile 643
		$total_joinrequests = $db->fetch_field($query, 'total');

if($total_joinrequests > 0)

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

if($total_joinrequests > 0)

		{

		{

			if($total_joinrequests == 1)
{
$lang->pending_joinrequests = $lang->pending_joinrequest;

			if($total_joinrequests == 1)
{
$lang->pending_joinrequests = $lang->pending_joinrequest;

			}

			}

			else
{
$total_joinrequests = my_number_format($total_joinrequests);

			else
{
$total_joinrequests = my_number_format($total_joinrequests);

Zeile 672Zeile 677
			if(!file_exists(MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions.php"))
{
$can_access_moderationqueue = false;

			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']."/inc/functions.php";

// Verify if we have permissions to access forum-moderation_queue

Zeile 682Zeile 687
			{
// 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)
{

				$permissions = forum_admin_permissions();
if(array_key_exists('moderation_queue', $permissions['permissions']) && $adminperms['forum']['moderation_queue'] != 1)
{

Zeile 695Zeile 700
	{
$can_access_moderationqueue = false;
}

	{
$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 708Zeile 713
			if($mybb->usergroup['cancp'] || $mybb->usergroup['issupermod'])
{
$unread = (int)$reported['unread'];

			if($mybb->usergroup['cancp'] || $mybb->usergroup['issupermod'])
{
$unread = (int)$reported['unread'];

			}

			}

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

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

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

				{

				{

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

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

Zeile 740Zeile 745
	}
}


	}
}


// Get awaiting moderation queue stats
if($can_access_moderationqueue || ($mybb->user['ismoderator'] && $mybb->usergroup['canmodcp'] == 1 && $mybb->usergroup['canmanagemodqueue'] == 1))




// Get awaiting moderation queue stats, except if the page is editpost.php,
// because that page can make changes - (un)approving attachments, or deleting
// unapproved attachments - that would invalidate anything generated here.
// Just leave this queue notification blank for editpost.php.
if(!(defined('THIS_SCRIPT') && THIS_SCRIPT == 'editpost.php') && ($can_access_moderationqueue || ($mybb->user['ismoderator'] && $mybb->usergroup['canmodcp'] == 1 && $mybb->usergroup['canmanagemodqueue'] == 1)))

{
$unapproved_posts = $unapproved_threads = 0;
$query = $db->simple_select("posts", "replyto", "visible = 0");
while($unapproved = $db->fetch_array($query))

{
$unapproved_posts = $unapproved_threads = 0;
$query = $db->simple_select("posts", "replyto", "visible = 0");
while($unapproved = $db->fetch_array($query))

	{

	{

		if($unapproved["replyto"] == 0){
$unapproved_threads++;
} else {
$unapproved_posts++;

		if($unapproved["replyto"] == 0){
$unapproved_threads++;
} else {
$unapproved_posts++;

		}

		}

	}

$query = $db->simple_select("attachments", "COUNT(aid) AS unapprovedattachments", "visible=0");

	}

$query = $db->simple_select("attachments", "COUNT(aid) AS unapprovedattachments", "visible=0");

	$unapproved_attachments = $db->fetch_field($query, "unapprovedattachments");

	$unapproved_attachments = $db->fetch_field($query, "unapprovedattachments");


$modqueue_types = array('threads', 'posts', 'attachments');



$modqueue_types = array('threads', 'posts', 'attachments');


Zeile 764Zeile 772
		if(!empty(${'unapproved_'.$modqueue_type}))
{
if(${'unapproved_'.$modqueue_type} == 1)

		if(!empty(${'unapproved_'.$modqueue_type}))
{
if(${'unapproved_'.$modqueue_type} == 1)

			{

			{

				$modqueue_message = $lang->{'unapproved_'.substr($modqueue_type, 0, -1)};
}
else

				$modqueue_message = $lang->{'unapproved_'.substr($modqueue_type, 0, -1)};
}
else

Zeile 781Zeile 789
{
$moderation_queue_last = array_pop($moderation_queue);
if(empty($moderation_queue))

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

	{

	{

		$moderation_queue = $moderation_queue_last;
}
else

		$moderation_queue = $moderation_queue_last;
}
else

Zeile 799Zeile 807
{
$charset = $lang->settings['charset'];
}

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





// Is this user apart of a banned group?
$bannedwarning = '';
if($mybb->usergroup['isbannedgroup'] == 1)
{

// Is this user apart of a banned group?
$bannedwarning = '';
if($mybb->usergroup['isbannedgroup'] == 1)
{

	// 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(!empty($mybb->user['banned']))




	{

	{

		// Format their ban lift date and reason appropriately
$banlift = $lang->banned_lifted_never;
$reason = htmlspecialchars_uni($ban['reason']);

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

		if(!empty($mybb->user['banlifted']))
{
$banlift = my_date('normal', $mybb->user['banlifted']);
}
else

		{

		{

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

			$banlift = $lang->banned_lifted_never;

		}
}

		}
}


if(empty($reason))

	else


	{

	{

		$reason = $lang->unknown;






		$banlift = $lang->unknown;
}

if(!empty($mybb->user['banreason']))
{
$reason = htmlspecialchars_uni($mybb->user['banreason']);

	}

	}


if(empty($banlift))

	else


	{

	{

		$banlift = $lang->unknown;

		$reason = $lang->unknown;

	}

// Display a nice warning to the user

	}

// Display a nice warning to the user

Zeile 941Zeile 949
$jsTemplates = array();
foreach (array('modal', 'modal_button') as $template) {
eval('$jsTemplates["'.$template.'"] = "'.$templates->get($template, 1, 0).'";');

$jsTemplates = array();
foreach (array('modal', 'modal_button') as $template) {
eval('$jsTemplates["'.$template.'"] = "'.$templates->get($template, 1, 0).'";');

	$jsTemplates[$template] = str_replace("\n", "\\\n", addslashes($jsTemplates[$template]));

	$jsTemplates[$template] = str_replace(array("\n","\r"), array("\\\n", ""), addslashes($jsTemplates[$template]));

}

// Set up some of the default templates

}

// Set up some of the default templates