The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
Is there anyway for me to add a PHP plugin code where a user has met a specific condition once they validated their email, it'll move him/her to another usergroup rather than the default registration group?
In this case, another plugin calls up $islinked is someone is linked or not. I'd like to have something that IF user $islinked and is in the email verification group that once he/she has his/her mail verified, that in combination with $islinked it'll move him to a specific usergroup. EG: Code:
if ($islinked) { && has just verified mail address -> move to usergroup
<if needed> add an ELSE code to continue normal verification to
registered usergroup if not islinked.
Code:
if ($islinked) && ($vbulletin->options['verifyemail'])
{
$newusergroupid = X;
}
else
{
$newusergroupid = 2;
}
Code:
// get special data templates from the datastore
$specialtemplates = array('steam_softlinks');
// pre-cache templates used by all actions
$globaltemplates = array(
'register_rules',
'register_verify_age',
);
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
require_once(DIR . '/includes/functions_login.php');
require_once(DIR . '/includes/openid.php');
require_once(DIR . '/includes/functions_steamconnect.php');
I greatly appreciated the help. |
|
#2
|
|||
|
|||
|
I was hoping at least 1 of you would know the answer. I'm already targeting the register_activate_x hook for this.
--------------- Added [DATE]1431943679[/DATE] at [TIME]1431943679[/TIME] --------------- Okidoki.. I figured out the code that I need: Code:
include_once(DIR . '/includes/functions_steamconnect.php');
if (!empty($vbulletin->userinfo['steam_link']))
{
XXXX
}
--------------- Added [DATE]1431955165[/DATE] at [TIME]1431955165[/TIME] --------------- EDIT From register.php Code:
// ### DO THE UG/TITLE UPDATE ###
$getusergroupid = iif($userinfo['displaygroupid'] != $userinfo['usergroupid'], $userinfo['displaygroupid'], $user['usergroupid']);
$user_usergroup =& $vbulletin->usergroupcache["$user[usergroupid]"];
$display_usergroup =& $vbulletin->usergroupcache["$getusergroupid"];
// init user data manager
$userdata =& datamanager_init('User', $vbulletin, ERRTYPE_STANDARD);
$userdata->set_existing($userinfo);
// Steam Validation Email Change
require_once(DIR . '/includes/functions_steamconnect.php');
if (!empty($vbulletin->userinfo['steam_link']))
{
$userdata->set('usergroupid', 9);
}
elseif (empty($vbulletin->userinfo['steam_link']))
{
$userdata->set('usergroupid', $user['usergroupid']);
}
If I alter Code:
$userdata->set('usergroupid', $user['usergroupid']);
Code:
$userdata->set('usergroupid', 9);
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|