The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Hi all,
Basically i plan to query all the users posts for the month by using php to work out the date, and querying how many posts each user has made that month to make a list of the top 10 (exluding admins). I can do this, but i'm thinking about server load.Going through every single user is quite a task, would it be best to be done on a cron than everytime the page is visited? RoundHost |
#2
|
||||
|
||||
![]()
[sql]
SELECT userid, username, COUNT(*) AS totalposts FROM post WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY) <= dateline GROUP BY userid ORDER BY totalposts DESC LIMIT 10 [/sql] That'll do the trick, we're assuming there are 30 days in a month though. Just set it to run at the last day of every month and your users won't know otherwise. If you want it to be completely accurate then I can look that up for you too ![]() |
#3
|
|||
|
|||
![]()
Thanks
|
#4
|
|||
|
|||
![]()
It sortof works :S
Basically, im echoing the results out in a table with the following code: PHP Code:
Anyway, the results i get, are not the top 10 posters in the last week, they are the top 10 posters ever, and my only super mod, doesnt appear in the results, yet i do, even though im a admin :S I do not see how that could have happened... |
#5
|
||||
|
||||
![]()
take a look at the post below...
|
#6
|
|||
|
|||
![]() Quote:
![]() Thanks for the help though ![]() |
#7
|
||||
|
||||
![]()
tiny error. but i just tried it and it works... take a look at the attached file.
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|