#!/usr/bin/env php forum); $category = getCategory($forum->category); if ($category->is_helpdesk) { $diff = ($now - $thread->create_time)/86400; $activity = ($thread->sufferers+1)/$diff; echo "help $diff $activity\n"; } else { $sql = "select * from post where thread=$thread->id"; $result2 = mysql_query($sql); $activity = 0; while ($post = mysql_fetch_object($result2)) { $diff = $now - $post->timestamp; $diff /= 7*86400; $activity += pow(2, -$diff); } echo "forum $activity\n"; } $sql = "update thread set activity=$activity where id=$thread->id"; mysql_query($sql); } ?>