fix email reg 100% (General)

by hunter ⌂ @, Monday, July 20, 2009, 07:16 (5404 days ago)

find code into file: register.inc.php
change from
$lang['new_user_email_txt'] = str_replace("[activate_link]", $settings['forum_address'] ."index.php?mode=register&id=".$new_user_id."&key=".$activate_code, $lang['new_user_email_txt']);

to:


$lang['new_user_email_txt'] = str_replace("[activate_link]","http://". $_SERVER['SERVER_NAME'] ."/index.php?mode=register&id=".$new_user_id."&key=".$activate_code, $lang['new_user_email_txt']);

visit my web : thegioi3d.x10hosting.com

Warning! The code will fail in some cases

by Auge, Monday, July 20, 2009, 17:14 (5403 days ago) @ hunter

Hello

find code into file: register.inc.php
change from
$lang['new_user_email_txt'] = str_replace("[activate_link]", $settings['forum_address'] ."index.php?mode=register&id=".$new_user_id."&key=".$activate_code, $lang['new_user_email_txt']);

to:

$lang['new_user_email_txt'] = str_replace("[activate_link]","http://". $_SERVER['SERVER_NAME'] ."/index.php?mode=register&id=".$new_user_id."&key=".$activate_code, $lang['new_user_email_txt']);

What's the reason to do it?

In many cases the forum is not installed in the root of a domain but in a subfolder. Thatswhy $settings['forum_address'] contains the full path to the forum folder. In your case the forum has to be directly installed in example.com so the URL has to be http://example.com/index.php. But what is when the forum is installed in the subfolder "forum"? The correct URL is http://example.com/forum/index.php. But that will fail with your code that generates http://example.com/index.php?mode=register....

Tschö, Auge

Warning! The code will fail in some cases

by hunter @, Wednesday, July 22, 2009, 03:44 (5402 days ago) @ Auge

Hello

find code into file: register.inc.php
change from
$lang['new_user_email_txt'] = str_replace("[activate_link]", $settings['forum_address'] ."index.php?mode=register&id=".$new_user_id."&key=".$activate_code, $lang['new_user_email_txt']);

to:

$lang['new_user_email_txt'] = str_replace("[activate_link]","http://". $_SERVER['SERVER_NAME'] ."/index.php?mode=register&id=".$new_user_id."&key=".$activate_code, $lang['new_user_email_txt']);


What's the reason to do it?

In many cases the forum is not installed in the root of a domain but in a subfolder. Thatswhy $settings['forum_address'] contains the full path to the forum folder. In your case the forum has to be directly installed in example.com so the URL has to be http://example.com/index.php. But what is when the forum is installed in the subfolder "forum"? The correct URL is http://example.com/forum/index.php. But that will fail with your code that generates http://example.com/index.php?mode=register....

Tschö, Auge

if you have sub subfolder "forum" you just to add "forum in to link here like:
fisrt into line here:
"/forum/index.php?mode=register&id=".......
so you know what to do ?

Warning! The code will fail in some cases

by Auge, Thursday, July 23, 2009, 10:24 (5400 days ago) @ hunter

Hello

find code into file: register.inc.php
change from
$lang['new_user_email_txt'] = str_replace("[activate_link]", $settings['forum_address'] ."index.php?mode=register&id=".$new_user_id."&key=".$activate_code, $lang['new_user_email_txt']);

to:

$lang['new_user_email_txt'] = str_replace("[activate_link]","http://". $_SERVER['SERVER_NAME'] ."/index.php?mode=register&id=".$new_user_id."&key=".$activate_code, $lang['new_user_email_txt']);

What's the reason to do it?

if you have sub subfolder "forum" you just to add "forum in to link here like:
fisrt into line here:
"/forum/index.php?mode=register&id=".......
so you know what to do ?

I know what to do. And again: What's the reason to do it?

The variable $settings['forum_address'] contains exactly the information of $_SERVER['SERVER_NAME'] and the local path to the forum wich you want me to add by hand. So why should I change to your solution if $settings['forum_address'] contains all needed information?

Is it possible that you used $settings['forum_address'] the wrong way?

Tschö, Auge

RSS Feed of thread