Page 1 of 1

reply comment replaces original comment

Posted: Fri Mar 06, 2009 6:53 pm
by superkingkong
Script URL: http://superkingkong.net/php/guestbook/gbook.php
Version of script: 1.6
Hosting company: datakl.com
URL of phpinfo.php: http://superkingkong.net/php/guestbook/gbook.php
URL of session_test.php: http://superkingkong.net/php/guestbook/session_test.php

What terms did you try when SEARCHING for a solution:
extra field

Write your message below:

Dear sir,

first of all, thanks for the wonderful script. and sorry for the trouble.

i've added extra three fields, sort of working, but with side effect.

now, whenever i do a "admin reply" to a existing comment, that comment will replace the original comment of that post.

i did a search on the forum, and found a quite similar post, after adding extra field, has problem with comment field. his problem was that the admin replies go to private.

but my problem is the admin replies replace the original comment. when i look at the entries.txt, the "0" is still there. the new comment is at the right place (before $date), thus replacing the old comment

i hope i can get some help here. thank you very much.

Posted: Sat Mar 07, 2009 9:55 am
by Henrie
It looks alright to me.

I see this under comment:
a nice painting. u should go and eat it

Admin reply: i want to go. but can swim there?
So first the comment and then your reply.

Or did i misunderstand you?

Greetings,
Henrie

Posted: Sat Mar 07, 2009 2:01 pm
by superkingkong
Henrie wrote:It looks alright to me.

I see this under comment:
a nice painting. u should go and eat it

Admin reply: i want to go. but can swim there?
So first the comment and then your reply.

Or did i misunderstand you?

Greetings,
Henrie
Hi,

i'd like to sincerely apologize for the delay.

after taking me the whole of yesterday troubleshooting the gbook :P, at about 2am in the morning, finally i've got it working. i was so tired and sleepy during that time, i slept right away, didn't have the "energy" to post it here. sorry about that. It's 9am now.

anyway, what i did was to increase the array. since i've added 3 extra fields, i increased the array size by 3, and add "3" the pointer, originally was 7, increased to 10. i haven't tested it extensively, but from my two posts after that "changed", it seems that it is working.

is that correct? :P

like i said in the beginning, if it is still 7 (default), whenever i do a admin reply, that reply will overwrite the comment.

it looks fine in general, as you've mentioned, but i'm not sure whether it will impact some other functions. Just in case if you can test it for me, the admin pass is 123, thank you very much :)

cheers.

Posted: Sat Mar 07, 2009 2:42 pm
by superkingkong
Dear sir,

i have one question, when i reply to a private post, will my admin reply appear in public or in private?

thanks.

Posted: Sat Mar 07, 2009 2:49 pm
by Klemen
It will appear in public.

Posted: Sat Mar 07, 2009 3:20 pm
by superkingkong
thanks for the info.

you know what, i just did a search with the term "private", and i saw a post that explains how to add additional field ....

#$*&^! :lol: ... if only i found that post yesterday :cry:

viewtopic.php?t=1045&highlight=private

anyway, i have a question here. according to the post...

Code: Select all

.....
$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'); 
        } 
.....

Code: Select all

printSign($name,$from,$email,$url,$comments,$sign_nosmileys,$sign_isprivate,$newfield1,'Please enter the security number');

Code: Select all

addEntry($name,$from,$email,$url,$comments,$isprivate,$newfield1);
i've noticed that the new field "$newfield1" is declared/called after $sign_isprivate or $isprivate,

is there a particular reason? or can i placed it anywhere in the line?

hope to know, thanks a lot.