Question

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
Dakurai
Posts: 5
Joined: Fri Aug 20, 2010 4:04 am

Question

Post by Dakurai »

Script URL: http:dakurai.co.cc/guestbook
Version of script:
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:

Write your message below:

Is there a way to add my IP somewhere and when I make a post on my gbook that it will say admin somewhere so no one can try to be me.
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Re: Question

Post by Klemen »

Try this:

1. backup existing files
2. open gbook.php in Notepad and change

Code: Select all

list($name,$from,$email,$url,$comment,$added,$isprivate,$reply)=explode($delimiter,$lines[$i]);
to

Code: Select all

list($name,$from,$email,$url,$comment,$added,$isprivate,$reply,$ip)=explode($delimiter,$lines[$i]);

        if ($ip == '127.0.0.1')
        {
        	$from .= '</span><br class="clear" /><span class="gbook_submitted_by" style="color:red">Admin';
        }
3. Change 127.0.0.1 to your IP
4. save changes, upload and test.

I haven't tested this so please report back if it worked or not.
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
Dakurai
Posts: 5
Joined: Fri Aug 20, 2010 4:04 am

Re: Question

Post by Dakurai »

I tried it and what I got was

Name: My Name
From:
Admin

Seems that when from always appears even if nothing is put for it.
i tried using $name instead of $from in the code and it looked better but the problem is that it only took effect on 1 of my entries, and when I made a new entry admin did not appear on it.

Also I have a question how do I set how many post appear?
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Re: Question

Post by Klemen »

Yes, sorry, it should be $name and not $from.

Do you have a static IP or a dynamic one?
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
Dakurai
Posts: 5
Joined: Fri Aug 20, 2010 4:04 am

Re: Question

Post by Dakurai »

Well I don't mind showing my IP so it will below..

142.163.30.213
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Re: Question

Post by Klemen »

Your IP address is changing, that's why the admin is shown only under one post (only one post has been made from that IP).

However, it seems your IP always starts with 142.163.30, so you can try changing

Code: Select all

if ($ip == '127.0.0.1')
to

Code: Select all

if (strpos($ip,'142.163.30') !== false)
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
Dakurai
Posts: 5
Joined: Fri Aug 20, 2010 4:04 am

Re: Question

Post by Dakurai »

It works perfectly! Thanks so much! You should defiantly make this an option if there is a new version.

I also have one more question, if I buy the license for the program I wont lose any of my entries or settings?
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Re: Question

Post by Klemen »

I've already added this to my "to do" list. I will try to find a better way for this, because many users don't have a static IP address.

If you purchase a license you will NOT lose any settings, entries or customizations. All you will need to do is upload a single file (gbook_license.php) to your server and this will have no unwanted effects on the guestbook.
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
Dakurai
Posts: 5
Joined: Fri Aug 20, 2010 4:04 am

Re: Question

Post by Dakurai »

I have one last question. With the website box is there a way to change when some makes a post instead of seeing their link it will just say "website" and its clickable?
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Re: Question

Post by Henrie »

Hello Dakurai,

In Gbook version 1.7
Edit file gbook.php
Find line 1114 which is

Code: Select all

$url = '<a href="'.$url.'" class="gbook_submitted" '.$settings['target'].' rel="nofollow">'.$url.'</a>';
and change it to

Code: Select all

$url = '<a href="'.$url.'" class="gbook_submitted" '.$settings['target'].' rel="nofollow">Visit website</a>';
You can change the text Visit website to whatever you want.

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