View Single Post
  #373  
Old 08-25-2006, 01:34 PM
Quarterbore Quarterbore is offline
 
Join Date: Mar 2005
Location: Valley Forge PA
Posts: 538
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can I please request a little programing help with my issue?

I know that my members USERID behaves in a VERY predictable way when comparing the original userid to the new userid. Here is the breakdown:

If USERID is # - then I want the system to ignore...

(788 or less) (ignore Userid+1 as a duplicate)
(789 to 960) (report any duplicates)
(961 to 1550) (ignore Userid-1 as duplicates)
(1551 to 1762) (ignore Userid-2 as duplicates)
(1763 to 1843) (ignore Userid-3 as duplicates)
(1844 or higher) (report all duplicates!)

Now, I know this code is done by the "Login Checker" plugin and the code I need to add these conditional is here:

PHP Code:
if( empty($idstack) )  
                    {  
                        
$idstack ",{$vbulletin->userinfo['userid']},";  
                        
setcookie("IDstack"$idstacktime()+10368000"/");  
                    }  
                    else  
                    {  
                        if(!
strstr($idstack",{$vbulletin->userinfo['userid']},"))  
                        {  
                            
$idstack .= ",{$vbulletin->userinfo['userid']},";  
                            
setcookie("IDstack"$idstacktime()+10368000"/");  
      
                            
$Unums split(","$idstack);  
                            
$andids null;  
                            
$numvs 0;  
                              
                            for (
$i 0$i < (sizeof($Unums)); $i++)   
                            {  
                                if( 
verify_id('user'$Unums[$i], FALSE, -1, -1) )  
                                {  
                                    if (!empty(
$Unums[$i]) && is_numeric($Unums[$i])) {          
                                        
$checkuser $vbulletin->db->query_first("SELECT username FROM " TABLE_PREFIX "user WHERE userid={$Unums[$i]}");  
                                        if ( !empty(
$andids) ) $andids .= "and";  
                                        
$andids .= " [url="$vbulletin->options['bburl'] ."/member.php?u=" $Unums[$i] . "] "$checkuser['username'] ."[/url] ";  
                                        
$numvs++;  
                                    }  
                                }  
                            }  
                              
                            
// Make sure we have at least 2 valid user violations  
                            
if ( $numvs ) return;  
                              
                            
$allowsmilie '1';  
                            
$visible '1'
Now, would the best way for me to fix my self induced problem be to write a series of conditional like this:

PHP Code:
// Adjust for IMPORT ID issue
$loggedinuser $vbulletin->userinfo['userid'];
if (!empty(
$Unums[$i]) && is_numeric($Unums[$i])) { 
     If (
$loggedinuser <= 188 AND $loggedinuser == Unums[$i] + 1){$numvs--;}
     If (
$loggedinuser >= 961  AND $loggedinuser <= 1550 AND $loggedinuser == Unums[$i] - 1){$numvs--;}
     If (
$loggedinuser >= 1551  AND $loggedinuser <= 1762 AND $loggedinuser == Unums[$i] - 2){$numvs--;}
     If (
$loggedinuser >= 1763  AND $loggedinuser <= 1843 AND $loggedinuser == Unums[$i] - 3){$numvs--;}

I assume that I have the variables figured out but this will be really hard fro me to test on my live site to figure out if it is eliminiatig the correct accounts! I addedd this right above the "// Make sure we have at least 2 valid user violations "

EDIT - FWIW, there is a bug in that code as I just tried it... It have me a syntax error as well as a headers resent error and I had to disable pluggins to remove the pluggin from my system. I still think the basic concept may work but this is not the right place or way to do it!!!

I'll update if I figure this out but from my count this impacts about 1700 members on my site so dealing with that many alerts is a huge problem!
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01813 seconds
  • Memory Usage 1,831KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete