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 4176 2008-09-03 13:50:09Z Tikitiki $
|
*/
define("IN_MYBB", 1);
|
*/
define("IN_MYBB", 1);
|
| define('THIS_SCRIPT', 'moderation.php');
|
$templatelist = 'changeuserbox';
| $templatelist = 'changeuserbox';
|
Zeile 192 | Zeile 193 |
---|
error_no_permission(); } }
|
error_no_permission(); } }
|
$thread['subject'] = htmlspecialchars_uni($thread['subject']);
| |
$plugins->run_hooks("moderation_deletethread");
| $plugins->run_hooks("moderation_deletethread");
|
Zeile 600 | Zeile 599 |
---|
$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 756 | Zeile 755 |
---|
if(!$mergethread['tid']) { error($lang->error_badmergeurl);
|
if(!$mergethread['tid']) { error($lang->error_badmergeurl);
|
}
| }
|
if($mergetid == $tid) { // sanity check error($lang->error_mergewithself);
| if($mergetid == $tid) { // sanity check error($lang->error_mergewithself);
|
Zeile 1102 | Zeile 1101 |
---|
break;
// Unapprove threads - Inline moderation
|
break;
// 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 { $threads = getids($fid, 'forum'); if(!is_moderator($fid, 'canmanagethreads')) { error_no_permission(); } } if(count($threads) < 1) { error($lang->error_inline_nothreadsselected); }
$moderation->unapprove_threads($threads, $fid);
| 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')) { error_no_permission(); } } if(count($threads) < 1) { error($lang->error_inline_nothreadsselected); }
$moderation->unapprove_threads($threads, $fid);
|
log_moderator_action($modlogdata, $lang->multi_unapproved_threads); if($mybb->input['inlinetype'] == 'search')
|
log_moderator_action($modlogdata, $lang->multi_unapproved_threads); if($mybb->input['inlinetype'] == 'search')
|
{
| {
|
clearinline($mybb->input['searchid'], 'search'); } else
| clearinline($mybb->input['searchid'], 'search'); } else
|
Zeile 1145 | Zeile 1144 |
---|
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(); }
| 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
|
} else
|
{
| {
|
$threads = getids($fid, 'forum'); if(!is_moderator($fid, 'canopenclosethreads')) { error_no_permission(); }
|
$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);
|
Zeile 1175 | Zeile 1174 |
---|
$moderation->stick_threads($threads);
log_moderator_action($modlogdata, $lang->multi_stuck_threads);
|
$moderation->stick_threads($threads);
log_moderator_action($modlogdata, $lang->multi_stuck_threads);
|
if($mybb->input['inlinetype'] == 'search') { clearinline($mybb->input['searchid'], 'search');
| if($mybb->input['inlinetype'] == 'search') { clearinline($mybb->input['searchid'], 'search');
|
} else {
| } else {
|
Zeile 1185 | Zeile 1184 |
---|
} moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsstuck); break;
|
} moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsstuck); break;
|
|
|
// Unstick threads - Inline moderaton case "multiunstickthreads":
|
// Unstick threads - Inline moderaton case "multiunstickthreads":
|
|
|
// 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 1197 | Zeile 1196 |
---|
// 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'))
|
{ error_no_permission(); } } else
| { error_no_permission(); } } else
|
{ $threads = getids($fid, 'forum'); if(!is_moderator($fid, 'canopenclosethreads'))
| { $threads = getids($fid, 'forum'); if(!is_moderator($fid, 'canopenclosethreads'))
|
Zeile 1210 | Zeile 1209 |
---|
} } if(count($threads) < 1)
|
} } if(count($threads) < 1)
|
{
| {
|
error($lang->error_inline_nothreadsselected);
|
error($lang->error_inline_nothreadsselected);
|
}
| }
|
$moderation->unstick_threads($threads);
log_moderator_action($modlogdata, $lang->multi_unstuck_threads);
| $moderation->unstick_threads($threads);
log_moderator_action($modlogdata, $lang->multi_unstuck_threads);
|
Zeile 1224 | Zeile 1223 |
---|
else { clearinline($fid, 'forum');
|
else { clearinline($fid, 'forum');
|
}
| }
|
moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsunstuck); break;
| moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsunstuck); break;
|
Zeile 1271 | Zeile 1270 |
---|
// Actually move the threads in Inline moderation case "do_multimovethreads":
|
// Actually move the threads in Inline moderation case "do_multimovethreads":
|
|
|
// 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 1308 | Zeile 1307 |
---|
// Delete posts - Inline moderation case "multideleteposts": add_breadcrumb($lang->nav_multi_deleteposts);
|
// Delete posts - Inline moderation case "multideleteposts": add_breadcrumb($lang->nav_multi_deleteposts);
|
if($mybb->input['inlinetype'] == 'search') { $posts = getids($mybb->input['searchid'], 'search'); } else { $posts = getids($tid, 'thread'); }
| 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"))
|
if(count($posts) < 1) { error($lang->error_inline_nopostsselected); } if(!is_moderator_by_pids($posts, "candeleteposts"))
|
{
| {
|
error_no_permission(); } $inlineids = implode("|", $posts);
| error_no_permission(); } $inlineids = implode("|", $posts);
|
Zeile 1335 | Zeile 1334 |
---|
{ clearinline($tid, 'thread'); }
|
{ clearinline($tid, 'thread'); }
|
|
|
$return_url = htmlspecialchars_uni($mybb->input['url']); eval("\$multidelete = \"".$templates->get("moderation_inline_deleteposts")."\";"); output_page($multidelete);
|
$return_url = htmlspecialchars_uni($mybb->input['url']); eval("\$multidelete = \"".$templates->get("moderation_inline_deleteposts")."\";"); output_page($multidelete);
|
break;
| break;
|
// Actually delete the posts in inline moderation case "do_multideleteposts":
| // Actually delete the posts in inline moderation case "do_multideleteposts":
|
Zeile 1350 | Zeile 1349 |
---|
$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(); } $deletecount = 0;
| error_no_permission(); } $deletecount = 0;
|
Zeile 1364 | Zeile 1363 |
---|
$query = $db->simple_select("posts", "*", "tid='$tid'"); $numposts = $db->num_rows($query); if(!$numposts)
|
$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);
|
$moderation->delete_thread($tid); mark_reports($tid, "thread"); $url = get_forum_link($fid);
|
} else {
| } else {
|
mark_reports($plist, "posts"); $url = get_thread_link($thread['tid']); }
| mark_reports($plist, "posts"); $url = get_thread_link($thread['tid']); }
|
Zeile 1382 | Zeile 1381 |
---|
// Merge posts - Inline moderation case "multimergeposts": add_breadcrumb($lang->nav_multi_mergeposts);
|
// Merge posts - Inline moderation case "multimergeposts": add_breadcrumb($lang->nav_multi_mergeposts);
|
if($mybb->input['inlinetype'] == 'search') { $posts = getids($mybb->input['searchid'], 'search'); } else {
| if($mybb->input['inlinetype'] == 'search') { $posts = getids($mybb->input['searchid'], 'search'); } else {
|
$posts = getids($tid, 'thread'); } if(count($posts) < 1)
| $posts = getids($tid, 'thread'); } if(count($posts) < 1)
|
Zeile 1463 | Zeile 1462 |
---|
{ 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
| $pidin = implode(',', $posts);
// Make sure that we are not splitting a thread with one post
|
Zeile 1482 | Zeile 1481 |
---|
error($lang->error_cantsplitonepost); } $threads[] = $pcheck[] = $tcheck['tid']; // Save tids for below
|
error($lang->error_cantsplitonepost); } $threads[] = $pcheck[] = $tcheck['tid']; // Save tids for below
|
}
| }
|
// Make sure that we are not splitting all posts in the thread // The query does not return a row when the count is 0, so find if some threads are missing (i.e. 0 posts after removal)
| // Make sure that we are not splitting all posts in the thread // The query does not return a row when the count is 0, so find if some threads are missing (i.e. 0 posts after removal)
|
Zeile 1505 | Zeile 1504 |
---|
{ // One or more threads do not have posts after splitting error($lang->error_cantsplitall);
|
{ // One or more threads do not have posts after splitting error($lang->error_cantsplitall);
|
}
| }
|
$inlineids = implode("|", $posts); if($mybb->input['inlinetype'] == 'search') { clearinline($mybb->input['searchid'], 'search');
|
$inlineids = implode("|", $posts); if($mybb->input['inlinetype'] == 'search') { clearinline($mybb->input['searchid'], 'search');
|
}
| }
|
else { clearinline($tid, 'thread');
| else { clearinline($tid, 'thread');
|
Zeile 1520 | Zeile 1519 |
---|
eval("\$splitposts = \"".$templates->get("moderation_inline_splitposts")."\";"); output_page($splitposts); break;
|
eval("\$splitposts = \"".$templates->get("moderation_inline_splitposts")."\";"); output_page($splitposts); break;
|
|
|
// Actually split the posts - Inline moderation case "do_multisplitposts":
|
// Actually split the posts - Inline moderation case "do_multisplitposts":
|
|
|
// Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
$postlist = explode("|", $mybb->input['posts']); foreach($postlist as $pid)
|
// Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
$postlist = explode("|", $mybb->input['posts']); foreach($postlist as $pid)
|
{
| {
|
$pid = intval($pid); $plist[] = $pid; }
| $pid = intval($pid); $plist[] = $pid; }
|
Zeile 1565 | Zeile 1564 |
---|
// Approve posts - Inline moderation case "multiapproveposts":
|
// Approve posts - Inline moderation case "multiapproveposts":
|
// Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
if($mybb->input['inlinetype'] == 'search') { $posts = getids($mybb->input['searchid'], 'search'); } else { $posts = getids($tid, 'thread');
| // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
if($mybb->input['inlinetype'] == 'search') { $posts = getids($mybb->input['searchid'], 'search'); } else { $posts = getids($tid, 'thread');
|
} if(count($posts) < 1)
|
} if(count($posts) < 1)
|
{
| {
|
error($lang->error_inline_nopostsselected); }
| error($lang->error_inline_nopostsselected); }
|
Zeile 1596 | Zeile 1595 |
---|
$moderation->approve_posts($pids);
log_moderator_action($modlogdata, $lang->multi_approve_posts);
|
$moderation->approve_posts($pids);
log_moderator_action($modlogdata, $lang->multi_approve_posts);
|
if($mybb->input['inlinetype'] == 'search') { clearinline($mybb->input['searchid'], 'search');
| if($mybb->input['inlinetype'] == 'search') { clearinline($mybb->input['searchid'], 'search');
|
} else {
| } else {
|
Zeile 1645 | Zeile 1644 |
---|
clearinline($mybb->input['searchid'], 'search'); } else
|
clearinline($mybb->input['searchid'], 'search'); } else
|
{
| {
|
clearinline($tid, 'thread'); } moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_inline_postsunapproved);
| clearinline($tid, 'thread'); } moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_inline_postsunapproved);
|
Zeile 1668 | Zeile 1667 |
---|
else { $tids = getids($fid, "forum");
|
else { $tids = getids($fid, "forum");
|
}
| }
|
if(count($tids) < 1) { error($lang->error_inline_nopostsselected); }
|
if(count($tids) < 1) { 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'); $lang->redirect_customtool_search = $lang->sprintf($lang->redirect_customtool_search, $tool['name']); redirect($mybb->input['url'], $lang->redirect_customtool_search); } else
|
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); } 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);
| clearinline($fid, "forum"); $lang->redirect_customtool_forum = $lang->sprintf($lang->redirect_customtool_forum, $tool['name']); redirect(get_forum_link($fid), $lang->redirect_customtool_forum);
|
Zeile 1692 | Zeile 1696 |
---|
} elseif($tool['type'] == 't' && $mybb->input['modtype'] == 'thread') {
|
} 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 1740 |
---|
$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 1828 | Zeile 1836 |
---|
$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 1880 |
---|
$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);
|