The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How would I setup the total views for the entire forum? I would think it would be some sort of mofication of this code which I found in index.php:
Code:
// get total posts $countposts=$DB_site->query_first('SELECT COUNT(*) AS posts FROM post'); $totalposts=$countposts['posts']; if ($totalposts=='') { $totalposts=0; } Can anybody help me out? It should be an easy hack, but not positive. |
#2
|
|||
|
|||
If you want to count all the posts for a single forum, use this:
PHP Code:
PHP Code:
|
#3
|
|||
|
|||
Oops, I just noticed that you said that you wanted total ~views~ so here is the code for that:
PHP Code:
|
#4
|
|||
|
|||
Kier, he wants total views not posts but think it will be based on posts, which it will not because views are stored in the thread table so you would have to add all the views for every thread together.
PHP Code:
i) i think that will work but i have not tested it ii) i would also think it is quite server intensive as it has to go through every single thread to count up. I can't see any other way of doing it bar having a counter increase every time a thread is viewed at the same time the thread count is increased. That would be possible and perhaps less server intensive in the end. iii) if it does not work tell me, someone will probably post glaring errors. |
#5
|
|||
|
|||
ar.. kier re posted and that looks a far far better way of doing it, something new to learn
|
#6
|
|||
|
|||
Hehe, I've never actually used the mySQL SUM() function before, but i figured it might exist/work, and it did! Now to go back to my site and do some optimising
|
#7
|
|||
|
|||
All I have to say is shweeeeeeeeeeeeeeet
You da man Kier! |
#8
|
|||
|
|||
Oks, where say
Quote:
Quote:
|
#9
|
||||
|
||||
Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|