Auto Purge Old Topics

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

Previous topic - Next topic

darrenbeige

Arantor, if you're planning a mod for 1.1 that will include a scheduled task element, you might aswell release the component as a separate mod entirely, and then merely depend on that with these three mods.

With regards to there being no direct modification panel, I for one would merely hardcode my 'decision' in (deleting any redundant options), adapting the code from 2.0 and setting a cron. Now, I realize that many users of SMF don't want/can't do that, but it is that much of an ask to request in the Installation to say 'setup a cron that will run every day which will execute this file: cron.php', and have the modSettings appear as a subsection of Boards, or underneath Moderators labelled 'Automatic Moderation'.

Thanks,

Arantor

No, I can't do that. One of the guidelines for mods is that they must be able to stand alone and not require any pre-existing mod. It can use features given by a mod but only if it works on its own.

As for your suggestion, actually, yes IMO it would be too much to ask of many users. Many of our users are on shared hosting that does not allow access to cron configuration, and the ones that do usually have all different options for cron meaning that it would be a support nightmare because every single case will be different.

Engineering a standalone scheduled tasks component that is as powerful as 2.0's is (i.e. that could support hook ins like 2.0's does) would basically mean backporting the entire system back to 1.1, which is not only a large job, it is also bordering on contravention of the license of SMF since it's redistribution of SMF sources.

It would be far easier to build a single one for this mod to support the three tasks (and only these three tasks) which is the route I'm planning on taking, especially since I originally intended never to backport any of this to 1.1.

darrenbeige

Fair enough. Would the scheduled tasks code you are trying to add slow down a 1.1 installation considerably?

imrich

I'd love to see the three in one mod. :)

It also may be nice to be able to select 'auto purge stickies' per board, to allow for flexibility, but this is not a hard requirement yet.

Thanks for your consideration.

Arantor

Quote from: darrenbeige on October 11, 2009, 06:16:01 AM
Fair enough. Would the scheduled tasks code you are trying to add slow down a 1.1 installation considerably?

No, but it *would* slow it down a little. I'm planning to not use DB queries (unlike 2.0) meaning that it would be much messier to add full blown scheduled tasks.

Quote from: imrich on October 11, 2009, 08:35:06 AM
I'd love to see the three in one mod.

For 1.1 it would be a single mod. For 2.0... it would actually look no difference to if you installed all three separately.

Quote from: imrich on October 11, 2009, 08:35:06 AM
It also may be nice to be able to select 'auto purge stickies' per board, to allow for flexibility, but this is not a hard requirement yet.

That'd be a rewrite, not a little feature add. Possibly doable for 1.1 version but I doubt I'll do that to be honest.

Arantor

Right. I thought more about this.

I will do Auto Move Old Topics, for those who just want the individual options.

Then at some point after - NOT immediately - I will write Auto Maintain Old Topics, which has all three in a single mod package, runs on both 1.1 and 2.0 (since it actually makes sense for me to do that in hindsight) but tie it into the board configuration rather than the setup I originally had. I suspect the 2.0 version will only be done in time for RC2 though.

Just seems to me to be the cleanest way to approach all this.

darrenbeige

That's sound like a good way of going about it.

imrich

#27
I think I found a small bug with this mod.

In SMF 2.0 RC1.2, if you use the Aministration Center's 'Quick Search' feature and type in any text, you receive the error message:

Quote
Fatal error: Call to undefined function ManageAutoPurge() in . . . /forum/Sources/Admin.php on line 888

The error message complains that there is no ManageAutoPurge() defined, although I see this in Admin.php


// Mod authors if you want to be "real freaking good" then add any setting pages for your mod BELOW this line!
array('ManageAutoPurge', 'area=modsettings;sa=autopurge'),



I'll look into this some more, but let me know if you find anything on this.



imrich

#28
Hmmm... looking into the mod, this code:

// Mod authors if you want to be "real freaking good" then add any setting pages for your mod BELOW this line!
array('ManageAutoPurge', 'area=modsettings;sa=autopurge'),


Really should have been this instead:


// Mod authors if you want to be "real freaking good" then add any setting pages for your mod BELOW this line!
array('ModifyAutoPurge', 'area=modsettings;sa=autopurge'),



Arantor

Indeed it should. I never realised that before, to be honest. (You're the first person to point it out to me, so thanks :))

Note that Auto Lock Old Topics (and possibly a few others) are similarly affected.

Thanks for pointing it out :) I'll release a fix momentarily.

imrich


steve51184

would it be possible to have an option to move the topics and not delete them?

Aunt Sally

Is there a way (or a mod) to auto purge old topics on SMF 1.1.11 ?

I can do it manually but it would save a lot of scheduled work to do it automatically.


GazOutEast

Hi Arantor

I'm hoping you'll update the Auto Purge Old Topics for 2.0 RC4 real soon

I just did the daftest thing in upgrading a site that depends on it (from RC2 to RC4) without thinking to check that the mod had been updated.

Now I have to manually prune 260 freelance job-listing boards every day.

Dohhhh - I feel a right wally, right now.

Gaz
I have 20:20 vision - I can see anything bigger than 20" x 20"

willemjan


Arantor

*shrug* Probably. There's no technical reason why it shouldn't.

rocknroller


willemjan

Quote from: Arantor on March 25, 2011, 11:10:04 AM
*shrug* Probably. There's no technical reason why it shouldn't.

Just so you know... It does ;)

imrich

Will you be updating this for 2.0 final? I hope so, thanks!

amiralib

hurry up .... we need it
2.0.2

Advertisement: