Blog module for Nailblog-2.x by Martin Wikström
http://www.waxjism.org/nail/

Content ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

User documentation
 * About
 * Administration
 * Usage

API documentation
 * File format
 * PHP functions
 * PHP variables

About ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This module provides blog pages where users can post blog
entries, comments and replies. It is possible to adjust who has
access to the blogs, who may post new entries, and who may post
comments.

Administration ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Blog administration is available on page "?act=admin&open=blog".
Blog administration is only available to users in group "admin"
or "blogadmin".

The main blog administration box provides a list of existing
blogs and tools to edit, remove and create new blogs.

The Edit Blog tool allows the administrator to edit the
following blog preferences:
 * Owner
   The blog owner has unlimited access to the blog.
 * Groups
   The blog may belong to one or more groups.
 * Access
   Here it is possible to set who:
    * has read access
    * has comment access
    * has write access
    * may delete/edit own posts
    * may delete/edit entries
    * may edit blog preferences
 * Title
   The blogs name.
 * Header
   An intro text for the blog which is always visible in the
   upper part of the blog page.
 * Footer
   An outro text for the blog which is always visible in the
   lower part of the blog page.

Usage ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Blogs are accessed on pages "?act=blog&id=x" where x is the
blogs Id number. A list of existing blogs and their Id numbers
are available for blog administrator on the blog administration
page (see above).

Depending on what privileges are set for a blog the user may
do the following things:
 * Edit blog preferences
   In the upper part of the blog page is a link titled
   "Blog preferences". This leads to a page which is similar to
   the Edit Blog tool mentioned above.
 * Post new entries
   Clicking the link "New blog entry" will open a form where the
   user may enter the new entrys title, user alias and content.
   Clicking "Submit" will post the entry to the top of the blog.
   Note that entries are in HTML format.
 * Post comments
   Below existing comments are links titled "Post comment"
   which open comment forms where users can enter their name
   and comments. The "Post comment" will then post the comment
   below the blog entry and below any previous comments posted
   to the same blog entry.
   Note that any HTML formatting in comments are escaped.
   Newlines are converted into "<br/>" and double newlines are
   converted into "</p><p>".
 * Edit entries
   Depending on the blog preferences a user may edit his own
   posted entries and comments, or every entry and comment on
   a blog page. This is done by clicking on the link "Edit" in
   an entrys or comments toolbox. The Edit entry tool has the
   following options:
    * Alias
      The name or alias of the entry owner.
    * Title
      The entry title (this value does not matter if said entry
      is a comment.
    * Content
      The entry content in HTML format.
 * Move entries
   A user with access to edit all entries on a blog may also
   reorder these entries. The Move Entry tool provides a list
   of all entries on a blog and by clicking on "move here" links
   next to the entries the entry to be moved is relocated above
   the selected entry.
 * Delete entries
   The blog will ask for confirmation before any entries are
   deleted.

File formats ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

data/bloglist.txt
 * This file contains a list of all the blogs and their
   preferences.
 * First row: Blog version.
 * Following rows: Blog definitions.
 * Blog definition (tab separated):
    * Id
    * Owner
    * Group
    * Access - as defined by nailblog_getprivs:
       * read - who has read access
       * comment - who may comment
       * write - who may post new entries
       * delself - who may delete/edit own posts
       * delposts - who may delete/edit blog posts
       * admin - who may change blog preferences
    * Title
    * Header
    * Footer

data/blog-*.txt
 * This file contains all entries and comments for one blog.
 * Each row: Blog content.
 * Blog content:
    * Id
    * Owner
    * Alias
    * Posted
    * Updated
    * Type - entry, comment, or reply
    * Title
    * Content

PHP functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 * blog_addtomenu()
   Add existing blogs to potential menu entries.

 * blog_admin()
   Blog administration.

 * blog_edit()
   Edit blog preferences.

 * blog_save()
   Save blog preferences.

 * blog_delete()
   Delete a blog.

 * blog_main()
   Display a blog.

 * blog_prefs()
   Edit blog preferences.

 * blog_saveprefs()
   Save blog preferences (non-admin).

 * blog_addentry()
   Appends a new entry to the end of a blog.

 * blog_addcomment()
   Adds a comment to a blog entry.

 * blog_delentry()
   This will delete a blog entry.

 * blog_editentry()
   Form for editing entries and comments.

 * blog_saventry()
   This will save a blog entry.

 * blog_moveentry(
   Moves an entry to a different location in the list.

PHP variables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 * $mod_blog=true;
   Tells the Nailblog that the blog module is in use.

 * $blog_version="2.0.1";
   Minimum preferred Nailblog version.

 * $user_group[]="blogadmin";
   Adds the group blogadmin to list of available groups.

JavaScript functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 * blog_setentryform()
   Shows or hides the New Blog Entry form.
   
 * blog_setcommentform(formid)
   Shows or hides a Add Comment form.
   
 * blog_jumptoentry(page,id)
   Jump to a specific entry by entry row Id (not entry Id).

JavaScript variables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 * blog_entryform_visible=false;
   Flag for if the New Blog Entry form is visible or not.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
