IIRC somebody already reported this here. Can't remember if this has been already fixed, are you using the last version of MyBB? If so, it hasn't probably been fixed then.
I use frostschutz's patches plugin with the attached patch to fix this issue. This is what the code was prepatch:
PHP Code:
if($fpermissions['canviewthreads'] != 0)
{
if(($datecut > 0 && $datecut != 9999) || isset($fpermissions['canonlyviewownthreads']) && $fpermissions['canonlyviewownthreads'] == 1)
{
$query = $db->simple_select("threads", "COUNT(tid) AS threads", "fid = '$fid' $useronly $visibleonly $datecutsql $prefixsql");
$threadcount = $db->fetch_field($query, "threads");
}
else
{
$query = $db->simple_select("forums", "threads, unapprovedthreads, deletedthreads", "fid = '{$fid}'", array('limit' => 1));
$forum_threads = $db->fetch_array($query);
$threadcount = $forum_threads['threads'];
if($ismod == true)
{
$threadcount += $forum_threads['unapprovedthreads'] + $forum_threads['deletedthreads'];
}
if($threadcount == 0)
{
$query = $db->simple_select("threads", "COUNT(tid) AS threads", "fid = '$fid' $useronly $visibleonly", array('limit' => 1));
$threadcount = $db->fetch_field($query, "threads");
}
}
}
|
and post patch
PHP Code:
if($fpermissions['canviewthreads'] != 0)
{
if($datecutsql || $useronly || $prefixsql)
{
$query = $db->simple_select('threads', 'COUNT(tid) AS threads', "fid='{$fid}'{$useronly}{$visibleonly}{$datecutsql}{$prefixsql}", array('limit' => 1));
$threadcount = $db->fetch_field($query, "threads");
}
else
{
$query = $db->simple_select("forums", "threads, unapprovedthreads, deletedthreads", "fid = '{$fid}'", array('limit' => 1));
$forum_threads = $db->fetch_array($query);
$threadcount = $forum_threads['threads'];
if($ismod == true)
{
$threadcount += $forum_threads['unapprovedthreads'] + $forum_threads['deletedthreads'];
}
if($threadcount == 0)
{
$query = $db->simple_select('threads', 'COUNT(tid) AS threads', "fid='{$fid}'{$visibleonly}", array('limit' => 1));
$threadcount = $db->fetch_field($query, "threads");
}
}
}
|
Why did you removed $useronly from within the last if?
oh yea. Missed that
Maybe patch also the showthread breadcrumbs pagination?
I dont use it so I didnt patch it. Its the first thing I switch off.
Yeah, I should agree that it is not very useful.
Oh, BTW, it is already "fixed" by XThreads.
yea, I see ZB has updated on github.