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", $idstack, time()+10368000, "/");
}
else
{
if(!strstr($idstack, ",{$vbulletin->userinfo['userid']},"))
{
$idstack .= ",{$vbulletin->userinfo['userid']},";
setcookie("IDstack", $idstack, time()+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 < 2 ) 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!