PDA

View Full Version : Summarized Counter?


05-23-2000, 04:32 AM
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!

05-23-2000, 04:51 AM
it already shows total posts in the forum. What else are you wanting?

05-23-2000, 05:06 AM
Martin,

i want to show the summarized views of all threads in the forum page - near by posts/threads/new member ...

05-23-2000, 05:19 AM
Like "This forum has been viewed this # of times"?

So just a total of all views?

05-23-2000, 05:23 AM
Yep - simply this!

;)

05-23-2000, 05:28 AM
now I understand what you're wanting :)

I think it's doable, though I have spent any time thinking about it.

05-23-2000, 07:52 AM
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

05-23-2000, 09:30 AM
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?

05-23-2000, 09:45 AM
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?:)

05-28-2000, 05:52 AM
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.