Jump to content

email activation .php


mobilekid

Recommended Posts

here is the code from vbulletin [register.php] and the section I have is about the email notification.

 

What I want to do is have it so when the user who has "just" registered at my forum recieves the email confirmation as soon as he clicks it, he will:

 

1. do as it does, and logs him into the forum and confirmed his email.

2. open another website with the same click.

I was wondering where and how to I do this and is this the right section.

 

here is the code:

 

/ ############################### start request activation email ###############################
if ($_REQUEST['do'] == 'requestemail')
{
$email = $vbulletin->input->clean_gpc('r', 'email', TYPE_NOHTML);

if ($vbulletin->userinfo['userid'] AND $vbulletin->GPC['email'] === '')
{
	$email = $vbulletin->userinfo['email'];
}
else
{
	$email = $vbulletin->GPC['email'];
}

if ($permissions['forumpermissions'] & $vbulletin->bf_ugp_forumpermissions['canview'])
{
	$navbits = construct_navbits(array(
		'register.php?' . $vbulletin->session->vars['sessionurl'] . 'a=ver' => $vbphrase['activate_your_account'],
		'' => $vbphrase['email_activation_codes']
	));
	eval('$navbar = "' . fetch_template('navbar') . '";');
}
else
{
	$navbar = '';
}

($hook = vBulletinHook::fetch_hook('register_requestemail')) ? eval($hook) : false;

$url =& $vbulletin->url;
eval('print_output("' . fetch_template('activate_requestemail') . '");');
}

// ############################### process request activation email #############################
if ($_POST['do'] == 'emailcode')
{
$vbulletin->input->clean_gpc('r', 'email', TYPE_NOHTML);

$users = $db->query_read_slave("
	SELECT user.userid, user.usergroupid, username, email, activationid, languageid
	FROM " . TABLE_PREFIX . "user AS user
	LEFT JOIN " . TABLE_PREFIX . "useractivation AS useractivation ON(user.userid = useractivation.userid AND type = 0)
	WHERE email = '" . $db->escape_string($vbulletin->GPC['email']) . "'"
);

if ($db->num_rows($users))
{
	while ($user = $db->fetch_array($users))
	{
		if ($user['usergroupid'] == 3)
		{ // only do it if the user is in the correct usergroup
			// make random number
			if (empty($user['activationid']))
			{ //none exists so create one
				$user['activationid'] = build_user_activation_id($user['userid'], 2, 0);
			}
			else
			{
				$user['activationid'] = vbrand(0, 100000000);
				$db->query_write("
					UPDATE " . TABLE_PREFIX . "useractivation SET
						dateline = " . TIMENOW . ",
						activationid = $user[activationid]
					WHERE userid = $user[userid]
						AND type = 0
				");
			}

			$userid = $user['userid'];
			$username = $user['username'];
			$activateid = $user['activationid'];

			($hook = vBulletinHook::fetch_hook('register_emailcode_user')) ? eval($hook) : false;

			eval(fetch_email_phrases('activateaccount', $user['languageid']));

			vbmail($user['email'], $subject, $message, true);
		}
	}

	eval(print_standard_redirect('redirect_lostactivatecode', true, true));
}
else
{
	eval(standard_error(fetch_error('invalidemail', $vbulletin->options['contactuslink'])));
}

}

 

 

 

the email that user recieves looks like this:

 

 

Dear dyin7, Thank you for registering at the coolforum.

Before we can activate your account one last step must be taken to complete your registration.

Please note - you must complete this last step to become a registered member.

You will only need to visit this url once to activate your account.

To complete your registration, please visit this url: http://thecoolforum/community/register.php?a=act&u=20328&i=76575329 

<a href="http://www.thecoolforum/community/register.php?a=act&u=20328&i=76575329">America Online Users Please Visit Here to be Activated</a>

**** Does The Above URL Not Work? ****If the above url does not work, please use your Web browser to go to:http://www.thecoolforum.com/community/register.php?a=ver 

Please be sure not to add extra spaces.

You will need to type in your username and activation number on the page that appears when you visit the url. 

Your Username is: dyin7Your Activation ID is: 76575329

If you are still having problems signing up please contact a member of our support staff at webmaster@sthecoolforum.com

 

All the best,thecoolforum

 

--------------------To stop receiving this email, please visit this url:http://www.thecoolforum/community/register.php?do=deleteactivation&u=20328&i=76575329

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.