I am creating a script that lock topics post automatically.

It is still writing and only finisehd the first part.
And now will build the admin UI so that users could modify the settings
in the acp.

open viewforum.php
[FIND]
<a href="http://ipost2host.com/viewtopic.php?f=13&t=1583#" target="_blank">
</a>
Code:
    $template->assign_var(&#39;RUN_CRON_TASK&#39;, &#39;[img]&#39; . append_sid($phpbb_root_path . &#39;cron.&#39; . $phpEx, &#39;cron_type=prune_forum&amp;f=&#39; . $forum_id) . &#39;[/img]&#39;);
}
[AFTER ADD]
<a href="http://ipost2host.com/viewtopic.php?f=13&t=1583#" target="_blank">
</a>
Code:
// Auto lock the topics from forums
$blr_config = array();
$blr_config[&#39;topic_auto_lock&#39;] = true;
$blr_config[&#39;topic_auto_lock_forums&#39;] = array(6);
$blr_config[&#39;interval&#39;] = 7;
$blr_interval = $blr_config[&#39;interval&#39;] * 24 * 3600;

$sql = &#39;SELECT COUNT(topic_id) AS num_posts
    FROM &#39;. TOPICS_TABLE . 
    " WHERE forum_id = $forum_id
        AND topic_type = " . POST_NORMAL . " AND topic_status = 0 AND (topic_time + $blr_interval) < " . time();

$result = $db->sql_query($sql);
$blr_count = (int) $db->sql_fetchfield(&#39;num_posts&#39;);
$db->sql_freeresult($result);

$lock_topics = in_array($forum_id, $blr_config[&#39;topic_auto_lock_forums&#39;]);

if ($blr_count && $lock_topics)
{
    $sql = &#39;UPDATE &#39; . TOPICS_TABLE .
        " SET topic_status = 1 
            WHERE forum_id = $forum_id
                AND topic_type = " . POST_NORMAL . " AND topic_status = 0 AND (topic_time + $blr_interval) < " . time();

    $db->sql_query($sql);
}
Enjoy and comments are welcome
I&#39;am update this when it finished.