Page 1 of 1

Spaces being skipped in posts

Posted: Tue Jan 31, 2006 7:01 am
by noisenet
Script URL: http://www.nineyearsunder.com/main.html - Click menu entry marked as "board".
Version of script: 1.34
Version of PHP: 4.3.11
Hosting company: ?
Have you searched THIS FORUM for your problem: Yes
(if not please do before posting)
If so, what terms did you try: space, spaces

Write your message below:
Hi. Recently I am noticing that when a user (or myself) posts into the Gbook, when the posts are rendered, some words as running together when they weren't entered that way initially. I thought, at first, I was getting a bunch of drunks, LOL, but it started happening when I posted too, when I'd go back using the back button to the entry page, the words and spaces were fine. Looking at entries.txt, the space problem is there so I'm assuming it happens when the script parses the entry from the form.

I don't know how long it's been happening, and it seems to be with random numbers of characters so I'm a little at a loss. Thank you in advance for your help and for the great script!

Posted: Tue Jan 31, 2006 10:06 am
by Klemen
Hi,

Can you show me an example?

Also note that HTML (and PHP) only show one space even if you have many in the code. For example I have put 10 spaces between the quotes here, but you only see it as single space: ' '

Posted: Tue Jan 31, 2006 1:30 pm
by noisenet
[quote="Klemen Stirn"]Hi,

Can you show me an example?

Also note that HTML (and PHP) only show one space even if you have many in the code. For example I have put 10 spaces between the quotes here, but you only see it as single space: ' '[/quote]

Absolultely. Just head over to http://www.nineyearsunder.com/main.html
On this page (framed page) click the menu item that says "Board" and it will take you to where you can see. I've manually edited all but the most current post, but you can see this glitch in that post.

Thanks!

Posted: Tue Jan 31, 2006 5:26 pm
by Henrie
Hi Noisenet,

I think you have modified the Gbook.php file and changed this line
$comments = wordwrap($comments,$settings['max_word'],'<br>',1);
to remove the <br> in the posts.
But i think you have not placed a space instead of the <br> but left it empty. You should change it as follows
$comments = wordwrap($comments,$settings['max_word'],' ',1);
There is a space between the quotes ['max_word'],'space',1);

Remark for Klemen:
Maybe you should have placed a space instead of a <br> as default in the latest Gbook version. It would improve the usability of the Gbook. Because now a <br> is inserted after every 75 chars (if max_word = 75) which breaks the makeup of the Gbook if it is wider (or smaller) than 75 chars.

Greetings,
Henrie

Posted: Tue Jan 31, 2006 5:59 pm
by noisenet
Once again, thanks a million for your help!!!

Posted: Wed Feb 01, 2006 11:35 am
by Klemen
Henrie wrote:Maybe you should have placed a space instead of a <br> as default in the latest Gbook version. It would improve the usability of the Gbook. Because now a <br> is inserted after every 75 chars (if max_word = 75) which breaks the makeup of the Gbook if it is wider (or smaller) than 75 chars.
Not a bad idea, I made the change to the official version and updated download files.

Regards