Vergleich admin/moderate.php - 1.2.2 - 1.2.13

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 3Zeile 3
 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

 * Website: http://www.mybboard.com
* License: http://www.mybboard.com/eula.html

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/eula.html

 *

 *

 * $Id: moderate.php 2223 2006-09-13 23:11:01Z Tikitiki $

 * $Id: moderate.php 3399 2007-10-22 06:07:30Z Tikitiki $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 76Zeile 76

if($mybb->input['action'] == "do_threads" || $mybb->input['action'] == "do_posts" || $mybb->input['action'] == "do_threadsposts")
{


if($mybb->input['action'] == "do_threads" || $mybb->input['action'] == "do_posts" || $mybb->input['action'] == "do_threadsposts")
{

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


	$plugins->run_hooks("admin_moderate_do_threadsposts");
if(is_array($mybb->input['threadvalidate']) && $mybb->input['action'] != "do_posts")
{
foreach($mybb->input['threadvalidate'] as $tid => $val)
{
$tid = intval($tid);

	$plugins->run_hooks("admin_moderate_do_threadsposts");
if(is_array($mybb->input['threadvalidate']) && $mybb->input['action'] != "do_posts")
{
foreach($mybb->input['threadvalidate'] as $tid => $val)
{
$tid = intval($tid);

			$query = $db->simple_select(TABLE_PREFIX."threads", "subject, fid", "tid='$tid'");

			$query = $db->simple_select(TABLE_PREFIX."threads", "subject, fid, dateline, uid", "tid='$tid'");

			$thread = $db->fetch_array($query);
if($mybb->input['threaddelete'][$tid] == "yes")
{
delete_thread($tid);

			$thread = $db->fetch_array($query);
if($mybb->input['threaddelete'][$tid] == "yes")
{
delete_thread($tid);

				$update_forum_count[$thread['fid']] = 1;

 
			}
else
{

			}
else
{

Zeile 97Zeile 98
					$message = $db->escape_string($mybb->input['threadmessage'][$tid]);

$db->query("UPDATE ".TABLE_PREFIX."threads SET visible='1', subject='{$subject}', unapprovedposts=unapprovedposts-1 WHERE tid = '".$tid."'");

					$message = $db->escape_string($mybb->input['threadmessage'][$tid]);

$db->query("UPDATE ".TABLE_PREFIX."threads SET visible='1', subject='{$subject}', unapprovedposts=unapprovedposts-1 WHERE tid = '".$tid."'");

 

$forum = $forum_cache[$thread['fid']];
if($forum['usepostcounts'] != "no")
{
$queryadd = ",postnum=postnum+1";
}
else
{
$queryadd = '';
}
$db->query("UPDATE ".TABLE_PREFIX."users SET lastpost='{$thread['dateline']}' {$queryadd} WHERE uid='{$thread['uid']}'");
$done_firstposts[$thread['firstpost']] = 1;


					
$sql_array = array(
"message" => $message,

					
$sql_array = array(
"message" => $message,

Zeile 104Zeile 118
						"visible" => 1
);
$db->update_query(TABLE_PREFIX."posts", $sql_array, "tid = '".$tid."'");

						"visible" => 1
);
$db->update_query(TABLE_PREFIX."posts", $sql_array, "tid = '".$tid."'");

					$update_forum_count[$thread['fid']] = 1;

// Update unapproved thread count
$db->query("UPDATE ".TABLE_PREFIX."forums SET unapprovedthreads=unapprovedthreads-1,unapprovedposts=unapprovedposts-1 WHERE fid='{$thread['fid']}'");
}
}
}


// Update unapproved thread count
$db->query("UPDATE ".TABLE_PREFIX."forums SET unapprovedthreads=unapprovedthreads-1,unapprovedposts=unapprovedposts-1,threads=threads+1, posts=posts+1 WHERE fid='{$thread['fid']}'");
}
}
}


	}

if(is_array($mybb->input['postvalidate']) && $mybb->input['action'] != "do_threads")

	}

if(is_array($mybb->input['postvalidate']) && $mybb->input['action'] != "do_threads")

Zeile 118Zeile 131
		foreach($mybb->input['postvalidate'] as $pid => $val)
{
$pid = intval($pid);

		foreach($mybb->input['postvalidate'] as $pid => $val)
{
$pid = intval($pid);

			$query = $db->simple_select(TABLE_PREFIX."posts", "tid", "pid='$pid'");

			$query = $db->simple_select(TABLE_PREFIX."posts", "tid, uid, dateline", "pid='$pid'");

			$post = $db->fetch_array($query);
$query = $db->simple_select(TABLE_PREFIX."threads", "fid", "tid='$post[tid]'");
$thread = $db->fetch_array($query);
if($mybb->input['postdelete'][$pid] == "yes")
{
delete_post($pid);

			$post = $db->fetch_array($query);
$query = $db->simple_select(TABLE_PREFIX."threads", "fid", "tid='$post[tid]'");
$thread = $db->fetch_array($query);
if($mybb->input['postdelete'][$pid] == "yes")
{
delete_post($pid);

				$update_thread_count[$post['tid']] = 1;
$update_forum_count[$thread['fid']] = 1;

 
			}
else
{

			}
else
{

Zeile 141Zeile 152
						"subject" => $subject
);
$db->update_query(TABLE_PREFIX."posts", $sql_array, "pid = '".$pid."'");

						"subject" => $subject
);
$db->update_query(TABLE_PREFIX."posts", $sql_array, "pid = '".$pid."'");

					$update_thread_count[$post['tid']] = 1;
$update_forum_count[$thread['fid']] = 1;
















$forum = $forum_cache[$thread['fid']];
if(!$done_firstposts[$post['pid']])
{
if($forum['usepostcounts'] != "no")
{
$queryadd = ",postnum=postnum+1";
}
else
{
$queryadd = '';
}
$db->query("UPDATE ".TABLE_PREFIX."users SET lastpost='{$post['dateline']}' {$queryadd} WHERE uid='{$post['uid']}'");
}


// Update unapproved thread count


// Update unapproved thread count

					$db->query("UPDATE ".TABLE_PREFIX."threads SET unapprovedposts=unapprovedposts-1 WHERE tid='$post[tid]'");


					$db->query("UPDATE ".TABLE_PREFIX."threads SET unapprovedposts=unapprovedposts-1, replies=replies+1 WHERE tid='$post[tid]'");					
$db->query("UPDATE ".TABLE_PREFIX."forums SET posts=posts+1 WHERE fid='$post[fid]'");

				}
}

				}
}

		}
}
if(is_array($update_thread_count))
{
foreach($update_thread_count as $tid => $val)
{
update_thread_count($tid);
}
}
if(is_array($update_forum_count))
{
foreach($update_forum_count as $fid => $val)
{
update_forum_count($fid);

 
		}
}
cpredirect("moderate.php?".SID."&action=".str_replace('do_', '', $mybb->input['action']), $lang->threadsposts_moderated);

		}
}
cpredirect("moderate.php?".SID."&action=".str_replace('do_', '', $mybb->input['action']), $lang->threadsposts_moderated);

Zeile 229Zeile 240
	$done = 0;

$query = $db->query("

	$done = 0;

$query = $db->query("

		SELECT t.tid, t.fid, t.subject, p.message AS postmessage, p.pid AS postpid, f.name AS forumname, u.username AS username
FROM (".TABLE_PREFIX."threads t, ".TABLE_PREFIX."posts p)


		SELECT t.tid, t.fid, t.subject, p.message AS postmessage, p.pid AS postpid, f.name AS forumname, u.username AS username, u.uid
FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."posts p ON (p.tid=t.tid)

		LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=t.fid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)

		LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=t.fid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)

		WHERE t.visible='0' AND p.tid=t.tid

		WHERE t.visible='0'

		ORDER BY t.lastpost DESC
");
$tcount = $db->num_rows($query);

		ORDER BY t.lastpost DESC
");
$tcount = $db->num_rows($query);

Zeile 284Zeile 296
		"order_dir" => "DESC"
);
$query = $db->query("

		"order_dir" => "DESC"
);
$query = $db->query("

		SELECT p.pid, p.subject, p.message, t.subject AS threadsubject, t.tid, f.name AS forumname, u.username AS username

		SELECT p.pid, p.subject, p.message, t.subject AS threadsubject, t.tid, f.name AS forumname, u.username AS username, u.uid

		FROM  ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=t.fid)

		FROM  ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=t.fid)