View Full Version : New Thread Count Wrong
Scott MacVicar
02-11-2002, 04:17 PM
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
02-11-2002, 04:20 PM
and after i've clicked getnew
Admin
02-11-2002, 04:31 PM
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
02-11-2002, 04:34 PM
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
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.