PDA

View Full Version : New Thread Count Wrong


Scott MacVicar
11 Feb 2002, 18:17
I'm guessin when you show the count of new threads its including those in private forums, i've added a screen shot.
When i came here it said 51 Updated Threads but when I get new it only shows 50 and as vBulletin checks for private forums in the getnew function i'm presuming its a bug in the coding.

Scott MacVicar
11 Feb 2002, 18:20
and after i've clicked getnew

Chen
11 Feb 2002, 18:31
The weird thing is, I also get a wrong thread count sometimes... could it be they're hiding a forum from me? :eek:

Anyhow just recently someone mentioned a new way to get these stats (total posts/threads) and I'll try to implement it.

Thanks for the heads up. :)

Scott MacVicar
11 Feb 2002, 18:34
I wish i had looked at the hack now

$getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM thread WHERE lastpost > '$bbuserinfo[lastvisit]'");
$getnewpost=$DB_site->query_first("SELECT count(*) AS posts FROM post WHERE dateline > '$bbuserinfo[lastvisit]'");

is the hack

I suppose you could make some minor alterations to the hack, to make this work.

you need to move the following section of code under the query which gets access table permissions.

foreach($ipermcache as $forumid => $perms) {
if($perms['canview']) {
$goodforums[] = $forumid;
}
}
if(!empty($goodforums)) {
$forumperms='AND forumid='.implode(' OR forumid=',$goodforums);
}
$getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM thread WHERE lastpost > '$bbuserinfo[lastvisit]' $forumperms");
$getnewpost=$DB_site->query_first("SELECT COUNT(*) AS posts FROM post WHERE dateline > '$bbuserinfo[lastvisit]' $forumperms");

So you add this below
// if user is know, then welcome

and then relocate the entire piece of code to below
} else {
$accesscache = '';
}

this won't have any effect on the forums