Back to vBulletin 3.0 Add-Ons

Automatically Lock Old Threads (Via vB Cron)
Mod Version: 1.00, by Gavin B.

This modification is in the archives.
vB Version: 3.0.7 Rating: (0 vote - 0 average) Installs: 3
Released: 30 May 2005 Last Update: Never Downloads: 2
Not Supported  

This vB cron allows you to define a certain period of time for threads to be automatically locked.
  • Copy-paste the following into a new PHP file, and upload to ./includes/cron/YOURFILENAME.php
  • Enter the adminCP and go to scheduled tasks, click "add new scheduled task"
  • Setup when you want the script to run, and add the filename into the 'filename' field.

PHP Code:
<?php

    error_reporting
(E_ALL & ~E_NOTICE);
    
    
// start editing
    // forum ID's to monitor - put a comma between each one
    
    
DEFINE('FORUM_IDS''15,59,14');
    
    
// time span to go back to.
    // eg for months use; 6 MONTH or 9 MONTH
    // years; 1 YEAR or 2 YEAR
    // days; 5 DAY or 29 DAY
    
    
DEFINE('TIME_SPAN''6 MONTH');    
    
    
// stop editing here
    
    
if (!is_object($DB_site))
    {
        exit;
    }    
    
    
$DB_site->query("UPDATE " TABLE_PREFIX "thread SET open=0 WHERE forumid IN("FORUM_IDS .") AND FROM_UNIXTIME(dateline) <  DATE_SUB(CURDATE(),INTERVAL "TIME_SPAN .")");
    
    
log_cron_action('Old Threads Locked'$nextitem);

?>

Download

This modification is archived and cannot be downloaded.

Similar Mods

Threads that lock themselves... vBulletin 2.x Full Releases

vblts.ru supports vBulletin®, 2022-2024