|
Joined: Jun 2008
Posts: 22
stranger
|
stranger
Joined: Jun 2008
Posts: 22 |
Hi there
Can anyone tell me if there is a way to find all the posts of a user which were deleted from our forum.
I need to find these posts and delete them.
Can I do a SQL query? Which tables do I use?
Thank you
|
|
|
|
Joined: Jun 2006
Posts: 9,242 Likes: 1
Former Developer
|
Former Developer
Joined: Jun 2006
Posts: 9,242 Likes: 1 |
You might be able to get some of them but not all. A couple versions back we added the POST_POSTER_NAME field to the ubbt_POSTS table and this remains intact after a user is deleted. So you can get posts made after that, but not prior.
select POST_ID from ubbt_POSTS where POST_POSTER_NAME='deleteuser'
Just change deleteduser to the username in question.
|
|
|
|
Joined: Jun 2008
Posts: 22
stranger
|
stranger
Joined: Jun 2008
Posts: 22 |
Thanks, I will try this and see what I get.
|
|
|
|
Joined: Jun 2008
Posts: 22
stranger
|
stranger
Joined: Jun 2008
Posts: 22 |
When I run a delete SQL command in the ubbt_POSTS table, will everything still be fine afterwards?
Like for example when I run this command, will all te other posts still display correctly?
delete from ubbt_POSTS where POST_POSTER_NAME='username'
|
|
|
|
Joined: Nov 2006
Posts: 40
newbie
|
newbie
Joined: Nov 2006
Posts: 40 |
The answer is yes, almost certainly... but it never hurts to back up a table before you run a multiple delete query on your database. It'd be a good idea to close the forums while you do it too.
|
|
|
|
Joined: Jun 2006
Posts: 9,242 Likes: 1
Former Developer
|
Former Developer
Joined: Jun 2006
Posts: 9,242 Likes: 1 |
The problem with just deleting from the ubbt_POSTS table is you may end up with empty topics. Entries in the ubbt_TOPICS table rely on an entry in the ubbt_POSTS table that match the first post in the topic. If the user you're deleting has started topics, then those topics will still display on the forum list and will be clickable, but will result in an error.
|
|
|
|
Joined: Nov 2006
Posts: 40
newbie
|
newbie
Joined: Nov 2006
Posts: 40 |
Ah. In other words, the answer is no, almost certainly not.
|
|
|
|
Joined: Jun 2006
Posts: 9,242 Likes: 1
Former Developer
|
Former Developer
Joined: Jun 2006
Posts: 9,242 Likes: 1 |
Ah. In other words, the answer is no, almost certainly not. Lol. So Neil, I must ask....that avatar? Is that you?
|
|
|
|
Joined: Nov 2006
Posts: 40
newbie
|
newbie
Joined: Nov 2006
Posts: 40 |
So Neil, I must ask....that avatar? Is that you? Well, yes, but there's a perfectly reasonable explanation.
|
|
|
|
Joined: Jun 2006
Posts: 9,242 Likes: 1
Former Developer
|
Former Developer
Joined: Jun 2006
Posts: 9,242 Likes: 1 |
There's a good explanation for holding what appears to be a sword, what looks to be a tombstone, and possibly some odd looking green pants or tights?
|
|
|
|
Joined: Nov 2006
Posts: 40
newbie
|
newbie
Joined: Nov 2006
Posts: 40 |
Well ok, fair enough, I'm not sure it's necessarily that good an explanation, so Google freakin' green elf shorts at your own peril.
|
|
|
|
Joined: Jun 2006
Posts: 9,242 Likes: 1
Former Developer
|
Former Developer
Joined: Jun 2006
Posts: 9,242 Likes: 1 |
hahaha! That's funny... and weird.... but definitely funny
|
|
|
|
Joined: Nov 2006
Posts: 40
newbie
|
newbie
Joined: Nov 2006
Posts: 40 |
And now it's my avatar. OMG - is that wrong?!
|
|
|
|
Joined: Jun 2006
Posts: 16,292 Likes: 116
|
Joined: Jun 2006
Posts: 16,292 Likes: 116 |
|
|
|
|
Joined: Nov 2006
Posts: 40
newbie
|
newbie
Joined: Nov 2006
Posts: 40 |
They wouldn't let me in. Thanks for reminding me... :weep:
|
|
|
|
Joined: Jun 2006
Posts: 16,292 Likes: 116
|
Joined: Jun 2006
Posts: 16,292 Likes: 116 |
Like I need an excuse to get drunk and run around with a sword... lol
|
|
|
|
Joined: Nov 2006
Posts: 40
newbie
|
newbie
Joined: Nov 2006
Posts: 40 |
It's a basic human need.
|
|
|
|
Joined: Nov 2006
Posts: 3,095 Likes: 1
Carpal Tunnel
|
Carpal Tunnel
Joined: Nov 2006
Posts: 3,095 Likes: 1 |
Well maybe if you looked a bit more like this in green.
|
|
|
|
Joined: Jun 2006
Posts: 16,292 Likes: 116
|
Joined: Jun 2006
Posts: 16,292 Likes: 116 |
|
|
|
|
Joined: Nov 2006
Posts: 40
newbie
|
newbie
Joined: Nov 2006
Posts: 40 |
Y'know, I remember a distinct lack of dusky, buxom maids while I had that kit on.
|
|
|
|
Joined: Mar 2008
Posts: 326
Enthusiast
|
Enthusiast
Joined: Mar 2008
Posts: 326 |
|
|
|
|
|