News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Auto Purge Old Topics

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

Previous topic - Next topic

Shambles


6Dasher

Hi,

I used to use the old version and was glad the update came out. It installed without a hitch on 2.0.2.
SMF user since 2005.

Arantor

I've updated this for 2.0.7 (and taking it back over)

Hj Ahmad Rasyid Hj Ismail

Nothing serious to report. The mod is working fine. Just minor undefined errors which I am too lazy to find a fix.  ;)

http://anypost.qom.my/index.php?topic=471.new
8: Undefined index: autoPurge_0

http://anypost.qom.my/index.php?action=profile;u=937
8: Undefined index: autoPurge_0

1667: // figure out the timestamp for each board - and build a list
1668: $topics_to_purge = array();
1669: if(count($boards_to_purge)) {
1670: foreach($boards_to_purge as $board_id) {
1671: $setting = 'autoPurge_' . $board_id;
==>1672: if($modSettings[$setting] > 9999)
1673: $modSettings[$setting] = 9999;
==>1674: $timestamp = time() - ($modSettings[$setting] * 86400);
1675: $topicquery = 'SELECT t.id_topic
1676: FROM {db_prefix}topics t
1677: INNER JOIN {db_prefix}messages m ON t.id_last_msg = m.id_msg
1678: WHERE t.id_board = {int:id_board}
1679: AND m.poster_time <= {int:timestamp}';
1680: $topicquery .= (!empty($modSettings['autoPurge_sticky']) && $modSettings['autoPurge_sticky']) ? '' : ' AND t.is_sticky = 0';

Arantor

That's interesting. How did you configure it in the admin panel?

I'll try and look at this one tomorrow but it's been years since I last looked at it, I don't really remember how it works but I'll try to figure it out.

Hj Ahmad Rasyid Hj Ismail

Normal setting. Auto Purge checked. 5 days. Auto purge working fine though.

Arantor

What settings are in the smf_settings table whose names begin with autoPurge_ ?

Hj Ahmad Rasyid Hj Ismail

autoPurge_1   5
autoPurge_sticky   1

Arantor

Except the error being thrown relates to an autoPurge_0 which I don't understand.

Hj Ahmad Rasyid Hj Ismail

I sorted the table and there was no other data except the above. May be I should uninstall and reinstall. I will report this later.

Hj Ahmad Rasyid Hj Ismail

Well, just to report, despite uninstall and reinstall, it is still there. The same undefined error.

By the way, can this mod be extend to members? Auto Purge Inactive Members (may be with warning like after 3 times warnings or so)?

Arantor

Not without a complete rewrite and to be honest I'd do it over from scratch if I were going down that road

@rjen

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

Taken over by @rjen

*** support for old version dropped ***
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

stoo23

Hi there,

I was wondering if this Mod' can be used with version 2.1.4 AND is it possible to have it function basically on Only One board ??

We have a use for that function, which in theory this mod could be perfect for, just wanted to check first (although I do have a test forum to try it on) :)

thanks in advance
Stewart

@rjen

Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

stoo23


stoo23

Hi again, well, the Mod' certainly works (as described)  :)  BUT

On my 'test' forum, it seems to be creating 'cron' related errors ??
as the Mod IS working, is Not a Big issue but would be great to work out why and Fix it before I install it on the Main Forum.

You cannot view this attachment.

You cannot view this attachment.

Any ideas or help, would be greatly appreciated.
cheers,
Stewart

@rjen

I have seen those too, and I now why they are there: it is because the mod moves the topics with the standard SMF function. When permanently deleting topics (no recycle bin) the function attempts to check the post count of the current member. Since the con job does not actually have a member id this message is the result.

It is annoying, but as far as I can see has nog negative impact
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

stoo23

OK, I was wondering about the 'reference' to a member.

We ARE using a 'Recycle Bin' though or won't that make Any difference ??

@rjen

I remember now: the way I adapted the mod skips the recycle bin.

It's been while, not sure though ...
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

Advertisement: