PDA

View Full Version : top posters within a certain period of time


kofoid
06-06-2006, 11:56 PM
Is there a way to get the top 10 posters within XX period of time for v3.5.2? Help! :)

gingery
08-01-2006, 02:23 PM
I'm looking for the same thing for 3.6 to place in the left column on all of my forum pages.

Paul M
08-01-2006, 03:27 PM
Is there a way to get the top 10 posters within XX period of time for v3.5.2? Help! :)
https://vborg.vbsupport.ru/showthread.php?t=92177

gingery
08-01-2006, 04:02 PM
Paul - I have your 3.6 RC version installed already. Is there a way to pull the top posters from the last 24 hours (only) and display it in a left column on the forum pages?

Paul M
08-01-2006, 04:42 PM
Not with that hack their isn't.

You could copy the relevant SQL and write your own code to display it.

gingery
08-01-2006, 04:57 PM
I have no clue how to do that.

I'll keep looking - I see there are several hacks that include "top poster" info, they just all seem to only count total posts.

Andrew Green
08-02-2006, 01:34 PM
I could give you code to display that, but you might want to rethink this. It can be a pretty server heavy thing to add on main pages, let alone every forum page...

If that was the goal I'd probably go with setting up a sperate table to store the results in and getting a cron job to update it every hour or so.

But you aren't going to want to run that query everytime someone visits a forum page...

gingery
08-02-2006, 03:44 PM
Thank you! I'm a newbie to all of this so please bear with me.
I could give you code to display that, but you might want to rethink this. It can be a pretty server heavy thing to add on main pages, let alone every forum page...
Duly noted. :)
If that was the goal I'd probably go with setting up a sperate table to store the results in and getting a cron job to update it every hour or so.
A separate table that I could display in my left column (and note that it only updates every hour) or one that I would have to give its own page? Would you be able to teach me how to set up the cron job?

As another thought, would it be easier to try to modify this hack (https://vborg.vbsupport.ru/showthread.php?t=105546) to display last 24 hours instead of all time? (provided it works with 3.6)

Paul M
08-02-2006, 03:52 PM
Yes, you could modify the sql in that to just pull out the last 24 hours.

gingery
08-02-2006, 06:10 PM
Yes, you could modify the sql in that to just pull out the last 24 hours.
Would this be the part I need to modify?
while($nt=mysql_fetch_array($rt)){
$test .= "<a href='member.php?u=$nt[userid]'>$nt[username]</a> ($nt[posts]), ";
}
If so, what do I need to change it to?

Andrew Green
08-02-2006, 06:54 PM
SELECT COUNT(post.dateline) AS postcount, post.userid, user.username
FROM " . TABLE_PREFIX . "post AS post
LEFT JOIN " . TABLE_PREFIX . "user AS user ON (post.userid = user.userid)
WHERE dateline > $startp AND user.usergroupid IN ($groupsp)
GROUP BY userid ORDER BY postcount DESC LIMIT 10

Just pulling that out of the thread without actually looking into the rest of the code... what you would need to change would be the $starttp variable somewhere before this, just set that to = 24 hours ago.

So your pulling a count of posts made in the last 24 hours, ordered by the postcount from highest to lowest (DESC) and only the top 10 (DESC 10)


A separate table that I could display in my left column (and note that it only updates every hour) or one that I would have to give its own page? Would you be able to teach me how to set up the cron job?

By seperate table I mean a new table in your database, not a html table... just to clarify there. Cron jobs can be done with the admincp as "Scheduled Tasks"

So the process that I would likely use is:

1 - Set up a table in your database to store whatever info you want to be able to pull and stick on your site.

2 - Write a scheduled task to update the table every hour.

3 - Use the table to draw from to pull the info you need, format it and plop it into your site.

Not easy if you don't know php or sql, but not terribly risky in that it doesn't involve changing any of vbulletins tables and fairly simple as possible solutions go.

Interesting idea though, might be a way to get posters posting a little more (competing for top spot) There are other ways to do this, better ways too, but also more complex in terms of what you would have to do ;)

gingery
08-02-2006, 07:31 PM
Not easy if you don't know php or sql
I know neither.
what you would need to change would be the $starttp variable somewhere before this, just set that to = 24 hours ago.
You've lost me - are you talking about the "Top xx Posters List (https://vborg.vbsupport.ru/showthread.php?t=92177)" or "Haggis Top Poster (https://vborg.vbsupport.ru/showthread.php?t=105546)"? I'm thinking the second one would be easier to alter since it is a simplier mod?

Interesting idea though, might be a way to get posters posting a little more (competing for top spot)
That is my goal. I want it to be only for 24 hours though because when you list all time it instantly knocks newbies out of the running when you have people with thousands of posts.

Andrew Green
08-02-2006, 08:16 PM
"Haggis Top Poster (https://vborg.vbsupport.ru/showthread.php?t=105546)"? I'm thinking the second one would be easier to alter since it is a simplier mod?

https://vborg.vbsupport.ru/showthread.php?t=92177 <- post 12

Query will be basically the same no matter what you use as a base though.

gingery
08-03-2006, 12:54 AM
Well, since this is the 'request a mod' section, I'm asking if someone would pretty please create this for me? I think something like the "Haggis Top Poster" mod altered to show the last 24 hours instead of all time would work perfectly for me. The only problem is that I have no idea how to create it myself.

gingery
08-26-2006, 02:41 PM
bump

crzy
09-09-2006, 10:36 AM
if you find out could you pls send me a pm cos i am looking for same thing tnx