Hello Jaap,
I thought i could just take the solution out of my HL-mod version guestbook and paste it in version 1.7, but it took a little more modification.
But it is done now.
Notification posts to the visitor for GBook version 1.7
Open file
gbook.php
Part 1 of 4: Notification of normal post
Search for (lines 993-994)
Code: Select all
/* Let the first page know a new entry has been submitted */
define('NOTICE',$lang['t47']);
Paste the following code directly before it on empty line 992.
Code: Select all
/* Notification posts to the visitor modification by Henrie >> part 1 of 4: Notification of normal post */
if (!(empty($email)) && $settings['notify_visitor'] == 1)
{
$char = array('.','@');
$repl = array('.','@');
$email=str_replace($repl,$char,$email);
$message = sprintf($lang['t76'],$name)."\n\n";
$message.= sprintf($lang['hl_t02'],$settings['gbook_title'])."\n\n";
$message.= "$lang[hl_t03]\n";
$message.= "$lang[t17] $name\n";
$message.= "$lang[t18] $from\n";
$message.= "$lang[t20] $email\n";
$message.= "$lang[t19] $url\n";
$message.= "$lang[t44]\n";
$message.= "$comments_nosmileys\n\n";
$message.= "$lang[hl_t04]\n";
$message.= "$settings[gbook_url]\n\n";
$message.= "$lang[t79]\n\n";
$message.= "$settings[website_title]\n";
$message.= "$settings[website_url]\n";
mail($email,$lang['hl_t01'],$message,"From: $settings[website_title] <$settings[admin_email]>\nReply-to: $settings[admin_email]\nReturn-path: $settings[admin_email]\nContent-type: text/plain; charset=".$lang['enc']);
}
/* End of Notification posts to the visitor modification by Henrie >> part 1 of 4: Notification of normal post */
Part 2 of 4: Notification of post waiting for approval
Search for (lines 955-956)
Code: Select all
/* Let the first page know a new entry has been submitted for approval */
define('NOTICE',$lang['t85']);
Paste the following code directly before it on empty line 954.
Code: Select all
/* Notification posts to the visitor modification by Henrie >> part 2 of 4: Notification of post waiting for approval */
if (!(empty($email)) && $settings['notify_visitor'] == 1)
{
$char = array('.','@');
$repl = array('.','@');
$email=str_replace($repl,$char,$email);
$message = sprintf($lang['t76'],$name)."\n\n";
$message.= sprintf($lang['hl_t05'],$settings['gbook_title'])."\n\n";
$message.= "$lang[hl_t03]\n";
$message.= "$lang[t17] $name\n";
$message.= "$lang[t18] $from\n";
$message.= "$lang[t20] $email\n";
$message.= "$lang[t19] $url\n";
$message.= "$lang[t44]\n";
$message.= "$comments_nosmileys\n\n";
$message.= "$lang[t79]\n\n";
$message.= "$settings[website_title]\n";
$message.= "$settings[website_url]\n";
mail($email,$lang['hl_t01'],$message,"From: $settings[website_title] <$settings[admin_email]>\nReply-to: $settings[admin_email]\nReturn-path: $settings[admin_email]\nContent-type: text/plain; charset=".$lang['enc']);
}
/* End of Notification posts to the visitor modification by Henrie >> part 2 of 4: Notification of post waiting for approval */
Part 3 of 4: Notification of approval/rejection
Search for (line 272)
Paste the following code directly before it on empty line 271.
Code: Select all
/* Notification posts to the visitor modification by Henrie >> part 3 of 4: Notification of approval/rejection */
$myline = explode("\t",$addline);
$email = $myline[2];
if (!(empty($email)) && $settings['notify_visitor'] == 1)
{
$char = array('.','@');
$repl = array('.','@');
$email=str_replace($repl,$char,$email);
$message = sprintf($lang['t76'],$name)."\n\n";
if (!$approve)
{
$message.= sprintf($lang['hl_t08'],$settings['gbook_title'])."\n\n";
}
else
{
$message.= sprintf($lang['hl_t07'],$settings['gbook_title'])."\n\n";
$message.= "$lang[hl_t04]\n";
$message.= "$settings[gbook_url]\n\n";
}
$message.= "$lang[t79]\n\n";
$message.= "$settings[website_title]\n";
$message.= "$settings[website_url]\n";
mail($email,$lang['hl_t01'],$message,"From: $settings[website_title] <$settings[admin_email]>\nReply-to: $settings[admin_email]\nReturn-path: $settings[admin_email]\nContent-type: text/plain; charset=".$lang['enc']);
}
/* End of Notification posts to the visitor modification by Henrie >> part 3 of 4: Notification of approval/rejection */
Part 4 of 4: Notification of approval/rejection
Search for (line 250)
Replace it with the following code
Code: Select all
/* Notification posts to the visitor modification by Henrie >> part 4 of 4: Notification of approval/rejection */
$addline = file_get_contents($file);
/* End of Notification posts to the visitor modification by Henrie >> part 4 of 4: Notification of approval/rejection */
define('NOTICE',$lang['t87']);
save and close the gbook.php file
Open the file
settings.php
Find
Code: Select all
/* Notify visitor when you reply to his/her guestbook entry? 1 = YES, 0 = NO */
$settings['notify_visitor']=0;
and change it to
Code: Select all
/* Notify visitor when you reply to his/her guestbook entry? 1 = YES, 0 = NO */
/* This setting is also used for the Notification posts to the visitor modification by Henrie */
$settings['notify_visitor']=1;
Open the file
language.inc.php
Add
Code: Select all
/* Language strings for modifications by Henrie */
$lang['hl_t01']='Thank you for signing my Guestbook.'; // E-mail subject
$lang['hl_t02']='Thank your for signing the %s Guestbook.'; // Text inside e-mail
$lang['hl_t03']='This is what you wrote:';
$lang['hl_t04']='Visit the below URL to view your message:';
$lang['hl_t05']='Thank your for signing the %s Guestbook. Your entry is waiting for approval and you will be notified when it has been approved.'; // Text inside e-mail
$lang['hl_t06']='Approval/rejection of your Guestbook entry'; // E-mail subject
$lang['hl_t07']='Your entry for the %s Guestbook has been approved.';
$lang['hl_t08']='Your entry for the %s Guestbook has been rejected.';
add it before
?>
Greetings,
Henrie