vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   top posters within a certain period of time (https://vborg.vbsupport.ru/showthread.php?t=117849)

kofoid 06-06-2006 11:56 PM

top posters within a certain period of time
 
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

Quote:

Originally Posted by kofoid
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.
Quote:

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. :)
Quote:

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 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

Quote:

Originally Posted by Paul M
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?
Quote:

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

Quote:

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)


Quote:

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

Quote:

Not easy if you don't know php or sql
I know neither.
Quote:

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" or "Haggis Top Poster"? I'm thinking the second one would be easier to alter since it is a simplier mod?

Quote:

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

Quote:

Originally Posted by gingery
"Haggis Top Poster"? 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


All times are GMT. The time now is 03:28 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
  • Page Generation 0.01041 seconds
  • Memory Usage 1,752KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (11)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (16)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete