This is what I have put in my globals.php, replacing what the original hack prescribed.
PHP Code:
// #############################################################################
// activity since last visit hack
$forumids = array_keys($forumcache);
foreach($forumids AS $key => $value) {
$fperms = &$bbuserinfo['forumpermissions']["$forumid"];
$forum = &$forumcache["$forumid"];
if (!($fperms & CANVIEW) OR !($fperms & CANSEARCH) OR !verify_forum_password($forumid, $forum['password'], false)) {
unset($forumids["$key"]);
}
}
$getnewthread=$DB_site->query_first("
SELECT COUNT(*) AS threads
FROM " . TABLE_PREFIX . "thread
WHERE lastpost IN(" . implode(', ', $forumids) . ") > '" . $bbuserinfo['lastvisit'] . "'
");
$getnewpost=$DB_site->query_first("
SELECT COUNT(*) AS posts
FROM " . TABLE_PREFIX . "post
WHERE dateline IN(" . implode(', ', $forumids) . ") > '" . $bbuserinfo['lastvisit'] . "'
");
But I got a database error, so... I guess I can't figure it out. I'm used to php, but this is the first experience I've had with vB's scripts. What am I missing?