vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Forum Home Enhancements - Today's Top Poster(s) on Forum Home (https://vborg.vbsupport.ru/showthread.php?t=194954)

TFEX 01-17-2010 08:41 PM

Go to plugin manager, find "Product: Today's Top Poster's"
Edit "Today's Top Posters" plugin

Replace entire PHP code with this:

Code:

if ($show['todays_top_poster']) {
  $todays_top_posters = '';
  $limit = $vbulletin->options['todays_top_posters_limit'];
  $exclude_usergroups = $vbulletin->options['todays_top_posters_usergroups'];
  $exclude_users = $vbulletin->options['todays_top_posters_users'];
  $exclude_forums = $vbulletin->options['todays_top_posters_exclude_private_forums'];
  if ($vbulletin->options['24_hours_top_posters']) {
    $top_posters_title = $vbphrase['24_hours_top_posters'];
    $dateline = TIMENOW - 86400;
  } else {
    $top_posters_title = $vbphrase['todays_top_posters'];
    $currenttime  = date('YmdHis',TIMENOW - intval($vbulletin->options['hourdiff'])); 
    $dateline = TIMENOW - (substr($currenttime, 8, 2) * 3600 + substr($currenttime, 10, 2) * 60 + substr($currenttime, 12, 2)); 
  }
  unset ($todays_top_posters);
  $top_posters = $vbulletin->db->query_read_slave("
    SELECT COUNT(post.dateline) AS postcount, post.userid, user.userid, post.threadid, thread.threadid,
    user.username, user.lastpost, user.lastpostid, user.posts, user.usergroupid, thread.forumid,
    IF(displaygroupid=0, usergroupid, displaygroupid) AS displaygroupid
    FROM " . TABLE_PREFIX . "post AS post
    LEFT JOIN " . TABLE_PREFIX . "user AS user ON (post.userid = user.userid)
    RIGHT JOIN " . TABLE_PREFIX . "thread AS thread ON (post.threadid = thread.threadid)
    " . iif(!empty($exclude_usergroups), "AND user.usergroupid NOT IN ($exclude_usergroups)") . "
    " . iif(!empty($exclude_users), "AND user.userid NOT IN ($exclude_users)") . "
    " . iif(!empty($exclude_forums), "AND thread.forumid NOT IN($exclude_forums)") . "
    WHERE post.dateline > $dateline AND user.posts != '0'
    GROUP BY post.userid 
    ORDER BY postcount DESC
    LIMIT 0, $limit");

  while($top_poster = $db->fetch_array($top_posters)){
    $top_poster[musername] = fetch_musername($top_poster);
    $show['comma_leader'] = ($todays_top_posters != '');
    eval('$todays_top_posters .= "' . fetch_template('todays_top_poster_bit') . '";');
  }
  eval ('$template_hook[forumhome_wgo_pos2] .= "' . fetch_template ('todays_top_poster') . '";');
  $db->free_result($top_posters);
}

Your "exclude forums" field in "vbulletin options -> Today's Top Poster" will now function properly.

grey_goose 01-18-2010 11:56 AM

Awesome! Thank you!!

IMO, when you get (and then post for others :D) results, you're not arrogant. You're confident. thumbs up.

NeXuM 02-14-2010 09:49 PM

anyone know if it works with vbulletin 3.6.4 ?

Cloverfield 03-07-2010 06:43 PM

Installed but it doesn't work. I installed both versions and neither works. I really want this. What do you think is wrong. I have disabled many other hacks to see if that was the problem but it still won't work.

Narkissos 03-10-2010 11:47 AM

Sweet update man. Thanks!

Chicago_VLNU_4s 03-11-2010 11:13 PM

installed..

Moved mine to a custom position below the navbar and it works. 3.8.x

saghir 03-14-2010 06:38 AM

for 4.0.2 ???

Chicago_VLNU_4s 03-15-2010 03:19 AM

Hey, anyone know how to make this show for the top posters of the week, rather than day?

I see changing the 3600 from the

Code:

$dateline = TIMENOW - (substr($currenttime, 8, 2) * 3600 + substr($currenttime, 10, 2) * 60 + substr($currenttime, 12, 2));
code will do so, but it doesn't sync up. Every few hours, the post count increases for the users on the list.

RitaW 03-18-2010 09:15 PM

Installed....thanks

Cloverfield 03-23-2010 11:34 PM

HELP. Just found out it works on an old redunant template but not on the one that every member and guest sees. What could be the problem?


All times are GMT. The time now is 12:51 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.01298 seconds
  • Memory Usage 1,737KB
  • 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
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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