Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Auto Expiration of Posts ?

Quote Reply
Auto Expiration of Posts ?
hello -

When setting up a new forum I set the "days to save new post data"
to a certain number of days.

I assumed that these posts would then disappear but no ....

How can I automatically makes posts in my forums disappear after a certain amount of days.

tks denny
Quote Reply
Re: [tmughostmaster] Auto Expiration of Posts ? In reply to
That field is only an optimization value for "new" post data - that is, the length of time GForum remembers which posts are new - on large forums, it can be a big optimization to forget this data if a person hasn't entered the forum in quite a long time.

GForum has no capability to automatically delete the old posts. You can manually do it through the Post menu in the admin panel, or you can set up a cron job to run nightly which runs:

perl -e 'use lib "/path/to/your/admin"; use GForum; GForum::init("/path/to/your/admin"); use GForum::Post; GForum::Post::delete_old(DAYS, FORUM_ID);'

You need to replace the colored values. For example, if you wanted to delete posts more than 30 days old from the forum with ID 6, you would substitute DAYS with 30, and FORUM_ID with 6. If you omit FORUM_ID entirely, it will delete threads older than 30 days from ALL forums. Note that prior to version 1.2.0, the FORUM_ID value was not supported: old posts from all forums were deleted.

Jason Rhinelander
Gossamer Threads
Quote Reply
Re: [Jagerman] Auto Expiration of Posts ? In reply to
Thank your very much