reply comment replaces original comment

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
superkingkong
Posts: 6
Joined: Fri Mar 06, 2009 6:35 pm

reply comment replaces original comment

Post 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.
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post 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
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.
superkingkong
Posts: 6
Joined: Fri Mar 06, 2009 6:35 pm

Post 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.
superkingkong
Posts: 6
Joined: Fri Mar 06, 2009 6:35 pm

Post 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.
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

It will appear in public.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image 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
superkingkong
Posts: 6
Joined: Fri Mar 06, 2009 6:35 pm

Post 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.
Post Reply