miniBB Support Forums | 16 years on The Web
miniBB ®


 | Begin | Register | Reply | Search | Statistics | File Bank | Manual |
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /   

Count Views for each page

Author zorglub
#1 | Posted: 21 Apr 2005 21:07 
Hi !
How would it be possible to count each view of a topic. Topic counter only add on when you display the first page. But in my script, I directly go to the last page (-1).

So I would like to make so that each page displayed is counted in views...

Where should I change something ? Thank you =)

Author Ivan
Advanced Member
#2 | Posted: 22 Apr 2005 02:35 
Then every time when someone wants to remember a phrase or something that he has already seen 10s of times, the board will count it as new visit - 100 rememberings, 100 visits. Not realistic :)

Author Team
#3 | Posted: 22 Apr 2005 10:21 
Yes, if you think, you find this useful... "View of a topic" actually relays on individual users who are reading it for the first time, not another.

This is in general defined in bb_func_vthread.php:

if($page==0 and isset($enableViews) and $enableViews) updateArray(array('topic_views'),$Tt,'topic_id',$topic);

just remove the condition "$page==0 and"

Author zorglub
#4 | Posted: 22 Apr 2005 15:12 
Team working, thank you =)

Ivan my board are stories that people continue, not a 'chat board'. So, I want to display which are the most 'read' and popular stories. So usually, people directly go to -1 page (there is a link for that at the first page) and only read the new 'episode'. Otherwise, it would be meaningless, I agree with you !

Author Moony
#5 | Posted: 29 Jun 2017 16:07 | Edited by: Moony 
In newer versions it should be :

if(isset($enableViews) and $enableViews) updateArray(array('topic_views'),$Tt,'topic_id',$topic);


if($page==PAGE1_OFFSET+1 and isset($enableViews) and $enableViews) updateArray(array('topic_views'),$Tt,'topic_id',$topic);

Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /
 Count Views for each page
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message

Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.

Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.


miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Try the Captcha add-on: protect your miniBB-forums from the automated spam and flood.