vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   vBulletin CMS Widgets - Widget: Top 5 Posters this Month (https://vborg.vbsupport.ru/showthread.php?t=230793)

SLY LS1 04-27-2010 12:06 PM

Quote:

Originally Posted by neudimenxion (Post 2000722)
i'vw got the same problem too.



Me to

xabo 05-16-2010 09:10 AM

Is there any way to ignore some usernames from the list?

TazDevilLooney 07-20-2010 08:07 PM

This fixes the display problem with IE7

Code:

$posts = "Posts";
  ob_start();
  require_once('./includes/functions_user.php');
  require_once('./includes/functions_bigthree.php');
  // Current Week Top Posters
  $starttime = mktime(0, 0, 0, date('n'), date('j'), date('Y')) - ((date('N')-1)*3600*24);
  // Get Top Members for current week
  $mostactiveweek_get = vB::$db->query_read("
    SELECT ".TABLE_PREFIX."user.userid, ".TABLE_PREFIX."user.username, ".TABLE_PREFIX."user.usertitle,
    COUNT(".TABLE_PREFIX."post.postid) AS postcount
    FROM ".TABLE_PREFIX."user
    LEFT JOIN ".TABLE_PREFIX."post
      ON ".TABLE_PREFIX."post.userid=".TABLE_PREFIX."user.userid
      AND dateline>'".$starttime."'
WHERE usergroupid=2

  GROUP BY ".TABLE_PREFIX."user.userid
  ORDER BY postcount DESC
  LIMIT 5");
  $topposter = true;
  $output_bits = '';
  while($user = vB::$db->fetch_array($mostactiveweek_get))
  {
        $percentage = round(($user[postcount]/$totalposts[postcount]) * 100);
        if($topposter == true)
        {
          $avatarurl = fetch_avatar_url($user[userid]);
          if (!$avatarurl) {
              $useravatar = 'images/misc/avatar.png';
          } else  {
              $useravatar = $avatarurl[0];
          }
          $output_bits .='<div align="center">
                          <img border="0" src="'.$useravatar.'"><br />
                          <a target="_self" href="member.php?u='.$user[userid].'">'.$user[username].'</a><br />
                          '.$user[usertitle].'<br />
                          '.$posts.': '.$user[postcount].'<br />
                          </div><hr />';
          $topposter = false;
        } else {
          $output_bits .= '<a target="_self" href="member.php?u='.$user[userid].'">'.$user[username].'</a><div style="text-align: right;margin-top:-15px;">'.$user[postcount].'</div>';
        }
  }
  $output = $output_bits;
  ob_end_clean();


Enjoy TazDevilLooney

Yurified 07-30-2010 03:09 PM

Awesome! Thanks xD
Is there a way that we can have this for forum sideblock?

cs28702 07-30-2010 06:02 PM

installed, much appreciated. I just set my for 2 hours . If its slow, I dont care

TazDevilLooney 07-30-2010 08:10 PM

Yes you sould be able to add it to a forum block. Try this....

AdminCP -> Forums and Moderators -> Forum Block Manager -> Add Block

Pick -> Custom HTML/PHP

Change title to what you want!
Content type -> PHP
Copy the code in to the Content Box

That sould be it....

TazDevilLooney

-> Update <-

Tested it my self and works fine enjoy.............

LuisManson 07-30-2010 08:48 PM

i can make it as a forum and with MANY groups.... :(
Code:

Database error in vBulletin 4.0.5:

Invalid SQL:

    SELECT user.userid, user.username, user.usertitle,
    COUNT(post.postid) AS postcount
    FROM user
    LEFT JOIN post
      ON post.userid=user.userid
      AND dateline>'1277953200'
  WHERE usergroupid IN (Array)
    GROUP BY user.userid
  ORDER BY postcount DESC
  LIMIT 5;

MySQL Error  : Unknown column 'Array' in 'where clause'
Error Number  : 1054
Request Date  : Friday, July 30th 2010 @ 06:47:57 PM
Error Date    : Friday, July 30th 2010 @ 06:47:57 PM
Script        : http://www.ccccc.com/forum.php
Referrer      : http://www.cccc.com/admincp/index.php?do=head
IP Address    : 201.253.32.50
Username      : xxxxxx
Classname    : vB_Database
MySQL Version : 5.0.90


Code used:

Code:

$grouparray = "2,28,23,26,24,25";
$groupids = explode(',',$grouparray);
$posts = "Posts";
  ob_start();
  require_once('./includes/functions_user.php');
  require_once('./includes/functions_bigthree.php');
  // Current Month Top Posters
  $starttime = mktime(0, 0, 0, date('m'), 1, date('Y'));
  // Get Top Members for current month
  $mostactivemonth_get = vB::$db->query_read("
    SELECT ".TABLE_PREFIX."user.userid, ".TABLE_PREFIX."user.username, ".TABLE_PREFIX."user.usertitle,
    COUNT(".TABLE_PREFIX."post.postid) AS postcount
    FROM ".TABLE_PREFIX."user
    LEFT JOIN ".TABLE_PREFIX."post
      ON ".TABLE_PREFIX."post.userid=".TABLE_PREFIX."user.userid
      AND dateline>'".$starttime."'
  WHERE usergroupid IN ($groupids)
    GROUP BY ".TABLE_PREFIX."user.userid
  ORDER BY postcount DESC
  LIMIT 5");
  $topposter = true;
  $output_bits = '';
  while($user = vB::$db->fetch_array($mostactivemonth_get))
  {
        $percentage = round(($user[postcount]/$totalposts[postcount]) * 100);
        if($topposter == true)
        {
          $avatarurl = fetch_avatar_url($user[userid]);
          if (!$avatarurl) {
              $useravatar = 'images/misc/avatar.png';
          } else  {
              $useravatar = $avatarurl[0];
          }
          $output_bits .='<div align="center">
                          <img border="0" src="'.$useravatar.'"><br />
                          <a target="_blank" href="member.php?u='.$user[userid].'">'.$user[username].'</a><br />
                          '.$user[usertitle].'<br />
                          '.$posts.':&nbsp;'.$user[postcount].'<br />
                          </div><hr />';
          $topposter = false;
        } else {
          $output_bits .= '<a target="_blank" href="member.php?u='.$user[userid].'">'.$user[username].'</a><div style="float: right;">'.$user[postcount].'</div><br />';
        }
  }
  $output = $output_bits;
  ob_end_clean();


Yurified 07-31-2010 02:44 PM

Quote:

Originally Posted by TazDevilLooney (Post 2076959)
Yes you sould be able to add it to a forum block. Try this....

AdminCP -> Forums and Moderators -> Forum Block Manager -> Add Block

Pick -> Custom HTML/PHP

Change title to what you want!
Content type -> PHP
Copy the code in to the Content Box

That sould be it....

TazDevilLooney

-> Update <-

Tested it my self and works fine enjoy.............

I tried it and I have blank block :(

apokphp 08-01-2010 01:38 AM

Quote:

Originally Posted by TazDevilLooney (Post 2076959)
Yes you sould be able to add it to a forum block. Try this....

AdminCP -> Forums and Moderators -> Forum Block Manager -> Add Block

Pick -> Custom HTML/PHP

Change title to what you want!
Content type -> PHP
Copy the code in to the Content Box

That sould be it....

TazDevilLooney

-> Update <-

Tested it my self and works fine enjoy.............

Not sure what code you used...but it definitely isn't the op's listed code on a 4.0.5 board. Full of sql errors when you try to use it as a forum widget.

TazDevilLooney 08-08-2010 11:29 PM

Yes you sould be able to add it to a forum block. Try this....

AdminCP -> Forums and Moderators -> Forum Block Manager -> Add Block

Quote:

Pick -> Custom HTML/PHP

Change title to what you want!
Content type -> PHP
Copy the code in to the Content Box

That sould be it....

TazDevilLooney

-> Update <-

Tested it my self and works fine enjoy.............
I had no problem with this.

Code:

$posts = "Posts";
  ob_start();
  require_once('./includes/functions_user.php');
  require_once('./includes/functions_bigthree.php');
  // Current Week Top Posters
  $starttime = mktime(0, 0, 0, date('n'), date('j'), date('Y')) - ((date('N')-1)*3600*24);
  // Get Top Members for current week
  $mostactiveweek_get = vB::$db->query_read("
    SELECT ".TABLE_PREFIX."user.userid, ".TABLE_PREFIX."user.username, ".TABLE_PREFIX."user.usertitle,
    COUNT(".TABLE_PREFIX."post.postid) AS postcount
    FROM ".TABLE_PREFIX."user
    LEFT JOIN ".TABLE_PREFIX."post
      ON ".TABLE_PREFIX."post.userid=".TABLE_PREFIX."user.userid
      AND dateline>'".$starttime."'
WHERE usergroupid=2

  GROUP BY ".TABLE_PREFIX."user.userid
  ORDER BY postcount DESC
  LIMIT 5");
  $topposter = true;
  $output_bits = '';
  while($user = vB::$db->fetch_array($mostactiveweek_get))
  {
        $percentage = round(($user[postcount]/$totalposts[postcount]) * 100);
        if($topposter == true)
        {
          $avatarurl = fetch_avatar_url($user[userid]);
          if (!$avatarurl) {
              $useravatar = 'images/misc/avatar.png';
          } else  {
              $useravatar = $avatarurl[0];
          }
          $output_bits .='<div align="center">
                          <img border="0" src="'.$useravatar.'"><br />
                          <a target="_self" href="member.php?u='.$user[userid].'">'.$user[username].'</a><br />
                          '.$user[usertitle].'<br />
                          '.$posts.': '.$user[postcount].'<br />
                          </div><hr />';
          $topposter = false;
        } else {
          $output_bits .= '<a target="_self" href="member.php?u='.$user[userid].'">'.$user[username].'</a><div style="text-align: right;margin-top:-15px;">'.$user[postcount].'</div>';
        }
  }
  $output = $output_bits;
  ob_end_clean();



http://www.missiontcomputers.com/images/top.png


VB 4.0.5
Server Errors In Log = 0/None
:confused:


All times are GMT. The time now is 11:40 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.02030 seconds
  • Memory Usage 1,768KB
  • 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
  • (4)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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