View Full Version : Summarized Counter?
How is it possible to display a total counter (added counters from the single threads) in the start-page of vb?
Thanks for your hints!
it already shows total posts in the forum. What else are you wanting?
Martin,
i want to show the summarized views of all threads in the forum page - near by posts/threads/new member ...
Like "This forum has been viewed this # of times"?
So just a total of all views?
now I understand what you're wanting :)
I think it's doable, though I have spent any time thinking about it.
Try adding some code like this to the index.php file at about line 80:
$countviews=$DB_site->query_first("SELECT SUM(views) AS views FROM thread");
$totalviews=$countviews[views];
if ($totalviews=="") {
$totalviews=0;
}
This is not included as standard, since the SQL call is potentially quite server intensive.
John
Originally posted by John
Try adding some code like this to the index.php file at about line 80:
$countviews=$DB_site->query_first("SELECT SUM(views) AS views FROM thread");
$totalviews=$countviews[views];
if ($totalviews=="") {
$totalviews=0;
}
This is not included as standard, since the SQL call is potentially quite server intensive.
John
John - why not adding a total counter into the database as standard?
I believe he answered that in your quote above?
This is not included as standard, since the SQL call is potentially quite server intensive.
John
Did I miss something?:)
Originally posted by werehere
I believe he answered that in your quote above?
Nope - i don't believe this ;)
In the table thread is a field called views used, why not adding something like a "global views" in the database, and everytime the field views of any thread is incremented - the "global views" would be incremented too!
If we use "global views" instead of a manual counting in index.php it would'nt be quite server intensive.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.