Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 Deleted cat/forum/reply/topic backlogs
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

bax
Junior Member

141 Posts

Posted - 21 August 2002 :  01:31:22  Show Profile
Because of the way our sites are designed, I need to ensure full data integrity. In other words, even if site adminstrators delete stuff, I need a record of it for later analysis. So, in the current version of Snitz, when stuff gets deleted by authors or moderators, it's gone forever. Topics, replies, etc. Gone. Not archived, just gone (at least, that's my understanding looking at the code). I don't want that.

So, I created 4 backlog tables (think I need one more for subscriptions), so that when a user deletes something, it is gone from the website, but not gone forever.

Backlog tables currently exist for category, forum, topic, reply. These tables are mirrors of their live tables, with one additional field, DATE_DELETED, which contains information about the date that this item was deleted (I should include WHO deleted it as well, but there's no easy way to do that).

The items are moved via INSTEAD OF triggers (had to use these because there are ntext columns in the tables, so normal triggers don't work). Therefore, this code is only supported with SQL Server 2000. I hope this is useful to someone. Nice thing about it is you don't have to touch the forum code, so if it changes, you're fine. If someone knows an easy way to add in the user who deleted this, that'd be cool. I can't think of one without changing forum code. Please let me know if this is useful.

Bryan

Backlogs can be downloaded from here:
http://bax.kleinbuendel.com/snitzStuff/forum_backlogs.sql

dayve
Forum Moderator

USA
5820 Posts

Posted - 21 August 2002 :  01:57:57  Show Profile  Visit dayve's Homepage
when I had 3.1SR4 I changed the code so that it did not delete the post but instead wrote a flag to a new field I created. Then I changed my SQL statement so that it would appear to be deleted to the members but admins would still see the post.

I plan on implementing that again here shortly..

Go to Top of Page

Etymon
Advanced Member

United States
2385 Posts

Posted - 21 August 2002 :  02:11:00  Show Profile  Visit Etymon's Homepage

Hi bax!

I am 100% with you on this one. Never liked the idea of losing important info especially for security reasons.

Questions: When you said, "So, in the current version of Snitz, when stuff gets deleted by authors or moderators, it's gone forever. Topics, replies, etc" are you referring to your current version or the new current version v3.4? Since v3.4 just came out I want to make sure which one you are speaking of.

Also, in the download you provided ... it's only for SQL, right? Do you have a variation for Access 2000?

Otherwise, I am very happy to see this MOD come to the board. Thanks so much for sharing it with us!


Cheers,

Etymon
Go to Top of Page

bax
Junior Member

141 Posts

Posted - 21 August 2002 :  02:23:19  Show Profile
Etymon:

Dayve's idea is the same type of thing. Dayve, you're basically just using a valid time stamp, and then only selecting items that are currently valid, correct? I thought about this approach, but that would involve changing all kinds of forum code, and I didn't want to do that (particularly since it seems to change quite often). However, if I ever DO want to implement the "deleted by" functionality, I'll probably have to. What I've created is basically a separate approach, that can be implemented without mucking about with the forum code. Since the forum code will CONTINUE TO CHANGE, I wanted an approach that will exist in perpetuity, so everytime I make an upgrade, I don't have to go change all this code.

Etymon: No, I don't work with Access 2000, this is SQL only. Anything I make will only be tested on SQL Server. If you want to do an Access version, I think you're going to have to use Dayve's approach, as I don't believe it can handle triggers and such. However, I could be wrong, and it wouldn't be the first time.

As for when I said, "in the current version", I meant the version that has been released publicly. When stuff is deleted from it, it's gone forever. What I have released helps prevent that.

Bryan
Go to Top of Page

bax
Junior Member

141 Posts

Posted - 21 August 2002 :  02:24:19  Show Profile
Dayve:

How extensive were the code changes you had to make? Seems to me you'd have to change every select statement thruout the forum code?
Go to Top of Page

Etymon
Advanced Member

United States
2385 Posts

Posted - 21 August 2002 :  02:27:08  Show Profile  Visit Etymon's Homepage

Thanks for the explanation, bax. It's still a nice MOD.

Dayve, could you please help me out with this conversion into Access 2000?
Go to Top of Page

bax
Junior Member

141 Posts

Posted - 21 August 2002 :  03:11:38  Show Profile
Etymon:

One thing you could do quickly for Access 2000. It wouldn't allow admins to still see the posts, tho - basically, this is the way to implement what I've done "by hand". Create same tables that I created. Then, find where the delete happens in the forum code (all in pop_delete, I believe). Before you delete something, insert it into the correct backlog table, then delete it. This is basically what the trigger does, just does it without me having to touch the forum code.

This works a bit different than what Dayve is doing (if I understand what you're doing Dayve), as his allows admins to still see stuff. However, this method would also require a lot less updating when the forum code changes.
Go to Top of Page

bax
Junior Member

141 Posts

Posted - 21 August 2002 :  03:47:40  Show Profile
Actually, my stuff isn't yet complete. Basically looks like every table needs a backlog to really work properly....
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.25 seconds. Powered By: Snitz Forums 2000 Version 3.4.07