[ABD] Auto lock topics

Any abandoned Extensions will be moved to this forum.

WARNING: Extensions in this forum are not currently being supported or maintained by the original Extension author. Proceed at your own risk.
Forum rules
IMPORTANT: Extension Development Forum rules

WARNING: Extensions in this forum are not currently being supported nor updated by the original Extension author. Proceed at your own risk.
Locked
CorporateGoth
Registered User
Posts: 10
Joined: Tue Nov 13, 2007 1:39 pm

[ABD] Auto lock topics

Post by CorporateGoth »

Extension Name: Auto lock topics
Author: CorporateGoth

Extension Description: Duplicate the functionality of auto prune, to allow for automatically LOCKING topics using the same thresholds (does not interfere with prune).
Extension Version: 0.1

Features:
  • Config is per-forum basis
  • Configurable time between auto lock sweeps.
  • Auto lock by last visit or last post (or both).
  • Auto lock options for stickys, announcements and polls.
  • While it copies some of the native phpBB prune code, it does not interfere with it.
  • The auto locking is performed by cron.
Development Repository: https://github.com/corporategoth/auto_lock_topics

Installation: Plugin goes under prez/auto_lock_topics

I hope this is useful to some. I wrote this mainly for my own board (which NEVER prunes topics, but locks old topics automatically to prevent ancient topics being resurrected). My board still has all topics in it's 12 year history online ;)
Korkel
Registered User
Posts: 391
Joined: Mon Jun 02, 2014 7:09 am
Location: ~/home/Liz/Desktop
Name: Liz Aalderink
Contact:

Re: [DEV] Auto lock topics

Post by Korkel »

Love this for spefic forums, does it also have the option to post an answer when locking?
"If you lose your left arm, your right arm will be left."
“The most important property of a program is whether it accomplishes the intention of its user.”
Image
CorporateGoth
Registered User
Posts: 10
Joined: Tue Nov 13, 2007 1:39 pm

Re: [DEV] Auto lock topics

Post by CorporateGoth »

Under the hood it is flipping the database flag from unlocked to locked. It does not attempt to post anything to the topics it locks right now. Besides which, who would it post from? and it would only be able to say the same thing each time (or at least per-forum).
Korkel
Registered User
Posts: 391
Joined: Mon Jun 02, 2014 7:09 am
Location: ~/home/Liz/Desktop
Name: Liz Aalderink
Contact:

Re: [DEV] Auto lock topics

Post by Korkel »

CorporateGoth wrote:Under the hood it is flipping the database flag from unlocked to locked. It does not attempt to post anything to the topics it locks right now. Besides which, who would it post from? and it would only be able to say the same thing each time (or at least per-forum).
Well, I got some forums (2) which got special permissions and needs an auto-lock with response if someone doesn't response.
"If you lose your left arm, your right arm will be left."
“The most important property of a program is whether it accomplishes the intention of its user.”
Image
Holger
Registered User
Posts: 1821
Joined: Tue Mar 12, 2002 3:54 pm
Location: Hannover

Re: [DEV] Auto lock topics

Post by Holger »

Very cool! Thanks!
PR for Swedish translation sent.

Feature request: show a button in the locked topic where the users can start a similar thread and add crossreferences to both.
Korkel
Registered User
Posts: 391
Joined: Mon Jun 02, 2014 7:09 am
Location: ~/home/Liz/Desktop
Name: Liz Aalderink
Contact:

Re: [DEV] Auto lock topics

Post by Korkel »

Last active:13 Apr 2015, 16:42

So we won't see any update, sadly. I need this.
"If you lose your left arm, your right arm will be left."
“The most important property of a program is whether it accomplishes the intention of its user.”
Image
User avatar
Jessica
Former Team Member
Posts: 4342
Joined: Sun Jul 18, 2010 2:53 pm
Location: Pennsylvania, USA
Name: Jessica
Contact:

Re: [DEV] Auto lock topics

Post by Jessica »

Korkel wrote:Last active:13 Apr 2015, 16:42

So we won't see any update, sadly. I need this.
That was only 8 days ago. Doesn't mean the extension author has gone inactive. Author could have real life stuff going on.
Pro-choice, Atheist, Pro-LGBT rights
Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid. - Albert Einstein
Mattix
Registered User
Posts: 25
Joined: Sat Oct 25, 2014 7:00 pm

Re: [DEV] Auto lock topics

Post by Mattix »

Do both checks (last post and viewed age) have to be true for a topic to be locked? Or is it either?

edit: on examining the code, a topic will get locked if either is true. An OR-relationship.
Mattix
Registered User
Posts: 25
Joined: Sat Oct 25, 2014 7:00 pm

Re: [DEV] Auto lock topics

Post by Mattix »

Finally got this working, there is an essential piece of info missing from the installation instructions, without which the cron isn't triggered:

Search viewforum.php for:

Code: Select all

if (!$config['use_system_cron'])
Add below the closing bracket for that if-statement:

Code: Select all

if (!$config['use_system_cron'])
{
	$cron = $phpbb_container->get('cron.manager');

	$task = $cron->find_task('cron.task.core.auto_lock_forum');
	$task->set_forum_data($forum_data);

	if ($task->is_ready())
	{
		$url = $task->get_url();
		$template->assign_var('RUN_CRON_TASK', '<img src="' . $url . '" width="1" height="1" alt="cron" />');
	}
}
With this addition the extension works as advertised.
User avatar
Raul [ThE KuKa]
Style Customisations
Style Customisations
Posts: 8495
Joined: Mon Dec 08, 2003 9:24 pm
Location: Spain
Name: Raul Arroyo
Contact:

Re: [DEV] Auto lock topics

Post by Raul [ThE KuKa] »

You should correct some things in extension, for example underscores are not allowed in the name of the extension. ;)

Read this please:
https://www.phpbb.com/extensions/writing/#a-packaging

Best regards.
All unsolicited PMs will be ignored.
:warning: Knowledge Base | Documentation | Board rules | phpBB Styles Rules & Policies | Styles Queue Stats :warning:


If you like my styles, translations, etc. and want to show some appreciation, then feel free to Donate.
:flag_es: phpBB Spain - Online Since 2003 :heart:


Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 26823
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: [DEV] Auto lock topics

Post by Paul »

This topic has been marked as [ABD] - Abandoned as the extension author has not been active recently. If the extension author wishes to continue development, please PM anyone on the Extensions Team to request this topic be unlocked.

Notice!
We do not recommend that a user of the phpBB software install this extension, or any other extension that is marked as “abandoned” or “in development”, on a live forum. Doing so may cause your forum to not perform in the manner it should.


Thank you,
The phpBB Extensions Team
Knock knock
Race condition
Who's there?

My BlogMy Photosmy phpBB Extensionscustom phpBB work & Development
Locked

Return to “Abandoned Extensions”