Automatic Lock
#1
Hope you find it useful... Rolleyes

<?php
/**
 * Lock!
 * Made for www.bhtuning.com
 */

include("inc/config.php");

$link = mysql_connect($config['database']['hostname'],$config['database']['username'],$config['database']['password']);
if (!$link) {
    die('Error: ' . mysql_error());
}

mysql_select_db($config['database']['database']);
mysql_query("SET NAMES UTF8");

$days = '180';
$timelock = time() - ($days * 24 * 60 * 60);

$query = 'UPDATE forum_threads SET closed = 1 WHERE lastpost < '.$timelock.' AND sticky=0;';
mysql_query($query);

mysql_close($link);
echo("Threads locked.");
?>

Please move this thread to "General Support", I've made a mistake when posting.


Forum Jump:


Users browsing this thread: 1 Guest(s)