The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Adding specific count of views
Someone suggested I add the following code if I want to put the totalviews of a forum onto the forumdisplay page, instead of total posts.
SELECT SUM(views) FROM thread I think I need a number value string (right?) - what do you suggest and where can I place it to generate the totalviews? thx for your help - |
#2
|
|||
|
|||
Anyone? thx
|
#3
|
||||
|
||||
well you'll want to limit that to a specific forum:
[sql]SELECT SUM(views) AS views FROM " . TABLE_PREFIX . "thread WHERE forumid = $forumid[/sql] or, do it with something like GROUP BY forumid. Now that I think about it, the second would be even better |
#4
|
|||
|
|||
So
SELECT SUM(views) AS views FROM " . TABLE_PREFIX . "thread GROUP BY forumid = $forumid ??? & what table should I add it to in mysql? Will it generate a number I can use in my boards - thx! |
#5
|
||||
|
||||
you could cache it in the datastore table...
that should generate a number, which you can call in your boards, but you'll have to fetch it from the database then... |
#6
|
|||
|
|||
Thx - is this the correct GROUP BY string?
SELECT SUM(views) AS views FROM " . TABLE_PREFIX . "thread GROUP BY forumid = $forumid & how do I call it back from the datastore? - it doesn't appear to have a name like $threadviews... |
#7
|
||||
|
||||
no, just GROUP BY forumid
you'll have to add it to the datastore first |
#8
|
|||
|
|||
Bear with me, Colin - sorry for the newbie questions -
So i can put the string into the data store, but how would I have it display within forumdisplay on my board - what do I ask for to get that value? i.e. $threadviews Thx |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|