Private post. Click to view.
-
- Posts: 18
- Joined: Thu Aug 17, 2006 9:30 pm
Private post. Click to view.
When you submit a reply to a posting I find the original comments disappear and are replaced by Private post. Click to view. Is this correct as I assumed that the guestbook owner could add a message to the original comments any has anyone else had this.
That shouldn't happen unless the post already was private. Have you been editing gbook.php?
Please include following info if you want further help
Script URL:
Version of script:
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when searching for a solution:
Please include following info if you want further help
Script URL:
Version of script:
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when searching for a solution:
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
He probably has been editing the gbook (see this post viewtopic.php?t=1038).
But he probably has done something wrong, I warned him in my post that some fields are used for very specific tasks that have been coded in gbook.
He posted a reply afterwards in which he asked what he should edit. Later when I wanted to reply, the post was deleted so I did not have the chance to reply.
My guess is that he found what he should edit. But according to this post he has done it the wrong way.
Greetings,
Henrie
But he probably has done something wrong, I warned him in my post that some fields are used for very specific tasks that have been coded in gbook.
He posted a reply afterwards in which he asked what he should edit. Later when I wanted to reply, the post was deleted so I did not have the chance to reply.
My guess is that he found what he should edit. But according to this post he has done it the wrong way.
Greetings,
Henrie
Last edited by Henrie on Sun Aug 20, 2006 2:20 pm, edited 1 time in total.
-
- Posts: 18
- Joined: Thu Aug 17, 2006 9:30 pm
Hi guys yes I have edited the book, sorry for the delay but I have been fighting with it for 2 days now.
What consumes the time is uploading and testing it on the server.
I found that the message “Private post. Click to view” appears due to my own fault of adding an extra field, also other problems which is connected with this are other fields eg web address, swooping with email address, I am really struggling to add another felid, I feel the problem is when writing to the log file and the guestbook reading the information and display the fields incorrectly, has anyone successfully added a field if so I would really appreciate a look at your gbook.php file.
What consumes the time is uploading and testing it on the server.
I found that the message “Private post. Click to view” appears due to my own fault of adding an extra field, also other problems which is connected with this are other fields eg web address, swooping with email address, I am really struggling to add another felid, I feel the problem is when writing to the log file and the guestbook reading the information and display the fields incorrectly, has anyone successfully added a field if so I would really appreciate a look at your gbook.php file.
Hello Raidersguy,
Here's a step by step description on how to add an extra field.
The changes and line numbers are for the original GBook version 1.43.
The newfield I have introduced is named newfield1
Where the name of the field is printed in the guestbook I have used the name newfield1_name, this can be changed to whatever you want.
Change (starting at line 71)to this
Change (line 103) to
and change (line 108)to
Change (line 124)to
Change (line 353)to
Add (after line 383, which is the following line)the following code (it does not have to be at that line exactly but must be somewhere in that paragraph with the other "hidden" input fields)
Change (line 430)to (notice that ,$ip,$newfield1 is added and not only $newfield)
Add after (starting at line 448)the following code (it can also be placed before the previous lines of code, depending on where you want the field to be displayed in the private messages)
Change (line 607)to
Change (line 632), these are the fields that are added to the entries.txt fileto
Add a new line somewhere in this code (starting at line 651)with the following code (this is adding the new field to the notifying mail)
Change (line 686)to
Add after (starting at line 713)The following code can also be added before that piece of code but has to be an entire table row ( <tr>...</tr> ). This is the field in the "sign guestbook" page
Change (line 779)to (notice that ,$ip,$newfield1 is added and not only $newfield)
Add after (starting at line 796)the following code (it can also be placed before that code, depending on where you want the line with the new field to be displayed in the guestbook)
This should be everything and works in my test guestbook.
I just hope I have not made an error when I added all this to this forum.
Greetings,
Henrie
Here's a step by step description on how to add an extra field.
The changes and line numbers are for the original GBook version 1.43.
The newfield I have introduced is named newfield1
Where the name of the field is printed in the guestbook I have used the name newfield1_name, this can be changed to whatever you want.
Change (starting at line 71)
Code: Select all
$name=gbook_input($_POST['name']);
$from=gbook_input($_POST['from']);
$a=check_mail_url(); $email=$a['email']; $url=$a['url'];
$comments=gbook_input($_POST['comments']);
$isprivate=gbook_input($_POST['private']);
if ($isprivate) {$sign_isprivate='checked';}
if ($_REQUEST['nosmileys']) {$sign_nosmileys='checked';}
if (empty($name))
{
printSign($name,$from,$email,$url,$comments,$sign_nosmileys,$sign_isprivate,'Please enter your name');
}
if ($email=='INVALID')
{
printSign($name,$from,'',$url,$comments,$sign_nosmileys,$sign_isprivate,'Enter a valid e-mail address or leave it empty');
}
if ($url=='INVALID')
{
printSign($name,$from,$email,'',$comments,$sign_nosmileys,$sign_isprivate,'Enter a valid website address or leave it empty');
}
if (empty($comments))
{
printSign($name,$from,$email,$url,$comments,$sign_nosmileys,$sign_isprivate,'Please enter your comments');
}
Code: Select all
$name=gbook_input($_POST['name']);
$from=gbook_input($_POST['from']);
$a=check_mail_url(); $email=$a['email']; $url=$a['url'];
$comments=gbook_input($_POST['comments']);
$isprivate=gbook_input($_POST['private']);
$newfield1=gbook_input($_POST['newfield1']);
if ($isprivate) {$sign_isprivate='checked';}
if ($_REQUEST['nosmileys']) {$sign_nosmileys='checked';}
if (empty($name))
{
printSign($name,$from,$email,$url,$comments,$sign_nosmileys,$sign_isprivate,$newfield1,'Please enter your name');
}
if ($email=='INVALID')
{
printSign($name,$from,'',$url,$comments,$sign_nosmileys,$sign_isprivate,$newfield1,'Enter a valid e-mail address or leave it empty');
}
if ($url=='INVALID')
{
printSign($name,$from,$email,'',$comments,$sign_nosmileys,$sign_isprivate,$newfield1,'Enter a valid website address or leave it empty');
}
if (empty($comments))
{
printSign($name,$from,$email,$url,$comments,$sign_nosmileys,$sign_isprivate,$newfield1,'Please enter your comments');
}
Code: Select all
printSign($name,$from,$email,$url,$comments,$sign_nosmileys,$sign_isprivate,'Please enter the security number');
Code: Select all
printSign($name,$from,$email,$url,$comments,$sign_nosmileys,$sign_isprivate,$newfield1,'Please enter the security number');
Code: Select all
printSign($name,$from,$email,$url,$comments,$sign_nosmileys,$sign_isprivate,'Wrong security number');
Code: Select all
printSign($name,$from,$email,$url,$comments,$sign_nosmileys,$sign_isprivate,$newfield1,'Wrong security number');
Code: Select all
addEntry($name,$from,$email,$url,$comments,$isprivate);
Code: Select all
addEntry($name,$from,$email,$url,$comments,$isprivate,$newfield1);
Code: Select all
function print_secimg($name,$from,$email,$url,$comments,$isprivate,$message=0) {
Code: Select all
function print_secimg($name,$from,$email,$url,$comments,$isprivate,$newfield1,$message=0) {
Code: Select all
<input type="hidden" name="private" value="<?php echo $isprivate; ?>">
Code: Select all
<input type="hidden" name="newfield1" value="<?php echo $newfield1; ?>">
Code: Select all
list($name,$from,$email,$url,$comment,$added,$isprivate,$reply)=explode($delimiter,$lines[$num]);
Code: Select all
list($name,$from,$email,$url,$comment,$added,$isprivate,$reply,$ip,$newfield1)=explode($delimiter,$lines[$num]);
Code: Select all
if ($email)
{
echo '<font class="smaller">E-mail:</font> <a href="mailto:'.$email.'" target="_blank" class="smaller">'.$email.'</a>';
}
Code: Select all
if ($newfield1)
{
echo '<font class="smaller">newfield1_name: '.$newfield1.'</font><br>';
}
Code: Select all
function addEntry($name,$from,$email,$url,$comments,$isprivate="0") {
Code: Select all
function addEntry($name,$from,$email,$url,$comments,$isprivate="0",$newfield1) {
Code: Select all
$addline = $name.$delimiter.$from.$delimiter.$email.$delimiter.$url.$delimiter.$comments.$delimiter.$added.$delimiter.$isprivate.$delimiter.'0'.$delimiter.$_SERVER['REMOTE_ADDR']."\n";
Code: Select all
$addline = $name.$delimiter.$from.$delimiter.$email.$delimiter.$url.$delimiter.$comments.$delimiter.$added.$delimiter.$isprivate.$delimiter.'0'.$delimiter.$_SERVER['REMOTE_ADDR'].$delimiter.$newfield1."\n";
Code: Select all
Name: $name
From: $from
E-mail: $email
Website: $url
Code: Select all
newfield1_name: $newfield1
Code: Select all
function printSign($name='',$from='',$email='',$url='',$comments='',$nosmileys='',$isprivate='',$error='') {
Code: Select all
function printSign($name='',$from='',$email='',$url='',$comments='',$nosmileys='',$isprivate='',$newfield1='',$error='') {
Code: Select all
<tr>
<td>Your e-mail:</td>
<td><input type="text" name="email" size="30" maxlength="50" value="<?php echo $email; ?>"></td>
</tr>
Code: Select all
<tr>
<td>newfield1_name:</td>
<td><input type="text" name="newfield1" size="30" maxlength="50" value="<?php echo $newfield1; ?>"></td>
</tr>
Code: Select all
list($name,$from,$email,$url,$comment,$added,$isprivate,$reply)=explode($delimiter,$lines[$i]);
Code: Select all
list($name,$from,$email,$url,$comment,$added,$isprivate,$reply,$ip,$newfield1)=explode($delimiter,$lines[$i]);
Code: Select all
if ($email)
{
echo '<font class="smaller">E-mail:</font> <a href="mailto:'.$email.'" target="_blank" class="smaller">'.$email.'</a><br>';
}
Code: Select all
if ($newfield1)
{
echo '<font class="smaller">newfield1_name: '.$newfield1.'</font><br>';
}
I just hope I have not made an error when I added all this to this forum.
Greetings,
Henrie
-
- Posts: 18
- Joined: Thu Aug 17, 2006 9:30 pm
-
- Posts: 18
- Joined: Thu Aug 17, 2006 9:30 pm