 |
 |
 |
 |
Registered: 01/02/10
Posts: 70
|
|
|
 |
 |
 |
 |
|
 |
 |
 |
 |
#216545 - 08/20/08 12:55 PM
Re: Topic Views
[Re: FREAK]
|
|
Registered: 06/04/06
Posts: 9922
Loc: Aberdeen, WA
   
|
|
Well, it seems to be behaving normally.
For example, the SP 8/18 post. 36 replies and 27 views. While there are 36 replies, there were only a total of 4 people that posted in the thread, and many of them came from the same person in a very short time-span, possibly via quick reply. So these wouldn't be counted as views. So, it just looks like not very many people have actually viewed the topic.
Same thing with the SP 8/15 post. Lots of replies, but those only came from a total of 3 people, so the view count isn't going to be that high.
You're more active ones seem to be normal. The posts under the Bad Man 2008 forums have pretty normal looking replies/views ratio.
As for clicking on a topic 5 times, and it only counting one. It basically tracks your last visited topic. If you visit topic A, then visit topic B, then go back to topic A, it will count 2 hits on topic A. If you just click Topic A 5 times in a row, it's just going to count it as one view.
|
|
Top
|
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#216566 - 08/21/08 03:03 PM
Re: Topic Views
[Re: Gizmo]
|
|
Registered: 06/04/06
Posts: 9922
Loc: Aberdeen, WA
   
|
|
Even leaving the site completely, unless you've closed your browser or clicked on another topic before returning to that same topic, your session is still going to track your last visited topic, so it's not going to count it. It's a modification necessary to get it to count every click on a topic. Normally we don't post modifications here, only on UBBDev, but since it's a quick little change, I'll go ahead. Around line 411 of showflat.inc.php, you'll see this:
if ($_SESSION['current_topic'] != $topic_info['TOPIC_ID']) {
$query = "
insert into {$config['TABLE_PREFIX']}TOPIC_VIEWS
(TOPIC_ID)
values
( ? )
";
$dbh -> do_placeholder_query($query,array($topic_info['TOPIC_ID']),__LINE__,__FILE__);
$_SESSION['current_topic'] = $topic_info['TOPIC_ID'];
}
Change that, to this:
$query = "
insert into {$config['TABLE_PREFIX']}TOPIC_VIEWS
(TOPIC_ID)
values
( ? )
";
$dbh -> do_placeholder_query($query,array($topic_info['TOPIC_ID']),__LINE__,__FILE__);
$_SESSION['current_topic'] = $topic_info['TOPIC_ID'];
You're just commenting out the conditional, so it's always going to update the topic instead. And remember, that topic views won't update until a new post is made somewhere on the forum.
|
|
Top
|
|
|
|
|
 |
 |
 |
 |
|
|