Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin Tips & Tricks
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Stop Banned Users from being Newest Member
bananalive
Join Date: Oct 2007
Posts: 2,802

 

UK
Show Printable Version Email this Page Subscription
bananalive bananalive is offline 06-01-2009, 10:00 PM

Prevents Banned Users from Displaying in What's Going On? Statistics phrase: Welcome to our newest member
  1. Open file: includes/functions_databuild.php
  2. Find:
    PHP Code:
    $newuser $vbulletin->db->query_first("SELECT userid, username FROM " TABLE_PREFIX "user WHERE userid = $members[maxid]"); 
  3. Replace:
    PHP Code:
    $newuser $vbulletin->db->query_first("SELECT userid, username FROM " TABLE_PREFIX "user WHERE usergroupid != '8' ORDER BY userid DESC"); 
  4. Save File
Reply With Quote
  #2  
Old 06-22-2009, 10:52 PM
NewAyenee NewAyenee is offline
 
Join Date: Oct 2006
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've applied this change to my page, but I'm not seeing it take affect on the page.

The current newest user is in the banned group, and when I try what the query should be from the AdminCP Execute SQL Query page, I get the right results, but when I refresh the index page, I keep seeing the banned user as the newest.

Is there anything else I need to do to get this to work correctly?


EDIT
Just as a test, I changed later lines on the page to return fixed values in the values array, like so:
PHP Code:
    $values = array(
        
'numbermembers' => $members['users'],
        
'activemembers' => $members['active'],
        
'newusername'   => "testuser",
        
'newuserid'     => "0"
    
); 
And it still got the banned user as the newest user, as it's always been getting. Even putting an exit() statement in the page didn't prevent it from running.

It's the only file on the host with that function and that query, but it doesn't seem to be working, and I'm not sure why.
Reply With Quote
  #3  
Old 06-23-2009, 05:08 PM
SurfCityvBer SurfCityvBer is offline
 
Join Date: Feb 2008
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I believe I've had this problem before when deleting a banned user -- try going into the Maintenance menu and Update Counters, Update User Titles and Ranks.
Reply With Quote
  #4  
Old 06-23-2009, 10:19 PM
NewAyenee NewAyenee is offline
 
Join Date: Oct 2006
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by SurfCityvBer View Post
I believe I've had this problem before when deleting a banned user -- try going into the Maintenance menu and Update Counters, Update User Titles and Ranks.
Well, there was already a cron job set through vBulletin to handle that, so this morning (by the time I saw your response), it had already taken effect.
Reply With Quote
  #5  
Old 06-29-2009, 05:51 AM
Qwk86gn's Avatar
Qwk86gn Qwk86gn is offline
 
Join Date: Jan 2009
Posts: 301
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks
Reply With Quote
  #6  
Old 06-29-2009, 07:23 AM
bananalive bananalive is offline
 
Join Date: Oct 2007
Location: UK
Posts: 2,802
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

To update the newest member immediately you can go:

AdminCP -> Scheduled Tasks -> Scheduled Tasks Manager -> Daily Statistics Log -> run now
Reply With Quote
  #7  
Old 07-01-2009, 05:25 PM
Sweeks Sweeks is offline
 
Join Date: Jul 2008
Posts: 633
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

After running the task it isnt working for me here somehow.
________
KTM LC4
Reply With Quote
  #8  
Old 07-21-2009, 11:42 AM
BigDog56 BigDog56 is offline
 
Join Date: Jan 2007
Posts: 430
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Worked like a charm! thank you for this tip!
Reply With Quote
  #9  
Old 07-28-2009, 02:09 PM
sebaot sebaot is offline
 
Join Date: Jul 2005
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for an awesome tip! It wasn't cool to see banned users and their names come up on the forum index. I used this, but I modified the query some:

Code:
$newuser = $vbulletin->db->query_first("SELECT userid, username FROM `" . TABLE_PREFIX . "user` WHERE joindate=(select max(joindate) from user where usergroupid!=8)");
I guess it should theoretically create a bit slower query on the database server, but result in less memory being allocated since the result is slimmed down to 1 row instead of all members in the users-table, even if the business class uses query_first. Never ran any tests to verify it, though. :-)
Reply With Quote
  #10  
Old 08-10-2009, 05:40 PM
goshalim goshalim is offline
 
Join Date: Oct 2007
Posts: 470
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've applied this change to my forum but I'm not seeing it take affect on the forum , and still showing the banned users.
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 10:43 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.06954 seconds
  • Memory Usage 2,293KB
  • Queries Executed 25 (?)
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)bbcode_code
  • (3)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)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
  • (9)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