June 16th, 2002


PATCHES: User bio can be marked preformatted


With these patches, the user bio can be marked as preformatted.


In the course of trying to work on the bio for a community, I realized, to my exasperation, that the user bio is auto-formatted (i.e. line breaks are added). When using heavy HTML, especially with tables and lists, this mangles the rendering atrociously, leaving unsightly gaps of whitespace. In the cases of events/entries and comments/responses, there is an option to mark the code as preformatted, thereby preventing the HTML cleaner from adding line breaks. It only goes to reason that a similar option should be available for the user bio.

So, I added one. This implementation adds a new column opt_preformatted to the table userbio, and adds appropriate support to editinfo.bml and userinfo.bml.

I followed some of the handling of the options on the table user, making the new column a char(1), and using values of "Y" and "N". This could be changed, if necessary.

I wasn't exactly sure of the procedure for adding new columns to the database, so I tried to follow what had been done before. I added a section in update-db-general.pl to ALTER the table and add the column, and also added the column to that table's CREATE TABLE section.

Question: Isn't this way of doing things—adding ALTER statements to the script to explicitly alter tables—a bit inefficient? Would it be possible to write a script to check the tables in the database against a table definition file, and make alterations if any differences are found between the existing schema and the definition file?


livejournal/htdocs/editinfo.bml Tested
livejournal/htdocs/userinfo.bml Tested
livejournal/bin/upgrading/en.dat Tested
livejournal/bin/upgrading/update-db-general.pl Tested

All patches tested locally.

happy, hackhack

Small patch, but someone had to do it

I'm almost ashamed to make a patch this small, but someone had to do it.

This patch fixes a typo in some modify_do.bml text in en.dat. Currently, it says, "Or, select 'None' if you don't want any pictures besids your moods." The patched version says, "Or, select 'None' if you don't want any pictures beside your moods."

Tested, even though I REALLY doubted this patch would break something. ;)