2
Ok, in case anyone wants to do this, I followed the steps (found
HERE) below and the only thing I changed was the
$myts->oopsStripSlashesGPC($HTTP_SERVER_VARS['REMOTE_ADDR'] ));
had to be changed to $xoopsMailer->assign('USERIP', $myts->oopsStripSlashesGPC(
$ip=$_SERVER['REMOTE_ADDR'] ));
in order to work with php.ini "register globals off" setting.
Quote:
kahumbu wrote:
I had the same idea, so after not finding any solution, I decided to dig in the code.
This hack will let you receive username, email and IP of the new user (if you wanted to receive notifications on new registration).
First, make a new file regnotify.tpl in language/english/mail_template/ containing this text:
A new user has registered:
Username: {USERNAME}
Email: {USEREMAIL}
User IP: {USERIP}
You could change that, of course, but keep those {variables}.
Second, open up register.php and add the hack around Line 266-267:
$xoopsMailer->useMail();
[b]// Start of Hack[/b]
$xoopsMailer->setTemplate('regnotify.tpl');
$xoopsMailer->assign('USERNAME', $myts->oopsStripSlashesGPC($uname));
$xoopsMailer->assign('USEREMAIL', $myts->oopsStripSlashesGPC($email));
$xoopsMailer->assign('USERIP', $myts->oopsStripSlashesGPC($HTTP_SERVER_VARS['REMOTE_ADDR'] ));
[b]// End of Hack[/b]
$member_handler =& xoops_gethandler('member');
Finally, comment out this line:
//$xoopsMailer->setBody(sprintf(_US_HASJUSTREG,$myts->oopsStripSlashesGPC($uname)));
I would like to get comments from the devs about using the $myts->... syntax with the REMOTE_ADDR var. I was just going along with the syntax of the other vars. I'm not exactly sure if I needed to do that.
For now, it works on my site. Hope this helps others. Feedback appreciated.