Vergleich admin/modules/forum/moderation_queue.php - 1.8.9 - 1.8.38

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 45Zeile 45
	require_once MYBB_ROOT."inc/class_moderation.php";
$moderation = new Moderation;


	require_once MYBB_ROOT."inc/class_moderation.php";
$moderation = new Moderation;


	if(is_array($mybb->input['threads']))

	if($mybb->get_input('threads', MyBB::INPUT_ARRAY))

	{
$threads_to_approve = $threads_to_delete = array();
// Fetch threads

	{
$threads_to_approve = $threads_to_delete = array();
// Fetch threads

		$query = $db->simple_select("threads", "tid", "tid IN (".implode(",", array_map("intval", array_keys($mybb->input['threads'])))."){$flist}");

		$query = $db->simple_select("threads", "tid", "tid IN (".implode(",", array_map("intval", array_keys($mybb->input['threads']))).")");

		while($thread = $db->fetch_array($query))
{
$action = $mybb->input['threads'][$thread['tid']];

		while($thread = $db->fetch_array($query))
{
$action = $mybb->input['threads'][$thread['tid']];

Zeile 83Zeile 83
		flash_message($lang->success_threads, 'success');
admin_redirect("index.php?module=forum-moderation_queue&type=threads");
}

		flash_message($lang->success_threads, 'success');
admin_redirect("index.php?module=forum-moderation_queue&type=threads");
}

	else if(is_array($mybb->input['posts']))

	else if($mybb->get_input('posts', MyBB::INPUT_ARRAY))

	{
$posts_to_approve = $posts_to_delete = array();
// Fetch posts

	{
$posts_to_approve = $posts_to_delete = array();
// Fetch posts

		$query = $db->simple_select("posts", "pid", "pid IN (".implode(",", array_map("intval", array_keys($mybb->input['posts'])))."){$flist}");






		$pids = array_map(
"intval",
array_keys($mybb->get_input('posts', MyBB::INPUT_ARRAY))
);

$query = $db->simple_select("posts", "pid", "pid IN (".implode(",", $pids).")");

		while($post = $db->fetch_array($query))
{
$action = $mybb->input['posts'][$post['pid']];

		while($post = $db->fetch_array($query))
{
$action = $mybb->input['posts'][$post['pid']];

Zeile 122Zeile 127
		admin_redirect("index.php?module=forum-moderation_queue&type=posts");

}

		admin_redirect("index.php?module=forum-moderation_queue&type=posts");

}

	else if(is_array($mybb->input['attachments']))

	else if($mybb->get_input('attachments', MyBB::INPUT_ARRAY))

	{

	{

		$query = $db->simple_select("attachments", "aid, pid", "aid IN (".implode(",", array_map("intval", array_keys($mybb->input['attachments'])))."){$flist}");

		$query = $db->simple_select("attachments", "aid, pid", "aid IN (".implode(",", array_map("intval", array_keys($mybb->input['attachments']))).")");

		while($attachment = $db->fetch_array($query))
{
$action = $mybb->input['attachments'][$attachment['aid']];

		while($attachment = $db->fetch_array($query))
{
$action = $mybb->input['attachments'][$attachment['aid']];

Zeile 155Zeile 160
$all_options .= "</ul>\n";

// Threads awaiting moderation

$all_options .= "</ul>\n";

// Threads awaiting moderation

if($mybb->input['type'] == "threads" || !$mybb->input['type'])

if(empty($mybb->input['type']) || $mybb->input['type'] == "threads")

{
$plugins->run_hooks("admin_forum_moderation_queue_threads");


{
$plugins->run_hooks("admin_forum_moderation_queue_threads");


Zeile 168Zeile 173
	{
// Figure out if we need to display multiple pages.
$per_page = 15;

	{
// Figure out if we need to display multiple pages.
$per_page = 15;

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

		if($mybb->input['page'] > 0)
{

		if($mybb->input['page'] > 0)
{

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

			$current_page = $mybb->input['page'];

			$start = ($current_page-1)*$per_page;
$pages = $unapproved_threads / $per_page;
$pages = ceil($pages);

			$start = ($current_page-1)*$per_page;
$pages = $unapproved_threads / $per_page;
$pages = ceil($pages);

Zeile 191Zeile 197
		$page->add_breadcrumb_item($lang->threads_awaiting_moderation);
$page->output_header($lang->threads_awaiting_moderation);
$page->output_nav_tabs($sub_tabs, "threads");

		$page->add_breadcrumb_item($lang->threads_awaiting_moderation);
$page->output_header($lang->threads_awaiting_moderation);
$page->output_nav_tabs($sub_tabs, "threads");


$form = new Form("index.php?module=forum-moderation_queue", "post");



$form = new Form("index.php?module=forum-moderation_queue", "post");


		$table = new Table;
$table->construct_header($lang->subject);
$table->construct_header($lang->author, array("class" => "align_center", "width" => "20%"));

		$table = new Table;
$table->construct_header($lang->subject);
$table->construct_header($lang->author, array("class" => "align_center", "width" => "20%"));

Zeile 216Zeile 222
			$forum_name = $forum_cache[$thread['fid']]['name'];
$threaddate = my_date('relative', $thread['dateline']);


			$forum_name = $forum_cache[$thread['fid']]['name'];
$threaddate = my_date('relative', $thread['dateline']);


			if($thread['username'] == "")

			if(!$thread['uid'])

			{
if($thread['threadusername'] != "")
{

			{
if($thread['threadusername'] != "")
{

Zeile 226Zeile 232
				{
$profile_link = htmlspecialchars_uni($lang->guest);
}

				{
$profile_link = htmlspecialchars_uni($lang->guest);
}

			}

			}

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

$thread['postmessage'] = nl2br(htmlspecialchars_uni($thread['postmessage']));

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

$thread['postmessage'] = nl2br(htmlspecialchars_uni($thread['postmessage']));





			$table->construct_cell("<a href=\"../{$thread['threadlink']}\" target=\"_blank\">{$thread['subject']}</a>");
$table->construct_cell($profile_link, array("class" => "align_center"));
$table->construct_cell($threaddate, array("class" => "align_center"));

			$table->construct_cell("<a href=\"../{$thread['threadlink']}\" target=\"_blank\">{$thread['subject']}</a>");
$table->construct_cell($profile_link, array("class" => "align_center"));
$table->construct_cell($threaddate, array("class" => "align_center"));

Zeile 243Zeile 249
			$controls .= $form->generate_radio_button("threads[{$thread['tid']}]", "ignore", $lang->ignore, array('class' => 'radio_ignore', 'checked' => true))." ";
$controls .= $form->generate_radio_button("threads[{$thread['tid']}]", "delete", $lang->delete, array('class' => 'radio_delete', 'checked' => false))." ";
$controls .= $form->generate_radio_button("threads[{$thread['tid']}]", "approve", $lang->approve, array('class' => 'radio_approve', 'checked' => false));

			$controls .= $form->generate_radio_button("threads[{$thread['tid']}]", "ignore", $lang->ignore, array('class' => 'radio_ignore', 'checked' => true))." ";
$controls .= $form->generate_radio_button("threads[{$thread['tid']}]", "delete", $lang->delete, array('class' => 'radio_delete', 'checked' => false))." ";
$controls .= $form->generate_radio_button("threads[{$thread['tid']}]", "approve", $lang->approve, array('class' => 'radio_approve', 'checked' => false));

			$controls .= "</div>";

$forum = "<strong>{$lang->forum} <a href=\"../{$thread['forumlink']}\" target=\"_blank\">{$forum_name}</a></strong><br />";

			$controls .= "</div>";

$forum = "<strong>{$lang->forum} <a href=\"../{$thread['forumlink']}\" target=\"_blank\">{$forum_name}</a></strong><br />";


$table->construct_cell("<div class=\"modqueue_message\">{$controls}<div class=\"modqueue_meta\">{$forum}</div>{$thread['postmessage']}</div>", array("colspan" => 3));
$table->construct_row();
}



$table->construct_cell("<div class=\"modqueue_message\">{$controls}<div class=\"modqueue_meta\">{$forum}</div>{$thread['postmessage']}</div>", array("colspan" => 3));
$table->construct_row();
}


		$table->output($lang->threads_awaiting_moderation);

		$table->output($lang->threads_awaiting_moderation, 1, "general tfixed");

		echo $all_options;
echo $pagination;


		echo $all_options;
echo $pagination;


Zeile 285Zeile 291
}

// Posts awaiting moderation

}

// Posts awaiting moderation

if($mybb->input['type'] == "posts" || $mybb->input['type'] == "")

if($mybb->get_input('type') == "posts" || $mybb->get_input('type') == "")

{
$plugins->run_hooks("admin_forum_moderation_queue_posts");


{
$plugins->run_hooks("admin_forum_moderation_queue_posts");


Zeile 298Zeile 304
		WHERE p.visible='0' AND t.firstpost != p.pid
");
$unapproved_posts = $db->fetch_field($query, "unapprovedposts");

		WHERE p.visible='0' AND t.firstpost != p.pid
");
$unapproved_posts = $db->fetch_field($query, "unapprovedposts");





	if($unapproved_posts > 0)
{
// Figure out if we need to display multiple pages.
$per_page = 15;

	if($unapproved_posts > 0)
{
// Figure out if we need to display multiple pages.
$per_page = 15;

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

		if($mybb->input['page'] > 0)
{

		if($mybb->input['page'] > 0)
{

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

			$current_page = $mybb->input['page'];

			$start = ($current_page-1)*$per_page;
$pages = $unapproved_posts / $per_page;
$pages = ceil($pages);

			$start = ($current_page-1)*$per_page;
$pages = $unapproved_posts / $per_page;
$pages = ceil($pages);

Zeile 361Zeile 368
			$forum_name = $forum_cache[$post['fid']]['name'];
$postdate = my_date('relative', $post['dateline']);


			$forum_name = $forum_cache[$post['fid']]['name'];
$postdate = my_date('relative', $post['dateline']);


			if($post['username'] == "")

			if(!$post['uid'])

			{
if($post['postusername'] != "")
{

			{
if($post['postusername'] != "")
{

Zeile 397Zeile 404
			$table->construct_row();
}


			$table->construct_row();
}


		$table->output($lang->posts_awaiting_moderation);

		$table->output($lang->posts_awaiting_moderation, 1, "general tfixed");

		echo $all_options;
echo $pagination;

$buttons[] = $form->generate_submit_button($lang->perform_action);
$form->output_submit_wrapper($buttons);

		echo $all_options;
echo $pagination;

$buttons[] = $form->generate_submit_button($lang->perform_action);
$form->output_submit_wrapper($buttons);

		$form->end();

		$form->end();


echo '<script type="text/javascript">
$(".mass_ignore").on("click", function () {


echo '<script type="text/javascript">
$(".mass_ignore").on("click", function () {

Zeile 411Zeile 418
					$(this).prop("checked", true);
});
return false;

					$(this).prop("checked", true);
});
return false;

			});
$(".mass_delete").on("click", function () {
$("input.radio_delete").each(function(e) {
$(this).prop("checked", true);
});
return false;

			});
$(".mass_delete").on("click", function () {
$("input.radio_delete").each(function(e) {
$(this).prop("checked", true);
});
return false;

			});
$(".mass_approve").on("click", function () {
$("input.radio_approve").each(function(e) {

			});
$(".mass_approve").on("click", function () {
$("input.radio_approve").each(function(e) {

Zeile 428Zeile 435

$page->output_footer();
}


$page->output_footer();
}

	else if($mybb->input['type'] == "posts")

	else if($mybb->get_input('type') == "posts")

	{
$page->output_header($lang->moderation_queue);
$page->output_nav_tabs($sub_tabs, "posts");

	{
$page->output_header($lang->moderation_queue);
$page->output_nav_tabs($sub_tabs, "posts");

Zeile 436Zeile 443
		$page->output_footer();
}
}

		$page->output_footer();
}
}





// Attachments awaiting moderation

// Attachments awaiting moderation

if($mybb->input['type'] == "attachments" || $mybb->input['type'] == "")

if($mybb->get_input('type') == "attachments" || $mybb->get_input('type') == "")

{
$plugins->run_hooks("admin_forum_moderation_queue_attachments");


{
$plugins->run_hooks("admin_forum_moderation_queue_attachments");


Zeile 455Zeile 462
	{
// Figure out if we need to display multiple pages.
$per_page = 15;

	{
// Figure out if we need to display multiple pages.
$per_page = 15;

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

		if($mybb->input['page'] > 0)

		if($mybb->input['page'] > 0)

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

		{
$current_page = $mybb->input['page'];

			$start = ($current_page-1)*$per_page;
$pages = $unapproved_attachments / $per_page;
$pages = ceil($pages);

			$start = ($current_page-1)*$per_page;
$pages = $unapproved_attachments / $per_page;
$pages = ceil($pages);

Zeile 488Zeile 496
		$table->construct_header($lang->controls, array("class" => "align_center", "colspan" => 3));

$query = $db->query("

		$table->construct_header($lang->controls, array("class" => "align_center", "colspan" => 3));

$query = $db->query("

			SELECT a.*, p.subject AS postsubject, p.dateline, p.uid, u.username, t.tid, t.subject AS threadsubject

			SELECT a.*, p.subject AS postsubject, p.dateline, p.username AS postusername, p.uid, u.username, t.tid, t.subject AS threadsubject

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

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

Zeile 497Zeile 505
			ORDER BY a.dateuploaded DESC
LIMIT {$start}, {$per_page}
");

			ORDER BY a.dateuploaded DESC
LIMIT {$start}, {$per_page}
");





		while($attachment = $db->fetch_array($query))
{
if(!$attachment['dateuploaded']) $attachment['dateuploaded'] = $attachment['dateline'];

		while($attachment = $db->fetch_array($query))
{
if(!$attachment['dateuploaded']) $attachment['dateuploaded'] = $attachment['dateline'];

Zeile 510Zeile 518

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


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

			$profile_link = build_profile_link(htmlspecialchars_uni($attachment['username']), $attachment['uid'], "_blank");

















if(!$attachment['uid'])
{
if($attachment['postusername'] != "")
{
$profile_link = $attachment['postusername'];
}
else
{
$profile_link = htmlspecialchars_uni($lang->guest);
}
}
else
{
$profile_link = build_profile_link(htmlspecialchars_uni($attachment['username']), $attachment['uid'], "_blank");
}


$table->construct_cell("<a href=\"../attachment.php?aid={$attachment['aid']}\" target=\"_blank\">{$attachment['filename']}</a> ({$attachment['filesize']})<br /><small class=\"modqueue_meta\">{$lang->post} <a href=\"{$link}\" target=\"_blank\">{$attachment['postsubject']}</a></small>");
$table->construct_cell($profile_link, array("class" => "align_center"));


$table->construct_cell("<a href=\"../attachment.php?aid={$attachment['aid']}\" target=\"_blank\">{$attachment['filename']}</a> ({$attachment['filesize']})<br /><small class=\"modqueue_meta\">{$lang->post} <a href=\"{$link}\" target=\"_blank\">{$attachment['postsubject']}</a></small>");
$table->construct_cell($profile_link, array("class" => "align_center"));

Zeile 552Zeile 575

$page->output_footer();
}


$page->output_footer();
}

	else if($mybb->input['type'] == "attachments")

	else if($mybb->get_input('type') == "attachments")

	{
$page->output_header($lang->moderation_queue);
$page->output_nav_tabs($sub_tabs, "attachments");

	{
$page->output_header($lang->moderation_queue);
$page->output_nav_tabs($sub_tabs, "attachments");