Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForumForumDelete a thread after certain daysDelete a thread after certain days
Previous
 
Next
New Post
11/18/2008 3:50 PM
 

A addOn is a single module / control which you can code in vb.NET or C#.NET by using the DotNetNuke Framework and the Forum Module.  Only chnages to the database have no effect to the Module, about there is no object in the code what can handle your new procedure.

 
New Post
11/19/2008 2:27 PM
 
gboyer wrote

ucann:

I would also like to be able to purge off Posts and/or Threads that are "expired".  I would like to purge any that are older than 1 month.

Have you found any resolution?

Thanks.

 
Hi gboyer,
 
I am working on it now. Basically it is working but I still need to work on it.
 
My solution is to use a stored procedure called Forum_Post_Delete that comes with the Forum module. This procedure has four variables:
 
@PostID INT,
@ModID INT,
@Notes NVARCHAR(1024),
@PortalID INT
 
As I mentioned in my previous post, I only delete threads in a “Buy and Sell” group when their posting date is expired. So there are some conditions in my case which are:
 
Group ID is fixed – “Buy and Sell” group
Mod ID is fixed – who executes the deletion and who is me
Posting date – variable
 
To use procedure Forum_Post_Delete needs, you need to determine PostID, and the PostID must be determined by the expired date. The postID can be selected from below SQL statement
 
SELECT DISTINCT Forum_Threads.ThreadID
FROM         Forum_Forums INNER JOIN
                      Forum_Groups ON Forum_Forums.GroupID = Forum_Groups.GroupID INNER JOIN
                      Forum_Threads ON Forum_Forums.ForumID = Forum_Threads.ForumID INNER JOIN
                      Forum_Posts ON Forum_Threads.ThreadID = Forum_Posts.ThreadID
WHERE     (Forum_Groups.GroupID = 5) AND (DATEDIFF(day, Forum_Posts.CreatedDate, GETDATE()) >= 14)
 
GroupID = 5, in my case, because it is fixed.
 
Then I write my own stored procedure:
 
ALTER procedure ZZZ_UCCAN_Forum_Thread_Delete
AS
DECLARE @@Thread_ID INT
 
Set @@Thread_ID = (SELECT DISTINCT Forum_Threads.ThreadID
FROM         Forum_Forums INNER JOIN
                      Forum_Groups ON Forum_Forums.GroupID = Forum_Groups.GroupID INNER JOIN
                      Forum_Threads ON Forum_Forums.ForumID = Forum_Threads.ForumID INNER JOIN
                      Forum_Posts ON Forum_Threads.ThreadID = Forum_Posts.ThreadID
WHERE     (Forum_Groups.GroupID = 5) AND (DATEDIFF(day, Forum_Posts.CreatedDate, GETDATE()) >= 1))
 
EXEC Forum_Post_Delete @PostID = @@Thread_ID,@ModID = 64,@Notes="Expired deletion",@PortalID = 0
 
Hopefully it works for you as well.

 

 

 
New Post
11/19/2008 4:19 PM
 

A thread can have more than one post. In my case, I delete thread rather than post. This deletion, as I tested, will cascade delete post(s) as well. This is what I need to do.

Selected Thread_ID (expired thread) can have more than one. My procedure above needs to add cursor to delete all expired threads.

 
New Post
11/20/2008 9:40 AM
 

The next version separates delete thread and delete post, and the delete post sproc is heavily modified because of it. Just an FYI for ya.


Chris Paterra

Get direct answers to your questions in the Community Exchange.
 
New Post
11/20/2008 10:40 AM
 

Crispy wrote
 

The next version separates delete thread and delete post, and the delete post sproc is heavily modified because of it. Just an FYI for ya.

This is very good to know. Thanks for sharing information.

By the way, I noticed that I can see CFKeditor now. Here is the picture I taken in this fall. Just for testing....

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForumForumDelete a thread after certain daysDelete a thread after certain days


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out