Bug #389
thread views is stuck if php shutdown function not enabled.
| Status: | Closed | Start date: | 08/20/2009 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | Ryan Gordon | % Done: | 100% |
|
| Category: | Other | |||
| Target version: | 1.4.10 | |||
| Reproducibility: | Always | Database Type: | ||
| Reported In MyBB Version: | 1.4.8 | Database Version: | ||
| PHP Version: | SQA assignments: | |||
| Browser: |
Description
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
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'];
History
#1 Updated by Michael Schlechtinger almost 3 years ago
Original thread: http://community.mybboard.net/thread-54017.html
#2 Updated by Ryan Gordon almost 3 years ago
- Status changed from New to Resolved
- Assignee set to Ryan Gordon
- Target version set to 1.4.9
This was resolved in revision #4427
#3 Updated by Ryan Gordon almost 3 years ago
- % Done changed from 0 to 100
#4 Updated by Michael Schlechtinger almost 3 years ago
- Status changed from Resolved to Closed
#5 Updated by Ryan Gordon over 2 years ago
- Target version changed from 1.4.9 to 1.4.10