![]() |
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! |
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
|
Anyone?
Here is what I have so far: (it returns top10 posters EVER, i want it for the current month) PHP Code:
cheers |
We just need to modify that to a specific date range. I will see what I can find also.
|
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. |
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')) |
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 |
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 |
i am interested in this also, for vb3 though :p
|
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.
|
All times are GMT. The time now is 03:11 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|