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)

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 12:56 PM.

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.01226 seconds
  • Memory Usage 1,728KB
  • 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
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete