Zeile 420 | Zeile 420 |
---|
$method_selected = array('move' => 'checked="checked"', 'redirect' => '', 'copy' => '');
$mybb->input['delayedmoderation']['redirect_expire'] = '';
|
$method_selected = array('move' => 'checked="checked"', 'redirect' => '', 'copy' => '');
$mybb->input['delayedmoderation']['redirect_expire'] = '';
|
$mybb->input['delayedmoderation']['subject'] = $thread['subject'];
| $mybb->input['delayedmoderation']['subject'] = isset($thread['subject']) ? $thread['subject'] : '';
|
$mybb->input['delayedmoderation']['threadurl'] = '';
$forumselect = build_forum_jump("", $fid, 1, '', 0, true, '', "delayedmoderation[new_forum]");
| $mybb->input['delayedmoderation']['threadurl'] = '';
$forumselect = build_forum_jump("", $fid, 1, '', 0, true, '', "delayedmoderation[new_forum]");
|
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 1136 | 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 1226 | 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 1541 | Zeile 1541 |
---|
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
| ORDER BY dateline ASC, pid ASC
|
");
$numposts = $db->num_rows($query);
| ");
$numposts = $db->num_rows($query);
|
Zeile 1611 | Zeile 1611 |
---|
$count = $db->fetch_array($query);
if($count['totalposts'] == 1)
|
$count = $db->fetch_array($query);
if($count['totalposts'] == 1)
|
{ error($lang->error_cantsplitonepost, $lang->error); }
| { error($lang->error_cantsplitonepost, $lang->error); }
|
if($count['totalposts'] == count($mybb->input['splitpost'])) { error($lang->error_cantsplitall, $lang->error);
|
if($count['totalposts'] == count($mybb->input['splitpost'])) { error($lang->error_cantsplitall, $lang->error);
|
}
| }
|
if(!empty($mybb->input['moveto'])) { $moveto = $mybb->get_input('moveto', MyBB::INPUT_INT); } else
|
if(!empty($mybb->input['moveto'])) { $moveto = $mybb->get_input('moveto', MyBB::INPUT_INT); } else
|
{
| {
|
$moveto = $fid; }
| $moveto = $fid; }
|
Zeile 1644 | Zeile 1644 |
---|
if(isset($mybb->input['splitpost'][$post['pid']]) && $mybb->input['splitpost'][$post['pid']] == 1) { $pids[] = $post['pid'];
|
if(isset($mybb->input['splitpost'][$post['pid']]) && $mybb->input['splitpost'][$post['pid']] == 1) { $pids[] = $post['pid'];
|
}
| }
|
mark_reports($post['pid'], "post"); }
| mark_reports($post['pid'], "post"); }
|
Zeile 1707 | Zeile 1707 |
---|
}
$inlineids = implode("|", $threads);
|
}
$inlineids = implode("|", $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'); }
|
$return_url = htmlspecialchars_uni($mybb->get_input('url')); eval("\$multidelete = \"".$templates->get("moderation_inline_deletethreads")."\";"); output_page($multidelete);
| $return_url = htmlspecialchars_uni($mybb->get_input('url')); eval("\$multidelete = \"".$templates->get("moderation_inline_deletethreads")."\";"); output_page($multidelete);
|
Zeile 1722 | Zeile 1722 |
---|
// 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->get_input('my_post_key'));
| // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
Zeile 1730 | Zeile 1730 |
---|
if(!is_moderator_by_tids($threadlist, "candeletethreads")) { error_no_permission();
|
if(!is_moderator_by_tids($threadlist, "candeletethreads")) { error_no_permission();
|
}
| }
|
foreach($threadlist as $tid) { $tid = (int)$tid;
| foreach($threadlist as $tid) { $tid = (int)$tid;
|
Zeile 1738 | Zeile 1738 |
---|
$tlist[] = $tid; } log_moderator_action($modlogdata, $lang->multi_deleted_threads);
|
$tlist[] = $tid; } log_moderator_action($modlogdata, $lang->multi_deleted_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');
|
} mark_reports($tlist, "threads"); moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsdeleted); break;
|
} mark_reports($tlist, "threads"); moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsdeleted); break;
|
|
|
// Open threads - Inline moderation
|
// 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, $lang->error); }
| 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);
| $moderation->open_threads($threads);
log_moderator_action($modlogdata, $lang->multi_opened_threads);
|
Zeile 1879 | Zeile 1879 |
---|
break;
// Unapprove threads - Inline moderation
|
break;
// Unapprove threads - Inline moderation
|
case "multiunapprovethreads":
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
if(!empty($mybb->input['searchid']))
| case "multiunapprovethreads":
// 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');
| { // From search page $threads = getids($mybb->get_input('searchid'), 'search');
|
Zeile 1952 | Zeile 1952 |
---|
$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')
| if($mybb->get_input('inlinetype') == 'search')
|
{ clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
|
{ clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
|
}
| }
|
else { clearinline($fid, 'forum');
|
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;
|
|
|
// Soft delete threads - Inline moderation case "multisoftdeletethreads":
| // Soft delete threads - Inline moderation case "multisoftdeletethreads":
|
Zeile 1971 | Zeile 1971 |
---|
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']))
|
{
| {
|
// From search page $threads = getids($mybb->get_input('searchid'), 'search'); if(!is_moderator_by_tids($threads, 'cansoftdeletethreads'))
|
// From search page $threads = getids($mybb->get_input('searchid'), 'search'); if(!is_moderator_by_tids($threads, 'cansoftdeletethreads'))
|
{
| {
|
error_no_permission(); } }
| error_no_permission(); } }
|
Zeile 1983 | Zeile 1983 |
---|
{ $threads = getids($fid, 'forum'); if(!is_moderator($fid, 'cansoftdeletethreads'))
|
{ $threads = getids($fid, 'forum'); if(!is_moderator($fid, 'cansoftdeletethreads'))
|
{ error_no_permission(); } }
| { error_no_permission(); } }
|
if(count($threads) < 1) { error($lang->error_inline_nothreadsselected, $lang->error);
|
if(count($threads) < 1) { error($lang->error_inline_nothreadsselected, $lang->error);
|
}
$moderation->soft_delete_threads($threads);
| }
$moderation->soft_delete_threads($threads);
|
log_moderator_action($modlogdata, $lang->multi_soft_deleted_threads); if($mybb->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
|
log_moderator_action($modlogdata, $lang->multi_soft_deleted_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 2008 | Zeile 2008 |
---|
break;
// Stick threads - Inline moderation
|
break;
// Stick threads - Inline moderation
|
case "multistickthreads":
// 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, 'canstickunstickthreads')) { error_no_permission();
| case "multistickthreads":
// 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, 'canstickunstickthreads')) { error_no_permission();
|
} } else
| } } else
|
Zeile 2041 | Zeile 2041 |
---|
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 2050 | Zeile 2050 |
---|
break;
// Unstick threads - Inline moderaton
|
break;
// Unstick threads - Inline moderaton
|
case "multiunstickthreads":
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
| case "multiunstickthreads":
// 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, 'canstickunstickthreads'))
|
if(!empty($mybb->input['searchid'])) { // From search page $threads = getids($mybb->get_input('searchid'), 'search'); if(!is_moderator_by_tids($threads, 'canstickunstickthreads'))
|
{ error_no_permission(); } } else
| { error_no_permission(); } } else
|
{ $threads = getids($fid, 'forum'); if(!is_moderator($fid, 'canstickunstickthreads'))
| { $threads = getids($fid, 'forum'); if(!is_moderator($fid, 'canstickunstickthreads'))
|
Zeile 2075 | Zeile 2075 |
---|
if(count($threads) < 1) { error($lang->error_inline_nothreadsselected, $lang->error);
|
if(count($threads) < 1) { error($lang->error_inline_nothreadsselected, $lang->error);
|
}
| }
|
$moderation->unstick_threads($threads);
log_moderator_action($modlogdata, $lang->multi_unstuck_threads);
|
$moderation->unstick_threads($threads);
log_moderator_action($modlogdata, $lang->multi_unstuck_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');
|
} moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsunstuck); break;
| } moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsunstuck); break;
|
Zeile 2153 | Zeile 2153 |
---|
// 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($lang->error_movetononmodforum, $lang->error); }
| error($lang->error_movetononmodforum, $lang->error); }
|
Zeile 2161 | Zeile 2161 |
---|
if(!$newforum || $newforum['type'] != "f" || $newforum['type'] == "f" && $newforum['linkto'] != '') { error($lang->error_invalidforum, $lang->error);
|
if(!$newforum || $newforum['type'] != "f" || $newforum['type'] == "f" && $newforum['linkto'] != '') { error($lang->error_invalidforum, $lang->error);
|
}
$plugins->run_hooks('moderation_do_multimovethreads');
| }
$plugins->run_hooks('moderation_do_multimovethreads');
|
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);
|
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;
|
foreach($tids as $tid) { $moderation->move_thread($tid, $moveto, $method, $expire); }
moderation_redirect(get_forum_link($moveto), $lang->redirect_inline_threadsmoved); break;
|
|
|
// 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') {
| if($mybb->get_input('inlinetype') == 'search') {
|
$posts = getids($mybb->get_input('searchid'), 'search');
|
$posts = getids($mybb->get_input('searchid'), 'search');
|
} else {
| } else {
|
$posts = getids($tid, 'thread'); }
| $posts = getids($tid, 'thread'); }
|
Zeile 2204 | Zeile 2204 |
---|
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($tid, 'thread');
| else { clearinline($tid, 'thread');
|
Zeile 2214 | Zeile 2214 |
---|
eval("\$multidelete = \"".$templates->get("moderation_inline_deleteposts")."\";"); output_page($multidelete);
|
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 2330 | Zeile 2330 |
---|
SELECT p.*, u.* FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."users u ON (p.uid=u.uid)
|
SELECT p.*, u.* FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."users u ON (p.uid=u.uid)
|
WHERE pid IN (".implode($posts, ",").") ORDER BY dateline ASC
| WHERE pid IN (".implode(",", $posts).") ORDER BY dateline ASC, pid ASC
|
"); $altbg = "trow1"; while($post = $db->fetch_array($query))
| "); $altbg = "trow1"; while($post = $db->fetch_array($query))
|
Zeile 2404 | 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, $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) WHERE p.pid IN ($pidin) GROUP BY p.tid, p.pid "); $threads = $pcheck = array(); while($tcheck = $db->fetch_array($query)) { if((int)$tcheck['count'] <= 1) { error($lang->error_cantsplitonepost, $lang->error); } $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) $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) WHERE p.pid IN ($pidin) AND q.pid NOT IN ($pidin) GROUP BY p.tid, p.pid "); $pcheck2 = array(); while($tcheck = $db->fetch_array($query)) { if($tcheck['count'] > 0) { $pcheck2[] = $tcheck['tid'];
| 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) WHERE p.pid IN ($pidin) GROUP BY p.tid, p.pid "); $threads = $pcheck = array(); while($tcheck = $db->fetch_array($query)) { if((int)$tcheck['count'] <= 1) { error($lang->error_cantsplitonepost, $lang->error); } $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) $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) WHERE p.pid IN ($pidin) AND q.pid NOT IN ($pidin) GROUP BY p.tid, p.pid "); $pcheck2 = array(); while($tcheck = $db->fetch_array($query)) { if($tcheck['count'] > 0) { $pcheck2[] = $tcheck['tid'];
|
} } if(count($pcheck2) != count($pcheck))
| } } if(count($pcheck2) != count($pcheck))
|
Zeile 2528 | Zeile 2528 |
---|
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)
|
WHERE p.pid IN ($pidin) GROUP BY p.tid, p.pid "); $pcheck = array(); while($tcheck = $db->fetch_array($query)) { if((int)$tcheck['count'] <= 1) { error($lang->error_cantsplitonepost, $lang->error); } $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) $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) WHERE p.pid IN ($pidin) AND q.pid NOT IN ($pidin)
| WHERE p.pid IN ($pidin)
|
GROUP BY p.tid, p.pid ");
|
GROUP BY p.tid, p.pid ");
|
$pcheck2 = array();
| $pcheck = array();
|
while($tcheck = $db->fetch_array($query)) {
|
while($tcheck = $db->fetch_array($query)) {
|
if($tcheck['count'] > 0)
| if((int)$tcheck['count'] <= 1)
|
{
|
{
|
$pcheck2[] = $tcheck['tid'];
| error($lang->error_cantsplitonepost, $lang->error);
|
}
|
}
|
| $pcheck[] = $tcheck['tid']; // Save tids for below
|
}
|
}
|
if(count($pcheck2) != count($pcheck)) { // One or more threads do not have posts after splitting
| // 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) $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) WHERE p.pid IN ($pidin) AND q.pid NOT IN ($pidin) GROUP BY p.tid, p.pid "); $pcheck2 = array(); while($tcheck = $db->fetch_array($query)) { if($tcheck['count'] > 0) { $pcheck2[] = $tcheck['tid']; } } if(count($pcheck2) != count($pcheck)) { // One or more threads do not have posts after splitting
|
error($lang->error_cantsplitall, $lang->error); }
if(isset($mybb->input['moveto']))
|
error($lang->error_cantsplitall, $lang->error); }
if(isset($mybb->input['moveto']))
|
{
| {
|
$moveto = $mybb->get_input('moveto', MyBB::INPUT_INT); } else
|
$moveto = $mybb->get_input('moveto', MyBB::INPUT_INT); } else
|
{
| {
|
$moveto = $fid; }
| $moveto = $fid; }
|
Zeile 2591 | Zeile 2591 |
---|
// Move posts - Inline moderation case "multimoveposts":
|
// Move posts - Inline moderation case "multimoveposts":
|
add_breadcrumb($lang->nav_multi_moveposts);
if($mybb->get_input('inlinetype') == 'search') {
| add_breadcrumb($lang->nav_multi_moveposts);
if($mybb->get_input('inlinetype') == 'search') {
|
$posts = getids($mybb->get_input('searchid'), 'search'); } else
| $posts = getids($mybb->get_input('searchid'), 'search'); } else
|
Zeile 2603 | Zeile 2603 |
---|
}
if(count($posts) < 1)
|
}
if(count($posts) < 1)
|
{
| {
|
error($lang->error_inline_nopostsselected, $lang->error); }
| error($lang->error_inline_nopostsselected, $lang->error); }
|
Zeile 2627 | Zeile 2627 |
---|
while($tcheck = $db->fetch_array($query)) { if((int)$tcheck['count'] <= 1)
|
while($tcheck = $db->fetch_array($query)) { if((int)$tcheck['count'] <= 1)
|
{
| {
|
error($lang->error_cantsplitonepost, $lang->error); } $threads[] = $pcheck[] = $tcheck['tid']; // Save tids for below
| error($lang->error_cantsplitonepost, $lang->error); } $threads[] = $pcheck[] = $tcheck['tid']; // Save tids for below
|
Zeile 2666 | Zeile 2666 |
---|
clearinline($tid, 'thread'); } $forumselect = build_forum_jump("", $fid, 1, '', 0, true, '', "moveto");
|
clearinline($tid, 'thread'); } $forumselect = build_forum_jump("", $fid, 1, '', 0, true, '', "moveto");
|
| $return_url = htmlspecialchars_uni($mybb->get_input('url'));
|
eval("\$moveposts = \"".$templates->get("moderation_inline_moveposts")."\";"); output_page($moveposts); break;
|
eval("\$moveposts = \"".$templates->get("moderation_inline_moveposts")."\";"); output_page($moveposts); break;
|
|
|
// Actually split the posts - Inline moderation case "do_multimoveposts":
| // Actually split the posts - Inline moderation case "do_multimoveposts":
|
Zeile 2689 | Zeile 2692 |
---|
preg_match("#thread-([0-9]+)?#i", $mybb->input['threadurl'], $threadmatch); preg_match("#post-([0-9]+)?#i", $mybb->input['threadurl'], $postmatch);
|
preg_match("#thread-([0-9]+)?#i", $mybb->input['threadurl'], $threadmatch); preg_match("#post-([0-9]+)?#i", $mybb->input['threadurl'], $postmatch);
|
if($threadmatch[1])
| if(!empty($threadmatch[1]))
|
{ $parameters['tid'] = $threadmatch[1]; }
|
{ $parameters['tid'] = $threadmatch[1]; }
|
if($postmatch[1])
| if(!empty($postmatch[1]))
|
{ $parameters['pid'] = $postmatch[1]; }
| { $parameters['pid'] = $postmatch[1]; }
|
Zeile 3063 | Zeile 3066 |
---|
}
// Add the IP's to the banfilters
|
}
// Add the IP's to the banfilters
|
foreach(array($user['regip'], $user['lastip']) as $ip)
| if($mybb->settings['purgespammerbanip'] == 1)
|
{
|
{
|
$ip = my_inet_ntop($db->unescape_binary($ip)); $query = $db->simple_select("banfilters", "type", "type = 1 AND filter = '".$db->escape_string($ip)."'"); if($db->num_rows($query) == 0)
| foreach(array($user['regip'], $user['lastip']) as $ip)
|
{
|
{
|
$insert = array( "filter" => $db->escape_string($ip), "type" => 1, "dateline" => TIME_NOW ); $db->insert_query("banfilters", $insert);
| $ip = my_inet_ntop($db->unescape_binary($ip)); $query = $db->simple_select("banfilters", "type", "type = 1 AND filter = '".$db->escape_string($ip)."'"); if($db->num_rows($query) == 0) { $insert = array( "filter" => $db->escape_string($ip), "type" => 1, "dateline" => TIME_NOW ); $db->insert_query("banfilters", $insert); }
|
} }
// 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 3155 | Zeile 3160 |
---|
$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 = htmlspecialchars_uni($mybb->get_input('searchid'));
|
$url = htmlspecialchars_uni($mybb->get_input('url')); $plugins->run_hooks('moderation_confirmation');
| $url = htmlspecialchars_uni($mybb->get_input('url')); $plugins->run_hooks('moderation_confirmation');
|
Zeile 3264 | Zeile 3269 |
---|
// Get threads which are associated with the posts $tids = array(); $options = array(
|
// Get threads which are associated with the posts $tids = array(); $options = array(
|
'order_by' => 'dateline', 'order_dir' => 'asc'
| 'order_by' => 'dateline, pid',
|
); $query = $db->simple_select("posts", "DISTINCT tid, dateline", "pid IN (".implode(',',$pids).")", $options); while($row = $db->fetch_array($query))
| ); $query = $db->simple_select("posts", "DISTINCT tid, dateline", "pid IN (".implode(',',$pids).")", $options); while($row = $db->fetch_array($query))
|