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.