Blog edition
vers. 1.2.19

the Nailbox

Back to the [Nailblog blog]

Nailblog documentation

Nailblog is a simple Content Management System, which uses text files for data storage instead of a database. It is not intended for big business use where scalability, size and speed are important factors, use Drupal or Joomla! for that. If you want a simple website where you can show some pages, share files, blog about stuff, i.e. if you're like me, then Nailblog may be your thing.

Table of contents

System Requirements

The core installation of Nailblog requires a web server and PHP. Additionally, for the backup functionality to work, the commands cd, mv, tar, and gzip, and piping functionality must be available on the server. This rules out windows servers. The file manager use GD for generating thumbnails.

Back to TOC

Installing Nailblog

Download the latest version of the Nailblog core (nailblog-[version].tar.gz), and extract it in the installation folder (like document root or public_html).

Create a data folder anywhere (it does not have to be accessible from the Internet), make it writeable by the web server, and edit sys/sets.php. Change the variable $nailblog_data to point to the newely created folder.

Create another folder which is accessible from the Internet, make it writeable by the web server and change the variable $nailblog_opendata in sets.php to wherever that folder is.

Here are the most basic steps needed to get the Nailblog up and running (cwd is the download folder) and since it uses the default values for $nailblog_data and $nailblog_opendata you won't need to edit the sys/sets.php file:

$ mv nailblog-1.2.8.tar.gz ~/public_html/
$ cd ~/public_html/
$ tar -xzvf nailblog-1.2.8.tar.gz
$ mkdir data
$ chmod 777 data
$ mkdir opendata
$ chmod 777 opendata

Next, browse to the installation folder and log in using username admin and password admin. I recommend you activate the settings module and change the admin password after this.

nailblog-installation-1.png nailblog-installation-2.png nailblog-installation-3.png nailblog-installation-4.png nailblog-installation-5.png

Back to TOC

Upgrading Nailblog

You should always upgrade the Nailblog installation one version number at a time. If you've installed using nailblog-1.2.5.tar.gz, and the current version is 1.2.8, you should download the files nailblog-1.2.6-patch.tar.gz, nailblog-1.2.7-patch.tar.gz, and nailblog-1.2.8-patch.tar.gz, and install them in that order. Alternatively, you can simply download the latest full installation and install it over the older installation but then you'll lose all settings you've made in sys/sets.php.

To install a patch you simply download it, and extract it in the installation folder where you've earlier extracted the nailblog installation package. Here's an example using the same installation folder as earlier:

$ mv nailblog-1.2.8-patch.tar.gz ~/public_html/
$ cd ~/public_html/
$ tar -xzvf nailblog-1.2.8-patch.tar.gz

And that's it. The next time you visit the site there may appear a message saying some updates have been made and that you should reload the page. This happens when there are automatic changes are done to the Nailblog data in order to make it compatible with the upgraded system.

Back to TOC

Administration

Logging in as admin, or someone belonging to the admin group, will give you unlimited access to the admin page; ?act=admin. Most of the modules will have some kind of administration controls on this page and these are accessed by clicking on the module titles. By clicking on the title "Global settings" you open the controls for the Nailblog installation and get access to the following controls:

Default template
This is the template currently in use. It is possible to install new templates and these will be available in this list.

Title bar
This is the text displayed in the browsers title bar (along with whatever the modules will put there).

Header content
This is the HTML code visible in the header part of every nailblog page. This is a good place for a <h1>Title</h1>.

Footer content
This is the HTML code visible in the footer part of every nailblog page. This is a good place for a legal notice, or your signature. Remember to add <p>paragraph tags</p>.

Session prefix
Login authentication data and some module specific variables are stored as session variables. If there are more than one Nailblog installation on the same server you might want to change the session prefix for one of them so you won't accidentaly get access to the wrong site when logging in to one of them.

Modules
Next is a list of every available module. Add-on modules, if you've installed some, also appear in this list. Check the checkboxes for each module you want to activate, X removes all user generated data for a specific module (be careful), and R raises the module in the list.

The modules are executed in the order they appear in the module list. Some modules work better if they are in a specific order; the honeypot module should be high up in the list in order to have an effect, but not above the menu modules. The file module should be above the gallery module (looks better that way).

Never uncheck the user module unless you activate another module which handles user authentication at the same time!

If you deaktivate the user module you'll lose admin privileges and the only way to get them back is to remove the file global.txt in the data folder, or edit it and add the line "user" to the end of it. The problem is that since the file is generated by the server you may not have write access to it.

Update
Click this button when you're done with all modifications. Also click it before raising a module, since you'd lose any changes otherwise.

Complete reset
This removes all user generated data. All of it. Even the global settings, so your back to step one and must probably log in as admin using password admin again.

Back to TOC

Core modules

Back to TOC

User module (user)

This module handles all user authentication. Along others, it gives access to the following pages:

On the admin page users who belong to the group admin can add, remove and edit users.

A user entry consists of the following attributes:

Back to TOC

Top and bottom menu (menu)

The menu module adds a menu to the top and bottom of the page. On the admin page users who belong to the group admin and menuadmin can add, move, edit and remove menu entries. One menu entry consists of the following attributes:

Back to TOC

Backup module (backup)

This module provides a quick method for backing up user generated data. On the admin page users who belong to the group admin have access to these tools:

Back to TOC

Blog module (blog)

This modules lets users blog away to their heart's content. Users in the admin and blogadmin group will have access to the blog administration tools on the admin page, where they can create, edit and remove blogs and blog combinations.

A blog combination is a page where the latest entries from several blogs are visible.

One blog has the following attributes:

A blog combination consists of the following attributes:

Back to TOC

Frontpage module (frontpage)

This module adds a frontpage to the site. Users in the group admin and frontpageadmin can change the content of the frontpage on the admin page.

Back to TOC

Dynamic template module (template)

This module adds the possibility to define different templates for different pages on the site. Users in the groups admin and templateadmin can set rules for different templates on the admin page.

Template rules are called pagesets. One pageset consists of two attributes:

If Page is set to "act=blog" then the pageset is valid for every blog viewed in blog mode, but not for pages where blog entries are viewed individually. If Page is set to "act=blog&id=1" then the pageset is only valid for the blog with Id 1. By visiting different pages and copying the end part of the URL you can easily create a few pagesets for the pages you want.

Back to TOC

Side menu module (sidemenu)

This module adds a menu, similar to the top and bottom menu, to the left side of the page. A user in the group admin and menuadmin can add, move, edit and remove menu entries on the admin page. Menu entries can also be set to only be visible for a surten group of pages. This adds support for sub menus. It is also possible to set which groups the menu entries are visible for.

One menu entry consists of these attributes:

You can add several rules for a menu entry. The entry will be shown when at least one rule match. Rules look like the end of URL's, like "act=blog", or "act=page&id=5", but also support NOT operators like "act!=blog". If an & is present then both sets must match for the rule to be a match. Here are some examples:

act=blog
The entry will only be visible when browsing a blog.

act=blog&id=1
The entry will only be visible when browsing the blog with the Id 1.

act=
act=blog
The entry will be visible on the frontpage, and when browsing blogs.

act!=blog
The entry will be visible on all pages except when browsing blogs.

There are some limitations, like when using the NOT operator twice will make the entry visible on all pages no matter what rules you put in there (unless the NOT operator is for the same variable and value).

Back to TOC

User settings module (sets)

This module adds the page ?act=sets, which provides a user in the group admin and user means to change their name and password.

Back to TOC

File manager module (file)

This module adds a filemanager which is accessed through the page ?act=file. Users in the group admin and fileadmin have unlimited access to the filemanager and may change the thumbnail size on the admin page.

The files uploaded to the file manager are accessed through PHP and not directly by the web server, which means they can be locked behind user authentication. A folder is owned by the user which creates it and the owner can set the folders groups as well as specify read and write access to either Owner, Group, or All.

Back to TOC

Page module (page)

This module provides static html-pages. Users in the group admin and pageadmin can create new, edit and delete pages as well as specify the owner and privileges for each page. The owner of a page have the right to edit and set privileges for that page, and users with write access to a page have the right to edit the page.

Back to TOC

Visit counter module (counter)

This module counts and logs page hits. Users in the group admin and counteradmin can read the visit logs where user agents, page hits and referers are listed. The user agents can be manually classed as bots or non-bots. A tool for clearing the logs, which is a healthy thing to do every now and then, will store the number of visits by bots and non-bots separately.

The Nailblog-tag <nailblog>mod_counter</nailblog> will be replaced with the number of non-bot visitors and can be used in site content, the header, footer and even in the title.

Back to TOC

Gallery module (gallery)

This module adds image gallery functionality to the file manager module. Users in the group admin can change the thumbnail size. The result is better if this module is below the file manager module in the module list. Non-image files are also shown as thumbnails in the galleries using a default thumbnail image.

Back to TOC

Honeypot module (honeypot)

This module adds a small form to the blog page, which is hidden from normal users by CSS. Some bots still see the form and tries to insert data to it which results in a ban on the bot's IP-address. Banned users will get a message that they can't access the blog pages and an opportunity to tell the admin that they are not bots and should be un-banned. Users in the group admin and honeypotadmin have the rights to unban users.

Back to TOC

Links module (links)

This module provides the site with one or several link collections. A collection of links can be filtered, and ordered by "last used", "most used" and "title". The link collections also has access control so it is possible to specify owner, groups, read access and write access.

Users in group admin and linksadmin are allowed to create, edit and delete link collections.

Back to TOC

RSS module (rss)

This module adds an rss-link to the blog module. The link is visible on blog pages and on blog collections.

Back to TOC

Template module (template)

This module makes it possible to use multiple templates on the same site. Users in the admin and templateadmin groups can specify which templates are to be used on which pages.

Back to TOC

by Martin Wikström

Updated: 2022-08-03 16:33