» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Online Users: 65
0 members and 65 guests
No Members online
Most users ever online was 611, 03-21-2008 at 11:10 PM.
» .::.
Web Hosting - web hosting, dedicated servers and web design services
Online Degree - search for 1000+ online degrees, online colleges & online universities.
Tattoo - we are a group of tattoo enthusiasts
Gexa Energy - your absolute best choice in electric service
Texas electricity - save on electric rates
Oral Chelation - initial cleansing of your veins & arteries

Register Now! Contact Us

About this Page
This is a discussion on Sending Welcome Email With Auto Registration Module within the Nuke 7.x - Modules forums, part of the PHP-Nuke 7.x category; I use an auto registration module on one of my Nuke sites because AOL keeps blocking emails intermittently thus people ...


Go Back   Nukemods Forum » PHP-Nuke 7.x » Nuke 7.x - Modules

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-19-2005, 02:15 PM
Junior Member
 
Join Date: Apr 2005
Posts: 8
Sending Welcome Email With Auto Registration Module
I use an auto registration module on one of my Nuke sites because AOL keeps blocking emails intermittently thus people can not click the confirmation link to register. The problem is that some people are using bad email addresses.

I want to modify the code below so it sends a welcome email with the username and password when using the auto registration option. This way I can see if the message bounces back, and why, to decide if the person gave a bad email or if the email was just blocked.

I tried including part of the code that is used for the normal registration after the auto registration to produce an email (see the code at the bottom) but gave up as I could not get it to work.

Here is the code if anyone can help. Send a PM or post if you need to see the rest of the code, I just included the part I thought it involved.

Thanks

Code:
function confirmNewUser($username, $user_email, $user_password, $user_password2, $random_num, $gfx_check) {
    global $stop, $EditedMessage, $sitename, $module_name, $minpass, $autoActivate;
    include("header.php");
    include("config.php");
    filter_text($username);
    $u]sername = $EditedMessage;
    $user_viewemail = "0";
    userCheck($username, $user_email);
    if (!$stop) {
	$datekey = date("F j");
	$rcode = hexdec(md5($_SERVER[HTTP_USER_AGENT] . $sitekey . $_POST[random_num] . $datekey));
	$code = substr($rcode, 2, 6);
	if (extension_loaded("gd") AND $code != $gfx_check AND ($gfx_chk == 3 OR $gfx_chk == 4 OR $gfx_chk == 6 OR $gfx_chk == 7)) {
	    title(""._NEWUSERERROR."");
	    OpenTable();
	    echo "<center>"._SECCODEINCOR."

"
		.""._GOBACK."</center>";
	    CloseTable();
	    include("footer.php");
	    die();
	}
	if ($user_password == "" AND $user_password2 == "") {
	    $user_password = makepass();
	} elseif ($user_password != $user_password2) {
	    title(""._NEWUSERERROR."");
	    OpenTable();
	    echo "<center>"._PASSDIFFERENT."

"._GOBACK."</center>";
	    CloseTable();
	    include("footer.php");
	    die();
	} elseif ($user_password == $user_password2 AND strlen($user_password) < $minpass) {
	    title(""._NEWUSERERROR."");
	    OpenTable();
	    echo "<center>"._YOUPASSMUSTBE." $minpass "._CHARLONG."

"._GOBACK."</center>";
	    CloseTable();
	    include("footer.php");
	    die();
	}
	title("$sitename: "._USERREGLOGIN."");
	OpenTable();
	echo "<center>"._USERFINALSTEP."

$username, "._USERCHECKDATA."

"
	    ."<table align='center' border='0'>"
	    ."<tr><td>"._UUSERNAME.": $username
</td></tr>"
	    ."<tr><td>"._EMAIL.": $user_email</td></tr></table>

";
	if (!$autoActivate) echo "<center>"._NOTE." "._YOUWILLRECEIVE."";
	echo "<form action=\"modules.php?name=$module_name\" method=\"post\">"
	    ."<input type=\"hidden\" name=\"random_num\" value=\"$random_num\">"
	    ."<input type=\"hidden\" name=\"gfx_check\" value=\"$gfx_check\">"
	    ."<input type=\"hidden\" name=\"username\" value=\"$username\">"
	    ."<input type=\"hidden\" name=\"user_email\" value=\"$user_email\">"
	    ."<input type=\"hidden\" name=\"user_password\" value=\"$user_password\">"
	    ."<input type=\"hidden\" name=\"op\" value=\"finish\">

"
	    ."<input type=\"submit\" value=\""._FINISH."\"> "._GOBACK."</form></center>";
	CloseTable();
    } else {
	OpenTable();
	echo "<center><font class=\"title\">Registration Error!</font>

";
	echo "<font class=\"content\">$stop
"._GOBACK."</font></center>";
	CloseTable();
    }
    include("footer.php");
}

function finishNewUser($username, $user_email, $user_password, $random_num, $gfx_check) {
    global $stop, $EditedMessage, $adminmail, $sitename, $Default_Theme, $user_prefix, $db, $storyhome, $module_name, $nukeurl, $autoActivate;
    include("header.php");
    include("config.php");
    userCheck($username, $user_email);
    $user_regdate = date("M d, Y");
    if (!isset($stop)) {
	$datekey = date("F j");
	$rcode = hexdec(md5($_SERVER[HTTP_USER_AGENT] . $sitekey . $random_num . $datekey));
	$code = substr($rcode, 2, 6);
	if (extension_loaded("gd") AND $code != $gfx_check AND ($gfx_chk == 3 OR $gfx_chk == 4 OR $gfx_chk == 6 OR $gfx_chk == 7)) {
	    Header("Location: modules.php?name=$module_name");
	    die();
	}
        mt_srand ((double)microtime()*1000000);
        $maxran = 1000000;
        $check_num = mt_rand(0, $maxran);
	$check_num = md5($check_num);
	$time = time();
	$finishlink = "$nukeurl/modules.php?name=$module_name&op=activate&username=$username&check_num=$check_num";
	$new_password = md5($user_password);
	$username = check_html($username, nohtml);
	$user_email = check_html($user_email, nohtml);
	$result = $db->sql_query("INSERT INTO ".$user_prefix."_users_temp (user_id, username, user_email, user_password, user_regdate, check_num, time) VALUES (NULL, '$username', '$user_email', '$new_password', '$user_regdate', '$check_num', '$time')");
	if(!$result) {
	    echo ""._ERROR."
";
	} elseif ($autoActivate) { activate($username, $check_num, $autoActivate);
	} else {
	   $message = ""._WELCOMETO." $sitename!\n\n"._YOUUSEDEMAIL." ($user_email) "._TOREGISTER." $sitename.\n\n "._TOFINISHUSER."\n\n $finishlink\n\n "._FOLLOWINGMEM."\n\n"._UNICKNAME." $username\n"._UPASSWORD." $user_password";
	    $subject = ""._ACTIVATIONSUB."";
	    $from = "$adminmail";
	    mail($user_email, $subject, $message, "From: $from\nX-Mailer: PHP/" . phpversion());
	    title("$sitename: "._USERREGLOGIN."");
	    OpenTable();
	    echo "<center>"._ACCOUNTCREATED."

";
	    echo ""._YOUAREREGISTERED.""
	        ."

"
		.""._FINISHUSERCONF."

"
		.""._THANKSUSER." $sitename!</center>";
	    CloseTable();
	}
    } else {
	echo "$stop";
    }
    include("footer.php");
}

function activate($username, $check_num, $autoActivate=FALSE) {
    global $db, $user_prefix, $module_name, $language, $stop, $EditedMessage, $adminmail, $sitename, $Default_Theme, $db, $storyhome, $nukeurl, $autoActivate;
    $past = time()-86400;
    $db->sql_query("DELETE FROM ".$user_prefix."_users_temp WHERE time < '$past'");
    $sql = "SELECT * FROM ".$user_prefix."_users_temp WHERE username='$username' AND check_num='$check_num'";
    $result = $db->sql_query($sql);
    if ($db->sql_numrows($result) == 1) {
	$row = $db->sql_fetchrow($result);
	if ($check_num == $row[check_num]) {
	    $db->sql_query("INSERT INTO ".$user_prefix."_users (user_id, username, user_email, user_password, user_avatar, user_regdate, user_lang) VALUES (NULL, '$row[username]', '$row[user_email]', '$row[user_password]', 'gallery/blank.gif', '$row[user_regdate]', '$language')");
	    $db->sql_query("DELETE FROM ".$user_prefix."_users_temp WHERE username='$username' AND check_num='$check_num'");
	    if (!$autoActivate) include("header.php");
	    include("config.php");
	    title(""._ACTIVATIONYES."");
	    OpenTable();
	    echo "<center>$row[username]: "._ACTMSG."</center>";
	    CloseTable();
	    include("footer.php");
	    die();
	} else {
	    if (!$autoActivate) include("header.php");
	    title(""._ACTIVATIONERROR."");
	    OpenTable();
	    echo "<center>"._ACTERROR1."</center>";
	    CloseTable();
	    include("footer.php");
	    die();
	}
    } else {
	if (!$autoActivate) include("header.php");
	title(""._ACTIVATIONERROR."");
	OpenTable();
	echo "<center>"._ACTERROR2."</center>";
	CloseTable();
	include("footer.php");
	die();
    }

}
I tried adding the globals to the auto activation if statement and this code but it did not work so what am I doing wrong?:

Code:
$message = ""._WELCOMETO." $sitename!\n\n"._YOUUSEDEMAIL." ($user_email) "._TOREGISTER." $sitename.\n\n "._TOFINISHUSER."\n\n $finishlink\n\n "._FOLLOWINGMEM."\n\n"._UNICKNAME." $username\n"._UPASSWORD." $user_password";
	    $subject = ""._ACTIVATIONSUB."";
	    $from = "$adminmail";
	    mail($user_email, $subject, $message, "From: $from\nX-Mailer: PHP/" . phpversion());
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-19-2005, 02:37 PM
Junior Member
 
Join Date: Feb 2005
Posts: 3
Pleas Help Pleas
Pleas All Help me some 1 give me Good Program for build / Repier php Site Plasss Help
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disallow registration by certain email domains Astroman Nuke 7.x - General 4 02-09-2007 05:00 PM
EMAIL REGISTRATION macca Nuke 7.x - General 5 04-15-2005 10:20 PM
Email Not Sending romer Open topics 1 10-13-2004 11:09 AM
registration email varialskate Nuke 6.5 to 6.9 - General 1 08-15-2004 06:52 AM
error: "failed sending email" ??? darkdan Purged Topics 3 02-12-2003 09:47 PM


All times are GMT -5. The time now is 07:44 AM.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.

LinkBacks Enabled by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31