Page 1 of 1

GBook Private Message Error

Posted: Wed May 10, 2006 9:42 pm
by zr
Script URL:
Version of script:
Version of PHP:
Hosting company:
Have you searched THIS FORUM for your problem:
(if not please do before posting)
If so, what terms did you try:

Write your message below:



First of all, this script is excellent. I've submitted a rating to both hotscripts and resource index. There is one small errorr, though. When you are viewing a private message, the links to delete, reply, or view IP don't work. I fixed it by changing all of the

Code: Select all

$i
with

Code: Select all

$num
in the showPrivate function, so it looks like...

Code: Select all

function showPrivate($pass,$num) {
global $settings;
if ($pass != $settings[apass]) {problem('Wrong password! Only the guestbook owner may read this 

post!');}

$delimiter="\t";
$lines=file($settings['logfile']);
list($name,$from,$email,$url,$comment,$added,$isprivate,$reply)=explode($delimiter,$lines[$num])

;

echo '
<table border="0" cellspacing="0" cellpadding="2" width="95%" class="entries">
<tr>
<td class="upper" width="35%"><b>Submitted by</b></td>
<td class="upper" width="65%"><b>Comments:</b></td>
</tr>
<tr>
<td valign="top" width="35%">Name: <b>'.$name.'</b><br>
';
if ($from)
{
	echo '<font class="smaller">From: '.$from.'</font><br>';
}
if ($settings['use_url'] && $url)
{
	echo '<font class="smaller">Website:</font> <a href="go.php?url='.$url.'" 

target="_blank" class="smaller">'.$url.'</a><br>';
}
if ($email)
{
	echo '<font class="smaller">E-mail:</font> <a href="mailto:'.$email.'" 

target="_blank" class="smaller">'.$email.'</a>';
}

echo '
</td>
<td valign="top" width="65%">
'.$comment;

    if (!empty($reply)) {
	echo '<p><i><b>Admin reply:</b> '.$reply.'</i>';
    }

echo '<hr>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="50%" align="left"><font class="smaller">Added: '.$added.'</font></td>
<td width="50%" align="right">
<a href="gbook.php?a=delete&num='.$num.'"><img src="images/delete.gif" width="14" height="14" 

border="0" alt="Delete this entry"></a>
&nbsp;<a href="gbook.php?a=reply&num='.$num.'"><img src="images/reply.gif" width="14" 

height="14" border="0" alt="Reply to entry"></a>
&nbsp;<a href="gbook.php?a=viewIP&num='.$num.'"><img src="images/ip.gif" width="14" height="14" 

border="0" alt="View IP address"></a>
&nbsp;
</td>
</tr>
</table>

</td>
</tr>
</table>
<p align="center"><a href="gbook.php">Back to Guestbook</a></p>
';

printDownHTML();
exit();
} // END showPrivate
Sorry I don't have the line number.

Thanks!
zr :D :D :D

Posted: Wed May 10, 2006 9:47 pm
by Klemen
Ha, never noticed that! I guess this happens when I don't use same variable names throughout the script :oops:

Thanks for letting me know, corrected in the code!

Regards