Auto-pruning in 2.2

Discussion of general topics related to the new version and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Forum rules
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Post Reply
User avatar
haravikk
Registered User
Posts: 292
Joined: Sun Apr 20, 2003 5:05 pm
Contact:

Auto-pruning in 2.2

Post by haravikk »

Hey, I'm wondering what file(s) actually handle auto-pruning in v2.2 (or rather 2.1)?
I'm mainly just curious to see how phpBB is currently doing this, as php doesn't seem to be all that good a language for scheduling things like automatic forum pruning and the like.
Images in sigs! please.
RyanThaDude29
Registered User
Posts: 90
Joined: Tue Apr 15, 2003 5:46 am
Location: Northwest Indiana
Contact:

Re: Auto-pruning in 2.2

Post by RyanThaDude29 »

I found this in viewforum.php

Code: Select all

// Do the forum Prune thang - cron type job ...
	if ($forum_data['prune_next'] < time() && $forum_data['enable_prune'])
	{
		include_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx);

		if ($forum_data['prune_days'])
		{
			auto_prune($forum_id, 'posted', $forum_data['forum_flags'], $forum_data['prune_days'], $forum_data['prune_freq']);
		}
		if ($forum_data['prune_viewed'])
		{
			auto_prune($forum_id, 'viewed', $forum_data['forum_flags'], $forum_data['prune_viewed'], $forum_data['prune_freq']);
		}
	}
Graham
Registered User
Posts: 1304
Joined: Tue Mar 19, 2002 7:11 pm
Location: UK

Re: Auto-pruning in 2.2

Post by Graham »

As it stands at present (and in 2.0.x) the auto-pruning does not run on an exact schedule, but rather it runs on the next page view of the relevant script after the time it should run using a test (as above) to determine if it should run or not.
"So Long, and Thanks for All the Fish"

Graham
Eeek, a blog!
Post Reply