View Full Version : Mini Mods - Quick User Delete In PostBit
cerjam
03-20-2007, 10:00 PM
My site gets spam bots alot and i'm always too lazy to go into the admincp and find the username and delete it. so i wrote this.
It injects a image into the postbit around the online/infraction images.
Find this in "POSTBIT/postbit legacy" whichever you use.
<if condition="$show['infractionlink']"><a href="infraction.php?$session[sessionurl]do=report&p=$post[postid]" rel="nofollow"><img class="inlineimg" src="$stylevar[imgdir_button]/infraction.gif" alt="<phrase 1="$post[username]">$vbphrase[add_infraction_for_x]</phrase>" border="0" /></a></if>
Add this under that part
<if condition="$bbuserinfo[userid] == YOURUSERID">
<a href="admincp/user.php?do=remove&u=$post[userid]" rel="nofollow"><img class="inlineimg" src="YOURDELETEUSERIMAGEURL" alt="<phrase 1="$post[username]">delete user</phrase>" border="0" /></a>
</if>
Only problem is it doesnt redirect you back to the thread, If anyone would like to tell me how to do that itd be great.
projectego
03-21-2007, 11:10 AM
Nice idea, cerjam. It's also good to hear I'm not the only one who finds constantly having to have to login to the Admin CP to ban users over and over again a hassle. ;)
Marco van Herwaarden
03-21-2007, 01:36 PM
Just curious, why do you want to delete the user instead of using an infraction to ban him. If you delete them they can reuse the same name/email address again.
Distance
03-21-2007, 03:52 PM
Agreed.
KevNJ
03-21-2007, 04:37 PM
Nice mod, although I wont be installing.
Not to take anything away from your mod. But since Ive installed this mod I have had ZERO spambots sign up since.
https://vborg.vbsupport.ru/showthread.php?t=124828
blazingpc
03-21-2007, 06:39 PM
Just curious, why do you want to delete the user instead of using an infraction to ban him. If you delete them they can reuse the same name/email address again.
Great point!!
Not to mention if you delete them then you will loose that number on your total members but if you just ban then the number stays but the spammer is gone.:)
puertoblack2003
03-21-2007, 07:14 PM
thanks for your hack..but i agree with everybody else there are multiple hacks for spammer that you can install to stop this, which i have installed and it works great..
cerjam
03-22-2007, 12:52 AM
why waste the space in the memberlist for 300 banned spam bots? this is so much cleaner. and if nothing else, someone can learn to make a postbit hack from this
Dream
03-22-2007, 01:18 AM
I wish there was a button like this to delete user + all his messages.
thincom2000
03-23-2007, 01:10 AM
You can easily do that with a query.
$db->query_write( "DELETE FROM " . TABLE_PREFIX . "post WHERE userid = " . $vbulletin->GPC['userid'] );
Dream
03-23-2007, 01:12 AM
But then there's all user attachments, etc, etc info
thincom2000
03-23-2007, 03:31 AM
Well if you don't know which tables have `userid` in them, you'll be running a lot of queries depending on your forum, but you can do this (I recommend testing on a backup database first):
$db->hide_errors();
$all_tables = $db->query_read("SHOW TABLES");
$getall = $db->fetch_array($all_tables);
$db->free_result($all_tables);
foreach ($getall AS $get_all)
{
$create_query = "DELETE FROM $get_all WHERE `userid` = " . $vbulletin->GPC['userid'];
$getro = $db->query_write($create_query);
echo "Deleted User #" . $getro['userid'] . " from $get_all.<br />";
$db->free_result($getro);
}
unset($get_all, $getall, $create_query);
$db->show_errors();
That should delete every database entry associated with a particular userid. (You will end up with orphaned posts if they started any threads).
You could technically do it in ONE query, but I think the whole query might fail and stop if the `userid` field doesn't exist in one of the tables.
HMBeaty
03-23-2007, 03:33 AM
why waste the space in the memberlist for 300 banned spam bots? this is so much cleaner. and if nothing else, someone can learn to make a postbit hack from this
I already did
User Management (https://vborg.vbsupport.ru/showthread.php?t=140398)
cerjam
03-23-2007, 06:29 AM
Nice hack redline, my thread and im marking out to you..lol. Nice though.
Atakan KOC
03-25-2007, 05:48 PM
Thanks....
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.