Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-23-2003, 09:50 PM
Drowned Drowned is offline
 
Join Date: Apr 2002
Location: Guatemala, Central Americ
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Poster of the day

I'm either blind or this hack doesn't exist. I bet it's very easy to make and lot's of people would use it. Instead of showing the top poster by it's total post, somebody could come up with a way for the top poster to be daily. Like TOP POSTER OF THE DAY. This way new users can become a top poster without having to catch up to older users. Something like this has to exist :devious:
Reply With Quote
  #2  
Old 03-25-2003, 12:19 AM
Drowned Drowned is offline
 
Join Date: Apr 2002
Location: Guatemala, Central Americ
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No way It has to exist!
Reply With Quote
  #3  
Old 03-25-2003, 11:12 AM
Lesane's Avatar
Lesane Lesane is offline
 
Join Date: Oct 2001
Location: The Netherlands
Posts: 1,149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Open root/index.php and find:

// get total posts

Place after it:

PHP Code:
// Top poster from last 24 hours
$hourslesane=time()-86400;
    
$gettopposter=$DB_site->query_first("SELECT DISTINCT(post.userid),COUNT(post.postid) AS posts,user.username FROM post LEFT JOIN user ON post.userid = user.userid WHERE post.userid > 0 AND post.dateline>=$hourslesane GROUP BY post.userid ORDER BY posts DESC LIMIT 1");
    
$topthisday="<smallfont><a href=\"member.php?action=getinfo&userid=$gettopposter[userid]\">$gettopposter[username]</a>: $gettopposter[posts] posts!";
// Top poster from last 24 hours 
Save & Upload.

Then you can place this in the template: forumhome
PHP Code:
Top Poster last 24 hours$topthisday 
That should work. 1 extra query on your main page though!
Reply With Quote
  #4  
Old 03-25-2003, 11:19 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just curious...can you do a left join and have only one query?
Reply With Quote
  #5  
Old 03-25-2003, 11:38 AM
Lesane's Avatar
Lesane Lesane is offline
 
Join Date: Oct 2001
Location: The Netherlands
Posts: 1,149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 02:19 PM Boofo said this in Post #4
Just curious...can you do a left join and have only one query?
Yes, you're right Boofo. I have reduced the query's into 1 query.
Reply With Quote
  #6  
Old 03-25-2003, 11:56 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you, sir. Every little bit helps.
Reply With Quote
  #7  
Old 03-26-2003, 12:24 AM
Drowned Drowned is offline
 
Join Date: Apr 2002
Location: Guatemala, Central Americ
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wow thanks!!! :bowdown:
Reply With Quote
  #8  
Old 03-26-2003, 03:26 AM
Drowned Drowned is offline
 
Join Date: Apr 2002
Location: Guatemala, Central Americ
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ummm... there seems to be a problem... when the top user posts, it substracts post from $gettopposter instead of adding them... when I installed the hack the top poster had 116 posts, now he has 94 :S Everytime he posts, it displays one less
Reply With Quote
  #9  
Old 03-26-2003, 04:51 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try changing this:

PHP Code:
DESC LIMIT 1 
to this:

PHP Code:
ASC LIMIT 1 
Reply With Quote
  #10  
Old 03-26-2003, 12:38 PM
Drowned Drowned is offline
 
Join Date: Apr 2002
Location: Guatemala, Central Americ
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Yesterday at 11:51 PM Boofo said this in Post #9
Try changing this:

PHP Code:
DESC LIMIT 1 
to this:

PHP Code:
ASC LIMIT 1 

When I change that it just displays the poster with the least post in the last 24 hours
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:36 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06979 seconds
  • Memory Usage 2,261KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (6)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete