Gossamer Forum
Home : Products : DBMan : Installation :

Line Break Problem

Quote Reply
Line Break Problem
Within my existing databse there is a section for comments. At the end of each line where there's a "return", dbman thinks its a new piece of information and moves it down to the next box. This causes all the remaining fields to get out of sync.

I am using | | to separate my data. Any thoughts or suggestions?

Thank you
Steve
Quote Reply
Re: Line Break Problem In reply to
Don, I don't understand how this could be. If you have used DBMan to create the file, then the linefeeds within the .db file should have been substituted with a ``. That's the way it works. Unless you've made some change to your db.cgi file so the linefeeds aren't substituted.


------------------
JPD





Quote Reply
Re: Line Break Problem In reply to
The changes that I made were:

I downloaded a fresh copy of DBMan - made the changes to our existing "default.db" as mentioned in previous post - added the following mods -

User-friendly html.pl - What's New - Short/Long Display of Records - Secure Password Lookup - Private Mailer - Misc. Changes - File Upload - Automatic View/Modify Search and Bug Fixes.

Our database before the above changes were made were working fine. The reason for the changes we wanted to clean things up a bit (our html.pl was a mess).

Everything seems to be working fine now also except for the comment field when one tries to add a carriage return. Everything in the comment field must remain on one continious line or it will mess things up in the DB.

What would I need to do to correct this?
----------------
donm

[This message has been edited by donm (edited August 30, 1999).]

[This message has been edited by donm (edited August 30, 1999).]
Quote Reply
Re: Line Break Problem In reply to
You're importing a database that was created elsewhere? If so, you'll need to convert all of the linefeeds to `` (that's usually the on the key that has the ~ sign, unshifted -- twice).

You may have other problems, too, if there are carriage returns in addition to linefeeds at the end of each line. There probably isn't any way to know until you try it out.


------------------
JPD





Quote Reply
Re: Line Break Problem In reply to
I am having the same problem - and I created my database with DBMan. However, it occurred after I completely revamped our database using the friendly html.pl and added a few more fields.

I took the existing DB and opened it with editPlus and added 4 new fields - all the fields appear in the correct places except after modifying an existing profile (record) that has something in the "Comment" field.

After modifying a record as described above, we have the same problem - fields are now out of sync. As long as you place everything on one line in the comment field you are ok. But, if you place a carriage return trying to break up a paragraph then you run into problems.
Quote Reply
Re: Line Break Problem In reply to
Try going into your database and changing all of the linefeeds within the Comment field to ``. You'll have to do it by hand, which will be a major pain, but I don't know of any other way to do it.


------------------
JPD





Quote Reply
Re: Line Break Problem In reply to
I am not sure what you mean by linefeeds? I took a look at the database and in some of the comment fields I see `` and in others I see ````.

But it doesn't seem to matter? When viewing the record I don't see any differences, everything still appears on one line?

What places the `` in the record? Please excuse my lack of smarts on this.

-----------------
donm
Quote Reply
Re: Line Break Problem In reply to
There are two places that use the `` to substitute for the newline character.

sub html_split_decode translates the `` into newline characters when a record is read from the database.

sub html_join_encode translates the newline characters back to `` before the record is saved to the database.

Do the newlins show up in your textarea fields?


------------------
JPD





Quote Reply
Re: Line Break Problem In reply to
The `` only show up when I open the default.db and look at the comment field in a text editor.

When viewing the records on the web that contain the `` in the record there are no line breaks - all text remains in one continuous line.
----------
donm
Quote Reply
Re: Line Break Problem In reply to
I understand that when you view records, the text is all on one line. What about when you look at a form -- like if you modify a record?


------------------
JPD





Quote Reply
Re: Line Break Problem In reply to
Oh ok - I apologize I didn't understand the question.... When I modify a record it appears with line breaks as it should.

But when I click on the modify button - the text in the record still appears all on one line.
--------------
donm

Quote Reply
Re: Line Break Problem In reply to
Did you add the code to translate newlines into <BR> tags to html_record --

Code:
$rec{'FieldName'} =~ s/\n/<BR>/g;



------------------
JPD





Quote Reply
Re: Line Break Problem In reply to
No - I did not see this anywhere?

-----------------
donm
Quote Reply
Re: Line Break Problem In reply to
Ah. I thought I'd typed that enough so that everyone would have seen it by now. Smile

Add that line to sub html_record (or sub html_record_long), just after

my (%rec) = @_;

That will make the lines work on your displays.



------------------
JPD





Quote Reply
Re: Line Break Problem In reply to
Great - that was it ! Everything is working as it should now !

As always - thanks !
--------------------

donm
Quote Reply
Re: Line Break Problem In reply to
I have been following my thread hoping the answer would come out, but it hasn't.

The orig. question was, a carriage return causes the rest of the data below it to get out of sync. I can't edit the database as it is being added to daily from lots of sources.

The database file is &#0124; &#0124; separated. Is there some way to keep the data contained in the tubes in one field when dbman returns search or other results.

Thank you
Steve
Quote Reply
Re: Line Break Problem In reply to
Sorry, Steve. We did go far afield.

I don't think there is a way to allow actual linefeed characters in the .db file within the records. Linefeeds are the way that the script defines a full record -- one line, one record.



------------------
JPD