Page 1 of 1

Question

Posted: Fri Aug 20, 2010 4:08 am
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.

Re: Question

Posted: Fri Aug 20, 2010 1:33 pm
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.

Re: Question

Posted: Sat Aug 21, 2010 12:50 am
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?

Re: Question

Posted: Sat Aug 21, 2010 9:35 am
by Klemen
Yes, sorry, it should be $name and not $from.

Do you have a static IP or a dynamic one?

Re: Question

Posted: Sat Aug 21, 2010 2:03 pm
by Dakurai
Well I don't mind showing my IP so it will below..

142.163.30.213

Re: Question

Posted: Sat Aug 21, 2010 8:05 pm
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)

Re: Question

Posted: Sat Aug 21, 2010 9:43 pm
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?

Re: Question

Posted: Sun Aug 22, 2010 10:02 am
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.

Re: Question

Posted: Thu Sep 02, 2010 3:34 am
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?

Re: Question

Posted: Thu Sep 02, 2010 4:34 pm
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