Vergleich modcp.php - 1.8.4 - 1.8.7

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 1574Zeile 1574
	add_breadcrumb($lang->edit_announcement, "modcp.php?action=edit_announcements&aid={$aid}");

// Get announcement

	add_breadcrumb($lang->edit_announcement, "modcp.php?action=edit_announcements&aid={$aid}");

// Get announcement

	if(!isset($announcement))

	if(!isset($announcement) || $mybb->request_method != 'post')

	{
$query = $db->simple_select("announcements", "*", "aid='{$aid}'");
$announcement = $db->fetch_array($query);

	{
$query = $db->simple_select("announcements", "*", "aid='{$aid}'");
$announcement = $db->fetch_array($query);

Zeile 2208Zeile 2208
		{
$altbg = alt_trow();
$post['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($post['threadsubject']));

		{
$altbg = alt_trow();
$post['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($post['threadsubject']));

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

			$post['threadlink'] = get_thread_link($post['tid']);
$post['postlink'] = get_post_link($post['pid'], $post['tid']);
$forum_link = get_forum_link($post['fid']);

			$post['threadlink'] = get_thread_link($post['tid']);
$post['postlink'] = get_post_link($post['pid'], $post['tid']);
$forum_link = get_forum_link($post['fid']);

Zeile 2723Zeile 2724

foreach($usertitles as $title)
{


foreach($usertitles as $title)
{

			if($title['posts'] <= $mybb->user['postnum'])

			if($title['posts'] <= $user['postnum'])

			{
$defaulttitle = $title['title'];

			{
$defaulttitle = $title['title'];

 
				break;

			}
}
}

			}
}
}

Zeile 2891Zeile 2893
						$val = str_replace("\n", "\\n", $val);

$sel = "";

						$val = str_replace("\n", "\\n", $val);

$sel = "";

						if($val == $seloptions[$val])

						if(isset($seloptions[$val]) && $val == $seloptions[$val])

						{
$sel = " selected=\"selected\"";
}

						{
$sel = " selected=\"selected\"";
}

Zeile 2971Zeile 2973
					foreach($expoptions as $key => $val)
{
$checked = "";

					foreach($expoptions as $key => $val)
{
$checked = "";

						if($val == $seloptions[$val])
{

						if(isset($seloptions[$val]) && $val == $seloptions[$val])
{

							$checked = " checked=\"checked\"";
}


							$checked = " checked=\"checked\"";
}


Zeile 3016Zeile 3018
	$lang->edit_profile = $lang->sprintf($lang->edit_profile, $user['username']);
$profile_link = build_profile_link(format_name($user['username'], $user['usergroup'], $user['displaygroup']), $user['uid']);


	$lang->edit_profile = $lang->sprintf($lang->edit_profile, $user['username']);
$profile_link = build_profile_link(format_name($user['username'], $user['usergroup'], $user['displaygroup']), $user['uid']);


 
	$user['signature'] = htmlspecialchars_uni($user['signature']);

	$codebuttons = build_mycode_inserter("signature");

// Do we mark the suspend signature box?

	$codebuttons = build_mycode_inserter("signature");

// Do we mark the suspend signature box?

Zeile 3049Zeile 3052
		$suspost_checked = "checked=\"checked\"";
}
else

		$suspost_checked = "checked=\"checked\"";
}
else

	{

	{

		$suspost_check = 0;
$suspost_checked = '';
}

		$suspost_check = 0;
$suspost_checked = '';
}

Zeile 3095Zeile 3098
		if($user[$option['option']])
{
if($user[$option['length']] == 0)

		if($user[$option['option']])
{
if($user[$option['length']] == 0)

			{

			{

				// User has a permanent ban
$string = $option['option']."_perm";
$suspension_info = $lang->$string;

				// User has a permanent ban
$string = $option['option']."_perm";
$suspension_info = $lang->$string;

Zeile 3125Zeile 3128
		// Generate the boxes for this option
$selection_options = '';
foreach($periods as $key => $value)

		// Generate the boxes for this option
$selection_options = '';
foreach($periods as $key => $value)

		{

		{

			$string = $option['select_option']."_period";
if($mybb->get_input($string) == $key)
{

			$string = $option['select_option']."_period";
if($mybb->get_input($string) == $key)
{

Zeile 3150Zeile 3153
				break;
case "suspendposting":
eval("\$suspost_options = \"".$templates->get("modcp_editprofile_select")."\";");

				break;
case "suspendposting":
eval("\$suspost_options = \"".$templates->get("modcp_editprofile_select")."\";");

				break;
}
}

eval("\$suspend_signature = \"".$templates->get("modcp_editprofile_signature")."\";");


				break;
}
}

eval("\$suspend_signature = \"".$templates->get("modcp_editprofile_signature")."\";");


	if(!isset($newtitle))
{
$newtitle = '';

	if(!isset($newtitle))
{
$newtitle = '';

Zeile 3170Zeile 3173
if($mybb->input['action'] == "finduser")
{
if($mybb->usergroup['caneditprofiles'] == 0)

if($mybb->input['action'] == "finduser")
{
if($mybb->usergroup['caneditprofiles'] == 0)

	{

	{

		error_no_permission();
}


		error_no_permission();
}


Zeile 3200Zeile 3203

// Sort order & direction
switch($mybb->get_input('sortby'))


// Sort order & direction
switch($mybb->get_input('sortby'))

	{

	{

		case "lastvisit":
$sortby = "lastvisit";
break;
case "postnum":
$sortby = "postnum";

		case "lastvisit":
$sortby = "lastvisit";
break;
case "postnum":
$sortby = "postnum";

			break;

			break;

		case "username":
$sortby = "username";
break;

		case "username":
$sortby = "username";
break;

Zeile 3216Zeile 3219
	$sortbysel = array('lastvisit' => '', 'postnum' => '', 'username' => '', 'regdate' => '');
$sortbysel[$mybb->get_input('sortby')] = " selected=\"selected\"";
$order = $mybb->get_input('order');

	$sortbysel = array('lastvisit' => '', 'postnum' => '', 'username' => '', 'regdate' => '');
$sortbysel[$mybb->get_input('sortby')] = " selected=\"selected\"";
$order = $mybb->get_input('order');

	if($order != "asc")
{

	if($order != "asc")
{

		$order = "desc";
}
$ordersel = array('asc' => '', 'desc' => '');

		$order = "desc";
}
$ordersel = array('asc' => '', 'desc' => '');

Zeile 3247Zeile 3250
	if($page)
{
$start = ($page-1) * $perpage;

	if($page)
{
$start = ($page-1) * $perpage;

	}
else

	}
else

	{
$start = 0;
$page = 1;

	{
$start = 0;
$page = 1;

	}


	}


	$page_url = 'modcp.php?action=finduser';
foreach(array('username', 'sortby', 'order') as $field)
{

	$page_url = 'modcp.php?action=finduser';
foreach(array('username', 'sortby', 'order') as $field)
{

Zeile 3261Zeile 3264
		if(!empty($mybb->input[$field]))
{
$page_url .= "&amp;{$field}=".$mybb->input[$field];

		if(!empty($mybb->input[$field]))
{
$page_url .= "&amp;{$field}=".$mybb->input[$field];

		}
}

$multipage = multipage($user_count, $perpage, $page, $page_url);

		}
}

$multipage = multipage($user_count, $perpage, $page, $page_url);


$usergroups_cache = $cache->read("usergroups");



$usergroups_cache = $cache->read("usergroups");


Zeile 3279Zeile 3282
		$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
$user['postnum'] = my_number_format($user['postnum']);
$regdate = my_date('relative', $user['regdate']);

		$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
$user['postnum'] = my_number_format($user['postnum']);
$regdate = my_date('relative', $user['regdate']);





		if($user['invisible'] == 1 && $mybb->usergroup['canviewwolinvis'] != 1 && $user['uid'] != $mybb->user['uid'])

		if($user['invisible'] == 1 && $mybb->usergroup['canviewwolinvis'] != 1 && $user['uid'] != $mybb->user['uid'])

		{

		{

			$lastdate = $lang->lastvisit_never;

if($user['lastvisit'])

			$lastdate = $lang->lastvisit_never;

if($user['lastvisit'])

Zeile 3289Zeile 3292
				// We have had at least some active time, hide it instead
$lastdate = $lang->lastvisit_hidden;
}

				// We have had at least some active time, hide it instead
$lastdate = $lang->lastvisit_hidden;
}

		}

		}

		else
{
$lastdate = my_date('relative', $user['lastvisit']);
}

		else
{
$lastdate = my_date('relative', $user['lastvisit']);
}





		$usergroup = htmlspecialchars_uni($usergroups_cache[$user['usergroup']]['title']);
eval("\$users .= \"".$templates->get("modcp_finduser_user")."\";");

		$usergroup = htmlspecialchars_uni($usergroups_cache[$user['usergroup']]['title']);
eval("\$users .= \"".$templates->get("modcp_finduser_user")."\";");

	}


	}


	// No results?
if(!$users)
{
eval("\$users = \"".$templates->get("modcp_finduser_noresults")."\";");
}

	// No results?
if(!$users)
{
eval("\$users = \"".$templates->get("modcp_finduser_noresults")."\";");
}





	$plugins->run_hooks("modcp_finduser_end");

eval("\$finduser = \"".$templates->get("modcp_finduser")."\";");
output_page($finduser);
}

	$plugins->run_hooks("modcp_finduser_end");

eval("\$finduser = \"".$templates->get("modcp_finduser")."\";");
output_page($finduser);
}





if($mybb->input['action'] == "warninglogs")
{
if($mybb->usergroup['canviewwarnlogs'] == 0)

if($mybb->input['action'] == "warninglogs")
{
if($mybb->usergroup['canviewwarnlogs'] == 0)

Zeile 3325Zeile 3328
	$mybb->input['filter'] = $mybb->get_input('filter', MyBB::INPUT_ARRAY);
$mybb->input['search'] = $mybb->get_input('search', MyBB::INPUT_ARRAY);
if(!empty($mybb->input['filter']['username']))

	$mybb->input['filter'] = $mybb->get_input('filter', MyBB::INPUT_ARRAY);
$mybb->input['search'] = $mybb->get_input('search', MyBB::INPUT_ARRAY);
if(!empty($mybb->input['filter']['username']))

	{

	{

		$search_user = get_user_by_username($mybb->input['filter']['username']);

$mybb->input['filter']['uid'] = (int)$search_user['uid'];

		$search_user = get_user_by_username($mybb->input['filter']['username']);

$mybb->input['filter']['uid'] = (int)$search_user['uid'];

Zeile 3340Zeile 3343
		$search['uid'] = (int)$mybb->input['filter']['uid'];
$where_sql .= " AND w.uid='{$search['uid']}'";
if(!isset($mybb->input['search']['username']))

		$search['uid'] = (int)$mybb->input['filter']['uid'];
$where_sql .= " AND w.uid='{$search['uid']}'";
if(!isset($mybb->input['search']['username']))

		{

		{

			$user = get_user($mybb->input['search']['uid']);
$mybb->input['search']['username'] = htmlspecialchars_uni($user['username']);
}

			$user = get_user($mybb->input['search']['uid']);
$mybb->input['search']['username'] = htmlspecialchars_uni($user['username']);
}

Zeile 3556Zeile 3559
			{
if(!is_array($ip_range))
{

			{
if(!is_array($ip_range))
{

					$post_ip_sql = "ipaddress=".$db->escape_binary($ip_range);

					$post_ip_sql = "p.ipaddress=".$db->escape_binary($ip_range);

				}
else
{

				}
else
{

					$post_ip_sql = "ipaddress BETWEEN ".$db->escape_binary($ip_range[0])." AND ".$db->escape_binary($ip_range[1]);

					$post_ip_sql = "p.ipaddress BETWEEN ".$db->escape_binary($ip_range[0])." AND ".$db->escape_binary($ip_range[1]);

				}
}


				}
}


Zeile 3568Zeile 3571

if($post_ip_sql)
{


if($post_ip_sql)
{

				$query = $db->simple_select('posts', 'COUNT(pid) AS count', "$post_ip_sql AND visible >= -1");







































































				$where_sql = '';

$unviewable_forums = get_unviewable_forums(true);

if($unviewable_forums)
{
$where_sql .= " AND p.fid NOT IN ({$unviewable_forums})";
}

if($inactiveforums)
{
$where_sql .= " AND p.fid NOT IN ({$inactiveforums})";
}

// Check group permissions if we can't view threads not started by us
$onlyusfids = array();
$group_permissions = forum_permissions();
foreach($group_permissions as $fid => $forumpermissions)
{
if(isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] == 1)
{
$onlyusfids[] = $fid;
}
}

if(!empty($onlyusfids))
{
$where_sql .= " AND ((t.fid IN(".implode(',', $onlyusfids).") AND t.uid='{$mybb->user['uid']}') OR t.fid NOT IN(".implode(',', $onlyusfids)."))";
}

// Moderators can view unapproved/deleted posts
if($mybb->usergroup['issupermod'] != 1)
{
$unapprove_forums = array();
$deleted_forums = array();
$visible_sql = " AND (p.visible = 1 AND t.visible = 1)";
$query = $db->simple_select("moderators", "fid, canviewunapprove, canviewdeleted", "(id='{$mybb->user['uid']}' AND isgroup='0') OR (id='{$mybb->user['usergroup']}' AND isgroup='1')");
while($moderator = $db->fetch_array($query))
{
if($moderator['canviewunapprove'] == 1)
{
$unapprove_forums[] = $moderator['fid'];
}

if($moderator['canviewdeleted'] == 1)
{
$deleted_forums[] = $moderator['fid'];
}
}

if(!empty($unapprove_forums))
{
$visible_sql .= " OR (p.visible = 0 AND p.fid IN(".implode(',', $unapprove_forums).")) OR (t.visible = 0 AND t.fid IN(".implode(',', $unapprove_forums)."))";
}
if(!empty($deleted_forums))
{
$visible_sql .= " OR (p.visible = -1 AND p.fid IN(".implode(',', $deleted_forums).")) OR (t.visible = -1 AND t.fid IN(".implode(',', $deleted_forums)."))";
}
}
else
{
// Super moderators (and admins)
$visible_sql = " AND p.visible >= -1";
}

$query = $db->query("
SELECT COUNT(p.pid) AS count
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid = p.tid)
WHERE {$post_ip_sql}{$where_sql}{$visible_sql}
");

				$post_results = $db->fetch_field($query, "count");
}
}

				$post_results = $db->fetch_field($query, "count");
}
}

Zeile 3710Zeile 3783
		if(isset($mybb->input['search_posts']) && $post_results && (!isset($mybb->input['search_users']) || (isset($mybb->input['search_users']) && $post_limit > 0)))
{
$ipaddresses = $tids = $uids = array();

		if(isset($mybb->input['search_posts']) && $post_results && (!isset($mybb->input['search_users']) || (isset($mybb->input['search_users']) && $post_limit > 0)))
{
$ipaddresses = $tids = $uids = array();

			
$query = $db->simple_select('posts', 'username AS postusername, uid, subject, pid, tid, ipaddress', "$post_ip_sql AND visible >= -1",
array('order_by' => 'dateline', 'order_dir' => 'DESC', 'limit_start' => $post_start, 'limit' => $post_limit));

 




 
			$query = $db->query("
SELECT p.username AS postusername, p.uid, p.subject, p.pid, p.tid, p.ipaddress
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid = p.tid)
WHERE {$post_ip_sql}{$where_sql}{$visible_sql}
ORDER BY p.dateline desc
LIMIT {$post_start}, {$post_limit}
");

			while($ipaddress = $db->fetch_array($query))
{
$tids[$ipaddress['tid']] = $ipaddress['pid'];

			while($ipaddress = $db->fetch_array($query))
{
$tids[$ipaddress['tid']] = $ipaddress['pid'];