Auto lock for old posts

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Anti-Spam Guide
angelorosso
Registered User
Posts: 9
Joined: Sun Apr 22, 2012 4:32 pm

Re: Auto lock for old posts

Post by angelorosso » Wed Nov 14, 2012 8:01 pm

in fact, move the topic in a basket makes the forum cleaner.

corleoner
Registered User
Posts: 189
Joined: Wed Jan 29, 2014 9:57 pm

Re: Auto lock for old posts

Post by corleoner » Mon Nov 30, 2015 1:31 am

HGN wrote:You have to know the forum_id's of the forums you want to apply the function to.

The code should be changed to

Code: Select all

$lock=time()-86400*30;
$sql="update ".TOPICS_TABLE." set topic_status='".ITEM_LOCKED."' where topic_last_post_time<".$lock." AND forum_id IN (id1, id2, id3)";
$db->sql_query($sql);
Replace id1, id2, id3 with the applicable forum id's .

Hey guys.

I added this code for a forum dedicated to threads which get too argumentative.

I've adapted this edit to make the threads lock after 48 hours of inactivity.

I have two questions.

With this current code as is, I can not move any threads into the forum id which uses this timed lock function.

It will allow me to move topics into other forums, but when I try to move topics into the forum added to this code, it just keeps the topic in the current forum it originated in rather than moving it.



Second question:

Is there a way to change to code, so that topics become locked within a time frame after being moved into the appropriate forum (rather than time limit from last post?).

Ideally, I'd like topics to lock 48 hours after they get moved(or 48hrs after the last post time before being moved). This allows any stubborn members to finish their dumb arguments and then the thread is locked for good.


If the second question is too difficult, I'd be happy to find a fix into how I can move topics while using the code.

Thanks for any help.

Locked

Return to “[3.0.x] MOD Requests”

Who is online

Users browsing this forum: No registered users and 21 guests

cron