Quote:
Originally Posted by Dismounted
$invitegroupid, as it stands right now, will return an array. And will not work as you want it to. You want to use $invitegroupid['NewusergroupID'].
The first will check if a value is true. True being one that is not null, not an empty array or string, or the integer 0 (a string that is "0" is not true). The second will actually assign the constant "content" (you were probably meaning to use the string, not the constant) to the variable. You were looking for the equivalence operator "==". This checks if the two values are the same (note that it will not check type).
|
yeah that did the trick, now i went from a specifik line error to a db error
possebly something wrong with the SELECT
so i checked it in Navicat entered the SELECT and it gave me an error.
DB looks like :
Attachment 94094
But the Query errrors 1054 :
Attachment 94095
usercode is the userimput, gonna try to exchange places between InvitationCODE(colum) and imput, so it says imput = colum,,
currently i have Colum = imput.. ill ofcourse report back
EDIT : lol well yeah adding '' helps.. result to the original line :
Attachment 94096
just wondering why it dosent check out in vb then..
EDIT 2 :
okay now the code runs through error less..
but aparently dosent check / modify usergroup id.. lol
?????????????????????????????????????????????????? ?????????????????? EDIT 3 :
FULL UPDATE CURRENT CODE running, not working, but no errors either :
Invitationcode.php (modifyed copy of register.php)
around line 212-230 added type
Code:
'invitation' => TYPE_STR,
line 362 ish right after coppa selection
Code:
$vbulletin->input->clean_gpc('r', 'invitation', TYPE_NOHTML);
if ($vbulletin->GPC['invitation'])
{
$invitegroupid = $db->query_first_slave("
SELECT NewusergroupID
FROM " . TABLE_PREFIX . "vbinvitationcode
WHERE InvitationCODE = '" . $vbulletin->GPC[COOKIE_PREFIX . 'invitation'] . "'");
$userdata->set('usergroupid', $invitegroupid['NewusergroupID']);
}
if (empty($user['usergroupid']))
{
$userdata->set('usergroupid', $newusergroupid);
}
This runs through but does not change the usergroup ID.
however if i replace the if statement with the original code it DOES change
the usergroup.. but no DB selection.
Code:
if ($vbulletin->GPC['invitation'] == 'awsome')
{
$userdata->set('usergroupid', '5');
}
else
{
$userdata->set('usergroupid', $newusergroupid);
}
################################################## ################################################## #################################### EDIT 4 ################################
Okay moved it all into the existing code for makering usergroups
and it runs smooth, but it still dosent place users in the group
only does "standard behavior" going back to the idea IF dont work as intended
Current usergroupID placement :
PHP Code:
// assign user to usergroup 3 if email needs verification
$vbulletin->input->clean_gpc('r', 'invitation', TYPE_NOHTML);
if ($vbulletin->options['verifyemail'])
{
$newusergroupid = 3;
}
else if ($vbulletin->options['moderatenewmembers'] OR $vbulletin->GPC['coppauser'])
{
$newusergroupid = 4;
}
else if ($vbulletin->GPC['invitation'])
{
$invitegroupid = $db->query_first_slave("
SELECT NewusergroupID
FROM " . TABLE_PREFIX . "vbinvitationcode
WHERE InvitationCODE = '" . $vbulletin->GPC[COOKIE_PREFIX . 'invitation'] . "'");
$userdata->set('usergroupid', $invitegroupid['NewusergroupID']);
}
else
{
$newusergroupid = 2;
}
But again if i does this it works, but no db

:
PHP Code:
if ($vbulletin->GPC['invitation'] == 'awsome')
{
$userdata->set('usergroupid', '5');
}
help
Changeing DB table name from NewusergroupID to NUGUID im suspecting interference
between the "other" $newusergroupid used in the same page.