vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin Tips & Tricks (https://vborg.vbsupport.ru/forumdisplay.php?f=239)
-   -   Stop Banned Users from being Newest Member (https://vborg.vbsupport.ru/showthread.php?t=215158)

bananalive 06-01-2009 10:00 PM

Stop Banned Users from being Newest Member
 
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

NewAyenee 06-22-2009 10:52 PM

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.

SurfCityvBer 06-23-2009 05:08 PM

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.

NewAyenee 06-23-2009 10:19 PM

Quote:

Originally Posted by SurfCityvBer (Post 1835747)
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.

Qwk86gn 06-29-2009 05:51 AM

Thanks :)

bananalive 06-29-2009 07:23 AM

To update the newest member immediately you can go:

AdminCP -> Scheduled Tasks -> Scheduled Tasks Manager -> Daily Statistics Log -> run now

Sweeks 07-01-2009 05:25 PM

After running the task it isnt working for me here somehow.
________
KTM LC4

BigDog56 07-21-2009 11:42 AM

Worked like a charm! thank you for this tip!

sebaot 07-28-2009 02:09 PM

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

goshalim 08-10-2009 05:40 PM

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.


All times are GMT. The time now is 05:07 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.05132 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
  • (1)bbcode_code_printable
  • (3)bbcode_php_printable
  • (1)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