2009-08-02, 12:41 AM
Hello everyone, I was very busy and didn't visit mybb community since long time, so please forgive me if this is a duplicated report or something similar (take any required action).
in showthread.php the update thread views doesn't check if the shutdown function is enabled or not, it just uses it, as a result if this function doesn't work, the thread views do not updated.
to be more specific
the following code from showthread.php
as I see, it should be something like
in showthread.php the update thread views doesn't check if the shutdown function is enabled or not, it just uses it, as a result if this function doesn't work, the thread views do not updated.
to be more specific
the following code from showthread.php
if($mybb->settings['delayedthreadviews'] == 1)
{
$db->shutdown_query("INSERT INTO ".TABLE_PREFIX."threadviews (tid) VALUES('{$tid}')");
}
else
{
$db->shutdown_query("UPDATE ".TABLE_PREFIX."threads SET views=views+1 WHERE tid='{$tid}'");
}
++$thread['views'];
as I see, it should be something like
if($mybb->settings['useshutdownfunc'] ==1)
{
if($mybb->settings['delayedthreadviews'] == 1)
{
$db->shutdown_query("INSERT INTO ".TABLE_PREFIX."threadviews (tid) VALUES('{$tid}')");
}
else
{
$db->shutdown_query("UPDATE ".TABLE_PREFIX."threads SET views=views+1 WHERE tid='{$tid}'");
}
}
else
{
if($mybb->settings['delayedthreadviews'] == 1)
{
$db->query("INSERT INTO ".TABLE_PREFIX."threadviews (tid) VALUES('{$tid}')");
}
else
{
$db->query("UPDATE ".TABLE_PREFIX."threads SET views=views+1 WHERE tid='{$tid}'");
}
}
++$thread['views'];