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

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

User documentation
 * About
 * Installation
 * Changelog

API documentation
 * Core PHP functions
 * Core PHP variables
 * Core CSS classes
 * Core JavaScript functions
 * Core JavaScript variables

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

The Nailblog is a simple modular content management system which
only depends on php to function. It is suitable for small sites
without access to a database.

Installation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 * Extract the files in public_html or document root or any
   place reachable through the web server.
 * Create a folder for generated data files anywhere and grant
   the web server write access to it.
 * Edit the file nailblog/sets.php and set the variable
   $nailblog_data to point to the created folder.
 * Browse to index.php and log in using username="admin" and
   password="admin".

Changelog ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Todo list
 * Fix the rule parser.

090631-nailblog-2.0.0-alpha2
 * nailblog.php
   Updated $nailblog_version to "2.0.0-alpha2".
 * nailblog/core.php
   Added nailblog_quicklist($trg,$vals,$titl,$ind,$repl) for
   creating dropdown lists.
   Fixed one bug in the rule parser in
   nailblog_getprivs($access,$rules,$groups,$owner).
 * nailblog/core.js
   Added function nailblog_appendinput(from,to) for appending
   values from one input box to another. This is mainly used by
   the PHP function nailblog_quicklist(...).
 * nailblog/modules/menu.php
   Added a quicklist for menu entry positions to menu_edit().
   Added a quicklist for menu entry href to menu_edit().
   Added move functionality to the menu entry list.
 * nailblog/modules/user.php
   Added a quicklist for group values to user_edit().
 * nailblog/modules/system.php
   Added move functionality to the module list.
 * nailblog/templates/default/style.css
   Added styles for left and right column.

090630-nailblog-2.0.0-alpha1
 * nailblog/modules/menu.php
   Continued work on the menu module.
 * nailblog/modules/system.php
   All relevant functions check if user authentication is
   enabled before validating access now.
 * nailblog/core.php
   Added nailblog_getprivs($access,$rules,$groups,$owner) for
   validating access privileges.
   Added variables $nailblog_top, $nailblog_left,
   $nailblog_right and $nailblog_bottom for output control.

090629-nailblog-2.0.0-alpha1
 * nailblog.php
   The system now checks if a user authentication module and
   a system administration module is activated. If not it
   provides a method for activating the default versions of
   these modules. This way the admin will not get locked out by
   mistake.
 * nailblog/core.php
   Added variables $nailblog_header, $nailblog_footer,
   $nailblog_systemversion and $nailblog_template.
   Added function nailblog_readsystem() for loading system
   settings from disk.
   Updated nailblog_redir($target) to send a message to
   nailblog_error($message) if $nailblog_errors is true.
 * nailblog/modules/system.php
   Created a module for administering then core system.
 * nailblog/templates/default/template.php
   Added output for $nailblog_header and $nailblog_footer.
 * nailblog/templates/default/style.css
   Added styles for header and footer.
 * nailblog/modules/menu.php
   Started working on a menu module.
 * nailblog/modules/user.php
   Fixed user_class method ingroups($groups). You now don't have
   to be in every group to pass. Just one.

090628-nailblog-2.0.0-alpha1
 * nailblog.php
   Made common JavaScript files load before module loaded ones.
 * nailblog/modules/user.php
   Continued work on the user authentication module.
 * nailblog/modules/user.js
   Added function user_md5(fieldid) for encrypting passwords.
 * nailblog/core.php
   Added function nailblog_getnextid($idpath,$startid) for
   getting a new, unused id.
   Added function nailblog_tabsafe($data) for prepairing data
   for storage in tab-separated-data files.
   Added function nailblog_savedata($filepath,$data) for
   writing data to disk.

090627-nailblog-2.0.0-alpha1
 * nailblog/modules/user.php
   Continued work on the user authentication module.
 * nailblog/modules/user.js
   Fixed an error in function user_md5salt where the password
   was encrypted incorrectly.
 * nailblog/core.php
   Added function nailblog_redir($target) for redirecting to
   other pages.
   Added variable $nailblog_title for specifying the document
   title.
 * nailblog/templates/default/template.php
   Created a default template.
 * nailblog/templates/default/style.css
   Created a stylesheet for the default template.

090626-nailblog-2.0.0-alpha1
 * index.php
   Renamed index.php to nailblog.php and made index.php include
   nailblog.php instead. This adds support for multiple Nailblog
   versions in the same installation directory.
 * nailblog.php
   Renamed from index.php, added support for variable $nailblog
   which is the system path.
 * nailblog/core.php
   Added function nailblog_tosession($varname,$value).
 * nailblog/modules/user.php
   Continued work on the user authentication module.
 * nailblog/modules/user.js
   Created a JavaScript file for the user module.

090518-nailblog-2.0.0-alpha1
 * index.php
   Created the index.php file.
 * nailblog/readme.txt
   Created this readme file.
 * nailblog/sets.php
   Created a file for default overrides.
 * nailblog/core.php
   Created a file for core functions and variables.
 * nailblog/modules/user.php
   Created a module for user authentication.

Core PHP functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 * nailblog_error($message)
   Prints the message if $nailblog_errors==true.
 * nailblog_commonjs($filename)
   Loads common JavaScript files.
 * nailblog_tosession($varname,$value)
   Store a value in a session variable.
 * nailblog_fromsession($varname,$default)
   Restores a value from a session variable.
 * nailblog_alert($message)
   Outputs an alert message.
 * nailblog_unmagic($data)
   Fix magic quotes if they are enabled.
 * nailblog_readdata($filepath,$default)
   Reads data from disk.
 * nailblog_parsedata($data)
   Converts tab separated data into an array unless the data is
   an array.
 * nailblog_redir($target)
   Redirects to another page.
 * nailblog_adminbox($module,$groups,$title)
   Header for an toolbox on the admin page.
 * nailblog_getnextid($idpath,$startid)
   Returns a new, unused Id stored in the specified file.
 * nailblog_tabsafe($data)
   Converts posted data to tab-separated-data.
 * nailblog_savedata($filepath,$data)
   Writes data to disk.
 * nailblog_appenddata($filepath,$data,$header)
   Appends data to a file. If file does not exist create it with
   $header and then append $data.
 * nailblog_readsystem()
   Reads system settings from disk.
 * nailblog_getprivs($access,$rules,$groups,$owner)
   Validates access privileges.
 * nailblog_quicklist($target,$values,$titles,$indent,$replace)
   Creates a dropdown list where a user can select values for
   a target input.

Core PHP variables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 * $nailblog
   Path to system folder (relative to the index file)
 * $nailblog_data
   Path to generated data.
 * $nailblog_modules
   Default modules.
 * $nailblog_errors
   Debugging.
 * $nailblog_session
   Session variable prefix.
 * $nailblog_maincalls
   Main functions calls.
 * $nailblog_postcalls
   Post processing functions calls.
 * $nailblog_head
   Document header output.
 * $nailblog_header
   Page header content output.
 * $nailblog_top
   "Breadcrumb" top bar content output.
 * $nailblog_left
   Left column content output.
 * $nailblog_right
   Right column content output.
 * $nailblog_center
   Center content output.
 * $nailblog_bottom
   Bottom breadcrumb content output.
 * $nailblog_footer
   Footer content output.

Core CSS classes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 * p.nailblog_alert
   Used for displaying important messages.
 * div.nailblog_adminbox
   Used for containing admin tools. These may take up more
   horizontal space than available so the style needs to support
   that with scrollbars or something similar.
 * div.nailblog_menu
   This is used as a container for menus.
 * span.nailblog_menuitem
   Container for one menu item.

Core JavaScript functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 * nailblog_init()
   Calls functions when page loads.
 * nailblog_copyinput(from,to)
   Copies the value of one input box to another.
 * nailblog_appendinput(from,to)
   Appends the value of one input box to another.

Core JavaScript variables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 * nailblog_onload
   Array containing references to functions to call when page
   loads.

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

