vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Poster of the day (https://vborg.vbsupport.ru/showthread.php?t=50733)

Drowned 03-23-2003 09:50 PM

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:

Drowned 03-25-2003 12:19 AM

No way :( It has to exist!

Lesane 03-25-2003 11:12 AM

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!

Boofo 03-25-2003 11:19 AM

Just curious...can you do a left join and have only one query?

Lesane 03-25-2003 11:38 AM

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

Boofo 03-25-2003 11:56 AM

Thank you, sir. Every little bit helps. ;)

Drowned 03-26-2003 12:24 AM

Wow thanks!!! :bowdown:

Drowned 03-26-2003 03:26 AM

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

Boofo 03-26-2003 04:51 AM

Try changing this:

PHP Code:

DESC LIMIT 1 

to this:

PHP Code:

ASC LIMIT 1 


Drowned 03-26-2003 12:38 PM

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


All times are GMT. The time now is 10:00 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.01393 seconds
  • Memory Usage 1,739KB
  • 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_php_printable
  • (2)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
  • (10)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