CHANGING SIZE OF GBOOK

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
wizzbang
Posts: 1
Joined: Mon Aug 29, 2005 9:54 pm

CHANGING SIZE OF GBOOK

Post by wizzbang »

Script URL:
Version of script:
Version of PHP:
Hosting company:
Have you searched THIS FORUM for your problem:
(if not please do before posting)
If so, what terms did you try:

Write your message below:

Can anyone help me locate the part of the script that will allow me to change the dimensions of the actual Guestbook? The default size, I find, is too wide, causing the script to mis-align, to go
like
this on smaller screens. Has anyone else noticed this?
Thanks in advance
Guest

Post by Guest »

hi,

find this code inside gbook.php (there are two lots)

<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\" width=\"95%\" class=\"entries\">

now change the 95% to whatever you choose(perhaps 500, or 75 %)

try not to use the % sign if you go over 100 or it will just get bigger

good luck,

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

Post by Henrie »

Hi wizzbang,

The cause of the mis-alignment is not caused by the width of the guestbook. It is caused by the function of the maximum chars word length.

In the settings.php file this setting.
/* Maximum chars word length */
$settings['max_word']=75;

It places a <br> (line-break) after 75 chars when a word is too long. The problem is it also places a <br> (line-break) after every 75 chars but when there are spaces it places it not in a word but at a space.
When you have a wide screen it causes a lot of white space at the right of your message. When you make the window smaller than the 75 chars the last word of a line autowraps and because the line-break is there it shows only the last word on the next line and the following word on a next line.

To prevent this from happening change the gbook.php file so that it places a space instead of a line-break.

Find line 423:
$comments = wordwrap($comments,$settings['max_word'],'<br>',1);
And change it to this (a space instead of <br>):
$comments = wordwrap($comments,$settings['max_word'],' ',1);

In long words it breaks long words with a space after the number of chars set in the max-word setting. And because a regular space is inserted instead of a <br> (line-break) at the other places the lines are fluent because they just autowrap at the width of the table.
You will not even see the extra space because a regular space is used instead of a &nbsp; and two regular spaces are in most browsers displayed as one space where the second space is ignored.

I hope this helps.

Greetings,
Henrie
Guest

Post by Guest »

oh you meant when people actually sign it with real long comments like
"WWWWWWWWWWWWWWWWWWWWWWWWWW" and never stop.

in that case Henrie is correct


wrap:hard;

would also do similar on the style of the comments field, but i think Henrie's is probably better.

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

Post by Henrie »

Hello B,

Just wanted to ask you something. I never heard of wrap:hard; in css.
I have read about it in textarea as wrap="hard" but not in css.

In css3 there is a wrap option but it only has values "wrap | no-wrap | soft-wrap | emergency" and because it is just a candidate recommendation and therefor should not be used now.

So just for my information what does wrap:hard; do because i tried it and it does nothing for me.

Greetings,
Henrie
Guest

Post by Guest »

Hello you are very correct in what you say again.

I did actually mean wrap="hard" and not a css attribute, it's just the way i typed it in.

you can also use,

"hard" | "virtual" | "physical" | "soft" | "on" | "off" | "none" attributes with wrap.

This has worked for me,

Have fun

B
Guest

Re: CHANGING SIZE OF GBOOK

Post by Guest »

[quote="wizzbang"]Script URL:
Version of script:
Version of PHP: PHP Version 4.3.11

Hosting company: webmasters.com
Have you searched THIS FORUM for your problem: yes
(if not please do before posting)
If so, what terms did you try: table size, sizing tables, table, etc...

Write your message below:

Thanks for the information I have received here already.. I have been able to reduce the size of the main guestbook tables.. However I can not find the place to reduce the table for the Anti Spam Check.. It is still full page.. I have played some with what I did find but am afraid to go too far. I don't know much about css and php yet..

Thanks Sharon
http://www.rampbbs.net/gbook/gbook.php
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

Hello Sharon,

There are two ways to change the width of the tables.

1.
In the style.css file add a width for the table.entries style.
Just add width:75%; (or any other width) to the table.entries style.
The table.entries style would now look like this:

Code: Select all

table.entries {
	color : black;
	font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
	font-size: 11px;
	BORDER-RIGHT: #23559C 1px solid;
	BORDER-LEFT: #23559C 1px solid;
	BORDER-TOP: #23559C 1px solid;
	BORDER-BOTTOM: #23559C 1px solid;
	width:75%;
}
This would be the preferred method, but Klemen does not have different styles in GBook for the different pages so it changes the width of every page, thus also that of the sign guestbook page (and it looks horrible if you set if for example to 75%).

2.
The other methode would be change the gbook.php file as you have done now.
To change the width of the anti-spam check page.
Go to line 179, it looks like this:

Code: Select all

<table class="entries" cellspacing="0" cellpadding="4" border="0">
and change it to this:

Code: Select all

<table class="entries" cellspacing="0" cellpadding="4" border="0" width="75%">
If you don't have an editor that shows line numbers, search for Anti-SPAM check and line number 179 should be three lines below that.

I think method 2 is the method to use in your case.

Greetings,
Henrie
Guest

Re: CHANGING SIZE OF GBOOK

Post by Guest »

Anonymous wrote:
wizzbang wrote:Script URL:
Version of script:
Version of PHP: PHP Version 4.3.11

Hosting company: webmasters.com
Have you searched THIS FORUM for your problem: yes
(if not please do before posting)
If so, what terms did you try: table size, sizing tables, table, etc...

Write your message below:

Thanks for the information I have received here already.. I have been able to reduce the size of the main guestbook tables.. However I can not find the place to reduce the table for the Anti Spam Check.. It is still full page.. I have played some with what I did find but am afraid to go too far. I don't know much about css and php yet..

Thanks Sharon
http://www.rampbbs.net/gbook/gbook.php
Henrie,

Thank you so much, that worked. Between the information I have found here already and the advice you gave someone else about removing the <br> and using a space instead, I think I may have it whipped. I have a lot to learn about PHP. I really like this guestbook.. I am running a different one for a Prayer book and would use this one for that as well if I could add comments to users imput..

Thank you again!!
Sharon
Post Reply