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>[AFTER ADD]Code:$template->assign_var('RUN_CRON_TASK', '[img]' . append_sid($phpbb_root_path . 'cron.' . $phpEx, 'cron_type=prune_forum&f=' . $forum_id) . '[/img]'); }
<a href="http://ipost2host.com/viewtopic.php?f=13&t=1583#" target="_blank">
</a>Enjoy and comments are welcomeCode:// Auto lock the topics from forums $blr_config = array(); $blr_config['topic_auto_lock'] = true; $blr_config['topic_auto_lock_forums'] = array(6); $blr_config['interval'] = 7; $blr_interval = $blr_config['interval'] * 24 * 3600; $sql = 'SELECT COUNT(topic_id) AS num_posts FROM '. 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('num_posts'); $db->sql_freeresult($result); $lock_topics = in_array($forum_id, $blr_config['topic_auto_lock_forums']); if ($blr_count && $lock_topics) { $sql = 'UPDATE ' . 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); }
I'am update this when it finished.


LinkBack URL
About LinkBacks

Reply With Quote

Bookmarks