Contact Lifestream



NP_Referrer

Rakaz has finally released Trackback 2.0 and Referrer 1.0 for Nucleus. And the good news is that I can get Referrer to work as intended now. Global referrers are being shown on the Profile page along with some of the other stats plugins (NP_Views/NP_MostViewed, NP_QueryLog) for Nucleus as well as the XBEL import system.

In addition:

I also added NP_MemberMail and extended its reach to function more like a traditional contact form. In order to get the fromName field to work I had to add the functionality to action.php of course. Again, a small core hack that adds up when it comes to upgrading the blog. But at least I will try to document what I do to make life easier.

Previous add-ons for action.php (around line 60 and 70 respectively). Both are needed for the extra website field in the comment form to work. A much better and complete guide to get extra fields in forms and to process them has been done by gRegor at the Nucleus Forum.
[php]$post['userweb'] = postVar(‘userweb’);

setcookie(‘comment_userweb’, $post['userweb'],$lifetime,’/',”,0);[/php]New add-ons (around line 106 and 109), the former to get the form data and the latter to replace anon tag if there is a name present.
[php]$fromName = postVar(‘fromname’);

if (!$fromName) {
$fromName = _MMAIL_FROMANON;
}[/php]And right after that something that is later pasted into every email body.
[php]// ENV_REPORT
$sendMessageagent = $_SERVER['HTTP_USER_AGENT'];
$sendMessagetime = date(“Y-m-d H:i:s”,time());
$sendMessageip = $_SERVER['REMOTE_ADDR'];
$sendMessagehost = gethostbyaddr($_SERVER['REMOTE_ADDR']);
$sendMessageport = $_SERVER['REMOTE_PORT'];

$env_output = “(Host: $sendMessagehost || IP Adress: $sendMessageip || Port: $sendMessageport || Server Time: $sendMessagetime || Agent: $sendMessageagent )”;[/php]