reply to an entry
Posted: Sun Aug 28, 2005 5:39 pm
Script URL: localhost
Version of script: 1.33
Version of PHP: 5.0.4
Hosting company: none
Have you searched THIS FORUM for your problem: i did
(if not please do before posting)
If so, what terms did you try:
Write your message below:
Hi.. First of all, thanks you very much for your worderfull script.
I tried to add more entries at the end of the specific line (it's a reply to a specific post in my guestbook). But each time I submit this entry, it will add replies to each entry in my guestbook, instead posted in a single entry.
A part of my (uhmm, yours actually
) is here:
I have an online version of this script at http://fsight-team.com/guestbook.php. This is what the script intended to look like. Note that replied post there was done manually editing the entries.txt.
I'm a newby to PHP. Are there any solution to this?
Version of script: 1.33
Version of PHP: 5.0.4
Hosting company: none
Have you searched THIS FORUM for your problem: i did
(if not please do before posting)
If so, what terms did you try:
Write your message below:
Hi.. First of all, thanks you very much for your worderfull script.
I tried to add more entries at the end of the specific line (it's a reply to a specific post in my guestbook). But each time I submit this entry, it will add replies to each entry in my guestbook, instead posted in a single entry.
A part of my (uhmm, yours actually

Code: Select all
<?
// -------------------------------------function insert reply -----------------------------------------
function doAddResp($pass,$num) {
global $settings;
$add = gbook_input($_REQUEST['add']);
$num = gbook_input($_REQUEST['num']);
// spell check
$delimiter="\t";
$addedrep = date ("l, M jS Y H:i");
$add = str_replace("\r\n","<br />",$add);
$add = str_replace("\n","<br />",$add);
$add = str_replace("\r","<br />",$add);
$add = wordwrap($add,$settings['max_word'],'<br />',1);
if ($settings['smileys'] == 1 && $_REQUEST['nosmileys'] != "Y") {$add = processsmileys($add);}
if ($settings['filter']) {
$add = filter_bad_words($add);
}
// add this entries before \n
$repline = "$delimiter$add$delimiter$addedrep$settings[newline]";
// read entries
$fp = @fopen($settings['logfile'],"rb") or problem("blah blah");
$reply = @fread($fp,filesize($settings['logfile']));
fclose($fp);
// write entries <<-- this is where things get complicated for me
$lines = explode($settings['newline'],$reply);
$fp = fopen($settings['logfile'],"wb") or problem("blah blah");
foreach ($lines as $thisline) {
$thisline .= $repline;
fputs($fp,$thisline);
}
fclose($fp);
// fin function insert reply
?>
I'm a newby to PHP. Are there any solution to this?
