14
« on: January 09, 2003, 07:06:14 AM »
HI V@no,
I think I have figured out how to do this, right now I think I must have been crazy I started at this as I really don't need it, but still I thought I was able to do so, so here is what I did:
Open member.php
Find:
if ($user_email != "") {
$sql = "SELECT ".get_user_table_field("", "user_id").get_user_table_field(", ", "user_name").get_user_table_field(", ", "user_password")."
Add: get_user_table_field(", ", "user_activationkey").
So it looks like:
if ($user_email != "") {
$sql = "SELECT ".get_user_table_field("", "user_id").get_user_table_field(", ", "user_name").get_user_table_field(", ", "user_password").get_user_table_field(", ", "user_activationkey")."
Find:
// Start Emailer
include(ROOT_PATH.'includes/email.php');
$site_email = new Email();
$site_email->set_to($user_email);
$site_email->set_subject($lang['send_password_emailsubject']);
After that you will find an array that looks like this:
$site_email->register_vars(array(
"user_name" => $checkuser[$user_table_fields['user_name']],
"user_password" => stripslashes($user_password),
"site_name" => $config['site_name']
));
Now add:
"activation_url" => $script_url."/register.php?action=activate&activationkey=".$checkuser[$user_table_fields['user_activationkey']],
So the end result looks like this:
// Start Emailer
include(ROOT_PATH.'includes/email.php');
$site_email = new Email();
$site_email->set_to($user_email);
$site_email->set_subject($lang['send_password_emailsubject']);
$site_email->register_vars(array(
"activation_url" => $script_url."/register.php?action=activate&activationkey=".$checkuser[$user_table_fields['user_activationkey']],
"user_name" => $checkuser[$user_table_fields['user_name']],
"user_password" => stripslashes($user_password),
"site_name" => $config['site_name']
));
$site_email->set_body("lost_password", $config['language_dir']);
$site_email->send_email();
Now you can use the tag: {activation_url} in your email templates.
Edit the Lost_password template in the Lang/{language}/email folder and add the {activation_url} tag somewhere.
Now upload all and I hope it works, I did tested it myself and for me it worked, but like I said before, I did not need it as my member don't have to activate.
Cheers,
Vraxor