To be honest i'm not sure what is used. When adding the timestamp to the database i've just used TIMENOW the same as I have used it above.
Just realised the error with the $hc_time and have sorted it thanks, but still not working.
Thanks, Paul.
Updated Code:
PHP Code:
<?php
if ($vbulletin->options['helpcenter_auto_close']>0){
$ticketreply = $vbulletin->db->query_first("SELECT * FROM " . TABLE_PREFIX ."helpcenter_ticket");
while ($ticket = $vbulletin->db->fetch_array($ticketreply))
{
$ticketid = $ticket['ticketid'];
$hc_time1 = TIMENOW;
$hc_time2 = $vbulletin->options['helpcenter_auto_close'];
$hc_timediff = intval($hc_time1-$hc_time2);
if ($ticket['datelastupdate']<=$hc_timediff){
$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX ."helpcenter_ticket SET ticketstatus=0 WHERE ticketid=$ticketid");
}
}
}
?>