Spaces being skipped in posts

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
noisenet
Posts: 5
Joined: Mon Jan 16, 2006 3:33 am

Spaces being skipped in posts

Post 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!
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post 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: ' '
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
noisenet
Posts: 5
Joined: Mon Jan 16, 2006 3:33 am

Post 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!
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post 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
Last edited by Henrie on Tue Jan 31, 2006 6:12 pm, edited 1 time in total.
noisenet
Posts: 5
Joined: Mon Jan 16, 2006 3:33 am

Post by noisenet »

Once again, thanks a million for your help!!!
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post 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
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
Post Reply