Copy of post to visitor ?
Copy of post to visitor ?
Version of script: 1.7
Hi Henrie,
In version 1.7 I don't see the option to send a copy of the post to the visitor after signing the guestbook ?
Your version had this option.
Jaap.
Hi Henrie,
In version 1.7 I don't see the option to send a copy of the post to the visitor after signing the guestbook ?
Your version had this option.
Jaap.
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)Paste the following code directly before it on empty line 992.
Part 2 of 4: Notification of post waiting for approval
Search for (lines 955-956)Paste the following code directly before it on empty line 954.
Part 3 of 4: Notification of approval/rejection
Search for (line 272)Paste the following code directly before it on empty line 271.
Part 4 of 4: Notification of approval/rejection
Search for (line 250)Replace it with the following code
save and close the gbook.php file
Open the file settings.php
Findand change it to
Open the file language.inc.php
Add
add it before ?>
Greetings,
Henrie
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']);
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 */
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']);
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 */
Search for (line 272)
Code: Select all
} // END approveEntry()
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 */
Search for (line 250)
Code: Select all
define('NOTICE',$lang['t87']);
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']);
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;
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;
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.';
Greetings,
Henrie
Last edited by Henrie on Fri Jan 01, 2010 9:48 pm, edited 1 time in total.
I do not monitor the Gbook forums regularly anymore since I do not use the Gbook script myself anymore for a long time. But it helped me a lot in learning to understand php.
I received your donation for a drink
Hartelijk bedankt (for those non-dutch reader: Thank you very much).
I will enjoy some extra drinks when celebrating new-year.
Happy New Year!
Henrie

Hartelijk bedankt (for those non-dutch reader: Thank you very much).
I will enjoy some extra drinks when celebrating new-year.
Happy New Year!
Henrie
I do not monitor the Gbook forums regularly anymore since I do not use the Gbook script myself anymore for a long time. But it helped me a lot in learning to understand php.
Hmmm.. nice code. i also use it for my site and its work. thanks to you for sending this code. its my pleasure that if you can give another code for editing. may be that ill easy against it... 

The [url=http://www.mcsepractice.com]mcse[/url] has been designed for knowledgeable security professionals in the field of security which is one of the fastest growing fields in IT.
Hello donaldjeo,
You are welcome
I am not sure what additional function you are asking. What would you like to edit?
Greetings,
Henrie
You are welcome

I am not sure what additional function you are asking. What would you like to edit?
Greetings,
Henrie
I do not monitor the Gbook forums regularly anymore since I do not use the Gbook script myself anymore for a long time. But it helped me a lot in learning to understand php.
Re: Copy of post to visitor ?
I have tried this modification in GB 1.7. I cannot get return msg that post is approved or rejected. Btw I think that in approval section part 2 of 4 should be:
$message.= sprintf($lang['hl_t05'],$settings['gbook_title'])."\n\n";
and not
$message.= sprintf($lang['hl_t04'],$settings['gbook_title'])."\n\n"
See language file:
$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
$message.= sprintf($lang['hl_t05'],$settings['gbook_title'])."\n\n";
and not
$message.= sprintf($lang['hl_t04'],$settings['gbook_title'])."\n\n"
See language file:
$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
Re: Copy of post to visitor ?
I have the same issue as asaki, changed ['hl_t04'] in ['hl_t05'] as suggested and is an improvement already, but i still don't receive an e-mail when the message is approved or declined. Any suggestions would be appreciated.
Re: Copy of post to visitor ?
Somehow I overlooked Asaki's post. I changed ['hl_t04'] to ['hl_t05'] now in the approval section part 2 of 4.
@Eduspin
I am sorry, but i do not have time to look at the code now to check if it is working or not. I think I tested i thoroughly when I first wrote te code, so I think it should work.
Just to be sure i understand you right, you are talking about the visitor not receiving a mail when you have approved or disapporove the message of the visitor?
Greetings,
Henrie.
@Eduspin
I am sorry, but i do not have time to look at the code now to check if it is working or not. I think I tested i thoroughly when I first wrote te code, so I think it should work.
Just to be sure i understand you right, you are talking about the visitor not receiving a mail when you have approved or disapporove the message of the visitor?
Greetings,
Henrie.
I do not monitor the Gbook forums regularly anymore since I do not use the Gbook script myself anymore for a long time. But it helped me a lot in learning to understand php.
Re: Copy of post to visitor ?
Yes, you understand right. Thank you for your reply.Henrie wrote:Somehow I overlooked Asaki's post. I changed ['hl_t04'] to ['hl_t05'] now in the approval section part 2 of 4.
@Eduspin
I am sorry, but i do not have time to look at the code now to check if it is working or not. I think I tested i thoroughly when I first wrote te code, so I think it should work.
Just to be sure i understand you right, you are talking about the visitor not receiving a mail when you have approved or disapporove the message of the visitor?
Greetings,
Henrie.
There is no hurry since i can manually send the approval for the time being.
The guestbook is at the moment at a testlocation at the server.
It is going to take a while before it's all as i like it.
When i reply a message the visitor gets an email about it, but not the approval or disapproval email.
Thanks.
Re: Copy of post to visitor ?
Hello Eduspin,
I finally had time to look into the issue of the notification mail of approval or rejection not being sent to the visitor.
I found the error and have to apologise to all who used the code in the past, because i think it may have never worked properly.
The error is in part 3 of 4. I used the following code The problem is that this code does not read the e-mail of the visitor properly and therefor can not sent the notification e-mail after approval or rejection to the visitor.
The following code should fix it, use it instead of the previously posted part 3 of 4.
I also applied this code to the original post viewtopic.php?p=12533#p12533 now.
It should work, but if you are having any issues with it, please let me know.
Greetings,
Henrie
I finally had time to look into the issue of the notification mail of approval or rejection not being sent to the visitor.
I found the error and have to apologise to all who used the code in the past, because i think it may have never worked properly.
The error is in part 3 of 4. I used the following code
Code: Select all
/* Notification posts to the visitor modification by Henrie >> part 3 of 4: Notification of approval/rejection */
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 */
The following code should fix it, use it instead of the previously posted part 3 of 4.
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 */
It should work, but if you are having any issues with it, please let me know.
Greetings,
Henrie
I do not monitor the Gbook forums regularly anymore since I do not use the Gbook script myself anymore for a long time. But it helped me a lot in learning to understand php.