The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Post count within a date range
On our board we give a prize away every month for the person with the most posts that month.
Right now I go into the database and manually extract the post counts and do the math. I would like to have a hack that would do that for me, and maybe even show under each users profile the number of posts they have so far each month. Then lastly I would like to have a seperate "stats" page that you could see who the top posters were every month for the past however many. Thanks for any help! |
#2
|
|||
|
|||
bump, im interested in this as well..i have created a query for the overall post count but cannot figure out how to retrieve a post count for the current month
|
#3
|
|||
|
|||
Anyone?
Here is what I have so far: (it returns top10 posters EVER, i want it for the current month) PHP Code:
cheers |
#4
|
||||
|
||||
We just need to modify that to a specific date range. I will see what I can find also.
|
#5
|
|||
|
|||
You would need to query the 'post' table. search.php contains code to do a similar thing (i.e., when you specify a username and last 30 days). All posts are timestamped. You'll see in there how to manufacture a timestamp 30 days old.
If you do not know the user you are after, this would be very time-consuming, as you'd have to check each user against the post table. Yikes. |
#6
|
||||
|
||||
Here is what I have come up with thus far:
Code:
SELECT COUNT(*) AS count FROM post WHERE post.userid = 1 AND (UNIX_TIMESTAMP('2004-04-02 00:00:00')) <= post.dateline AND post.dateline <= (UNIX_TIMESTAMP('2004-05-04 00:00:00')) |
#7
|
||||
|
||||
OK, with a little help I finally came up with this for a query, now on to the rest of it.
Code:
SELECT COUNT(post.postid) AS count, user.username FROM post LEFT JOIN user ON (user.userid = post.userid) WHERE post.userid = 1 AND (UNIX_TIMESTAMP('2004-04-02 00:00:00')) <= post.dateline AND post.dateline <= (UNIX_TIMESTAMP('2004-05-04 00:00:00')) GROUP BY post.userid |
#8
|
||||
|
||||
Here is What I finall came up with so I could show all users and list them within a certain date range. Now I just need to figure out how to write a script that will let the user select the date range and how to make that work with this script or one similar to it.
Code:
SELECT COUNT(post.postid) AS count, user.username FROM post LEFT JOIN user ON (user.userid = post.userid) AND (UNIX_TIMESTAMP('2004-04-02 00:00:00')) <= post.dateline AND post.dateline <= (UNIX_TIMESTAMP('2004-05-04 00:00:00')) GROUP BY user.userid ORDER BY count DESC, username |
#9
|
|||
|
|||
i am interested in this also, for vb3 though
|
#10
|
||||
|
||||
I am working on it for VB3. I have gotten the results that I want, I just have to get them to work correctly with a template etc.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|