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
CHANGING SIZE OF GBOOK
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 and two regular spaces are in most browsers displayed as one space where the second space is ignored.
I hope this helps.
Greetings,
Henrie
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 and two regular spaces are in most browsers displayed as one space where the second space is ignored.
I hope this helps.
Greetings,
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
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
Re: CHANGING SIZE OF GBOOK
[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
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
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: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:and change it to this:
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
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%;
}
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">
Code: Select all
<table class="entries" cellspacing="0" cellpadding="4" border="0" width="75%">
I think method 2 is the method to use in your case.
Greetings,
Henrie
Re: CHANGING SIZE OF GBOOK
Henrie,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
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