diff -Naur forum/inc/functions_post.php forum/inc/functions_post.php --- forum/inc/functions_post.php 2018-09-11 20:40:45.000000000 +0200 +++ forum/inc/functions_post.php 2019-01-03 19:45:45.975729084 +0100 @@ -510,6 +510,11 @@ $post['button_find'] = ''; $post['onlinestatus'] = ''; $post['replink'] = ''; + + if($post_type != 3 && $post_type != 1 && is_member($mybb->settings['purgespammergroups'])) { + eval("\$post['button_purgespammer'] = \"".$templates->get('postbit_purgespammer_ip')."\";"); + } + eval("\$post['user_details'] = \"".$templates->get("postbit_author_guest")."\";"); } diff -Naur forum/showthread.php forum/showthread.php --- forum/showthread.php 2018-09-11 20:40:45.000000000 +0200 +++ forum/showthread.php 2019-01-03 19:45:45.983729011 +0100 @@ -24,6 +24,7 @@ $templatelist .= ",showthread_moderationoptions_approve,showthread_moderationoptions_unapprove,showthread_inlinemoderation_delete,showthread_moderationoptions_standard,showthread_quickreply_options_close,showthread_inlinemoderation_custom,showthread_search"; $templatelist .= ",postbit_profilefield_multiselect_value,postbit_profilefield_multiselect,showthread_subscription,postbit_deleted_member,postbit_away,postbit_warn,postbit_classic,postbit_reputation,postbit_deleted,postbit_offline,postbit_online,postbit_signature"; $templatelist .= ",postbit_editreason,postbit_quickdelete,showthread_threadnotes_viewnotes,showthread_threadedbox,showthread_poll_resultbit,showthread_poll_results,showthread_threadnotes,showthread_classic_header,showthread_poll_undovote,postbit_groupimage"; +$templatelist .= ",postbit_purgespammer_ip"; require_once "./global.php"; require_once MYBB_ROOT."inc/functions_post.php"; diff -Naur forum/moderation.php forum/moderation.php --- forum/moderation.php 2018-09-11 20:40:45.000000000 +0200 +++ forum/moderation.php 2019-01-03 19:45:45.983729011 +0100 @@ -20,6 +20,7 @@ $templatelist .= ",moderation_delayedmodaction_notes_redirect,moderation_delayedmodaction_notes_merge,moderation_delayedmoderation_thread,moderation_threadnotes_modaction_thread,moderation_getip_modal"; $templatelist .= ",moderation_delayedmoderation_date_day,moderation_delayedmoderation_date_month,moderation_threadnotes_modaction_post,moderation_merge,moderation_split,moderation_threadnotes_modaction_forum"; $templatelist .= ",moderation_delayedmoderation_openclose,moderation_delayedmoderation_softdeleterestore,moderation_delayedmoderation_delete,moderation_delayedmoderation_stick,moderation_delayedmoderation_approve"; +$templatelist .= ",moderation_purgespammer_ip"; require_once "./global.php"; require_once MYBB_ROOT."inc/functions_post.php"; @@ -2999,7 +2999,7 @@ { error_no_permission(); } - +if(isset($mybb->input["uid"]) && $mybb->input["uid"] != "") { $uid = $mybb->get_input('uid', MyBB::INPUT_INT); $user = get_user($uid); if(!$user['uid'] || !purgespammer_show($user['postnum'], $user['usergroup'], $user['uid'])) @@ -3116,6 +3116,69 @@ eval("\$purgespammer = \"".$templates->get('moderation_purgespammer')."\";"); output_page($purgespammer); } +} else if(isset($mybb->input["pid"]) && $mybb->input["pid"] != "") { + $b_ip = $db->fetch_array($db->simple_select("posts", "ipaddress", "`pid` = ".(int)$mybb->input["pid"]))["ipaddress"]; + if(!$b_ip) + error("Couldn't optain IP-Adress ... is the Post-ID correct?"); + + $ip = my_inet_ntop($db->unescape_binary($b_ip)); + + // Posts + $postdata = []; + $query = $db->simple_select('posts', '`pid`, `subject`', "`ipaddress` = ".$db->escape_binary($b_ip)); + while($post = $db->fetch_array($query)) { + $postdata[] = $post; + } + + // Threads + $threaddata = []; + foreach($postdata as $post) { + $t_query = $db->simple_select('threads', '`tid`, `subject`', "`replies` = 0 AND `firstpost` = ".(int)$post["pid"]); + while($thread = $db->fetch_array($t_query)) { + $threaddata[] = $thread; + } + } + + if($mybb->input['action'] == "purgespammer") { + $plugins->run_hooks("moderation_purgespammer_show"); + + add_breadcrumb($lang->purgespammer); + $lang->purgespammer_purge = $lang->sprintf($lang->purgespammer_purge, htmlspecialchars_uni($user['username'])); + $lang->purgespammer_purge_desc = $lang->sprintf($lang->purgespammer_purge_desc, $lang->purgespammer_delete); + + $postdeletehtml = ""; + foreach($postdata as $post) { + $postdeletehtml .= "