Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

How to restore deleted posts?

Quote Reply
How to restore deleted posts?
If a user has deleted a post, is it possible to restore that post so everyone can see it again? I'm talking about deleted posts which are still visible to moderators, but not users.

If not, maybe in a future upgrade?

Jason
Quote Reply
Re: [wickedmoon] How to restore deleted posts? In reply to
I think it may be to do with the post_deleted column in the posts table. I haven't tried it out but I assume deleted posts will be 1 and all other posts 0 so try changing it to 0 and that should "un-delete" the post.
Quote Reply
Re: [wickedmoon] How to restore deleted posts? In reply to
Hm. This is a good point. Maybe the 'Delete' button should become 'UnDelete' for moderators once the post has been deleted by an user to allow this 'rollback' style feature.

Good idea.

- wil
Quote Reply
Re: [Paul] How to restore deleted posts? In reply to
Can anyone confirm this before I go messing about in mysqlman?

If it's ok to do so I'll make the changes in the database to restore the posts. Having a Restore button would be great. Maybe this can be included in the templates right now with the right code??

Jason
Quote Reply
Re: [wickedmoon] How to restore deleted posts? In reply to
Yeah, I confirm it (I just tested) ;)

Last edited by:

Paul: Jun 6, 2002, 3:54 AM
Quote Reply
Re: [Paul] How to restore deleted posts? In reply to
You're not going to tell me later I've f***** up my database? :)

Jason
Quote Reply
Re: [Paul] How to restore deleted posts? In reply to
You've also got the post_deleted_by and post_deleted_time columns. In posts that haven't been deleted they still contain information, eg "GT::CGI=HASH(0x82c6194)" appears in one of the post_deleted_by fields.

I just resurrected a deleted post, but in the forum view of the subject headings for each thread, there's a broken image link beside the post I restored. It says <img src="http://example.com/gfx/forum/GT::CGI=HASH(0x82c61ac)" border="0">

It's not as easy as just changing a number, but if it is possible, what else do I need to change to bring back a deleted post?

Jason
Quote Reply
Don't mess with a low level utility In reply to
I've left the test post deleted, as there was more to it than changing 1 to 0. I tried changing it back to how it was before, but when viewing the post_icon column, instead of saying "NULL" like other posts, it's blank. I've tried editing this field to be like the others (the others have some code like GT::CGI=HASH(0x82c6194) in them), it just creates a broken image link in the forum.

How can I make this post I fiddled about with appear like the other deleted posts in the table columns?

Jason
Quote Reply
Re: [wickedmoon] How to restore deleted posts? In reply to
It sounds like you have other issues going on because AFAIK it is as easy as changing 1 to 0 as I tried it on my own installation and it worked fine.

The info in the other two columns can be left (or deleted)...it shouldn't matter.

You shouldn't have object references in your columns so it looks like you have something weird going on.

Last edited by:

Paul: Jun 6, 2002, 6:11 AM
Quote Reply
Re: [Paul] How to restore deleted posts? In reply to
When editing a post from mysqlman, I click the Null checkbox for those fields I want to be left blank, but it's not saving my changes. When I save and go back to the post the checkboxes have been cleared and that "GT::CGI=HASH(0x82c5cd4)" type code keeps reappearing.

I don't think there's anything weird going on, I just don't understand how to make fields "Null" and keep them that way. Any ideas?

Jason
Quote Reply
Re: [wickedmoon] How to restore deleted posts? In reply to
>>
When editing a post from mysqlman, I click the Null checkbox for those fields I want to be left blank, but it's not saving my changes.
<<

You have to delete everything from the column when you select it as null otherwise it won't change.

eg...

Column_Name [ Existing Content ] [x]

If you just hit X to make it null (X is just my version of a tickbox :) ) then you will still see Existing Content in the column.....so you need to erase it first (or at the time of checking the tickbox) eg:

Column_Name [ ] [X]

...then it will become null.

Last edited by:

Paul: Jun 6, 2002, 6:33 AM
Quote Reply
Re: [Paul] How to restore deleted posts? In reply to
I tried that. I've almost got it right. Everything's Null except the "date deleted" field, which is stuck on "0". I tried removing all content from fields, hit save, that did the trick - the columns were blank, but there was no Null. I edit again, this time selecting the Null checkboxes, but strange things happen. I remove the 0 from the "date deleted" field, try to set it to Null, but then the other Null fields revert back again to that "hash" code, with the Null checkbox de-selected.

Even if I remove all content and then try to set them to Null, it won't let me. I can do a few, but can't get them all to change and stay changed at the same time.

Jason
Quote Reply
Re: [wickedmoon] How to restore deleted posts? In reply to
>>
Everything's Null except the "date deleted" field, which is stuck on "0".
<<

post_deleted isn't meant to be null, it should be 0

post_deleted_by and post_deleted_time can be null....it seems to work ok.