News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Auto Purge Old Topics

Started by @rjen, October 06, 2009, 11:36:19 AM

Previous topic - Next topic

@rjen

Link to the mod

Original author: Arantor

Description:
An addition to the Auto Lock Old Topics mod, this mod adds a Scheduled Task to check for topics that have not been replied to in a while, and automatically removes them.

You can change it on a per-board setting, so different boards have different amounts of time if you like, and you can specify never to remove old posts.

By default the task will only select locked topics allowing the admin to use this mod as an add-on to the Auto Lock mod by first locking the topics and then moving topics to the recycle bin. An option is provided to let the mod purge all topics and not just locked topics.

You can also have it optionally ignore or remove sticky topics.

Posts are purged in this manner:
  • They do go to the recycle bin, allowing you to undo accidentally purged topics
  • Do NOT get removed from member post counts
All extra information attached to the old topics that haven't been replied to is also removed - polls, calendar entries, log of what has been read etc. so on forums that don't need to archive posts this would be an excellent way of keeping space managed.

This new version is created for SMF2.1 and is all hooks
No support is provided for older versions of SMF.


Version history:
2.0 - 6 April 2023
Compatibility for 2.1.x (all hooks)

Taken over by @rjen

*** support for old version dropped ***

1.3.2 - 27 January 2014
Compatibility for 2.0.7 (no code changes)

1.3.1 - June 22, 2013
Compatibility for 2.0.4 (no code changes)

1.3 - July 28, 2012
Added compatibility for 2.0 - 2.0.2
Dropped support for all RC versions

1.2 - November 1, 2009
Added compatibility for RC2

1.1 - October 19, 2009
Minor bugfix regarding admin panel quick search

1.0 - September 25, 2009
Original release
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

imrich


Arantor


imrich

Thanks! This seems perfect. For a future version, it would be nice to have the option to send posts to the 'recycle bin' for some boards.

Then use the ability to prune the recycle board too. :)

Thanks for this mod, it's sorely needed for SMF 2.


Arantor

The idea of this mod is to purge old posts. I don't really want to get into the realms of putting it into the recycle bin on the basis that if it's 30 days old without a reply, all you're doing is moving it to the recycle bin for ANOTHER 30 days where it likely won't get a reply anyway, then you just purge it again.

Thus as I see it you just hold those topics around longer without any real benefit.

imrich

I understand this, thanks.

I was hoping to use it for helping to automate moderation of a board I have.

As an example, members can post 'for sale' items in the 'for sale' board.  But these postings tend to get stale as people post them and then forget about them. To keep them 'fresh' we delete them after 15 days of inactivity.

Sometimes we have someone who was away for a day or two miss the deadline of 15 days and they get upset that the posting was deleted and we have to 'bring it back'.  We do this via the recycle bin.

The recycle bin would be set for a 30 or 45 day purge period. So posts can stay in there a bit longer than the 'for sale' board, but not too long. ;)

If we had the ability to choose which boards posts would be sent to the 'recycle bin' or not, we could have complete control! I shorter period on the 'send to the recycle bin' boards, and a longer period on the 'recycle bin', where posts would be deleted forever would be ideal.

I understand if this mod doesn't support this and for your reasons for doing it. I do appreciate this mod. I wish it was a core feature of SMF!  However, having the ability to schedule a 'delete' (which would send a topic to the 'recycle board' if it exists would be great.

It may be easier to create a new mod, one that moves items to the recycle board if it exists, and then this one that purges them forever. It could be used if no recycle board exists, or to purge the recycle board itself.

Either way, thanks for this mod, I have needed this for a while.

I installed it on my SMF 2 RC1.2 test forum without any errors, and I'll start testing it further.

Thanks again!

Arantor

Hmmm, interesting idea.

I'd possibly see the necessity of having it be able to move topics to different boards, e.g. move some to recycle bin, others to just a read-only archived board.

I'll play around with how that might work in interface terms and likely bring out Auto Move Old Topics, though I am also debating making an all-in-one mod for all three at some point.

imrich

Thanks for considering it.

I'll keep an eye on this thread in anticipation. :)


darrenbeige

Quote from: Arantor on October 08, 2009, 02:47:34 PM
Hmmm, interesting idea.

I'd possibly see the necessity of having it be able to move topics to different boards, e.g. move some to recycle bin, others to just a read-only archived board.

I'll play around with how that might work in interface terms and likely bring out Auto Move Old Topics, though I am also debating making an all-in-one mod for all three at some point.

Auto Move Old Topics sounds very neat indeed.

Arantor

AMOT will be 2.0 only but I'm really leaning towards the idea of a single mod for 1.1 as well.

In hindsight a mod that adds all three for 2.0 would be no different to having each of the three separate mods just all attached together in a single package.

swtdivalove

An interesting idea to go with this is the ability to Auto Archive also once the pruning is done and if selected to auto archive.

Maybe even setting it as a CSV that can be downloaded also?  This would save having to download the entire database and sifting through tons of stuff that may or may not pertain to the actual archive.

Arantor

What do you mean by 'auto archive'? There are at least three different meanings that could be derived to, one of which is what this mod already does, one of which is what Auto Move Old Topics would do and the last is to automatically store it in a zip file as a partial SQL backup.

I do not plan on writing a backup script.

darrenbeige

I'd support a complete package for 1.1 (although I'd probably just scratch completely the auto-locking code), but if you don't I am still inclined to port the 'Auto Move' mod to 1.1

Arantor

Except that the key part of it is a scheduled task, which just doesn't exist in 1.1, which is why I was so determined I'd never backport it.

But if you have three parts, there is really sufficient impetus to make a single scheduler to hook all three into.

darrenbeige

I haven't really examined SMF2 or its Scheduled Tasks, but aren't they just an equivalent of a cron?

Arantor

They are an equivalent of cron, but there isn't a cron interface in 1.1, at least not directly.

There also isn't a handy area mod authors can just drop settings into (unlike 2.0's Admin > Modifications area)

darrenbeige

Couldn't you just direct people in tge installation instructions to also run the cron?

swtdivalove

Quote from: Arantor on October 10, 2009, 03:31:02 PM
What do you mean by 'auto archive'? There are at least three different meanings that could be derived to, one of which is what this mod already does, one of which is what Auto Move Old Topics would do and the last is to automatically store it in a zip file as a partial SQL backup.

I do not plan on writing a backup script.

My apologies, I did not know or did not understand that it was doing all of these things.

Arantor

It isn't as simple as that, in fact.

The 2.0 mods also currently rely directly on a 2.0 only feature to simplify the admin area; there is no feature in 1.1 that provides a dedicated configuration area for mods (whereas 2.0 has Configuration > Modifications)

So it's a further edit to set that up too.

But even getting past that, setting up cron is not available on many shared hosts, even those with cPanel access, meaning the option is completely useless for them. It would be a support nightmare for me to write a mod and attempt to support it on every variation of host out there, whereas it would be feasible to have a scheduled task setup.


Edit: It doesn't. I wanted to know what you meant by auto archive, since it has 3 meanings, one already covered, one due to be covered and one I'm not going to write.

Advertisement: