Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Add preview functionality to Blosxom Apps
A fair number of people use Blosxom, Rael Dornfest's weblog software, for its simplicity and power, and given Movable Type's recent change to its pricing structure, even more people may do so soon.

The major drawback, IMHO, has to do with comments, or "writebacks," which must be written with HTML tags, cannot be previewed before being posted, and can't be edited once posted. I searched for quite some time in vain for a plugin that would at least allow a preview, which would mitigate the problem substantially.

Finally I gave up and dug around until I found a JavaScript that could be modified to produce at least a crude preview functionality. WARNING: I am not an especially competent or elegant programmer, so the following will almost certainly offend sensitive readers! The essence of the hack is to replace the foot.writeback file that comes with the vanilla installation. I created a replacement HTML file, which permits both a preview window and a mini-primer for those posters not familiar with HTML tags. Try one of these two links to view the source; the .txt file will actually be interpreted by Safari for some reason ...

.src text file  text file

I am, of course, open to other, better solutions -- as I said, this is just something I cobbled together in order to provide a quick fix. It's not a plugin, and it's hardly elegant. But it does have the advantage that it works.
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[7,177 views]  

Add preview functionality to Blosxom | 10 comments | Create New Account
Click here to return to the 'Add preview functionality to Blosxom' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Add preview functionality to Blosxom
Authored by: matx666 on May 28, '04 12:34:51PM

I love blosxom. I can't wait to try this out....



[ Reply to This | # ]
Any practical advice how set Blosxom up?
Authored by: hamarkus on May 28, '04 02:01:37PM

Any practical advice how set Blosxom up if you run it on your own computer?

I mean, should one add oneself to staff (the group for the docs folder) or change the group (for the docs folder) to admin?

Is there any way to get static html pages (i.e. files) out of it, that I could mirror to a webserver with a fixed IP?



[ Reply to This | # ]
Any practical advice how set Blosxom up?
Authored by: tinker on May 28, '04 03:45:45PM

I run it on my own machine and I never tinkered with permissions. (But, like I said, I'm hardly an authority.) Static rendering, I think, is one of the options handled in /CGI-Executables/blosxom.cgi.



[ Reply to This | # ]
But how do put files into /Library/.../docs w/o changing permissions?
Authored by: hamarkus on May 28, '04 04:31:34PM

As I understand it, I put text files into the /Library/Webserver/Documents/Blosxom/docs folder which are then incorporated into an 'html file' which other people can find at http://[my IP]/Weblogs.

Unfortunately, the owner of the docs folder is www and the group is staff. This means I, as an admin user, cannot put any (text) files into that folder. Since it is the whole point to put files into this folder, I either have to change the permissions of this folder (i.e. group to admin) or login as root or use sudo to put my files in it.

I have the strong feeling that I misunderstand something here, I mean, it cannot be that complicated.



[ Reply to This | # ]
But how do put files into /Library/.../docs w/o changing permissions?
Authored by: argh128 on May 28, '04 05:19:46PM

I don't use bloxom.. but you can do the following.

1) Add your self to the staff group. You can do this by using the netinfo manager, selecting groups and inserting a new value to the users property. Set the value of the inserted property to your short username.

2) make sure that the group staff has read/write privileges to the directories in question.

---

A completely SANE Canadian.



[ Reply to This | # ]
But how do put files into /Library/.../docs w/o changing permissions?
Authored by: tinker on May 28, '04 08:30:27PM

I did this a while ago and don't remember the details of setting it up, but, as I have it set up (and maybe I did it incorrectly!), I don't actually have a docs folder. I have a number of /Webserver/Documents/Blosxom/foo/ directories, where "foo" might be "News" or "Books" or whatever, and the individual .txt files go inside these directories. This as I understand it is part of Blosxom's appeal: the message tree mirrors the directory tree inside /Blosxom. Since I created these directories, I can access them without sudo-ing.



[ Reply to This | # ]
Any practical advice how set Blosxom up?
Authored by: n8gray on Jun 01, '04 08:05:16PM
Any practical advice how set Blosxom up if you run it on your own computer? I mean, should one add oneself to staff (the group for the docs folder) or change the group (for the docs folder) to admin?

You already are in the staff group.

Is there any way to get static html pages (i.e. files) out of it, that I could mirror to a webserver with a fixed IP?

Yes, if you run blosxom.cgi from the command line it will generate static pages. You need to give it some info first (a location where to put the files, which files to generate, and a password to make it harder for random browsers to activate this feature). See this page for details.

Also, I've written a blog entry that might help you understand the permissions issues with setting up Blosxom.

[ Reply to This | # ]

Watch out for HTML tags
Authored by: stewby on May 28, '04 03:54:57PM

What I've done instead is modified the comment plugin to replace [code]<[/code] and [code]>[/code] with their HTML character entities instead... that's *much* safer. People can do very bad things to your site with the ability to submit arbitrary HTML.

If you want to allow styling, you can set up some simple regex replacements for things like newlines to insert controlled HTML. Not only is it safer, but people posting comments needn't know HTML.



[ Reply to This | # ]
Watch out for HTML tags
Authored by: tinker on May 28, '04 08:03:11PM

I'd be quite happy to do this too -- but note that permitting HTML tags in comments/writebacks is the default with Blosxom, not anything I've added. The problem is that Blosxom treats all comments as pure HTML, so people who write in with multiple paragraphs (separated by control-Ms) are annoyed to see their un-editable comments go up as one big block of text. Just trying to provide a quick fix for that. Altering how the writebacks plugin handles input goes well beyond my range. I agree, though, that it would be a very helpful addition.



[ Reply to This | # ]
Update: Watch out for HTML tags
Authored by: tinker on May 30, '04 11:30:18AM

I tried Fletcher Penney's Writebackplus plugin, available through the Blosxom plugin registry, and it does a wonderful job of stripping out HTML tags. Can also be configured in a straightforward way, i.e., even by me. It has a few nice features as well, for example, adds the time/date to a comment posting. Thanks for the heads-up.



[ Reply to This | # ]