PDA

View Full Version : Want views instead of posts


okc
12-13-2004, 05:45 AM
Can anyone tell me how to calculate totalviews of a forum - I want to put this on my forumhome instead of # of posts.

I see a lot of hacks with this included but there's so much other crap I don't want - can't I just get the $totalviews string from anywhere?

thx alot

tubedogg
12-13-2004, 06:06 PM
Can anyone tell me how to calculate totalviews of a forum - I want to put this on my forumhome instead of # of posts.

I see a lot of hacks with this included but there's so much other crap I don't want - can't I just get the $totalviews string from anywhere?

thx alot
You could do
SELECT SUM(views) FROM thread;
but that would cause a full table scan every time which if you have a lot of threads could be A Bad Thing?.

okc
12-13-2004, 06:11 PM
Thx - where would I input that?

Basically I'd like to have a numeric value that will go into my forum home page. It can run every hour or so, not constantly.