Zeile 6 | Zeile 6 |
---|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* $Id: moderation.php 3826 2008-05-10 16:49:24Z Tikitiki $
| * $Id: moderation.php 4279 2008-11-26 00:01:25Z Tikitiki $
|
*/
define("IN_MYBB", 1);
|
*/
define("IN_MYBB", 1);
|
| define('THIS_SCRIPT', 'moderation.php');
|
$templatelist = 'changeuserbox';
| $templatelist = 'changeuserbox';
|
Zeile 94 | Zeile 95 |
---|
else { eval("\$loginbox = \"".$templates->get("loginbox")."\";");
|
else { eval("\$loginbox = \"".$templates->get("loginbox")."\";");
|
| }
if($mybb->request_method != "post" && $mybb->input['action'] != "getip") { error_no_permission();
|
}
// Begin!
| }
// Begin!
|
Zeile 163 | Zeile 169 |
---|
// Remove redirects to a specific thread case "removeredirects":
|
// Remove redirects to a specific thread case "removeredirects":
|
// Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
| // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
if(!is_moderator($fid, "canmanagethreads"))
|
if(!is_moderator($fid, "canmanagethreads"))
|
{
| {
|
error_no_permission(); }
$plugins->run_hooks("moderation_removeredirects");
|
error_no_permission(); }
$plugins->run_hooks("moderation_removeredirects");
|
|
|
$moderation->remove_redirects($tid);
log_moderator_action($modlogdata, $lang->redirects_removed);
| $moderation->remove_redirects($tid);
log_moderator_action($modlogdata, $lang->redirects_removed);
|
Zeile 184 | Zeile 190 |
---|
case "deletethread":
add_breadcrumb($lang->nav_deletethread);
|
case "deletethread":
add_breadcrumb($lang->nav_deletethread);
|
if(!is_moderator($fid, "candeleteposts")) { if($permissions['candeletethreads'] != 1 || $mybb->user['uid'] != $thread['uid']) { error_no_permission(); }
| if(!is_moderator($fid, "candeleteposts")) { if($permissions['candeletethreads'] != 1 || $mybb->user['uid'] != $thread['uid']) { error_no_permission(); }
|
}
|
}
|
$thread['subject'] = htmlspecialchars_uni($thread['subject']);
| |
$plugins->run_hooks("moderation_deletethread");
| $plugins->run_hooks("moderation_deletethread");
|
Zeile 233 | Zeile 237 |
---|
// Delete the poll from a thread confirmation page case "deletepoll": add_breadcrumb($lang->nav_deletepoll);
|
// Delete the poll from a thread confirmation page case "deletepoll": add_breadcrumb($lang->nav_deletepoll);
|
if(!is_moderator($fid, "candeleteposts")) { if($permissions['candeletethreads'] != 1 || $mybb->user['uid'] != $thread['uid']) { error_no_permission(); } }
| if(!is_moderator($fid, "candeleteposts")) { if($permissions['candeletethreads'] != 1 || $mybb->user['uid'] != $thread['uid']) { error_no_permission(); } }
|
$plugins->run_hooks("moderation_deletepoll");
$query = $db->simple_select("polls", "*", "tid='$tid'");
| $plugins->run_hooks("moderation_deletepoll");
$query = $db->simple_select("polls", "*", "tid='$tid'");
|
Zeile 254 | Zeile 258 |
---|
eval("\$deletepoll = \"".$templates->get("moderation_deletepoll")."\";"); output_page($deletepoll); break;
|
eval("\$deletepoll = \"".$templates->get("moderation_deletepoll")."\";"); output_page($deletepoll); break;
|
|
|
// Delete the actual poll here! case "do_deletepoll":
|
// Delete the actual poll here! case "do_deletepoll":
|
|
|
// Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
| // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
Zeile 266 | Zeile 270 |
---|
error($lang->redirect_pollnotdeleted); } if(!is_moderator($fid, "candeleteposts"))
|
error($lang->redirect_pollnotdeleted); } if(!is_moderator($fid, "candeleteposts"))
|
{
| {
|
if($permissions['candeletethreads'] != 1 || $mybb->user['uid'] != $thread['uid']) { error_no_permission();
| if($permissions['candeletethreads'] != 1 || $mybb->user['uid'] != $thread['uid']) { error_no_permission();
|
Zeile 278 | Zeile 282 |
---|
{ error($lang->error_invalidpoll); }
|
{ error($lang->error_invalidpoll); }
|
|
|
$plugins->run_hooks("moderation_do_deletepoll");
$lang->poll_deleted = $lang->sprintf($lang->poll_deleted, $thread['subject']);
| $plugins->run_hooks("moderation_do_deletepoll");
$lang->poll_deleted = $lang->sprintf($lang->poll_deleted, $thread['subject']);
|
Zeile 291 | Zeile 295 |
---|
// Approve a thread case "approvethread":
|
// Approve a thread case "approvethread":
|
// Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
if(!is_moderator($fid, "canopenclosethreads"))
| // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
if(!is_moderator($fid, "canopenclosethreads"))
|
{ error_no_permission(); }
| { error_no_permission(); }
|
Zeile 311 | Zeile 315 |
---|
moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_threadapproved); break;
|
moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_threadapproved); break;
|
|
|
// Unapprove a thread case "unapprovethread":
|
// Unapprove a thread case "unapprovethread":
|
// Verify incoming POST request
| // Verify incoming POST request
|
verify_post_check($mybb->input['my_post_key']);
if(!is_moderator($fid, "canopenclosethreads"))
|
verify_post_check($mybb->input['my_post_key']);
if(!is_moderator($fid, "canopenclosethreads"))
|
{
| {
|
error_no_permission(); } $query = $db->simple_select("threads", "*", "tid='$tid'");
| error_no_permission(); } $query = $db->simple_select("threads", "*", "tid='$tid'");
|
Zeile 331 | Zeile 335 |
---|
log_moderator_action($modlogdata, $lang->thread_unapproved);
$moderation->unapprove_threads($tid, $fid);
|
log_moderator_action($modlogdata, $lang->thread_unapproved);
$moderation->unapprove_threads($tid, $fid);
|
|
|
moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_threadunapproved); break;
// Delete selective posts in a thread case "deleteposts": add_breadcrumb($lang->nav_deleteposts);
|
moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_threadunapproved); break;
// Delete selective posts in a thread case "deleteposts": add_breadcrumb($lang->nav_deleteposts);
|
if(!is_moderator($fid, "candeleteposts")) { error_no_permission();
| if(!is_moderator($fid, "candeleteposts")) { error_no_permission();
|
} $posts = ""; $query = $db->query("
| } $posts = ""; $query = $db->query("
|
Zeile 348 | Zeile 352 |
---|
FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."users u ON (p.uid=u.uid) WHERE tid='$tid'
|
FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."users u ON (p.uid=u.uid) WHERE tid='$tid'
|
ORDER BY dateline ASC "); $altbg = "trow1"; while($post = $db->fetch_array($query)) { $postdate = my_date($mybb->settings['dateformat'], $post['dateline']); $posttime = my_date($mybb->settings['timeformat'], $post['dateline']);
$parser_options = array( "allow_html" => $forum['allowhtml'], "allow_mycode" => $forum['allowmycode'], "allow_smilies" => $forum['allowsmilies'], "allow_imgcode" => $forum['allowimgcode'], "filter_badwords" => 1 ); if($post['smilieoff'] == 1) {
| ORDER BY dateline ASC "); $altbg = "trow1"; while($post = $db->fetch_array($query)) { $postdate = my_date($mybb->settings['dateformat'], $post['dateline']); $posttime = my_date($mybb->settings['timeformat'], $post['dateline']);
$parser_options = array( "allow_html" => $forum['allowhtml'], "allow_mycode" => $forum['allowmycode'], "allow_smilies" => $forum['allowsmilies'], "allow_imgcode" => $forum['allowimgcode'], "filter_badwords" => 1 ); if($post['smilieoff'] == 1) {
|
$parser_options['allow_smilies'] = 0; }
| $parser_options['allow_smilies'] = 0; }
|
Zeile 374 | Zeile 378 |
---|
}
$plugins->run_hooks("moderation_deleteposts");
|
}
$plugins->run_hooks("moderation_deleteposts");
|
|
|
eval("\$deleteposts = \"".$templates->get("moderation_deleteposts")."\";"); output_page($deleteposts); break;
| eval("\$deleteposts = \"".$templates->get("moderation_deleteposts")."\";"); output_page($deleteposts); break;
|
Zeile 386 | Zeile 390 |
---|
verify_post_check($mybb->input['my_post_key']);
if(!is_moderator($fid, "candeleteposts"))
|
verify_post_check($mybb->input['my_post_key']);
if(!is_moderator($fid, "candeleteposts"))
|
{ error_no_permission(); }
| { error_no_permission(); }
|
$plugins->run_hooks("moderation_do_deleteposts");
$deletethread = "1";
| $plugins->run_hooks("moderation_do_deleteposts");
$deletethread = "1";
|
Zeile 460 | Zeile 464 |
---|
$message = $parser->parse_message($post['message'], $parser_options); eval("\$posts .= \"".$templates->get("moderation_mergeposts_post")."\";"); $altbg = alt_trow();
|
$message = $parser->parse_message($post['message'], $parser_options); eval("\$posts .= \"".$templates->get("moderation_mergeposts_post")."\";"); $altbg = alt_trow();
|
}
$plugins->run_hooks("moderation_mergeposts");
| }
$plugins->run_hooks("moderation_mergeposts");
|
eval("\$mergeposts = \"".$templates->get("moderation_mergeposts")."\";"); output_page($mergeposts); break;
| eval("\$mergeposts = \"".$templates->get("moderation_mergeposts")."\";"); output_page($mergeposts); break;
|
Zeile 475 | Zeile 479 |
---|
verify_post_check($mybb->input['my_post_key']);
if(!is_moderator($fid, "canmanagethreads"))
|
verify_post_check($mybb->input['my_post_key']);
if(!is_moderator($fid, "canmanagethreads"))
|
{
| {
|
error_no_permission();
|
error_no_permission();
|
}
| }
|
$plugins->run_hooks("moderation_do_mergeposts");
$mergepost = $mybb->input['mergepost'];
| $plugins->run_hooks("moderation_do_mergeposts");
$mergepost = $mybb->input['mergepost'];
|
Zeile 488 | Zeile 492 |
---|
}
foreach($mergepost as $pid => $yes)
|
}
foreach($mergepost as $pid => $yes)
|
{ $plist[] = intval($pid); } $moderation->merge_posts($plist, $tid, $mybb->input['sep']);
mark_reports($plist, "posts");
| { $plist[] = intval($pid); } $moderation->merge_posts($plist, $tid, $mybb->input['sep']);
mark_reports($plist, "posts");
|
log_moderator_action($modlogdata, $lang->merged_selective_posts); moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_mergeposts);
|
log_moderator_action($modlogdata, $lang->merged_selective_posts); moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_mergeposts);
|
break;
| break;
|
// Move a thread case "move":
| // Move a thread case "move":
|
Zeile 511 | Zeile 515 |
---|
$forumselect = build_forum_jump("", '', 1, '', 0, '', "moveto"); eval("\$movethread = \"".$templates->get("moderation_move")."\";"); output_page($movethread);
|
$forumselect = build_forum_jump("", '', 1, '', 0, '', "moveto"); eval("\$movethread = \"".$templates->get("moderation_move")."\";"); output_page($movethread);
|
break;
| break;
|
// Lets get this thing moving! case "do_move":
| // Lets get this thing moving! case "do_move":
|
Zeile 521 | Zeile 525 |
---|
$moveto = intval($mybb->input['moveto']); $method = $mybb->input['method'];
|
$moveto = intval($mybb->input['moveto']); $method = $mybb->input['method'];
|
|
|
if(!is_moderator($fid, "canmanagethreads"))
|
if(!is_moderator($fid, "canmanagethreads"))
|
{ error_no_permission();
| { error_no_permission();
|
} // Check if user has moderator permission to move to destination if(!is_moderator($moveto, "canmanagethreads") && !is_moderator($fid, "canmovetononmodforum")) { error_no_permission(); }
|
} // Check if user has moderator permission to move to destination if(!is_moderator($moveto, "canmanagethreads") && !is_moderator($fid, "canmovetononmodforum")) { error_no_permission(); }
|
$newperms = forum_permissions($moveto); if($newperms['canview'] == 0 && !is_moderator($fid, "canmovetononmodforum")) { error_no_permission(); }
| $newperms = forum_permissions($moveto); if($newperms['canview'] == 0 && !is_moderator($fid, "canmovetononmodforum")) { error_no_permission(); }
|
$query = $db->simple_select("forums", "*", "fid='$moveto'"); $newforum = $db->fetch_array($query); if($newforum['type'] != "f")
| $query = $db->simple_select("forums", "*", "fid='$moveto'"); $newforum = $db->fetch_array($query); if($newforum['type'] != "f")
|
Zeile 600 | Zeile 604 |
---|
$info = ''; if($modaction['tsubject']) {
|
$info = ''; if($modaction['tsubject']) {
|
$info .= "<strong>$lang->thread</strong> <a href=\"".get_thread_link($modaction['tid'])."\">".$modaction['tsubject']."</a><br />";
| $info .= "<strong>$lang->thread</strong> <a href=\"".get_thread_link($modaction['tid'])."\">".htmlspecialchars_uni($modaction['tsubject'])."</a><br />";
|
} if($modaction['fname']) {
|
} if($modaction['fname']) {
|
$info .= "<strong>$lang->forum</strong> <a href=\"".get_forum_link($modaction['fid'])."\">".$modaction['fname']."</a><br />";
| $info .= "<strong>$lang->forum</strong> <a href=\"".get_forum_link($modaction['fid'])."\">".htmlspecialchars_uni($modaction['fname'])."</a><br />";
|
} if($modaction['psubject']) {
|
} if($modaction['psubject']) {
|
$info .= "<strong>$lang->post</strong> <a href=\"".get_post_link($modaction['pid'])."#pid".$modaction['pid']."\">".$modaction['psubject']."</a>";
| $info .= "<strong>$lang->post</strong> <a href=\"".get_post_link($modaction['pid'])."#pid".$modaction['pid']."\">".htmlspecialchars_uni($modaction['psubject'])."</a>";
|
}
eval("\$modactions .= \"".$templates->get("moderation_threadnotes_modaction")."\";");
| }
eval("\$modactions .= \"".$templates->get("moderation_threadnotes_modaction")."\";");
|
Zeile 627 | Zeile 631 |
---|
// Update the thread notes! case "do_threadnotes":
|
// Update the thread notes! case "do_threadnotes":
|
// Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
if(!is_moderator($fid, "canmanagethreads")) { error_no_permission(); }
$plugins->run_hooks("moderation_do_threadnotes");
| // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
if(!is_moderator($fid, "canmanagethreads")) { error_no_permission(); }
$plugins->run_hooks("moderation_do_threadnotes");
|
log_moderator_action($modlogdata, $lang->thread_notes_edited); $sqlarray = array( "notes" => $db->escape_string($mybb->input['threadnotes']),
| log_moderator_action($modlogdata, $lang->thread_notes_edited); $sqlarray = array( "notes" => $db->escape_string($mybb->input['threadnotes']),
|
Zeile 686 | Zeile 690 |
---|
break;
// Lets get those threads together baby! (Merge threads)
|
break;
// Lets get those threads together baby! (Merge threads)
|
case "do_merge":
// Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
if(!is_moderator($fid, "canmanagethreads")) { error_no_permission(); }
| case "do_merge":
// Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
if(!is_moderator($fid, "canmanagethreads")) { error_no_permission(); }
|
$plugins->run_hooks("moderation_do_merge");
| $plugins->run_hooks("moderation_do_merge");
|
Zeile 710 | Zeile 714 |
---|
preg_match("#post-([0-9]+)?#i", $mybb->input['threadurl'], $postmatch); if($threadmatch[1])
|
preg_match("#post-([0-9]+)?#i", $mybb->input['threadurl'], $postmatch); if($threadmatch[1])
|
{
| {
|
$parameters['tid'] = $threadmatch[1]; } if($postmatch[1]) { $parameters['pid'] = $postmatch[1];
|
$parameters['tid'] = $threadmatch[1]; } if($postmatch[1]) { $parameters['pid'] = $postmatch[1];
|
} } else
| } } else
|
{ // Get thread to merge's tid the normal way $splitloc = explode(".php", $mybb->input['threadurl']);
| { // Get thread to merge's tid the normal way $splitloc = explode(".php", $mybb->input['threadurl']);
|
Zeile 768 | Zeile 772 |
---|
if($mybb->input['subject']) { $subject = $mybb->input['subject'];
|
if($mybb->input['subject']) { $subject = $mybb->input['subject'];
|
} else
| } else
|
{ $subject = $thread['subject']; }
| { $subject = $thread['subject']; }
|
Zeile 817 | Zeile 821 |
---|
if($post['smilieoff'] == 1) { $parser_options['allow_smilies'] = 0;
|
if($post['smilieoff'] == 1) { $parser_options['allow_smilies'] = 0;
|
}
| }
|
$message = $parser->parse_message($post['message'], $parser_options); eval("\$posts .= \"".$templates->get("moderation_split_post")."\";"); $altbg = alt_trow();
|
$message = $parser->parse_message($post['message'], $parser_options); eval("\$posts .= \"".$templates->get("moderation_split_post")."\";"); $altbg = alt_trow();
|
}
| }
|
$forumselect = build_forum_jump("", $fid, 1, '', 0, '', "moveto");
$plugins->run_hooks("moderation_split");
| $forumselect = build_forum_jump("", $fid, 1, '', 0, '', "moveto");
$plugins->run_hooks("moderation_split");
|
Zeile 840 | Zeile 844 |
---|
if(!is_moderator($fid, "canmanagethreads")) { error_no_permission();
|
if(!is_moderator($fid, "canmanagethreads")) { error_no_permission();
|
}
$plugins->run_hooks("moderation_do_split");
| }
$plugins->run_hooks("moderation_do_split");
|
if(!is_array($mybb->input['splitpost'])) { error($lang->error_nosplitposts);
|
if(!is_array($mybb->input['splitpost'])) { error($lang->error_nosplitposts);
|
}
| }
|
$query = $db->simple_select("posts", "COUNT(*) AS totalposts", "tid='{$tid}'"); $count = $db->fetch_array($query);
| $query = $db->simple_select("posts", "COUNT(*) AS totalposts", "tid='{$tid}'"); $count = $db->fetch_array($query);
|
Zeile 856 | Zeile 860 |
---|
error($lang->error_cantsplitall); } if($mybb->input['moveto'])
|
error($lang->error_cantsplitall); } if($mybb->input['moveto'])
|
{
| {
|
$moveto = intval($mybb->input['moveto']); } else
| $moveto = intval($mybb->input['moveto']); } else
|
Zeile 867 | Zeile 871 |
---|
if($db->num_rows($query) == 0) { error($lang->error_invalidforum);
|
if($db->num_rows($query) == 0) { error($lang->error_invalidforum);
|
}
| }
|
// move the selected posts over $query = $db->simple_select("posts", "pid", "tid='$tid'"); while($post = $db->fetch_array($query))
|
// move the selected posts over $query = $db->simple_select("posts", "pid", "tid='$tid'"); while($post = $db->fetch_array($query))
|
{
| {
|
if($mybb->input['splitpost'][$post['pid']] == 1) { $pids[] = $post['pid']; } mark_reports($post['pid'], "post");
|
if($mybb->input['splitpost'][$post['pid']] == 1) { $pids[] = $post['pid']; } mark_reports($post['pid'], "post");
|
}
| }
|
$newtid = $moderation->split_posts($pids, $tid, $moveto, $mybb->input['newsubject']);
|
$newtid = $moderation->split_posts($pids, $tid, $moveto, $mybb->input['newsubject']);
|
|
|
log_moderator_action($modlogdata, $lang->thread_split);
moderation_redirect(get_thread_link($newtid), $lang->redirect_threadsplit);
| log_moderator_action($modlogdata, $lang->thread_split);
moderation_redirect(get_thread_link($newtid), $lang->redirect_threadsplit);
|
Zeile 890 | Zeile 894 |
---|
// Delete Thread Subscriptions case "removesubscriptions": if(!is_moderator($fid, "canmanagethreads"))
|
// Delete Thread Subscriptions case "removesubscriptions": if(!is_moderator($fid, "canmanagethreads"))
|
{ error_no_permission(); }
| { error_no_permission(); }
|
$plugins->run_hooks("moderation_removesubscriptions");
|
$plugins->run_hooks("moderation_removesubscriptions");
|
|
|
$moderation->remove_thread_subscriptions($tid, true);
log_moderator_action($modlogdata, $lang->removed_subscriptions);
| $moderation->remove_thread_subscriptions($tid, true);
log_moderator_action($modlogdata, $lang->removed_subscriptions);
|
Zeile 912 | Zeile 916 |
---|
// From search page $threads = getids($mybb->input['searchid'], 'search'); if(!is_moderator_by_tids($threads, 'candeleteposts'))
|
// From search page $threads = getids($mybb->input['searchid'], 'search'); if(!is_moderator_by_tids($threads, 'candeleteposts'))
|
{ error_no_permission(); } } else {
| { error_no_permission(); } } else {
|
$threads = getids($fid, 'forum'); if(!is_moderator($fid, 'candeleteposts')) {
| $threads = getids($fid, 'forum'); if(!is_moderator($fid, 'candeleteposts')) {
|
Zeile 927 | Zeile 931 |
---|
if(count($threads) < 1) { error($lang->error_inline_nothreadsselected);
|
if(count($threads) < 1) { error($lang->error_inline_nothreadsselected);
|
}
| }
|
$inlineids = implode("|", $threads); if($mybb->input['inlinetype'] == 'search') { clearinline($mybb->input['searchid'], 'search');
|
$inlineids = implode("|", $threads); if($mybb->input['inlinetype'] == 'search') { clearinline($mybb->input['searchid'], 'search');
|
}
| }
|
else { clearinline($fid, 'forum');
| else { clearinline($fid, 'forum');
|
Zeile 941 | Zeile 945 |
---|
$return_url = htmlspecialchars_uni($mybb->input['url']); eval("\$multidelete = \"".$templates->get("moderation_inline_deletethreads")."\";"); output_page($multidelete);
|
$return_url = htmlspecialchars_uni($mybb->input['url']); eval("\$multidelete = \"".$templates->get("moderation_inline_deletethreads")."\";"); output_page($multidelete);
|
break;
| break;
|
// Actually delete the threads - Inline moderation case "do_multideletethreads":
|
// Actually delete the threads - Inline moderation case "do_multideletethreads":
|
|
|
// Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
| // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
Zeile 953 | Zeile 957 |
---|
if(!is_moderator_by_tids($threadlist, "candeleteposts")) { error_no_permission();
|
if(!is_moderator_by_tids($threadlist, "candeleteposts")) { error_no_permission();
|
}
| }
|
foreach($threadlist as $tid)
|
foreach($threadlist as $tid)
|
{
| {
|
$tid = intval($tid); $moderation->delete_thread($tid); $tlist[] = $tid; } log_moderator_action($modlogdata, $lang->multi_deleted_threads);
|
$tid = intval($tid); $moderation->delete_thread($tid); $tlist[] = $tid; } log_moderator_action($modlogdata, $lang->multi_deleted_threads);
|
if($mybb->input['inlinetype'] == 'search') { clearinline($mybb->input['searchid'], 'search'); } else { clearinline($fid, 'forum');
| if($mybb->input['inlinetype'] == 'search') { clearinline($mybb->input['searchid'], 'search'); } else { clearinline($fid, 'forum');
|
} mark_reports($tlist, "threads"); moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsdeleted);
| } mark_reports($tlist, "threads"); moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsdeleted);
|
Zeile 980 | Zeile 984 |
---|
verify_post_check($mybb->input['my_post_key']); if(!empty($mybb->input['searchid']))
|
verify_post_check($mybb->input['my_post_key']); if(!empty($mybb->input['searchid']))
|
{
| {
|
// From search page $threads = getids($mybb->input['searchid'], 'search'); if(!is_moderator_by_tids($threads, 'canopenclosethreads'))
| // From search page $threads = getids($mybb->input['searchid'], 'search'); if(!is_moderator_by_tids($threads, 'canopenclosethreads'))
|
Zeile 992 | Zeile 996 |
---|
{ $threads = getids($fid, 'forum'); if(!is_moderator($fid, 'canopenclosethreads'))
|
{ $threads = getids($fid, 'forum'); if(!is_moderator($fid, 'canopenclosethreads'))
|
{
| {
|
error_no_permission(); }
|
error_no_permission(); }
|
}
| }
|
if(count($threads) < 1) { error($lang->error_inline_nothreadsselected);
|
if(count($threads) < 1) { error($lang->error_inline_nothreadsselected);
|
}
$moderation->open_threads($threads);
| }
$moderation->open_threads($threads);
|
log_moderator_action($modlogdata, $lang->multi_opened_threads); if($mybb->input['inlinetype'] == 'search') { clearinline($mybb->input['searchid'], 'search');
|
log_moderator_action($modlogdata, $lang->multi_opened_threads); if($mybb->input['inlinetype'] == 'search') { clearinline($mybb->input['searchid'], 'search');
|
}
| }
|
else { clearinline($fid, 'forum');
| else { clearinline($fid, 'forum');
|
Zeile 1017 | Zeile 1021 |
---|
break;
// Close threads - Inline moderation
|
break;
// Close threads - Inline moderation
|
case "multiclosethreads":
// Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
if(!empty($mybb->input['searchid'])) { // From search page $threads = getids($mybb->input['searchid'], 'search'); if(!is_moderator_by_tids($threads, 'canmanagethreads')) { error_no_permission(); } } else { $threads = getids($fid, 'forum'); if(!is_moderator($fid, 'canmanagethreads')) { error_no_permission(); } } if(count($threads) < 1) { error($lang->error_inline_nothreadsselected); }
| case "multiclosethreads":
// Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
if(!empty($mybb->input['searchid'])) { // From search page $threads = getids($mybb->input['searchid'], 'search'); if(!is_moderator_by_tids($threads, 'canmanagethreads')) { error_no_permission(); } } else { $threads = getids($fid, 'forum'); if(!is_moderator($fid, 'canmanagethreads')) { error_no_permission(); } } if(count($threads) < 1) { error($lang->error_inline_nothreadsselected); }
|
$moderation->close_threads($threads);
| $moderation->close_threads($threads);
|
Zeile 1089 | Zeile 1093 |
---|
$moderation->approve_threads($threads, $fid);
log_moderator_action($modlogdata, $lang->multi_approved_threads);
|
$moderation->approve_threads($threads, $fid);
log_moderator_action($modlogdata, $lang->multi_approved_threads);
|
if($mybb->input['inlinetype'] == 'search') { clearinline($mybb->input['searchid'], 'search'); } else
| if($mybb->input['inlinetype'] == 'search') { clearinline($mybb->input['searchid'], 'search'); } else
|
{ clearinline($fid, 'forum'); } $cache->update_stats(); moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsapproved); break;
|
{ clearinline($fid, 'forum'); } $cache->update_stats(); moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsapproved); break;
|
|
|
// Unapprove threads - Inline moderation
|
// Unapprove threads - Inline moderation
|
case "multiunapprovethreads":
// Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
if(!empty($mybb->input['searchid'])) { // From search page $threads = getids($mybb->input['searchid'], 'search'); if(!is_moderator_by_tids($threads, 'canmanagethreads')) { error_no_permission(); } } else
| case "multiunapprovethreads":
// Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
if(!empty($mybb->input['searchid'])) { // From search page $threads = getids($mybb->input['searchid'], 'search'); if(!is_moderator_by_tids($threads, 'canmanagethreads')) { error_no_permission(); } } else
|
{ $threads = getids($fid, 'forum'); if(!is_moderator($fid, 'canmanagethreads'))
| { $threads = getids($fid, 'forum'); if(!is_moderator($fid, 'canmanagethreads'))
|
Zeile 1145 | Zeile 1149 |
---|
break;
// Stick threads - Inline moderation
|
break;
// Stick threads - Inline moderation
|
case "multistickthreads":
// Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
if(!empty($mybb->input['searchid'])) { // From search page $threads = getids($mybb->input['searchid'], 'search'); if(!is_moderator_by_tids($threads, 'canopenclosethreads')) { error_no_permission(); } } else { $threads = getids($fid, 'forum'); if(!is_moderator($fid, 'canopenclosethreads')) { error_no_permission(); } }
| case "multistickthreads":
// Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
if(!empty($mybb->input['searchid'])) { // From search page $threads = getids($mybb->input['searchid'], 'search'); if(!is_moderator_by_tids($threads, 'canopenclosethreads')) { error_no_permission(); } } else { $threads = getids($fid, 'forum'); if(!is_moderator($fid, 'canopenclosethreads')) { error_no_permission(); } }
|
if(count($threads) < 1) { error($lang->error_inline_nothreadsselected);
|
if(count($threads) < 1) { error($lang->error_inline_nothreadsselected);
|
}
$moderation->stick_threads($threads);
| }
$moderation->stick_threads($threads);
|
log_moderator_action($modlogdata, $lang->multi_stuck_threads); if($mybb->input['inlinetype'] == 'search') { clearinline($mybb->input['searchid'], 'search');
|
log_moderator_action($modlogdata, $lang->multi_stuck_threads); if($mybb->input['inlinetype'] == 'search') { clearinline($mybb->input['searchid'], 'search');
|
}
| }
|
else { clearinline($fid, 'forum');
| else { clearinline($fid, 'forum');
|
Zeile 1187 | Zeile 1191 |
---|
break;
// Unstick threads - Inline moderaton
|
break;
// Unstick threads - Inline moderaton
|
case "multiunstickthreads":
// Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
| case "multiunstickthreads":
// Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
if(!empty($mybb->input['searchid']))
|
if(!empty($mybb->input['searchid']))
|
{
| {
|
// From search page $threads = getids($mybb->input['searchid'], 'search'); if(!is_moderator_by_tids($threads, 'canopenclosethreads')) { error_no_permission(); }
|
// From search page $threads = getids($mybb->input['searchid'], 'search'); if(!is_moderator_by_tids($threads, 'canopenclosethreads')) { error_no_permission(); }
|
} else { $threads = getids($fid, 'forum'); if(!is_moderator($fid, 'canopenclosethreads')) { error_no_permission(); } } if(count($threads) < 1)
| } else
|
{
|
{
|
error($lang->error_inline_nothreadsselected); }
$moderation->unstick_threads($threads);
| $threads = getids($fid, 'forum'); if(!is_moderator($fid, 'canopenclosethreads')) { error_no_permission(); } } if(count($threads) < 1) { error($lang->error_inline_nothreadsselected); }
$moderation->unstick_threads($threads);
|
log_moderator_action($modlogdata, $lang->multi_unstuck_threads); if($mybb->input['inlinetype'] == 'search') { clearinline($mybb->input['searchid'], 'search'); } else
|
log_moderator_action($modlogdata, $lang->multi_unstuck_threads); if($mybb->input['inlinetype'] == 'search') { clearinline($mybb->input['searchid'], 'search'); } else
|
{
| {
|
clearinline($fid, 'forum'); } moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsunstuck);
| clearinline($fid, 'forum'); } moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsunstuck);
|
Zeile 1237 | Zeile 1241 |
---|
// From search page $threads = getids($mybb->input['searchid'], 'search'); if(!is_moderator_by_tids($threads, 'canmanagethreads'))
|
// From search page $threads = getids($mybb->input['searchid'], 'search'); if(!is_moderator_by_tids($threads, 'canmanagethreads'))
|
{ error_no_permission(); } }
| { error_no_permission(); } }
|
else { $threads = getids($fid, 'forum');
| else { $threads = getids($fid, 'forum');
|
Zeile 1288 | Zeile 1292 |
---|
// Make sure moderator has permission to move to the new forum $newperms = forum_permissions($moveto); if(($newperms['canview'] == 0 || !is_moderator($moveto, 'canmanagethreads')) && !is_moderator_by_tids($tids, 'canmovetononmodforum'))
|
// Make sure moderator has permission to move to the new forum $newperms = forum_permissions($moveto); if(($newperms['canview'] == 0 || !is_moderator($moveto, 'canmanagethreads')) && !is_moderator_by_tids($tids, 'canmovetononmodforum'))
|
{ error_no_permission(); }
| { error_no_permission(); }
|
$newforum = get_forum($moveto); if($newforum['type'] != "f") { error($lang->error_invalidforum);
|
$newforum = get_forum($moveto); if($newforum['type'] != "f") { error($lang->error_invalidforum);
|
}
| }
|
$moderation->move_threads($tids, $moveto);
log_moderator_action($modlogdata, $lang->multi_moved_threads);
| $moderation->move_threads($tids, $moveto);
log_moderator_action($modlogdata, $lang->multi_moved_threads);
|
Zeile 1310 | Zeile 1314 |
---|
add_breadcrumb($lang->nav_multi_deleteposts); if($mybb->input['inlinetype'] == 'search')
|
add_breadcrumb($lang->nav_multi_deleteposts); if($mybb->input['inlinetype'] == 'search')
|
{ $posts = getids($mybb->input['searchid'], 'search'); } else { $posts = getids($tid, 'thread'); } if(count($posts) < 1) { error($lang->error_inline_nopostsselected); } if(!is_moderator_by_pids($posts, "candeleteposts")) { error_no_permission(); } $inlineids = implode("|", $posts); if($mybb->input['inlinetype'] == 'search') { clearinline($mybb->input['searchid'], 'search');
| { $posts = getids($mybb->input['searchid'], 'search');
|
} else {
|
} else {
|
clearinline($tid, 'thread');
| $posts = getids($tid, 'thread'); } if(count($posts) < 1) { error($lang->error_inline_nopostsselected); } if(!is_moderator_by_pids($posts, "candeleteposts")) { error_no_permission(); } $inlineids = implode("|", $posts); if($mybb->input['inlinetype'] == 'search') { clearinline($mybb->input['searchid'], 'search'); } else { clearinline($tid, 'thread');
|
} $return_url = htmlspecialchars_uni($mybb->input['url']);
|
} $return_url = htmlspecialchars_uni($mybb->input['url']);
|
|
|
eval("\$multidelete = \"".$templates->get("moderation_inline_deleteposts")."\";"); output_page($multidelete); break;
|
eval("\$multidelete = \"".$templates->get("moderation_inline_deleteposts")."\";"); output_page($multidelete); break;
|
|
|
// Actually delete the posts in inline moderation case "do_multideleteposts":
| // Actually delete the posts in inline moderation case "do_multideleteposts":
|
Zeile 1350 | Zeile 1354 |
---|
$postlist = explode("|", $mybb->input['posts']); if(!is_moderator_by_pids($postlist, "candeleteposts"))
|
$postlist = explode("|", $mybb->input['posts']); if(!is_moderator_by_pids($postlist, "candeleteposts"))
|
{
| {
|
error_no_permission(); }
|
error_no_permission(); }
|
| $postlist = array_map('intval', $postlist); $pids = implode(',', $postlist); $tids = array(); if($pids) { $query = $db->simple_select("threads", "tid", "firstpost IN({$pids})"); while($tid = $db->fetch_field($query, "tid")) { $tids[] = $tid; } }
|
$deletecount = 0; foreach($postlist as $pid) {
| $deletecount = 0; foreach($postlist as $pid) {
|
Zeile 1361 | Zeile 1378 |
---|
$plist[] = $pid; $deletecount++; }
|
$plist[] = $pid; $deletecount++; }
|
$query = $db->simple_select("posts", "*", "tid='$tid'"); $numposts = $db->num_rows($query); if(!$numposts) { $moderation->delete_thread($tid); mark_reports($tid, "thread"); $url = get_forum_link($fid);
| // If we have multiple threads, we must be coming from the search if(!empty($tids)) { foreach($tids as $tid) { $moderation->delete_thread($tid); mark_reports($tid, "thread"); $url = get_forum_link($fid); }
|
}
|
}
|
| // Otherwise we're just deleting from showthread.php
|
else {
|
else {
|
mark_reports($plist, "posts"); $url = get_thread_link($thread['tid']);
| $query = $db->simple_select("posts", "*", "tid='$tid'"); $numposts = $db->num_rows($query); if(!$numposts) { $moderation->delete_thread($tid); mark_reports($tid, "thread"); $url = get_forum_link($fid); } else { mark_reports($plist, "posts"); $url = get_thread_link($thread['tid']); }
|
}
|
}
|
|
|
$lang->deleted_selective_posts = $lang->sprintf($lang->deleted_selective_posts, $deletecount); log_moderator_action($modlogdata, $lang->deleted_selective_posts); moderation_redirect($url, $lang->redirect_postsdeleted);
| $lang->deleted_selective_posts = $lang->sprintf($lang->deleted_selective_posts, $deletecount); log_moderator_action($modlogdata, $lang->deleted_selective_posts); moderation_redirect($url, $lang->redirect_postsdeleted);
|
Zeile 1400 | Zeile 1433 |
---|
error_no_permission(); } $inlineids = implode("|", $posts);
|
error_no_permission(); } $inlineids = implode("|", $posts);
|
if($mybb->input['inlinetype'] == 'search') { clearinline($mybb->input['searchid'], 'search');
| if($mybb->input['inlinetype'] == 'search') { clearinline($mybb->input['searchid'], 'search');
|
} else { clearinline($tid, 'thread'); }
|
} else { clearinline($tid, 'thread'); }
|
|
|
$return_url = htmlspecialchars_uni($mybb->input['url']);
eval("\$multimerge = \"".$templates->get("moderation_inline_mergeposts")."\";"); output_page($multimerge); break;
|
$return_url = htmlspecialchars_uni($mybb->input['url']);
eval("\$multimerge = \"".$templates->get("moderation_inline_mergeposts")."\";"); output_page($multimerge); break;
|
|
|
// Actually merge the posts - Inline moderation case "do_multimergeposts":
|
// Actually merge the posts - Inline moderation case "do_multimergeposts":
|
|
|
// Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
$postlist = explode("|", $mybb->input['posts']); if(!is_moderator_by_pids($postlist, "canmanagethreads"))
|
// Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
$postlist = explode("|", $mybb->input['posts']); if(!is_moderator_by_pids($postlist, "canmanagethreads"))
|
{ error_no_permission();
| { error_no_permission();
|
} foreach($postlist as $pid)
| } foreach($postlist as $pid)
|
Zeile 1463 | Zeile 1496 |
---|
{ error_no_permission(); }
|
{ error_no_permission(); }
|
array_walk($posts, 'intval');
| $posts = array_map('intval', $posts);
|
$pidin = implode(',', $posts);
// Make sure that we are not splitting a thread with one post // Select number of posts in each thread that the splitted post is in $query = $db->query(" SELECT DISTINCT p.tid, COUNT(q.pid) as count
|
$pidin = implode(',', $posts);
// Make sure that we are not splitting a thread with one post // Select number of posts in each thread that the splitted post is in $query = $db->query(" SELECT DISTINCT p.tid, COUNT(q.pid) as count
|
FROM (".TABLE_PREFIX."posts p, ".TABLE_PREFIX."posts q) WHERE p.tid=q.tid AND p.pid IN ($pidin)
| FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."posts q ON (p.tid=q.tid) WHERE p.pid IN ($pidin)
|
GROUP BY p.pid
|
GROUP BY p.pid
|
");
| ");
|
$threads = $pcheck = array(); while($tcheck = $db->fetch_array($query)) {
| $threads = $pcheck = array(); while($tcheck = $db->fetch_array($query)) {
|
Zeile 1673 | Zeile 1707 |
---|
{ error($lang->error_inline_nopostsselected); }
|
{ error($lang->error_inline_nopostsselected); }
|
| if(!is_moderator_by_tids($tids)) { error_no_permission(); }
|
$custommod->execute(intval($mybb->input['action']), $tids); $lang->custom_tool = $lang->sprintf($lang->custom_tool, $tool['name']); log_moderator_action($modlogdata, $lang->custom_tool); if($mybb->input['inlinetype'] == 'search')
|
$custommod->execute(intval($mybb->input['action']), $tids); $lang->custom_tool = $lang->sprintf($lang->custom_tool, $tool['name']); log_moderator_action($modlogdata, $lang->custom_tool); if($mybb->input['inlinetype'] == 'search')
|
{
| {
|
clearinline($mybb->input['searchid'], 'search');
|
clearinline($mybb->input['searchid'], 'search');
|
$lang->redirect_customtool_search = $lang->sprintf($lang->redirect_customtool_search, $tool['name']); redirect($mybb->input['url'], $lang->redirect_customtool_search);
| $lang->redirect_customtool_search = $lang->sprintf($lang->redirect_customtool_search, $tool['name']); $return_url = htmlspecialchars_uni($mybb->input['url']); redirect($return_url, $lang->redirect_customtool_search);
|
} else { clearinline($fid, "forum"); $lang->redirect_customtool_forum = $lang->sprintf($lang->redirect_customtool_forum, $tool['name']); redirect(get_forum_link($fid), $lang->redirect_customtool_forum);
|
} else { clearinline($fid, "forum"); $lang->redirect_customtool_forum = $lang->sprintf($lang->redirect_customtool_forum, $tool['name']); redirect(get_forum_link($fid), $lang->redirect_customtool_forum);
|
}
| }
|
break; } elseif($tool['type'] == 't' && $mybb->input['modtype'] == 'thread') {
|
break; } elseif($tool['type'] == 't' && $mybb->input['modtype'] == 'thread') {
|
| if(!is_moderator_by_tids($tid)) { error_no_permission(); }
|
$ret = $custommod->execute(intval($mybb->input['action']), $tid); $lang->custom_tool = $lang->sprintf($lang->custom_tool, $tool['name']); log_moderator_action($modlogdata, $lang->custom_tool);
| $ret = $custommod->execute(intval($mybb->input['action']), $tid); $lang->custom_tool = $lang->sprintf($lang->custom_tool, $tool['name']); log_moderator_action($modlogdata, $lang->custom_tool);
|
Zeile 1732 | Zeile 1776 |
---|
$options = array( 'order_by' => 'dateline', 'order_dir' => 'asc'
|
$options = array( 'order_by' => 'dateline', 'order_dir' => 'asc'
|
); $query = $db->simple_select("posts", "DISTINCT tid", "pid IN ($pids)", $options);
| ); $query = $db->simple_select("posts", "DISTINCT tid", "pid IN (".implode(',',$pids).")", $options);
|
while($row = $db->fetch_array($query)) { $tids[] = $row['tid'];
| while($row = $db->fetch_array($query)) { $tids[] = $row['tid'];
|
Zeile 1746 | Zeile 1790 |
---|
{ clearinline($mybb->input['searchid'], 'search'); $lang->redirect_customtool_search = $lang->sprintf($lang->redirect_customtool_search, $tool['name']);
|
{ clearinline($mybb->input['searchid'], 'search'); $lang->redirect_customtool_search = $lang->sprintf($lang->redirect_customtool_search, $tool['name']);
|
redirect($mybb->input['url'], $lang->redirect_customtool_search);
| $return_url = htmlspecialchars_uni($mybb->input['url']); redirect($return_url, $lang->redirect_customtool_search);
|
} else {
| } else {
|
Zeile 1828 | Zeile 1873 |
---|
$posts = array($posts); } // Validate input
|
$posts = array($posts); } // Validate input
|
array_walk($posts, 'intval');
| $posts = array_map('intval', $posts);
|
$posts[] = 0; // Get forums $posts_string = implode(',', $posts);
| $posts[] = 0; // Get forums $posts_string = implode(',', $posts);
|
Zeile 1872 | Zeile 1917 |
---|
$threads = array($threads); } // Validate input
|
$threads = array($threads); } // Validate input
|
array_walk($threads, 'intval');
| $threads = array_map('intval', $threads);
|
$threads[] = 0; // Get forums $threads_string = implode(',', $threads);
| $threads[] = 0; // Get forums $threads_string = implode(',', $threads);
|
Zeile 1898 | Zeile 1943 |
---|
global $mybb; if(!empty($mybb->input['url'])) {
|
global $mybb; if(!empty($mybb->input['url'])) {
|
redirect($mybb->input['url'], $message, $title);
| redirect(htmlentities($mybb->input['url']), $message, $title);
|
} redirect($url, $message, $title); }
| } redirect($url, $message, $title); }
|