limit field size?

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
Me59
Posts: 49
Joined: Sun Sep 04, 2005 10:40 pm

limit field size?

Post by Me59 »

Script URL:
Version of script: 1.5
Hosting company:
...
Write your message below:

the guestbook looks a bit ugly with long entries for Email or URL - is there a way to limit the *displayed* field maybe with a ... extension for too long entries?

To be more clearly, if an email/URL entry is like:
thisismywonderfullongemail@whatevermydomainis.com

should display like maybe:
thisismywonderfullong...


can this be done?
Me59
Posts: 49
Joined: Sun Sep 04, 2005 10:40 pm

Post by Me59 »

Ok, got it done. so it looks better me think :)
Instead of printing the full URL/Email I use a clickable link instead:
For anyone who wants it:

for guestbook 1.5 only
Find line 895 and replace with:
echo 'Website: <a href="go.php?url='.$url.'" class="smaller" target="_blank">Link</a><br />';

Find line 900 and replace with:
echo 'E-mail: <a href="mailto:'.$email.'" class="smaller">Link</a>';

from now on no more ugly long URLs and Emails - instead just the word Link is printed. Keeps the guestbook much cleaner.
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Yes, or you can use an image (mail icon) for example instead of the "Link". Henrie posted one here:
viewtopic.php?t=1050
(at the end of 1st post and in another post later on for v1.5)
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
Me59
Posts: 49
Joined: Sun Sep 04, 2005 10:40 pm

Post by Me59 »

Thanks, Klemen, looks even nicer now!

Had to add one more <br> to separate the icons from the From: field otherwise it looked a bit squashed.

thanks

Steve
Me59
Posts: 49
Joined: Sun Sep 04, 2005 10:40 pm

Post by Me59 »

Klemen,
You should make the iconised guest book the default layout and also the better spacing between messages. Another suggestion would be changing the comments' text-align to justify by default.

have a look at my guest book - looks neat, no?

btw, the last line Powered by... can you make the links open in a new window coz it looks not nice in a framed page layout

Steve
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

Hi Steve,

I would like to see how your guestbook looks but you don't have a link posted so I can not visit it.

To open a link in a new window would require the target= attribute. This is not allowed anymore in the xhtml doctype (which Gbook is since version 1.5).
It can be done by using javascript but this is not what i prefer.
I think people should get used to new browsing behaviour:
ctrl+click link to open in a new tab
shift+click link to open in a new window

Greetings,
Henrie
Me59
Posts: 49
Joined: Sun Sep 04, 2005 10:40 pm

Post by Me59 »

Hi Henrie,
thanks for the info - my website is http://myenchanting.com ...Guestbook is on the right hand side.

there is a webmaster entry showing both links - Email and WWW
whereof the WWW link opens in a new window and not inside the frame.

le'me know what you think
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

Hi Steve,

I like the images you have used for the website and e-mail links.
And I really hope that Klemen includes the separation of the posts in his next GBook version. It really does look a lot better.

Greetings,
Henrie
Me59
Posts: 49
Joined: Sun Sep 04, 2005 10:40 pm

Post by Me59 »

Henrie wrote:Hi Steve,
..
I think people should get used to new browsing behaviour:
ctrl+click link to open in a new tab
shift+click link to open in a new window

Greetings,
Henrie
Henrie,
Ouch, I think it will take much more time until people get used to it (if at all)! - not many around being familiar with *any* Windows keystrokes.

Ok, let's see what Klemen is going to do since he did not bother to comment yet. Personally, I think the iconised guestbook looks much cleaner! He can have my code for free :) I am just contributing to this project.
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Didn't comment yet? See post N#3 :wink:

As Henrie already told you GBook is now XHTML and XHTML Strict doesn't allow target="" attribute in anchor tags. Why exactly goes beyond my understanding, but believe me that people developing XHTML have a way superior knowledge of how these things work from both you and me :wink: But I think it comes down to letting people decide where to open links and not forcing them to open it in a new window.

Anyway, the solution would be using Javascript, Henrie already posted some code in the "mods, add-ons" forum. I would still include current link code in the <noscript></noscript> tags to make sure people/robots not parsing Javascript can still follow the links.

Yes Henrie, the spacing will be added in the next version, I like it.
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
Me59
Posts: 49
Joined: Sun Sep 04, 2005 10:40 pm

Post by Me59 »

Klemen Stirn wrote:Didn't comment yet? See post N#3 :wink:

..

Na, that's not what I meant. I was talking about making the iconised guest book the default installation layout since it looks much better.

However, I see your not going to move that way. Ok, then continuing the semi professional layout meaning a lot of more work if I ever think of upgrading the guest book again. The customisation so far was a bit of work.

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

Post by Klemen »

Ah, then you should ask in a way I can understand what you mean.

I never said I won't add icons instead of current text, in fact I like that better and it does solve problems with too long URLs / e-mails. My comments were regarding opening LINKS in a NEW WINDOW, that won't be added again as it's not allowed with XHTML.
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
thegrrl
Posts: 6
Joined: Fri Jun 22, 2007 11:36 pm

Post by thegrrl »

Omg this is exactly what I am looking for thank you so much for posting this, I just love this guestbook yay!
Post Reply