Quote:
Originally Posted by Boofo
If it is showing 0 for thread views in the table, then you have something else going on. As long as you have this query:
PHP Code:
// <!-- TOTAL THREAD VIEWS --> $getthreadviews=$DB_site->query_first(" SELECT SUM(views) AS tviews FROM " . TABLE_PREFIX . "thread ");
and this code:
PHP Code:
$statscache['getthreadviews'] = intval ($getthreadviews[tviews]);
and this variable in the forumhome template:
HTML Code:
$statscache[getthreadviews]
then it will return whatever the table has in it for thread views.
Try this: Take the cron job off for this and set it up like in the install file and let it run for a few minutes and see if they start showing up then. Make sure to set the cache update time to 0 to test it.
|
Okay, but I don't know what difference that would make as I looked in the database directly and thread.views is set to "0" for all threads.. But, thread views are displaying in the forums as they should be. :S
I'd already changed it to do a COUNT on the threadviews table and now it's showing thread views as "2,827". I have thread views set to update hourly and noticed that the threadviews table's used for hourly updates instead of updating thread.views immediately upon viewing.
PHP Code:
// update views counter
if ($vboptions['threadviewslive'])
{
// doing it as they happen
$DB_site->shutdown_query("
UPDATE " . TABLE_PREFIX . "thread
SET views = views + 1
WHERE threadid = " . intval($threadinfo['threadid'])
);
}
else
{
// or doing it once an hour
$DB_site->shutdown_query("
INSERT INTO " . TABLE_PREFIX . "threadviews (threadid)
VALUES (" . intval($threadinfo['threadid']) . ')'
);
}
Will have to look at vB's CRON script and see why the thread.views isn't being updated.. But, the views are displaying i the forums htough. :S