LnBlog

A simple file-based weblog focused on design elegance.

Copyright (c) 2005, Peter A. Geer <pageer@skepticats.com>

Introduction

LnBlog is a simple blog written in PHP which stores data in text files. It is strives to be easy to use, easy to manage, and feature rich while maintaining a clean, elegant, and modular design. It is built to create sites with a clean, directory-based URL structure and valid XHTML and CSS for style and layout.

Status

Currently, LnBlog is in the active developmen, which just means that it is functional and tested, but not anywhere close to done yet. There are still lots of features to add, both in the back-end code and in terms of interface elements. You can see the to do list to get an idea of what is currently planned. If you have any comments or suggestions, or if you have any problems or find any bugs, feel free to e-mail me.

Requirements

LnBlog is fairly light on requirements. It does not require any particular operating system or web server and is known to work on Linux/Apache and WinXP/IIS. The only hard requirements are the following:

  1. PHP 4.0 or greater.
  2. Support for Perl Compatible Regular Expression (PCRE), which is enabled by default in most PHP packages.
  3. The ability for scripts to read and write files to the server. To do this, you must either have FTP access to the web server and configure LnBLog to use it, or have PHP's safe mode disabled and appropriate directory permissions set on the web server.

Feature List

Initial Setup

For step-by-step instructions, please see the install guide. If you're more technically inclined, then it's probably safe to just skip to the summary below.

Here's the quick version. Just extract the installation archive and upload the whole LnBlog directory to a location in the publicly accessible portion of your web hosting account. You can them navigate to that directory with your favorite browser to run the configuration scripts. The first script configures file writing. If you have FTP access to the web server, you can use FTP for file writing (this is recommended) by selecting the FTP option and giving the appropriate information below. Otherwise, LnBlog will use PHP's standard filesystem functions, which will require that Safe Mode be turned off and appropriate permissions set on the relevant directories.

After file writing support is configured, you must set an administrator login. This will be used to add new weblogs as well as to log into the ones you create. After that's set, you can log in and start adding new blogs. There are also administrative functions to modify a blog and update a blog (used when upgrading LnBlog).

Adding Entries

Adding a blog entry is pretty self-explanatory. Just log in and click on the "add entry" link. You will be taken to the entry edit screen, where you can enter the subject for your entry, the entry text itself, and turn comments for this entry on or off.

There are three possible input modes, which you can change between with the option buttons below the edit area. They are:

  1. Auto-markup: Adds HTML paragraphs and line breaks based on the plain-text input and convert all http and ftp URLs to links.
  2. LBCode: Use a dialect of the BBCode markup popular in web forums to markup your page. Paragraphs and line breaks are inserted like with auto-markup, but you can also include other supported tags. See the LBCode Syntax section for details.
  3. Raw HTML: The text you type is treated as raw HTML code. No processing is done and there's no guarantee that your page will validate. In other words, this is for people who know what they're doing.

LBCode Syntax

LnBlog supports marking up your text with LBCode, which is a variant of BBCode, the markup language used in many popular web-board and forum packages, such as phpBB. I call this dialect LBCode because it makes absolutely no attempt to match the official syntax (if there is such a thing) of BBCode. The primary purpose of LBCode is to let the user write rich text that is valid XHTML 1.0 Strict without having to learn any XHTML or worry about making mistakes while writing. Below is a table of the currently supported tags, with descriptions, example, and the mapping to HTML. Please note that LnBlog does not currently handle LBCode errors gracefully - incorrect syntax will simply be displayed as plain text.

DescriptionCodeExampleHTML equivalent
Bold text [b]bold[/b] bold <strong>bold</strong>
Italic text [i]italic[/i] italic <em>italic</em>
Underlined text [u]underline[/u] underline <span style="text-decoration: underline">underline</span>
Abbreviation [ab=Full phrase]abbreviation[/ab] abbreviation <abbr title="Full phrase">abbreviation</abbr>
Acronym [ac=Full phrase]acronym[/ac] acronym <acronym title="Full phrase">acronym</acronym>
Block quotation [quote]Quotation[/quote]
Quotation
<blockquote>Quotation</blockquote>
Short quotation [q]Quote[/q] Quote <q>Quote</q>
Hyperlink [url=http://www.google.com]Google[/url] Google <a href="http://www.google.com">Google</a>
Image [img=http://www.google.com/images/logo.gif]Google logo[/img] Google logo <img src="http://www.google.com/images/logo.gif" alt="Google logo" title="Google logo" />
Number list [numlist]
[*]First item
[*]Second item
[/numlist]
  1. First item
  2. Second item
<ol>
<li>First item</li>
<li>Second item</li>
</ol>
Unordered list [list]
[*]First item
[*]Second item
[/list]
  • First item
  • Second item
<ul>
<li>First item</li>
<li>Second item</li>
</ul>

Notes on LBCode

  1. The line breaks between items in numbered lists and unordered lists are not optional. You must put each item on a single line and you must put the beginning and ending tags on their own line.
  2. When you give just a file name (i.e. a path containing no '/' characters) as the target for an [img] or [url] tag, LnBlog will automatically convert it to an absolute URI to a file in the entry directory when it is displayed. This feature is provided for two reasons: because you will not know the absoute URI of a blog entry until after you post it and because the post can be displayed at its permanent location, in which case the relative link is valid, or in another place (the front page of the blog or an RSS feed), where the relative link is not valid.
  3. In Mozilla-based browser, [ac] and [ab] both do the same thing. They are both provided because there is a semantic difference, i.e. that an abbreviation is simply a shortening of a phrase using the initial letters, whereas an acronym is such a shortening that actually spells a pronounceable word. However, while the <abbr> tag is often the semantically correct one, Internet Explorer 6 doesn't support it, so you should use this tag with care.
  4. In the [img] tag, the text between the opening and closing tags is required. This is because it is used as the text for both the ALT attribute, which is required in XHTML, and the TITLE attribute, which gives you the tooltips in Mozilla-based browsers. Since Internet Explorer incorrectly uses the ALT text for tooltips, you'll actually get the same tooltip in all browsers.
  5. In Mozilla-based browsers, the <q> tag renders quotation marks automatically. However, this depends on the CSS2 :before and :after pseudo-elements, which are not supported by Internet Explorer, so use this with care. Note that in the default LnBlog stylsheets, the <q> tag is rendered with italic text, so that even in Internet Explorer, it can be distinguished from normal text.

CMS Features

While LnBlog is a technically a weblog package, it also includes several "mini-CMS features. These exist mostly for the sake of maintaining the design conssitency of the site and making it slightly easier to manage. The following sections describe these.

Adding Articles

An article in LnBlog is just a blog entry with a different URL and different display template. It's basically a cheap and easy way to add static content that meshes with the overall look and feel of the blog, but doesn't require any extra work. You still get BBCode support and revision history, but the URL structure is pneumonic and comments are turned off by default. You can enter the last component of the article URL when you first post it or go with the default, which is to use the subject with all letters converted to lower case, spaces converted to underscores, and all other characters removed.

Uploading Files

LnBlog provides pages to upload files to the root of the current blog or to the current entry or article. Currently, you can only upload one file at a time. You should also note the file size limit when trying to upload a file. To change this, must change the values of the PHP configuration variables upload_max_size and post_max_size by creating a .htaccess file (if you use Apache) or by modifying the system php.ini file.

License