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 Week (https://vborg.vbsupport.ru/showthread.php?t=230794)

MaryTheG(r)eek 12-21-2009 10:00 PM

Widget: Top 5 Posters this Week
 
......................................

Garamond 12-22-2009 02:16 PM

Excellent add-on :) I like it!

kendo 12-24-2009 11:34 PM

Nice work!

Is it possible to include multiple usergroups in this, or just one?

MaryTheG(r)eek 12-25-2009 05:01 AM

Quote:

Originally Posted by kendo (Post 1937662)
Nice work!

Is it possible to include multiple usergroups in this, or just one?

Yes, sure. You can do it on 2 ways:

1.- Changing the "where" argument from WHERE usergroupid=2, to WHERE usergroupid=2 OR usergroupid=3 OR usergrooupid=7 . In this example we assume that you want to include members who belong to usergroups 2,3,7

2.- By using an array. At the top of the file add:
Code:

$grouparray = "2,3,7";
$groupids = explode(',',$grouparray);

Then change the "where" argument from WHERE usergroupid=2, to WHERE usergroupid IN ($groupids)

Maria

kf4eok 12-26-2009 02:15 AM

Thanks, installed

Clizon 01-03-2010 01:36 AM

Any way to EXCLUDE certain users? I have some newsbot users that will always win the post wars.

Bergler 01-03-2010 05:06 AM

Quote:

Originally Posted by MicroHellas (Post 1937803)
Yes, sure. You can do it on 2 ways:

1.- Changing the "where" argument from WHERE usergroupid=2, to WHERE usergroupid=2 OR usergroupid=3 OR usergrooupid=7 . In this example we assume that you want to include members who belong to usergroups 2,3,7

2.- By using an array. At the top of the file add:
Code:

$grouparray = "2,3,7";
$groupids = explode(',',$grouparray);

Then change the "where" argument from WHERE usergroupid=2, to WHERE usergroupid IN ($groupids)

Maria


Ah ha! That worked!! Was that always here, my bad :o Thanks for the great widget!! Happy new year!

microlight 01-06-2010 05:03 PM

Didn't work.

Broke my board :(

Got the following database error because I have the majority of users are imported from a previous board. The user name is REGISTERED and the user I.D. is 31. I edited the code as you said... but it didn't work. Any ideas?

Database error in vBulletin 4.0.0:

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>'1262563200'
WHERE usergroupid=2 OR to WHERE usergroupid=31
GROUP BY user.userid
ORDER BY postcount DESC
LIMIT 5;

MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'to WHERE usergroupid=31
GROUP BY user.userid
ORDER BY postcount DESC
LI' at line 7
Error Number : 1064
Request Date : Wednesday, January 6th 2010 @ 07:00:10 PM
Error Date : Wednesday, January 6th 2010 @ 07:00:11 PM
Script : http://www.microlightforum.com/content.php?121
Referrer : http://www.microlightforum.com/content.php?142
IP Address : 90.194.162.111
Username : VinceG
Classname : vB_Database
MySQL Version : 5.0.87-community

Blackhat 01-06-2010 11:29 PM

this widget crashes my whole site when using it

MaryTheG(r)eek 01-07-2010 04:09 AM

Quote:

Originally Posted by microlight (Post 1948947)
Didn't work.

Broke my board :(

Got the following database error because I have the majority of users are imported from a previous board. The user name is REGISTERED and the user I.D. is 31. I edited the code as you said... but it didn't work. Any ideas?

Database error in vBulletin 4.0.0:

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>'1262563200'
WHERE usergroupid=2 OR to WHERE usergroupid=31
GROUP BY user.userid
ORDER BY postcount DESC
LIMIT 5;

MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'to WHERE usergroupid=31
GROUP BY user.userid
ORDER BY postcount DESC
LI' at line 7
Error Number : 1064
Request Date : Wednesday, January 6th 2010 @ 07:00:10 PM
Error Date : Wednesday, January 6th 2010 @ 07:00:11 PM
Script : http://www.microlightforum.com/content.php?121
Referrer : http://www.microlightforum.com/content.php?142
IP Address : 90.194.162.111
Username : VinceG
Classname : vB_Database
MySQL Version : 5.0.87-community

Please, don't say so easy "didn't work" and "broke my site", before you're totally sure that you did everything correct.

In your case, you wrote "WHERE usergroupid=2 OR to WHERE usergroupid=31" while the correct is "WHERE usergroupid=2 OR usergroupid=31". Why you added more "to WHERE"?

Maria


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