View Full Version : Total Views For Forum
SystemLogic
07 Mar 2001, 16:24
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:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
I tried playing around with it a little, but couldn't figure it out.
Can anybody help me out? It should be an easy hack, but not positive.
If you want to count all the posts for a single forum, use this:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
and if you want to count all the posts for the entire board, use this:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Hope this helps.
Oops, I just noticed that you said that you wanted total ~views~ so here is the code for that:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
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.
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Now:
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.
ar.. kier re posted and that looks a far far better way of doing it, something new to learn :)
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 :rolleyes: ;)
All I have to say is shweeeeeeeeeeeeeeet
You da man Kier!
Oks, where say
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
In the thread.forumid=\"$forumid\""); I need to put the forum id?
eva2000
25 May 2001, 23:29
Originally posted by Ninboy
Oks, where say
In the I need to put the forum id? a releeased hack is here http://vbulletin.com/forum/showthread.php?s=&threadid=14739
vBulletin® v3.6.12, Copyright ©2000-2012, Jelsoft Enterprises Ltd.