Zeile 45 | Zeile 45 |
---|
$post = get_post($pid); if(!$post) {
|
$post = get_post($pid); if(!$post) {
|
error($lang->error_invalidpost);
| error($lang->error_invalidpost, $lang->error);
|
} $tid = $post['tid']; }
| } $tid = $post['tid']; }
|
Zeile 55 | Zeile 55 |
---|
$thread = get_thread($tid); if(!$thread) {
|
$thread = get_thread($tid); if(!$thread) {
|
error($lang->error_invalidthread);
| error($lang->error_invalidthread, $lang->error);
|
} $fid = $thread['fid']; }
| } $fid = $thread['fid']; }
|
Zeile 80 | Zeile 80 |
---|
if(!$pm) {
|
if(!$pm) {
|
error($lang->error_invalidpm);
| error($lang->error_invalidpm, $lang->error);
|
} }
| } }
|
Zeile 198 | Zeile 198 |
---|
} if(count($tids) < 1) {
|
} if(count($tids) < 1) {
|
error($lang->error_inline_nothreadsselected);
| error($lang->error_inline_nothreadsselected, $lang->error);
|
}
$mybb->input['tids'] = $tids;
| }
$mybb->input['tids'] = $tids;
|
Zeile 249 | Zeile 249 |
---|
{ case "pgsql": case "sqlite":
|
{ case "pgsql": case "sqlite":
|
$query = $db->simple_select("modtools", 'tid, name, groups', "(','||forums||',' LIKE '%,$fid,%' OR ','||forums||',' LIKE '%,-1,%' OR forums='') AND type = 't'");
| $query = $db->simple_select("modtools", 'tid, name, `groups`', "(','||forums||',' LIKE '%,$fid,%' OR ','||forums||',' LIKE '%,-1,%' OR forums='') AND type = 't'");
|
break; default:
|
break; default:
|
$query = $db->simple_select("modtools", 'tid, name, groups', "(CONCAT(',',forums,',') LIKE '%,$fid,%' OR CONCAT(',',forums,',') LIKE '%,-1,%' OR forums='') AND type = 't'");
| $query = $db->simple_select("modtools", 'tid, name, `groups`', "(CONCAT(',',forums,',') LIKE '%,$fid,%' OR CONCAT(',',forums,',') LIKE '%,-1,%' OR forums='') AND type = 't'");
|
} while($tool = $db->fetch_array($query)) {
| } while($tool = $db->fetch_array($query)) {
|
Zeile 532 | Zeile 532 |
---|
"); } }
|
"); } }
|
|
|
while($delayedmod = $db->fetch_array($query)) {
|
while($delayedmod = $db->fetch_array($query)) {
|
$delayedmod['dateline'] = my_date("jS M Y, {$mybb->settings['timeformat']}", $delayedmod['delaydateline']);
| $delayedmod['dateline'] = my_date('normal', $delayedmod['delaydateline'], "", 2);
|
$delayedmod['username'] = htmlspecialchars_uni($delayedmod['username']); $delayedmod['profilelink'] = build_profile_link($delayedmod['username'], $delayedmod['uid']); $delayedmod['action'] = $actions[$delayedmod['type']];
| $delayedmod['username'] = htmlspecialchars_uni($delayedmod['username']); $delayedmod['profilelink'] = build_profile_link($delayedmod['username'], $delayedmod['uid']); $delayedmod['action'] = $actions[$delayedmod['type']];
|
Zeile 580 | Zeile 580 |
---|
eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_redirect")."\";"); } }
|
eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_redirect")."\";"); } }
|
else if($delayedmod['type'] == 'merge')
| elseif($delayedmod['type'] == 'merge')
|
{ $delayedmod['subject'] = htmlspecialchars_uni($delayedmod['inputs']['subject']); $delayedmod['threadurl'] = htmlspecialchars_uni($delayedmod['inputs']['threadurl']);
| { $delayedmod['subject'] = htmlspecialchars_uni($delayedmod['inputs']['subject']); $delayedmod['threadurl'] = htmlspecialchars_uni($delayedmod['inputs']['threadurl']);
|
Zeile 619 | Zeile 619 |
---|
} if(count($tids) < 1) {
|
} if(count($tids) < 1) {
|
error($lang->error_inline_nothreadsselected);
| error($lang->error_inline_nothreadsselected, $lang->error);
|
}
$threads = $lang->sprintf($lang->threads_selected, count($tids));
| }
$threads = $lang->sprintf($lang->threads_selected, count($tids));
|
Zeile 701 | Zeile 701 |
---|
error_no_permission(); }
|
error_no_permission(); }
|
if($thread['closed'] == 1)
| if($thread['visible'] == -1) { error($lang->error_thread_deleted, $lang->error); }
if($thread['closed'] == 1)
|
{ $openclose = $lang->opened; $redirect = $lang->redirect_openthread;
| { $openclose = $lang->opened; $redirect = $lang->redirect_openthread;
|
Zeile 712 | Zeile 717 |
---|
$openclose = $lang->closed; $redirect = $lang->redirect_closethread; $moderation->close_threads($tid);
|
$openclose = $lang->closed; $redirect = $lang->redirect_closethread; $moderation->close_threads($tid);
|
}
| }
|
$lang->mod_process = $lang->sprintf($lang->mod_process, $openclose);
|
$lang->mod_process = $lang->sprintf($lang->mod_process, $openclose);
|
log_moderator_action($modlogdata, $lang->mod_process);
moderation_redirect(get_thread_link($thread['tid']), $redirect);
| log_moderator_action($modlogdata, $lang->mod_process);
moderation_redirect(get_thread_link($thread['tid']), $redirect);
|
break;
// Stick or unstick that post to the top bab!
| break;
// Stick or unstick that post to the top bab!
|
Zeile 729 | Zeile 734 |
---|
if(!is_moderator($fid, "canstickunstickthreads")) { error_no_permission();
|
if(!is_moderator($fid, "canstickunstickthreads")) { error_no_permission();
|
}
| }
if($thread['visible'] == -1) { error($lang->error_thread_deleted, $lang->error); }
|
$plugins->run_hooks("moderation_stick");
| $plugins->run_hooks("moderation_stick");
|
Zeile 756 | Zeile 766 |
---|
// Remove redirects to a specific thread case "removeredirects":
|
// Remove redirects to a specific thread case "removeredirects":
|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
| // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
if(!is_moderator($fid, "canmanagethreads")) { error_no_permission();
|
if(!is_moderator($fid, "canmanagethreads")) { error_no_permission();
|
}
$plugins->run_hooks("moderation_removeredirects");
| }
if($thread['visible'] == -1) { error($lang->error_thread_deleted, $lang->error); }
$plugins->run_hooks("moderation_removeredirects");
|
$moderation->remove_redirects($tid);
| $moderation->remove_redirects($tid);
|
Zeile 798 | Zeile 813 |
---|
verify_post_check($mybb->get_input('my_post_key'));
if(!is_moderator($fid, "candeletethreads"))
|
verify_post_check($mybb->get_input('my_post_key'));
if(!is_moderator($fid, "candeletethreads"))
|
{ 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 813 | Zeile 828 |
---|
$thread['subject'] = $db->escape_string($thread['subject']); $lang->thread_deleted = $lang->sprintf($lang->thread_deleted, $thread['subject']); log_moderator_action($modlogdata, $lang->thread_deleted);
|
$thread['subject'] = $db->escape_string($thread['subject']); $lang->thread_deleted = $lang->sprintf($lang->thread_deleted, $thread['subject']); log_moderator_action($modlogdata, $lang->thread_deleted);
|
|
|
$moderation->delete_thread($tid);
mark_reports($tid, "thread"); moderation_redirect(get_forum_link($fid), $lang->redirect_threaddeleted);
|
$moderation->delete_thread($tid);
mark_reports($tid, "thread"); moderation_redirect(get_forum_link($fid), $lang->redirect_threaddeleted);
|
break;
| break;
|
// Delete the poll from a thread confirmation page case "deletepoll":
| // Delete the poll from a thread confirmation page case "deletepoll":
|
Zeile 830 | Zeile 845 |
---|
{ error_no_permission(); }
|
{ error_no_permission(); }
|
}
| }
|
$plugins->run_hooks("moderation_deletepoll");
| $plugins->run_hooks("moderation_deletepoll");
|
Zeile 838 | Zeile 853 |
---|
$poll = $db->fetch_array($query); if(!$poll) {
|
$poll = $db->fetch_array($query); if(!$poll) {
|
error($lang->error_invalidpoll);
| error($lang->error_invalidpoll, $lang->error);
|
}
eval("\$deletepoll = \"".$templates->get("moderation_deletepoll")."\";");
| }
eval("\$deletepoll = \"".$templates->get("moderation_deletepoll")."\";");
|
Zeile 846 | Zeile 861 |
---|
break;
// Delete the actual poll here!
|
break;
// Delete the actual poll here!
|
case "do_deletepoll":
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
if(!isset($mybb->input['delete'])) {
| case "do_deletepoll":
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
if($thread['visible'] == -1) { error($lang->error_thread_deleted, $lang->error); }
if(!isset($mybb->input['delete'])) {
|
error($lang->redirect_pollnotdeleted); } if(!is_moderator($fid, "canmanagepolls"))
|
error($lang->redirect_pollnotdeleted); } if(!is_moderator($fid, "canmanagepolls"))
|
{
| {
|
if($permissions['candeletethreads'] != 1 || $mybb->user['uid'] != $thread['uid']) { error_no_permission(); }
|
if($permissions['candeletethreads'] != 1 || $mybb->user['uid'] != $thread['uid']) { error_no_permission(); }
|
}
| }
|
$query = $db->simple_select("polls", "pid", "tid = $tid"); $poll = $db->fetch_array($query); if(!$poll)
|
$query = $db->simple_select("polls", "pid", "tid = $tid"); $poll = $db->fetch_array($query); if(!$poll)
|
{ error($lang->error_invalidpoll); }
| { error($lang->error_invalidpoll, $lang->error); }
|
$plugins->run_hooks("moderation_do_deletepoll");
| $plugins->run_hooks("moderation_do_deletepoll");
|
Zeile 881 | Zeile 901 |
---|
// Approve a thread case "approvethread":
|
// Approve a thread case "approvethread":
|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
if(!is_moderator($fid, "canapproveunapprovethreads")) { error_no_permission(); } $thread = get_thread($tid);
$plugins->run_hooks("moderation_approvethread");
| // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
if(!is_moderator($fid, "canapproveunapprovethreads")) { error_no_permission(); }
if($thread['visible'] == -1) { error($lang->error_thread_deleted, $lang->error); }
$thread = get_thread($tid);
$plugins->run_hooks("moderation_approvethread");
|
$lang->thread_approved = $lang->sprintf($lang->thread_approved, $thread['subject']); log_moderator_action($modlogdata, $lang->thread_approved);
|
$lang->thread_approved = $lang->sprintf($lang->thread_approved, $thread['subject']); log_moderator_action($modlogdata, $lang->thread_approved);
|
$moderation->approve_threads($tid, $fid);
| $moderation->approve_threads($tid, $fid);
|
moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_threadapproved); break;
| moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_threadapproved); break;
|
Zeile 906 | Zeile 932 |
---|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
|
|
if(!is_moderator($fid, "canapproveunapprovethreads"))
|
if(!is_moderator($fid, "canapproveunapprovethreads"))
|
{
| {
|
error_no_permission(); }
|
error_no_permission(); }
|
| if($thread['visible'] == -1) { error($lang->error_thread_deleted, $lang->error); }
|
$thread = get_thread($tid);
$plugins->run_hooks("moderation_unapprovethread");
| $thread = get_thread($tid);
$plugins->run_hooks("moderation_unapprovethread");
|
Zeile 973 | Zeile 1005 |
---|
if(!is_moderator($fid, "canmanagethreads")) { error_no_permission();
|
if(!is_moderator($fid, "canmanagethreads")) { error_no_permission();
|
| }
if($thread['visible'] == -1) { error($lang->error_thread_deleted, $lang->error);
|
}
$plugins->run_hooks("moderation_move");
| }
$plugins->run_hooks("moderation_move");
|
Zeile 980 | Zeile 1017 |
---|
$forumselect = build_forum_jump("", '', 1, '', 0, true, '', "moveto"); eval("\$movethread = \"".$templates->get("moderation_move")."\";"); output_page($movethread);
|
$forumselect = build_forum_jump("", '', 1, '', 0, true, '', "moveto"); eval("\$movethread = \"".$templates->get("moderation_move")."\";"); output_page($movethread);
|
break;
| break;
|
// Let's get this thing moving! case "do_move":
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
// Let's get this thing moving! case "do_move":
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
|
|
$moveto = $mybb->get_input('moveto', MyBB::INPUT_INT); $method = $mybb->get_input('method');
if(!is_moderator($fid, "canmanagethreads"))
|
$moveto = $mybb->get_input('moveto', MyBB::INPUT_INT); $method = $mybb->get_input('method');
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"))
| if($thread['visible'] == -1)
|
{
|
{
|
error($lang->error_movetononmodforum);
| error($lang->error_thread_deleted, $lang->error);
|
}
|
}
|
| $newperms = forum_permissions($moveto); if($newperms['canview'] == 0 && !is_moderator($fid, "canmovetononmodforum")) { error($lang->error_movetononmodforum, $lang->error); }
|
$newforum = get_forum($moveto); if(!$newforum || $newforum['type'] != "f" || $newforum['type'] == "f" && $newforum['linkto'] != '') {
|
$newforum = get_forum($moveto); if(!$newforum || $newforum['type'] != "f" || $newforum['type'] == "f" && $newforum['linkto'] != '') {
|
error($lang->error_invalidforum);
| error($lang->error_invalidforum, $lang->error);
|
} if($method != "copy" && $thread['fid'] == $moveto)
|
} if($method != "copy" && $thread['fid'] == $moveto)
|
{ error($lang->error_movetosameforum);
| { error($lang->error_movetosameforum, $lang->error);
|
}
$plugins->run_hooks('moderation_do_move');
| }
$plugins->run_hooks('moderation_do_move');
|
Zeile 1029 | Zeile 1073 |
---|
$newtid = $moderation->move_thread($tid, $moveto, $method, $expire);
switch($method)
|
$newtid = $moderation->move_thread($tid, $moveto, $method, $expire);
switch($method)
|
{
| {
|
case "copy": log_moderator_action($modlogdata, $lang->thread_copied); break;
| case "copy": log_moderator_action($modlogdata, $lang->thread_copied); break;
|
Zeile 1046 | Zeile 1090 |
---|
// Viewing thread notes case "viewthreadnotes": if(!is_moderator($fid))
|
// Viewing thread notes case "viewthreadnotes": if(!is_moderator($fid))
|
{
| {
|
error_no_permission(); }
// Make sure we are looking at a real thread here. if(!$thread) {
|
error_no_permission(); }
// Make sure we are looking at a real thread here. if(!$thread) {
|
error($lang->error_nomember);
| error($lang->error_nomember, $lang->error);
|
}
$plugins->run_hooks('moderation_viewthreadnotes');
| }
$plugins->run_hooks('moderation_viewthreadnotes');
|
Zeile 1074 | Zeile 1118 |
---|
error_no_permission(); } $thread['notes'] = htmlspecialchars_uni($parser->parse_badwords($thread['notes']));
|
error_no_permission(); } $thread['notes'] = htmlspecialchars_uni($parser->parse_badwords($thread['notes']));
|
$trow = alt_trow(1);
| $trow = alt_trow(1);
|
if(is_moderator($fid, "canviewmodlog")) {
| if(is_moderator($fid, "canviewmodlog")) {
|
Zeile 1092 | Zeile 1136 |
---|
$modactions = ''; while($modaction = $db->fetch_array($query)) {
|
$modactions = ''; while($modaction = $db->fetch_array($query)) {
|
$modaction['dateline'] = my_date("jS M Y, G:i", $modaction['dateline']);
| $modaction['dateline'] = my_date('relative', $modaction['dateline']);
|
$modaction['username'] = htmlspecialchars_uni($modaction['username']); $modaction['profilelink'] = build_profile_link($modaction['username'], $modaction['uid']); $modaction['action'] = htmlspecialchars_uni($modaction['action']);
| $modaction['username'] = htmlspecialchars_uni($modaction['username']); $modaction['profilelink'] = build_profile_link($modaction['username'], $modaction['uid']); $modaction['action'] = htmlspecialchars_uni($modaction['action']);
|
Zeile 1108 | Zeile 1152 |
---|
$modaction['fname'] = htmlspecialchars_uni($modaction['fname']); $modaction['forumlink'] = get_forum_link($modaction['fid']); eval("\$info .= \"".$templates->get("moderation_threadnotes_modaction_forum")."\";");
|
$modaction['fname'] = htmlspecialchars_uni($modaction['fname']); $modaction['forumlink'] = get_forum_link($modaction['fid']); eval("\$info .= \"".$templates->get("moderation_threadnotes_modaction_forum")."\";");
|
}
| }
|
if($modaction['psubject']) {
| if($modaction['psubject']) {
|
Zeile 1119 | Zeile 1163 |
---|
eval("\$modactions .= \"".$templates->get("moderation_threadnotes_modaction")."\";"); $trow = alt_trow();
|
eval("\$modactions .= \"".$templates->get("moderation_threadnotes_modaction")."\";"); $trow = alt_trow();
|
}
| }
|
if(!$modactions) { eval("\$modactions = \"".$templates->get("moderation_threadnotes_modaction_error")."\";"); }
|
if(!$modactions) { eval("\$modactions = \"".$templates->get("moderation_threadnotes_modaction_error")."\";"); }
|
}
| }
|
$actions = array( 'openclosethread' => $lang->open_close_thread, 'deletethread' => $lang->delete_thread,
| $actions = array( 'openclosethread' => $lang->open_close_thread, 'deletethread' => $lang->delete_thread,
|
Zeile 1136 | Zeile 1180 |
---|
'removesubscriptions' => $lang->remove_subscriptions, 'approveunapprovethread' => $lang->approve_unapprove_thread );
|
'removesubscriptions' => $lang->remove_subscriptions, 'approveunapprovethread' => $lang->approve_unapprove_thread );
|
|
|
switch($db->type) { case "pgsql":
| switch($db->type) { case "pgsql":
|
Zeile 1164 | Zeile 1208 |
---|
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=d.uid) LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=d.fid) WHERE ','||d.tids||',' LIKE '%,{$tid},%'
|
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=d.uid) LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=d.fid) WHERE ','||d.tids||',' LIKE '%,{$tid},%'
|
ORDER BY d.dateline DESC
| ORDER BY d.dateline DESC
|
LIMIT 0, 20 "); break;
| LIMIT 0, 20 "); break;
|
Zeile 1182 | Zeile 1226 |
---|
$delayedmods = ''; while($delayedmod = $db->fetch_array($query)) {
|
$delayedmods = ''; while($delayedmod = $db->fetch_array($query)) {
|
$delayedmod['dateline'] = my_date("jS M Y, G:i", $delayedmod['delaydateline']);
| $delayedmod['dateline'] = my_date('normal', $delayedmod['delaydateline'], "", 2);
|
$delayedmod['username'] = htmlspecialchars_uni($delayedmod['username']); $delayedmod['profilelink'] = build_profile_link($delayedmod['username'], $delayedmod['uid']); $delayedmod['action'] = $actions[$delayedmod['type']];
| $delayedmod['username'] = htmlspecialchars_uni($delayedmod['username']); $delayedmod['profilelink'] = build_profile_link($delayedmod['username'], $delayedmod['uid']); $delayedmod['action'] = $actions[$delayedmod['type']];
|
Zeile 1226 | Zeile 1270 |
---|
eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_redirect")."\";"); } }
|
eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_redirect")."\";"); } }
|
else if($delayedmod['type'] == 'merge')
| elseif($delayedmod['type'] == 'merge')
|
{ $delayedmod['subject'] = htmlspecialchars_uni($delayedmod['inputs']['subject']); $delayedmod['threadurl'] = htmlspecialchars_uni($delayedmod['inputs']['threadurl']);
| { $delayedmod['subject'] = htmlspecialchars_uni($delayedmod['inputs']['subject']); $delayedmod['threadurl'] = htmlspecialchars_uni($delayedmod['inputs']['threadurl']);
|
Zeile 1250 | Zeile 1294 |
---|
// Update the thread notes! case "do_threadnotes":
|
// Update the thread notes! case "do_threadnotes":
|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
if(!is_moderator($fid, "canmanagethreads"))
| // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
if(!is_moderator($fid, "canmanagethreads"))
|
{ error_no_permission(); }
| { error_no_permission(); }
|
Zeile 1314 | Zeile 1358 |
---|
case "getpmip": if($pmid <= 0) {
|
case "getpmip": if($pmid <= 0) {
|
error($lang->error_invalidpm);
| error($lang->error_invalidpm, $lang->error);
|
} add_breadcrumb($lang->nav_pms, "private.php"); $pm['subject'] = htmlspecialchars_uni($parser->parse_badwords($pm['subject']));
| } add_breadcrumb($lang->nav_pms, "private.php"); $pm['subject'] = htmlspecialchars_uni($parser->parse_badwords($pm['subject']));
|
Zeile 1341 | Zeile 1385 |
---|
{ $ipaddress = $pm['ipaddress']; eval("\$modoptions = \"".$templates->get("moderation_getip_modoptions")."\";");
|
{ $ipaddress = $pm['ipaddress']; eval("\$modoptions = \"".$templates->get("moderation_getip_modoptions")."\";");
|
}
$plugins->run_hooks('moderation_getpmip');
| }
$plugins->run_hooks('moderation_getpmip');
|
if($modal) { eval("\$getpmip = \"".$templates->get("moderation_getpmip_modal", 1, 0)."\";");
| if($modal) { eval("\$getpmip = \"".$templates->get("moderation_getpmip_modal", 1, 0)."\";");
|
Zeile 1361 | Zeile 1405 |
---|
// Merge threads case "merge": add_breadcrumb($lang->nav_merge);
|
// Merge threads case "merge": add_breadcrumb($lang->nav_merge);
|
if(!is_moderator($fid, "canmanagethreads")) { error_no_permission(); }
$plugins->run_hooks("moderation_merge");
| if(!is_moderator($fid, "canmanagethreads")) { error_no_permission(); }
if($thread['visible'] == -1) { error($lang->error_thread_deleted, $lang->error); }
$plugins->run_hooks("moderation_merge");
|
eval("\$merge = \"".$templates->get("moderation_merge")."\";"); output_page($merge); break;
|
eval("\$merge = \"".$templates->get("moderation_merge")."\";"); output_page($merge); break;
|
|
|
// Let's get those threads together baby! (Merge threads) case "do_merge":
| // Let's get those threads together baby! (Merge threads) case "do_merge":
|
Zeile 1381 | Zeile 1430 |
---|
if(!is_moderator($fid, "canmanagethreads")) { error_no_permission();
|
if(!is_moderator($fid, "canmanagethreads")) { error_no_permission();
|
| }
if($thread['visible'] == -1) { error($lang->error_thread_deleted, $lang->error);
|
}
$plugins->run_hooks("moderation_do_merge");
| }
$plugins->run_hooks("moderation_do_merge");
|
Zeile 1433 | Zeile 1487 |
---|
$mergetid = (int)$post['tid']; } elseif(!empty($parameters['tid']))
|
$mergetid = (int)$post['tid']; } elseif(!empty($parameters['tid']))
|
{
| {
|
$mergetid = (int)$parameters['tid']; } else
| $mergetid = (int)$parameters['tid']; } else
|
Zeile 1442 | Zeile 1496 |
---|
} $mergethread = get_thread($mergetid); if(!$mergethread)
|
} $mergethread = get_thread($mergetid); if(!$mergethread)
|
{ error($lang->error_badmergeurl); }
| { error($lang->error_badmergeurl, $lang->error); }
|
if($mergetid == $tid) { // sanity check
|
if($mergetid == $tid) { // sanity check
|
error($lang->error_mergewithself);
| error($lang->error_mergewithself, $lang->error);
|
} if(!is_moderator($mergethread['fid'], "canmanagethreads"))
|
} if(!is_moderator($mergethread['fid'], "canmanagethreads"))
|
{
| {
|
error_no_permission(); } if(isset($mybb->input['subject']))
| error_no_permission(); } if(isset($mybb->input['subject']))
|
Zeile 1460 | Zeile 1514 |
---|
else { $subject = $thread['subject'];
|
else { $subject = $thread['subject'];
|
}
| }
|
$moderation->merge_threads($mergetid, $tid, $subject);
log_moderator_action($modlogdata, $lang->thread_merged);
|
$moderation->merge_threads($mergetid, $tid, $subject);
log_moderator_action($modlogdata, $lang->thread_merged);
|
|
|
moderation_redirect(get_thread_link($tid), $lang->redirect_threadsmerged); break;
| moderation_redirect(get_thread_link($tid), $lang->redirect_threadsmerged); break;
|
Zeile 1476 | Zeile 1530 |
---|
{ error_no_permission(); }
|
{ error_no_permission(); }
|
| if($thread['visible'] == -1) { error($lang->error_thread_deleted, $lang->error); }
|
$query = $db->query(" SELECT p.*, u.* FROM ".TABLE_PREFIX."posts p
| $query = $db->query(" SELECT p.*, u.* FROM ".TABLE_PREFIX."posts p
|
Zeile 1483 | Zeile 1543 |
---|
WHERE tid='$tid' ORDER BY dateline ASC ");
|
WHERE tid='$tid' ORDER BY dateline ASC ");
|
|
|
$numposts = $db->num_rows($query); if($numposts <= 1) {
|
$numposts = $db->num_rows($query); if($numposts <= 1) {
|
error($lang->error_cantsplitonepost);
| error($lang->error_cantsplitonepost, $lang->error);
|
}
$altbg = "trow1";
| }
$altbg = "trow1";
|
Zeile 1525 | Zeile 1586 |
---|
// Let's break them up buddy! (Do the split) case "do_split":
|
// Let's break them up buddy! (Do the split) case "do_split":
|
|
|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
if(!is_moderator($fid, "canmanagethreads")) { error_no_permission();
|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
if(!is_moderator($fid, "canmanagethreads")) { error_no_permission();
|
| }
if($thread['visible'] == -1) { error($lang->error_thread_deleted, $lang->error);
|
}
$plugins->run_hooks("moderation_do_split");
| }
$plugins->run_hooks("moderation_do_split");
|
Zeile 1539 | Zeile 1605 |
---|
$mybb->input['splitpost'] = $mybb->get_input('splitpost', MyBB::INPUT_ARRAY); if(empty($mybb->input['splitpost'])) {
|
$mybb->input['splitpost'] = $mybb->get_input('splitpost', MyBB::INPUT_ARRAY); if(empty($mybb->input['splitpost'])) {
|
error($lang->error_nosplitposts);
| error($lang->error_nosplitposts, $lang->error);
|
} $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);
|
|
|
if($count['totalposts'] == 1) {
|
if($count['totalposts'] == 1) {
|
error($lang->error_cantsplitonepost);
| error($lang->error_cantsplitonepost, $lang->error);
|
}
if($count['totalposts'] == count($mybb->input['splitpost']))
|
}
if($count['totalposts'] == count($mybb->input['splitpost']))
|
{ error($lang->error_cantsplitall);
| { error($lang->error_cantsplitall, $lang->error);
|
}
if(!empty($mybb->input['moveto'])) { $moveto = $mybb->get_input('moveto', MyBB::INPUT_INT);
|
}
if(!empty($mybb->input['moveto'])) { $moveto = $mybb->get_input('moveto', MyBB::INPUT_INT);
|
}
| }
|
else { $moveto = $fid;
|
else { $moveto = $fid;
|
}
| }
|
$newforum = get_forum($moveto); if(!$newforum || $newforum['type'] != "f" || $newforum['type'] == "f" && $newforum['linkto'] != '') {
|
$newforum = get_forum($moveto); if(!$newforum || $newforum['type'] != "f" || $newforum['type'] == "f" && $newforum['linkto'] != '') {
|
error($lang->error_invalidforum);
| error($lang->error_invalidforum, $lang->error);
|
}
$pids = array();
| }
$pids = array();
|
Zeile 1574 | Zeile 1640 |
---|
// 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(isset($mybb->input['splitpost'][$post['pid']]) && $mybb->input['splitpost'][$post['pid']] == 1) { $pids[] = $post['pid']; } mark_reports($post['pid'], "post");
|
if(isset($mybb->input['splitpost'][$post['pid']]) && $mybb->input['splitpost'][$post['pid']] == 1) { $pids[] = $post['pid']; } mark_reports($post['pid'], "post");
|
}
| }
|
$newtid = $moderation->split_posts($pids, $tid, $moveto, $mybb->get_input('newsubject'));
log_moderator_action($modlogdata, $lang->thread_split);
|
$newtid = $moderation->split_posts($pids, $tid, $moveto, $mybb->get_input('newsubject'));
log_moderator_action($modlogdata, $lang->thread_split);
|
|
|
moderation_redirect(get_thread_link($newtid), $lang->redirect_threadsplit); break;
// Delete Thread Subscriptions case "removesubscriptions":
|
moderation_redirect(get_thread_link($newtid), $lang->redirect_threadsplit); break;
// Delete Thread Subscriptions case "removesubscriptions":
|
|
|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
if(!is_moderator($fid, "canmanagethreads"))
|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
if(!is_moderator($fid, "canmanagethreads"))
|
{
| {
|
error_no_permission();
|
error_no_permission();
|
| }
if($thread['visible'] == -1) { error($lang->error_thread_deleted, $lang->error);
|
}
$plugins->run_hooks("moderation_removesubscriptions");
| }
$plugins->run_hooks("moderation_removesubscriptions");
|
Zeile 1618 | Zeile 1689 |
---|
// From search page $threads = getids($mybb->get_input('searchid'), 'search'); if(!is_moderator_by_tids($threads, 'candeletethreads'))
|
// From search page $threads = getids($mybb->get_input('searchid'), 'search'); if(!is_moderator_by_tids($threads, 'candeletethreads'))
|
{
| {
|
error_no_permission(); } }
| error_no_permission(); } }
|
Zeile 1632 | Zeile 1703 |
---|
} if(count($threads) < 1) {
|
} if(count($threads) < 1) {
|
error($lang->error_inline_nothreadsselected);
| error($lang->error_inline_nothreadsselected, $lang->error);
|
}
$inlineids = implode("|", $threads);
| }
$inlineids = implode("|", $threads);
|
Zeile 1680 | Zeile 1751 |
---|
break;
// Open threads - Inline moderation
|
break;
// Open threads - Inline moderation
|
case "multiopenthreads":
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
if(!empty($mybb->input['searchid'])) { // From search page $threads = getids($mybb->get_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); }
$moderation->open_threads($threads);
| case "multiopenthreads":
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
if(!empty($mybb->input['searchid'])) { // From search page $threads = getids($mybb->get_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, $lang->error); }
$moderation->open_threads($threads);
|
log_moderator_action($modlogdata, $lang->multi_opened_threads); if($mybb->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
|
log_moderator_action($modlogdata, $lang->multi_opened_threads); if($mybb->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
|
}
| }
|
else { clearinline($fid, 'forum');
| else { clearinline($fid, 'forum');
|
Zeile 1733 | Zeile 1804 |
---|
// From search page $threads = getids($mybb->get_input('searchid'), 'search'); if(!is_moderator_by_tids($threads, 'canopenclosethreads'))
|
// From search page $threads = getids($mybb->get_input('searchid'), 'search'); if(!is_moderator_by_tids($threads, 'canopenclosethreads'))
|
{ error_no_permission(); } }
| { error_no_permission(); } }
|
else { $threads = getids($fid, 'forum');
| else { $threads = getids($fid, 'forum');
|
Zeile 1747 | Zeile 1818 |
---|
} if(count($threads) < 1) {
|
} if(count($threads) < 1) {
|
error($lang->error_inline_nothreadsselected);
| error($lang->error_inline_nothreadsselected, $lang->error);
|
}
$moderation->close_threads($threads);
log_moderator_action($modlogdata, $lang->multi_closed_threads);
|
}
$moderation->close_threads($threads);
log_moderator_action($modlogdata, $lang->multi_closed_threads);
|
if($mybb->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search'); } else {
| if($mybb->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search'); } else {
|
clearinline($fid, 'forum'); } moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsclosed); break;
|
clearinline($fid, 'forum'); } moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsclosed); break;
|
|
|
// Approve threads - Inline moderation case "multiapprovethreads":
| // Approve threads - Inline moderation case "multiapprovethreads":
|
Zeile 1775 | Zeile 1846 |
---|
// From search page $threads = getids($mybb->get_input('searchid'), 'search'); if(!is_moderator_by_tids($threads, 'canapproveunapprovethreads'))
|
// From search page $threads = getids($mybb->get_input('searchid'), 'search'); if(!is_moderator_by_tids($threads, 'canapproveunapprovethreads'))
|
{ error_no_permission(); } }
| { error_no_permission(); } }
|
else { $threads = getids($fid, 'forum');
| else { $threads = getids($fid, 'forum');
|
Zeile 1788 | Zeile 1859 |
---|
} } if(count($threads) < 1)
|
} } if(count($threads) < 1)
|
{ error($lang->error_inline_nothreadsselected); }
| { error($lang->error_inline_nothreadsselected, $lang->error); }
|
$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->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search'); } else {
| if($mybb->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search'); } else {
|
clearinline($fid, 'forum'); } $cache->update_stats();
| clearinline($fid, 'forum'); } $cache->update_stats();
|
Zeile 1818 | Zeile 1889 |
---|
// From search page $threads = getids($mybb->get_input('searchid'), 'search'); if(!is_moderator_by_tids($threads, 'canapproveunapprovethreads'))
|
// From search page $threads = getids($mybb->get_input('searchid'), 'search'); if(!is_moderator_by_tids($threads, 'canapproveunapprovethreads'))
|
{ error_no_permission(); } }
| { error_no_permission(); } }
|
else { $threads = getids($fid, 'forum');
| else { $threads = getids($fid, 'forum');
|
Zeile 1831 | Zeile 1902 |
---|
} } if(count($threads) < 1)
|
} } if(count($threads) < 1)
|
{ error($lang->error_inline_nothreadsselected); }
| { error($lang->error_inline_nothreadsselected, $lang->error); }
|
$moderation->unapprove_threads($threads, $fid);
log_moderator_action($modlogdata, $lang->multi_unapproved_threads);
|
$moderation->unapprove_threads($threads, $fid);
log_moderator_action($modlogdata, $lang->multi_unapproved_threads);
|
if($mybb->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search'); } else {
| if($mybb->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search'); } else {
|
clearinline($fid, 'forum'); } $cache->update_stats();
| clearinline($fid, 'forum'); } $cache->update_stats();
|
Zeile 1861 | Zeile 1932 |
---|
// From search page $threads = getids($mybb->get_input('searchid'), 'search'); if(!is_moderator_by_tids($threads, 'canrestorethreads'))
|
// From search page $threads = getids($mybb->get_input('searchid'), 'search'); if(!is_moderator_by_tids($threads, 'canrestorethreads'))
|
{ error_no_permission(); } }
| { error_no_permission(); } }
|
else { $threads = getids($fid, 'forum');
| else { $threads = getids($fid, 'forum');
|
Zeile 1874 | Zeile 1945 |
---|
} } if(count($threads) < 1)
|
} } if(count($threads) < 1)
|
{ error($lang->error_inline_nothreadsselected); }
| { error($lang->error_inline_nothreadsselected, $lang->error); }
|
$moderation->restore_threads($threads);
log_moderator_action($modlogdata, $lang->multi_restored_threads);
|
$moderation->restore_threads($threads);
log_moderator_action($modlogdata, $lang->multi_restored_threads);
|
if($mybb->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search'); } else { clearinline($fid, 'forum'); }
| if($mybb->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search'); } else { clearinline($fid, 'forum'); }
|
$cache->update_stats(); moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsrestored); break;
| $cache->update_stats(); moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsrestored); break;
|
Zeile 1918 | Zeile 1989 |
---|
} if(count($threads) < 1) {
|
} if(count($threads) < 1) {
|
error($lang->error_inline_nothreadsselected);
| error($lang->error_inline_nothreadsselected, $lang->error);
|
}
$moderation->soft_delete_threads($threads);
| }
$moderation->soft_delete_threads($threads);
|
Zeile 1961 | Zeile 2032 |
---|
} if(count($threads) < 1) {
|
} if(count($threads) < 1) {
|
error($lang->error_inline_nothreadsselected);
| error($lang->error_inline_nothreadsselected, $lang->error);
|
}
$moderation->stick_threads($threads);
| }
$moderation->stick_threads($threads);
|
Zeile 1979 | Zeile 2050 |
---|
break;
// Unstick threads - Inline moderaton
|
break;
// Unstick threads - Inline moderaton
|
case "multiunstickthreads":
// Verify incoming POST request
| case "multiunstickthreads":
// Verify incoming POST request
|
verify_post_check($mybb->get_input('my_post_key'));
if(!empty($mybb->input['searchid']))
| verify_post_check($mybb->get_input('my_post_key'));
if(!empty($mybb->input['searchid']))
|
Zeile 1989 | Zeile 2060 |
---|
// From search page $threads = getids($mybb->get_input('searchid'), 'search'); if(!is_moderator_by_tids($threads, 'canstickunstickthreads'))
|
// From search page $threads = getids($mybb->get_input('searchid'), 'search'); if(!is_moderator_by_tids($threads, 'canstickunstickthreads'))
|
{ error_no_permission(); }
| { error_no_permission(); }
|
} else {
| } else {
|
Zeile 2003 | Zeile 2074 |
---|
} if(count($threads) < 1) {
|
} if(count($threads) < 1) {
|
error($lang->error_inline_nothreadsselected);
| error($lang->error_inline_nothreadsselected, $lang->error);
|
}
$moderation->unstick_threads($threads);
| }
$moderation->unstick_threads($threads);
|
Zeile 2012 | Zeile 2083 |
---|
if($mybb->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
|
if($mybb->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
|
}
| }
|
else { clearinline($fid, 'forum');
| else { clearinline($fid, 'forum');
|
Zeile 2022 | Zeile 2093 |
---|
// Move threads - Inline moderation case "multimovethreads":
|
// Move threads - Inline moderation case "multimovethreads":
|
add_breadcrumb($lang->nav_multi_movethreads);
| add_breadcrumb($lang->nav_multi_movethreads);
|
if(!empty($mybb->input['searchid'])) { // From search page $threads = getids($mybb->get_input('searchid'), 'search'); if(!is_moderator_by_tids($threads, 'canmanagethreads'))
|
if(!empty($mybb->input['searchid'])) { // From search page $threads = getids($mybb->get_input('searchid'), 'search'); if(!is_moderator_by_tids($threads, 'canmanagethreads'))
|
{ error_no_permission(); }
| { error_no_permission(); }
|
} else {
| } else {
|
Zeile 2040 | Zeile 2111 |
---|
{ error_no_permission(); }
|
{ error_no_permission(); }
|
}
| }
|
if(count($threads) < 1) {
|
if(count($threads) < 1) {
|
error($lang->error_inline_nothreadsselected);
| error($lang->error_inline_nothreadsselected, $lang->error);
|
} $inlineids = implode("|", $threads); if($mybb->get_input('inlinetype') == 'search')
| } $inlineids = implode("|", $threads); if($mybb->get_input('inlinetype') == 'search')
|
Zeile 2063 | Zeile 2134 |
---|
// 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->get_input('my_post_key'));
| // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
$moveto = $mybb->get_input('moveto', MyBB::INPUT_INT);
|
$moveto = $mybb->get_input('moveto', MyBB::INPUT_INT);
|
| $method = $mybb->get_input('method');
|
$threadlist = explode("|", $mybb->get_input('threads')); if(!is_moderator_by_tids($threadlist, 'canmanagethreads')) {
| $threadlist = explode("|", $mybb->get_input('threads')); if(!is_moderator_by_tids($threadlist, 'canmanagethreads')) {
|
Zeile 2081 | Zeile 2154 |
---|
$newperms = forum_permissions($moveto); if(($newperms['canview'] == 0 || !is_moderator($moveto, 'canmanagethreads')) && !is_moderator_by_tids($tids, 'canmovetononmodforum')) {
|
$newperms = forum_permissions($moveto); if(($newperms['canview'] == 0 || !is_moderator($moveto, 'canmanagethreads')) && !is_moderator_by_tids($tids, 'canmovetononmodforum')) {
|
error($lang->error_movetononmodforum);
| error($lang->error_movetononmodforum, $lang->error);
|
}
$newforum = get_forum($moveto); if(!$newforum || $newforum['type'] != "f" || $newforum['type'] == "f" && $newforum['linkto'] != '')
|
}
$newforum = get_forum($moveto); if(!$newforum || $newforum['type'] != "f" || $newforum['type'] == "f" && $newforum['linkto'] != '')
|
{ error($lang->error_invalidforum); }
$moderation->move_threads($tids, $moveto);
| { error($lang->error_invalidforum, $lang->error); }
$plugins->run_hooks('moderation_do_multimovethreads');
|
log_moderator_action($modlogdata, $lang->multi_moved_threads);
|
log_moderator_action($modlogdata, $lang->multi_moved_threads);
|
| $expire = 0; if($mybb->get_input('redirect_expire', MyBB::INPUT_INT) > 0) { $expire = TIME_NOW + ($mybb->get_input('redirect_expire', MyBB::INPUT_INT) * 86400); }
foreach($tids as $tid) { $moderation->move_thread($tid, $moveto, $method, $expire); }
|
moderation_redirect(get_forum_link($moveto), $lang->redirect_inline_threadsmoved); break;
| moderation_redirect(get_forum_link($moveto), $lang->redirect_inline_threadsmoved); break;
|
Zeile 2100 | Zeile 2182 |
---|
// 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->get_input('inlinetype') == 'search') { $posts = getids($mybb->get_input('searchid'), 'search');
| if($mybb->get_input('inlinetype') == 'search') { $posts = getids($mybb->get_input('searchid'), 'search');
|
} else { $posts = getids($tid, 'thread');
|
} else { $posts = getids($tid, 'thread');
|
}
| }
|
if(count($posts) < 1) {
|
if(count($posts) < 1) {
|
error($lang->error_inline_nopostsselected);
| error($lang->error_inline_nopostsselected, $lang->error);
|
} if(!is_moderator_by_pids($posts, "candeleteposts"))
|
} if(!is_moderator_by_pids($posts, "candeleteposts"))
|
{
| {
|
error_no_permission(); } $inlineids = implode("|", $posts);
| error_no_permission(); } $inlineids = implode("|", $posts);
|
Zeile 2126 | Zeile 2208 |
---|
else { clearinline($tid, 'thread');
|
else { clearinline($tid, 'thread');
|
}
| }
|
$return_url = htmlspecialchars_uni($mybb->get_input('url'));
| $return_url = htmlspecialchars_uni($mybb->get_input('url'));
|
Zeile 2147 | Zeile 2229 |
---|
} $postlist = array_map('intval', $postlist); $pids = implode(',', $postlist);
|
} $postlist = array_map('intval', $postlist); $pids = implode(',', $postlist);
|
|
|
$tids = array(); if($pids) {
| $tids = array(); if($pids) {
|
Zeile 2235 | Zeile 2317 |
---|
if(empty($posts)) {
|
if(empty($posts)) {
|
error($lang->error_inline_nopostsselected);
| error($lang->error_inline_nopostsselected, $lang->error);
|
}
if(!is_moderator_by_pids($posts, "canmanagethreads"))
| }
if(!is_moderator_by_pids($posts, "canmanagethreads"))
|
Zeile 2299 | Zeile 2381 |
---|
$mergepost = $mybb->get_input('mergepost', MyBB::INPUT_ARRAY); if(count($mergepost) <= 1) {
|
$mergepost = $mybb->get_input('mergepost', MyBB::INPUT_ARRAY); if(count($mergepost) <= 1) {
|
error($lang->error_nomergeposts);
| error($lang->error_nomergeposts, $lang->error);
|
}
foreach($mergepost as $pid => $yes)
| }
foreach($mergepost as $pid => $yes)
|
Zeile 2322 | Zeile 2404 |
---|
// Split posts - Inline moderation case "multisplitposts": add_breadcrumb($lang->nav_multi_splitposts);
|
// Split posts - Inline moderation case "multisplitposts": add_breadcrumb($lang->nav_multi_splitposts);
|
if($mybb->get_input('inlinetype') == 'search') { $posts = getids($mybb->get_input('searchid'), 'search'); } else { $posts = getids($tid, 'thread'); }
if(count($posts) < 1) { error($lang->error_inline_nopostsselected); }
if(!is_moderator_by_pids($posts, "canmanagethreads")) { error_no_permission(); } $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("
| if($mybb->get_input('inlinetype') == 'search') { $posts = getids($mybb->get_input('searchid'), 'search'); } else { $posts = getids($tid, 'thread'); }
if(count($posts) < 1) { error($lang->error_inline_nopostsselected, $lang->error); }
if(!is_moderator_by_pids($posts, "canmanagethreads")) { error_no_permission(); } $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 FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."posts q ON (p.tid=q.tid)
| SELECT DISTINCT p.tid, COUNT(q.pid) as count FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."posts q ON (p.tid=q.tid)
|
Zeile 2358 | Zeile 2440 |
---|
{ if((int)$tcheck['count'] <= 1) {
|
{ if((int)$tcheck['count'] <= 1) {
|
error($lang->error_cantsplitonepost);
| error($lang->error_cantsplitonepost, $lang->error);
|
} $threads[] = $pcheck[] = $tcheck['tid']; // Save tids for below }
| } $threads[] = $pcheck[] = $tcheck['tid']; // Save tids for below }
|
Zeile 2383 | Zeile 2465 |
---|
if(count($pcheck2) != count($pcheck)) { // One or more threads do not have posts after splitting
|
if(count($pcheck2) != count($pcheck)) { // One or more threads do not have posts after splitting
|
error($lang->error_cantsplitall);
| error($lang->error_cantsplitall, $lang->error);
|
}
$inlineids = implode("|", $posts);
| }
$inlineids = implode("|", $posts);
|
Zeile 2435 | Zeile 2517 |
---|
if(empty($posts)) {
|
if(empty($posts)) {
|
error($lang->error_inline_nopostsselected);
| error($lang->error_inline_nopostsselected, $lang->error);
|
}
$pidin = implode(',', $posts);
| }
$pidin = implode(',', $posts);
|
Zeile 2454 | Zeile 2536 |
---|
{ if((int)$tcheck['count'] <= 1) {
|
{ if((int)$tcheck['count'] <= 1) {
|
error($lang->error_cantsplitonepost);
| error($lang->error_cantsplitonepost, $lang->error);
|
} $pcheck[] = $tcheck['tid']; // Save tids for below }
| } $pcheck[] = $tcheck['tid']; // Save tids for below }
|
Zeile 2479 | Zeile 2561 |
---|
if(count($pcheck2) != count($pcheck)) { // One or more threads do not have posts after splitting
|
if(count($pcheck2) != count($pcheck)) { // One or more threads do not have posts after splitting
|
error($lang->error_cantsplitall);
| error($lang->error_cantsplitall, $lang->error);
|
}
if(isset($mybb->input['moveto']))
| }
if(isset($mybb->input['moveto']))
|
Zeile 2494 | Zeile 2576 |
---|
$newforum = get_forum($moveto); if(!$newforum || $newforum['type'] != "f" || $newforum['type'] == "f" && $newforum['linkto'] != '') {
|
$newforum = get_forum($moveto); if(!$newforum || $newforum['type'] != "f" || $newforum['type'] == "f" && $newforum['linkto'] != '') {
|
error($lang->error_invalidforum);
| error($lang->error_invalidforum, $lang->error);
|
}
$newsubject = $mybb->get_input('newsubject');
| }
$newsubject = $mybb->get_input('newsubject');
|
Zeile 2522 | Zeile 2604 |
---|
if(count($posts) < 1) {
|
if(count($posts) < 1) {
|
error($lang->error_inline_nopostsselected);
| error($lang->error_inline_nopostsselected, $lang->error);
|
}
if(!is_moderator_by_pids($posts, "canmanagethreads"))
| }
if(!is_moderator_by_pids($posts, "canmanagethreads"))
|
Zeile 2546 | Zeile 2628 |
---|
{ if((int)$tcheck['count'] <= 1) {
|
{ if((int)$tcheck['count'] <= 1) {
|
error($lang->error_cantsplitonepost);
| error($lang->error_cantsplitonepost, $lang->error);
|
} $threads[] = $pcheck[] = $tcheck['tid']; // Save tids for below }
| } $threads[] = $pcheck[] = $tcheck['tid']; // Save tids for below }
|
Zeile 2571 | Zeile 2653 |
---|
if(count($pcheck2) != count($pcheck)) { // One or more threads do not have posts after splitting
|
if(count($pcheck2) != count($pcheck)) { // One or more threads do not have posts after splitting
|
error($lang->error_cantmoveall);
| error($lang->error_cantmoveall, $lang->error);
|
}
$inlineids = implode("|", $posts);
| }
$inlineids = implode("|", $posts);
|
Zeile 2656 | Zeile 2738 |
---|
$newthread = get_thread($newtid); if(!$newthread) {
|
$newthread = get_thread($newtid); if(!$newthread) {
|
error($lang->error_badmovepostsurl);
| error($lang->error_badmovepostsurl, $lang->error);
|
} if($newtid == $tid) { // sanity check
|
} if($newtid == $tid) { // sanity check
|
error($lang->error_movetoself);
| error($lang->error_movetoself, $lang->error);
|
}
$postlist = explode("|", $mybb->get_input('posts'));
| }
$postlist = explode("|", $mybb->get_input('posts'));
|
Zeile 2689 | Zeile 2771 |
---|
if(empty($posts)) {
|
if(empty($posts)) {
|
error($lang->error_inline_nopostsselected);
| error($lang->error_inline_nopostsselected, $lang->error);
|
}
$pidin = implode(',', $posts);
| }
$pidin = implode(',', $posts);
|
Zeile 2708 | Zeile 2790 |
---|
{ if((int)$tcheck['count'] <= 1) {
|
{ if((int)$tcheck['count'] <= 1) {
|
error($lang->error_cantsplitonepost);
| error($lang->error_cantsplitonepost, $lang->error);
|
} $threads[] = $pcheck[] = $tcheck['tid']; // Save tids for below }
| } $threads[] = $pcheck[] = $tcheck['tid']; // Save tids for below }
|
Zeile 2733 | Zeile 2815 |
---|
if(count($pcheck2) != count($pcheck)) { // One or more threads do not have posts after splitting
|
if(count($pcheck2) != count($pcheck)) { // One or more threads do not have posts after splitting
|
error($lang->error_cantmoveall);
| error($lang->error_cantmoveall, $lang->error);
|
}
$newtid = $moderation->split_posts($posts, $tid, $newthread['fid'], $db->escape_string($newthread['subject']), $newtid);
| }
$newtid = $moderation->split_posts($posts, $tid, $newthread['fid'], $db->escape_string($newthread['subject']), $newtid);
|
Zeile 2761 | Zeile 2843 |
---|
} if(count($posts) < 1) {
|
} if(count($posts) < 1) {
|
error($lang->error_inline_nopostsselected);
| error($lang->error_inline_nopostsselected, $lang->error);
|
}
if(!is_moderator_by_pids($posts, "canapproveunapproveposts"))
| }
if(!is_moderator_by_pids($posts, "canapproveunapproveposts"))
|
Zeile 2806 | Zeile 2888 |
---|
if(count($posts) < 1) {
|
if(count($posts) < 1) {
|
error($lang->error_inline_nopostsselected);
| error($lang->error_inline_nopostsselected, $lang->error);
|
} $pids = array();
| } $pids = array();
|
Zeile 2849 | Zeile 2931 |
---|
} if(count($posts) < 1) {
|
} if(count($posts) < 1) {
|
error($lang->error_inline_nopostsselected);
| error($lang->error_inline_nopostsselected, $lang->error);
|
}
if(!is_moderator_by_pids($posts, "canrestoreposts"))
| }
if(!is_moderator_by_pids($posts, "canrestoreposts"))
|
Zeile 2893 | Zeile 2975 |
---|
if(count($posts) < 1) {
|
if(count($posts) < 1) {
|
error($lang->error_inline_nopostsselected);
| error($lang->error_inline_nopostsselected, $lang->error);
|
} $pids = array();
| } $pids = array();
|
Zeile 2999 | Zeile 3081 |
---|
// Clear the profile $userhandler->clear_profile($uid, $mybb->settings['purgespammerbangroup']);
|
// Clear the profile $userhandler->clear_profile($uid, $mybb->settings['purgespammerbangroup']);
|
$cache->update_banned();
| |
$cache->update_bannedips(); $cache->update_awaitingactivation();
| $cache->update_bannedips(); $cache->update_awaitingactivation();
|
Zeile 3028 | Zeile 3109 |
---|
redirect(get_profile_link($uid), $lang->purgespammer_success); } }
|
redirect(get_profile_link($uid), $lang->purgespammer_success); } }
|
else if($mybb->input['action'] == "purgespammer")
| elseif($mybb->input['action'] == "purgespammer")
|
{ $plugins->run_hooks("moderation_purgespammer_show");
| { $plugins->run_hooks("moderation_purgespammer_show");
|
Zeile 3060 | Zeile 3141 |
---|
if(!is_member($tool['groups'])) { error_no_permission();
|
if(!is_member($tool['groups'])) { error_no_permission();
|
| } if($thread['visible'] == -1) { error($lang->error_thread_deleted, $lang->error);
|
}
if(!empty($options['confirmation']) && empty($mybb->input['confirm']))
| }
if(!empty($options['confirmation']) && empty($mybb->input['confirm']))
|
Zeile 3068 | Zeile 3154 |
---|
$lang->confirm_execute_tool_desc = $lang->sprintf($lang->confirm_execute_tool_desc, htmlspecialchars_uni($tool['name']));
|
$lang->confirm_execute_tool_desc = $lang->sprintf($lang->confirm_execute_tool_desc, htmlspecialchars_uni($tool['name']));
|
$action = $mybb->input['action']; $modtype = $mybb->get_input('modtype'); $inlinetype = $mybb->get_input('inlinetype'); $searchid = $mybb->get_input('searchid');
| $action = $mybb->get_input('action', MyBB::INPUT_INT); $modtype = htmlspecialchars_uni($mybb->get_input('modtype')); $inlinetype = htmlspecialchars_uni($mybb->get_input('inlinetype')); $searchid = $mybb->get_input('searchid', MyBB::INPUT_INT);
|
$url = htmlspecialchars_uni($mybb->get_input('url')); $plugins->run_hooks('moderation_confirmation');
|
$url = htmlspecialchars_uni($mybb->get_input('url')); $plugins->run_hooks('moderation_confirmation');
|
|
|
eval('$page = "'.$templates->get('moderation_confirmation').'";');
|
eval('$page = "'.$templates->get('moderation_confirmation').'";');
|
|
|
output_page($page); exit;
|
output_page($page); exit;
|
}
$tool['name'] = htmlspecialchars_uni($tool['name']);
| }
$tool['name'] = htmlspecialchars_uni($tool['name']);
|
if($tool['type'] == 't' && $mybb->get_input('modtype') == 'inlinethread') {
| if($tool['type'] == 't' && $mybb->get_input('modtype') == 'inlinethread') {
|
Zeile 3095 | Zeile 3181 |
---|
} if(count($tids) < 1) {
|
} if(count($tids) < 1) {
|
error($lang->error_inline_nopostsselected);
| error($lang->error_inline_nopostsselected, $lang->error);
|
} if(!is_moderator_by_tids($tids, "canusecustomtools")) {
| } if(!is_moderator_by_tids($tids, "canusecustomtools")) {
|
Zeile 3104 | Zeile 3190 |
---|
$thread_options = my_unserialize($tool['threadoptions']); if($thread_options['movethread'] && $forum_cache[$thread_options['movethread']]['type'] != "f")
|
$thread_options = my_unserialize($tool['threadoptions']); if($thread_options['movethread'] && $forum_cache[$thread_options['movethread']]['type'] != "f")
|
{ error($lang->error_movetocategory); }
| { error($lang->error_movetocategory, $lang->error); }
|
$custommod->execute($mybb->get_input('action', MyBB::INPUT_INT), $tids); $lang->custom_tool = $lang->sprintf($lang->custom_tool, $tool['name']); log_moderator_action($modlogdata, $lang->custom_tool); if($mybb->get_input('inlinetype') == 'search')
|
$custommod->execute($mybb->get_input('action', MyBB::INPUT_INT), $tids); $lang->custom_tool = $lang->sprintf($lang->custom_tool, $tool['name']); log_moderator_action($modlogdata, $lang->custom_tool); if($mybb->get_input('inlinetype') == 'search')
|
{
| {
|
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search'); $lang->redirect_customtool_search = $lang->sprintf($lang->redirect_customtool_search, $tool['name']); $return_url = htmlspecialchars_uni($mybb->get_input('url'));
|
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search'); $lang->redirect_customtool_search = $lang->sprintf($lang->redirect_customtool_search, $tool['name']); $return_url = htmlspecialchars_uni($mybb->get_input('url'));
|
redirect($return_url, $lang->redirect_customtool_search);
| moderation_redirect($return_url, $lang->redirect_customtool_search);
|
} else {
| } else {
|
Zeile 3129 | Zeile 3215 |
---|
elseif($tool['type'] == 't' && $mybb->get_input('modtype') == 'thread') { if(!is_moderator_by_tids($tid, "canusecustomtools"))
|
elseif($tool['type'] == 't' && $mybb->get_input('modtype') == 'thread') { if(!is_moderator_by_tids($tid, "canusecustomtools"))
|
{
| {
|
error_no_permission(); }
$thread_options = my_unserialize($tool['threadoptions']); if($thread_options['movethread'] && $forum_cache[$thread_options['movethread']]['type'] != "f") {
|
error_no_permission(); }
$thread_options = my_unserialize($tool['threadoptions']); if($thread_options['movethread'] && $forum_cache[$thread_options['movethread']]['type'] != "f") {
|
error($lang->error_movetocategory);
| error($lang->error_movetocategory, $lang->error);
|
}
$ret = $custommod->execute($mybb->get_input('action', MyBB::INPUT_INT), $tid);
| }
$ret = $custommod->execute($mybb->get_input('action', MyBB::INPUT_INT), $tid);
|
Zeile 3167 | Zeile 3253 |
---|
if(count($pids) < 1) {
|
if(count($pids) < 1) {
|
error($lang->error_inline_nopostsselected);
| error($lang->error_inline_nopostsselected, $lang->error);
|
} if(!is_moderator_by_pids($pids, "canusecustomtools")) {
| } if(!is_moderator_by_pids($pids, "canusecustomtools")) {
|
Zeile 3194 | Zeile 3280 |
---|
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search'); $lang->redirect_customtool_search = $lang->sprintf($lang->redirect_customtool_search, $tool['name']); $return_url = htmlspecialchars_uni($mybb->get_input('url'));
|
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search'); $lang->redirect_customtool_search = $lang->sprintf($lang->redirect_customtool_search, $tool['name']); $return_url = htmlspecialchars_uni($mybb->get_input('url'));
|
redirect($return_url, $lang->redirect_customtool_search);
| moderation_redirect($return_url, $lang->redirect_customtool_search);
|
} else {
| } else {
|
Zeile 3220 | Zeile 3306 |
---|
/** * Some little handy functions for our inline moderation
|
/** * Some little handy functions for our inline moderation
|
* * @param int $id
| * * @param int $id
|
* @param string $type * * @return array
| * @param string $type * * @return array
|
Zeile 3264 | Zeile 3350 |
---|
* @return array */ function getallids($id, $type)
|
* @return array */ function getallids($id, $type)
|
{ global $db, $mybb;
| { global $db, $mybb;
|
$ids = array();
| $ids = array();
|
Zeile 3287 | Zeile 3373 |
---|
{ $query = $db->simple_select("threads", "tid", "fid='".(int)$id."'"); while($tid = $db->fetch_field($query, "tid"))
|
{ $query = $db->simple_select("threads", "tid", "fid='".(int)$id."'"); while($tid = $db->fetch_field($query, "tid"))
|
{
| {
|
if(in_array($tid, $removed_ids)) { continue;
| if(in_array($tid, $removed_ids)) { continue;
|
Zeile 3296 | Zeile 3382 |
---|
$ids[] = $tid; } }
|
$ids[] = $tid; } }
|
else if($type == 'search')
| elseif($type == 'search')
|
{ $query = $db->simple_select("searchlog", "resulttype, posts, threads", "sid='".$db->escape_string($id)."' AND uid='{$mybb->user['uid']}'", 1); $searchlog = $db->fetch_array($query);
| { $query = $db->simple_select("searchlog", "resulttype, posts, threads", "sid='".$db->escape_string($id)."' AND uid='{$mybb->user['uid']}'", 1); $searchlog = $db->fetch_array($query);
|
Zeile 3310 | Zeile 3396 |
---|
}
if(is_array($ids))
|
}
if(is_array($ids))
|
{
| {
|
foreach($ids as $key => $tid) { if(in_array($tid, $removed_ids))
| foreach($ids as $key => $tid) { if(in_array($tid, $removed_ids))
|
Zeile 3322 | Zeile 3408 |
---|
}
return $ids;
|
}
return $ids;
|
}
/** * @param int $id * @param string $type */
| }
/** * @param int $id * @param string $type */
|
function clearinline($id, $type) { my_unsetcookie("inlinemod_".$type.$id); my_unsetcookie("inlinemod_{$type}{$id}_removed");
|
function clearinline($id, $type) { my_unsetcookie("inlinemod_".$type.$id); my_unsetcookie("inlinemod_{$type}{$id}_removed");
|
}
| }
|
/** * @param int $id * @param string $type
| /** * @param int $id * @param string $type
|
Zeile 3355 | Zeile 3441 |
---|
* @return bool True if moderator of all; false otherwise */ function is_moderator_by_pids($posts, $permission='')
|
* @return bool True if moderator of all; false otherwise */ function is_moderator_by_pids($posts, $permission='')
|
{
| {
|
global $db, $mybb;
// Speedy determination for supermods/admins and guests
| global $db, $mybb;
// Speedy determination for supermods/admins and guests
|
Zeile 3366 | Zeile 3452 |
---|
elseif(!$mybb->user['uid']) { return false;
|
elseif(!$mybb->user['uid']) { return false;
|
}
| }
|
// Make an array of threads if not an array if(!is_array($posts)) {
| // Make an array of threads if not an array if(!is_array($posts)) {
|
Zeile 3399 | Zeile 3485 |
---|
* @return bool True if moderator of all; false otherwise */ function is_moderator_by_tids($threads, $permission='')
|
* @return bool True if moderator of all; false otherwise */ function is_moderator_by_tids($threads, $permission='')
|
{
| {
|
global $db, $mybb;
// Speedy determination for supermods/admins and guests
| global $db, $mybb;
// Speedy determination for supermods/admins and guests
|
Zeile 3410 | Zeile 3496 |
---|
elseif(!$mybb->user['uid']) { return false;
|
elseif(!$mybb->user['uid']) { return false;
|
}
| }
|
// Make an array of threads if not an array if(!is_array($threads)) {
| // Make an array of threads if not an array if(!is_array($threads)) {
|
Zeile 3427 | Zeile 3513 |
---|
if(!is_moderator($forum['fid'], $permission)) { return false;
|
if(!is_moderator($forum['fid'], $permission)) { return false;
|
}
| }
|
} return true; }
| } return true; }
|
Zeile 3443 | Zeile 3529 |
---|
global $mybb; if(!empty($mybb->input['url'])) {
|
global $mybb; if(!empty($mybb->input['url'])) {
|
redirect(htmlentities($mybb->input['url']), $message, $title);
| $url = htmlentities($mybb->input['url']);
|
}
|
}
|
| if(my_strpos($url, $mybb->settings['bburl'].'/') !== 0) { if(my_strpos($url, '/') === 0) { $url = my_substr($url, 1); } $url_segments = explode('/', $url); $url = $mybb->settings['bburl'].'/'.end($url_segments); }
|
redirect($url, $message, $title); }
| redirect($url, $message, $title); }
|