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
- Installing Nailblog
- Upgrading Nailblog
- Administration
- Core modules
- User module (user)
- Top and bottom menu (menu)
- Backup module (backup)
- Blog module (blog)
- Frontpage module (frontpage)
- Dynamic template module (template)
- Side menu module (sidemenu)
- User settings module (sets)
- File manager module (file)
- Page module (page)
- Visit counter module (counter)
- Gallery module (gallery)
- Honeypot module (honeypot)
- Links module (links)
- RSS module (rss)
- Template module (template)
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.
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.
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.
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.
Core modules
User module (user)
This module handles all user authentication. Along others, it gives access to the following pages:
- ?act=user_form
The login page. - ?act=user_logout
This page logs you out and redirects you to the login page.
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:
- Id
The unique user Id (0 fo an unauthenticated user). - Login
The login name. - Password
The login password. - Name
The full name of the user ("Guest" for an unauthenticated user). - Groups
A comma separated list of groups the user belongs to. Different modules give different privileges to a user depending on which groups the user belongs to ("admin" for the default admin user, "guest" for an unauthenticated user).
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:
- Id
The unique menu entry Id. - Groups
A comma separated list of groups. Only users which belongs to one or more of these groups can see the menu entry. - Link
The page the menu entry refers to. - Title
The title for the menu entry.
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:
- Download backup data
Click here in order to download the data you've selected from a list available above this button. You can specify the filename for the resulting tarball too. - Restore from backup
This tool will upload a backup file and extract it in the data folder. It will not remove files, only overwrite them, so you can upload backups in more than one step. If you want to revert to an older backup it is recommended that you first do a complete reset on the system in order to remove garbage files.
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:
- Id
The unique blog id. - Owner
The user id of the blogs owner (as defined by the user module). - Groups
A comma separated list of groups the blog belongs to (as defined by the user module). - Access
Access control for adding entries, comments, and viewing blogs. Each of these can be set to Owner, Group (only users with one or more groups in common are granted access), or All. - Title
The title of the blog (may be left empty too). - Description
An introduction in HTML which is always visible at the top of the blog.
A blog combination consists of the following attributes:
- Id
Unique blog combination id. - Groups
Comma separated list of groups the blog combination belongs to. Only users with at least one group in common have read access to the blog combination in question. - Title
The title for the blog combination. - Introtext
An introduction in HTML which is always visible at the top of the blog combination page. - Blog entries
Default number of entries visible on the blog combination page (can be overridden by visitors). - Blogs
Comma separated list of blog Id's. The latest entries from these blogs are shown on the blog combination page. Even though the defined blogs may have stricter access rules the entries are still visible if this blog combination allowes it.
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.
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:
- Page
This is the URL for the page this pageset is applied to. - Template
This is the template which is applied to the pages this pageset is valid for.
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.
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:
- Id
The unique id for the menu entry. - Groups
The groups to which users need to belong to in order to see the menu entries. - Level
How much the menu item must be indented, or if it's a title or a label instead of a menu entry. - Link
The URL the menu entry points to. - Title
The title for the menu entry. - Rules
A set of rules which hides the menu entry if not matched. Leave this empty if you want the menu entry to show on all pages.
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).
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.
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.
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.
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.
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.
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.
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.
RSS module (rss)
This module adds an rss-link to the blog module. The link is visible on blog pages and on blog collections.
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.