Vergleich modcp.php - 1.8.33 - 1.8.37

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 2064Zeile 2064
	{
$attachments = array_map("intval", array_keys($mybb->input['attachments']));
$query = $db->query("

	{
$attachments = array_map("intval", array_keys($mybb->input['attachments']));
$query = $db->query("

			SELECT a.pid, a.aid

			SELECT a.pid, a.aid, t.tid

			FROM  ".TABLE_PREFIX."attachments a
LEFT JOIN ".TABLE_PREFIX."posts p ON (a.pid=p.pid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)

			FROM  ".TABLE_PREFIX."attachments a
LEFT JOIN ".TABLE_PREFIX."posts p ON (a.pid=p.pid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)

Zeile 2080Zeile 2080
			if($action == "approve")
{
$db->update_query("attachments", array("visible" => 1), "aid='{$attachment['aid']}'");

			if($action == "approve")
{
$db->update_query("attachments", array("visible" => 1), "aid='{$attachment['aid']}'");

 
				if(isset($attachment['tid']))
{
update_thread_counters((int)$attachment['tid'], array("attachmentcount" => "+1"));
}

			}
else if($action == "delete")
{
remove_attachment($attachment['pid'], '', $attachment['aid']);

			}
else if($action == "delete")
{
remove_attachment($attachment['pid'], '', $attachment['aid']);

 
				if(isset($attachment['tid']))
{
update_thread_counters((int)$attachment['tid'], array("attachmentcount" => "-1"));
}

			}
}

$plugins->run_hooks("modcp_do_modqueue_end");

			}
}

$plugins->run_hooks("modcp_do_modqueue_end");





		redirect("modcp.php?action=modqueue&type=attachments", $lang->redirect_attachmentsmoderated);
}
}

		redirect("modcp.php?action=modqueue&type=attachments", $lang->redirect_attachmentsmoderated);
}
}

Zeile 2100Zeile 2108
	if($mybb->usergroup['canmanagemodqueue'] == 0)
{
error_no_permission();

	if($mybb->usergroup['canmanagemodqueue'] == 0)
{
error_no_permission();

	}


	}


	if($nummodqueuethreads == 0 && $nummodqueueposts == 0 && $nummodqueueattach == 0 && $mybb->usergroup['issupermod'] != 1)
{
error($lang->you_cannot_use_mod_queue);

	if($nummodqueuethreads == 0 && $nummodqueueposts == 0 && $nummodqueueattach == 0 && $mybb->usergroup['issupermod'] != 1)
{
error($lang->you_cannot_use_mod_queue);

Zeile 2114Zeile 2122
		if($nummodqueuethreads == 0 && $mybb->usergroup['issupermod'] != 1)
{
error($lang->you_cannot_moderate_threads);

		if($nummodqueuethreads == 0 && $mybb->usergroup['issupermod'] != 1)
{
error($lang->you_cannot_moderate_threads);

		}


		}


		$forum_cache = $cache->read("forums");

		$forum_cache = $cache->read("forums");





		$query = $db->simple_select("threads", "COUNT(tid) AS unapprovedthreads", "visible='0' {$flist_queue_threads}");
$unapproved_threads = $db->fetch_field($query, "unapprovedthreads");

// Figure out if we need to display multiple pages.
if($mybb->get_input('page') != "last")

		$query = $db->simple_select("threads", "COUNT(tid) AS unapprovedthreads", "visible='0' {$flist_queue_threads}");
$unapproved_threads = $db->fetch_field($query, "unapprovedthreads");

// Figure out if we need to display multiple pages.
if($mybb->get_input('page') != "last")

		{

		{

			$page = $mybb->get_input('page', MyBB::INPUT_INT);

			$page = $mybb->get_input('page', MyBB::INPUT_INT);

		}

		}


$perpage = $mybb->settings['threadsperpage'];
$pages = $unapproved_threads / $perpage;


$perpage = $mybb->settings['threadsperpage'];
$pages = $unapproved_threads / $perpage;

		$pages = ceil($pages);

if($mybb->get_input('page') == "last")
{
$page = $pages;
}

if($page > $pages || $page <= 0)
{
$page = 1;
}

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

		$pages = ceil($pages);

if($mybb->get_input('page') == "last")
{
$page = $pages;
}

if($page > $pages || $page <= 0)
{
$page = 1;
}

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


$multipage = multipage($unapproved_threads, $perpage, $page, "modcp.php?action=modqueue&type=threads");



$multipage = multipage($unapproved_threads, $perpage, $page, "modcp.php?action=modqueue&type=threads");


Zeile 2178Zeile 2186
				{
$thread['threadusername'] = htmlspecialchars_uni($thread['threadusername']);
$profile_link = $thread['threadusername'];

				{
$thread['threadusername'] = htmlspecialchars_uni($thread['threadusername']);
$profile_link = $thread['threadusername'];

				}
else
{
$profile_link = $lang->guest;
}
}
else

				}
else
{
$profile_link = $lang->guest;
}
}
else

			{
$thread['username'] = htmlspecialchars_uni($thread['username']);
$profile_link = build_profile_link($thread['username'], $thread['uid']);

			{
$thread['username'] = htmlspecialchars_uni($thread['username']);
$profile_link = build_profile_link($thread['username'], $thread['uid']);

Zeile 2358Zeile 2366
		if($nummodqueueattach == 0 && $mybb->usergroup['issupermod'] != 1)
{
error($lang->you_cannot_moderate_attachments);

		if($nummodqueueattach == 0 && $mybb->usergroup['issupermod'] != 1)
{
error($lang->you_cannot_moderate_attachments);

		}

		}


$query = $db->query("
SELECT COUNT(aid) AS unapprovedattachments


$query = $db->query("
SELECT COUNT(aid) AS unapprovedattachments

Zeile 2371Zeile 2379

// Figure out if we need to display multiple pages.
if($mybb->get_input('page') != "last")


// Figure out if we need to display multiple pages.
if($mybb->get_input('page') != "last")

		{

		{

			$page = $mybb->get_input('page', MyBB::INPUT_INT);
}


			$page = $mybb->get_input('page', MyBB::INPUT_INT);
}


Zeile 2382Zeile 2390
		if($mybb->get_input('page') == "last")
{
$page = $pages;

		if($mybb->get_input('page') == "last")
{
$page = $pages;

		}


		}


		if($page > $pages || $page <= 0)
{
$page = 1;

		if($page > $pages || $page <= 0)
{
$page = 1;

		}

		}


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


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

		}

		}

		else
{
$start = 0;

		else
{
$start = 0;

Zeile 2400Zeile 2408
		}

$multipage = multipage($unapproved_attachments, $perpage, $page, "modcp.php?action=modqueue&amp;type=attachments");

		}

$multipage = multipage($unapproved_attachments, $perpage, $page, "modcp.php?action=modqueue&amp;type=attachments");





		$query = $db->query("
SELECT a.*, p.subject AS postsubject, p.dateline, p.uid, u.username, t.tid, t.subject AS threadsubject
FROM ".TABLE_PREFIX."attachments a

		$query = $db->query("
SELECT a.*, p.subject AS postsubject, p.dateline, p.uid, u.username, t.tid, t.subject AS threadsubject
FROM ".TABLE_PREFIX."attachments a

Zeile 2422Zeile 2430
			}

$attachdate = my_date('relative', $attachment['dateuploaded']);

			}

$attachdate = my_date('relative', $attachment['dateuploaded']);





			$attachment['postsubject'] = htmlspecialchars_uni($parser->parse_badwords($attachment['postsubject']));
$attachment['filename'] = htmlspecialchars_uni($attachment['filename']);
$attachment['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($attachment['threadsubject']));
$attachment['filesize'] = get_friendly_size($attachment['filesize']);

			$attachment['postsubject'] = htmlspecialchars_uni($parser->parse_badwords($attachment['postsubject']));
$attachment['filename'] = htmlspecialchars_uni($attachment['filename']);
$attachment['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($attachment['threadsubject']));
$attachment['filesize'] = get_friendly_size($attachment['filesize']);





			$link = get_post_link($attachment['pid'], $attachment['tid']) . "#pid{$attachment['pid']}";
$thread_link = get_thread_link($attachment['tid']);
$attachment['username'] = htmlspecialchars_uni($attachment['username']);

			$link = get_post_link($attachment['pid'], $attachment['tid']) . "#pid{$attachment['pid']}";
$thread_link = get_thread_link($attachment['tid']);
$attachment['username'] = htmlspecialchars_uni($attachment['username']);

Zeile 2531Zeile 2539
			$returndate = "{$return_day}-{$return_month}-{$return_year}";
}
else

			$returndate = "{$return_day}-{$return_month}-{$return_year}";
}
else

		{

		{

			$returndate = "";
}
$away = array(

			$returndate = "";
}
$away = array(

Zeile 2635Zeile 2643
				"update_field" => "suspendposting",
"update_length" => "suspensiontime"
)

				"update_field" => "suspendposting",
"update_length" => "suspensiontime"
)

		);


		);


		require_once MYBB_ROOT."inc/functions_warnings.php";
foreach($moderator_options as $option)
{

		require_once MYBB_ROOT."inc/functions_warnings.php";
foreach($moderator_options as $option)
{

Zeile 2716Zeile 2724
			// Continue with the update if there is no errors
$user_info = $userhandler->update_user();
if(!empty($extra_user_updates))

			// Continue with the update if there is no errors
$user_info = $userhandler->update_user();
if(!empty($extra_user_updates))

			{

			{

				$db->update_query("users", $extra_user_updates, "uid='{$user['uid']}'");
}
log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->edited_user);

$plugins->run_hooks("modcp_do_editprofile_end");

				$db->update_query("users", $extra_user_updates, "uid='{$user['uid']}'");
}
log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->edited_user);

$plugins->run_hooks("modcp_do_editprofile_end");





			redirect("modcp.php?action=finduser", $lang->redirect_user_updated);
}

			redirect("modcp.php?action=finduser", $lang->redirect_user_updated);
}

	}

	}

}

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

}

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

	{

	{

		error_no_permission();

		error_no_permission();

	}


	}


	add_breadcrumb($lang->mcp_nav_editprofile, "modcp.php?action=editprofile");

$user = get_user($mybb->get_input('uid', MyBB::INPUT_INT));
if(!$user)
{
error($lang->error_nomember);

	add_breadcrumb($lang->mcp_nav_editprofile, "modcp.php?action=editprofile");

$user = get_user($mybb->get_input('uid', MyBB::INPUT_INT));
if(!$user)
{
error($lang->error_nomember);

	}


	}


	// Check if the current user has permission to edit this user
if(!modcp_can_manage_user($user['uid']))
{
error_no_permission();

	// Check if the current user has permission to edit this user
if(!modcp_can_manage_user($user['uid']))
{
error_no_permission();

	}

$userperms = user_permissions($user['uid']);

	}

$userperms = user_permissions($user['uid']);


// Set display group
$displaygroupfields = array("title", "description", "namestyle", "usertitle", "stars", "starimage", "image");

if(!$user['displaygroup'])


// Set display group
$displaygroupfields = array("title", "description", "namestyle", "usertitle", "stars", "starimage", "image");

if(!$user['displaygroup'])

	{

	{

		$user['displaygroup'] = $user['usergroup'];
}


		$user['displaygroup'] = $user['usergroup'];
}


Zeile 2768Zeile 2776
	if(!my_validate_url($user['website']))
{
$user['website'] = '';

	if(!my_validate_url($user['website']))
{
$user['website'] = '';

	}

	}


if($user['icq'] != "0")
{


if($user['icq'] != "0")
{

Zeile 2817Zeile 2825
				$defaulttitle = htmlspecialchars_uni($title['title']);
break;
}

				$defaulttitle = htmlspecialchars_uni($title['title']);
break;
}

		}
}

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


		}
}

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


	if(empty($user['usertitle']))
{
$lang->current_custom_usertitle = '';

	if(empty($user['usertitle']))
{
$lang->current_custom_usertitle = '';

	}

	}


$bdaydaysel = $selected = '';
for($day = 1; $day <= 31; ++$day)
{
if($mybb->input['birthday_day'] == $day)


$bdaydaysel = $selected = '';
for($day = 1; $day <= 31; ++$day)
{
if($mybb->input['birthday_day'] == $day)

		{

		{

			$selected = "selected=\"selected\"";
}
else
{
$selected = '';
}

			$selected = "selected=\"selected\"";
}
else
{
$selected = '';
}





		eval("\$bdaydaysel .= \"".$templates->get("usercp_profile_day")."\";");

		eval("\$bdaydaysel .= \"".$templates->get("usercp_profile_day")."\";");

	}


	}


	$bdaymonthsel = array();
foreach(range(1, 12) as $month)
{
$bdaymonthsel[$month] = '';
}
$bdaymonthsel[$mybb->input['birthday_month']] = 'selected="selected"';

	$bdaymonthsel = array();
foreach(range(1, 12) as $month)
{
$bdaymonthsel[$month] = '';
}
$bdaymonthsel[$mybb->input['birthday_month']] = 'selected="selected"';

 

$awaysection = '';


if($mybb->settings['allowaway'] != 0)
{


if($mybb->settings['allowaway'] != 0)
{

Zeile 3672Zeile 3682
		// Searching post IP addresses
if(isset($mybb->input['search_posts']))
{

		// Searching post IP addresses
if(isset($mybb->input['search_posts']))
{

 
			$post_ip_sql = '';

			if($ip_range)
{
if(!is_array($ip_range))

			if($ip_range)
{
if(!is_array($ip_range))

Zeile 3766Zeile 3777
		// Searching user IP addresses
if(isset($mybb->input['search_users']))
{

		// Searching user IP addresses
if(isset($mybb->input['search_users']))
{

 
			$user_ip_sql = '';

			if($ip_range)
{
if(!is_array($ip_range))

			if($ip_range)
{
if(!is_array($ip_range))

Zeile 4259Zeile 4271
		");
$user = $db->fetch_array($query);


		");
$user = $db->fetch_array($query);


		if($user['uid'])

		if($user)

		{
$existing_ban = true;
}

		{
$existing_ban = true;
}

Zeile 4283Zeile 4295

$user = get_user_by_username($mybb->input['username'], $options);



$user = get_user_by_username($mybb->input['username'], $options);


		if(!$user['uid'])

		if(!$user)

		{
$errors[] = $lang->invalid_username;
}

		{
$errors[] = $lang->invalid_username;
}

Zeile 4308Zeile 4320

// Check banned group
$usergroups_cache = $cache->read('usergroups');


// Check banned group
$usergroups_cache = $cache->read('usergroups');

	$usergroup = $usergroups_cache[$mybb->get_input('usergroup', MyBB::INPUT_INT)];




	if(isset($usergroups_cache[$mybb->get_input('usergroup', MyBB::INPUT_INT)]))
{
$usergroup = $usergroups_cache[$mybb->get_input('usergroup', MyBB::INPUT_INT)];
}





	if(empty($usergroup['gid']) || empty($usergroup['isbannedgroup']))

	if(!isset($usergroup) || empty($usergroup['isbannedgroup']))

	{
$errors[] = $lang->error_nobangroup;
}

	{
$errors[] = $lang->error_nobangroup;
}