MyBB Community Forums

Full Version: Help w/ coding manual delete thread, what tables should i update..
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi Guys

I've not gone down the plugin dev road, coz i've very little time to code on my hands and learning plugin dev, troubleshooting that, and getting used to it takes time.. i can achieve almost everythin i want thru simple scripts i add ot mybb, or simple code tweaks or insertions ..

Most of the code mod i make for mybb is personal requirement, like for our organization and stuff..

ANywho, I was trying to battle spam, spammers and their posts, and i found the admin interface to be too tasky, specially if u get tons of spam all the time.. so i wanted a one click way to just delete a user and all its posts..

Basically for every user post the username area has a little button to get rid of that spam account and all the posts related to that..

on click it basically calls a script i made that:

1) gets the IP, and email address of the user, and insert it into my own blacklist table
2) finds all posts in the mybb_posts authored by this user and deletes them
3) deletes the said user from mybb_users

This works, but results in a lot of misalligned data..

my question now is, WHAT ARE FIELDS that i need to UPDATE to keep the mybb in synch? i could painstakingly try and figure this out, like updating the post counts, the threads etc.. but i would love it if the admins or anyone can point me in the right direction..


Would appreciate the community's guidance

thanks
A plugin has already been created for that. It's called "Goodbye spammer".
thanks for that Malcolm, but i prefer to make my own though, because i want control over my mods, like perhaps i wana shoot an email at the spammer automatically as well, etc etc.. or just delete, and all tht.. i want control hhee hence i would still love the directions to w/c data should be altered..


PS, i did try the plugin goodbye spammer and it doesnt work half the time, some users dont have the goodbyspammer link

like this:

http://d.pr/5rmB

but no need to troubleshoot, as i do plan to use my own scripts..... pls advise guys
^ hmm., reinventing the wheel wastes time & resources ... anyway, please see this
(2011-08-10, 04:24 AM)ranjani Wrote: [ -> ]^ hmm., reinventing the wheel wastes time & resources ... anyway, please see this



well yes, but what's the point in using the wheel if you wanted something of a different shape? modifying the wheel to take a different shape wastes more time and resources, and will be plagued by problems..

if you must know, my script will not only delete.. per user..i can also select to mass delete by IP address, email address used, or even a SEARCH STRING in posts.. way more advanced than avaialable plugin..

another function of it is that, i have actually modified the mybb_user table and added a column to tag spammers.. and changed the login script to allow LOGIN of these spam accounts making them think they're still active, but then send them to a fake post page or script, and from there i can do things w/ the data they're posting.. this is for speciifc spammers of interest only..

i have the option to user DELETE, BAN, or CHANGE the password only of the spam accounts , again for various reasons w/c i dont need to explain anymore

hehe so no it's not reinventing the wheel, i'ts developing something better.. i just wish i had the time to study plugin dev, so i can share my work.. but right now it's just so much easier/faster for me to simply hard code it.

and updating isnt a pain, i noted exactly where to re-insert my codes..and takes only 5 minutes after a successful update Smile


SOooooo anyway, thanks much for that.. i didnt know it was as simple as deleting mybb_post and mybb_threads entries.. i thought i had to edit some stats, counts, or alter other table entries or whatever.


Thanks a bunch Smile

TJ