Wheatblog Online Documentation

Normative for Wheatblog Release 1.0

Previous Revision: (April 12th, 2005)
This Revision: (May 26th, 2005)

Wheatblog: An Overview

This document covers the basic requirements, setup and maintenence of Wheatblog.

<More specific documentation can be found on our main documentation page>.

Installation Requirements top 

For a simple, fast implementation of wB, check out the quickstart guide.

Web Server top 

Wheatblog was originally designed to run under the Apache Web server, but is likely to work on similar HTTP/1.1 compliant server platforms, provided they support PHP>=4 and either MySQL or SQLite. Consult your hosting provider's documentation to determine if you meet these requirements.

When beginning your install, there are several things to consider. Most important is probably familiarizing yourself with the basic required elements: the web server, PHP, a compatible database, and the ability to perform file permission changes. Most hosts provide a web-based control panel, and changing permissions is a common task often accomplished in the File transfer process.

Once you have established that Wheatblog will work with your setup, you should choose a location for your blog. If you want your blog to be a stadalone part of your website, you should pick a directory separate from your document root (i.e., whatever directory represents http://yoursite.com/) Consider this position carefully. One of the most common mistakes made when establishing a web presence is the shifting of files on a web server, which, without complex server-side redirection, creates 404's — something the web has far too many of already. Another good reason to be sure of the location for your blog is search engines; moving your pages around after they have been exposed to the web will negate any search engine records that have been established, effectively bringing your site back to square one. This link discipline is an important part of conveying your message to the public, and a bit of thought in the beginning will pay dividends down the road.


With a full two-thirds of the market, Apache is far and away the most popular web server on the internet. The design and subsequent testing of Wheatblog was concentrated on an Apache-based hosting environment, though no real special configuration of the web server itself is required. There are certain benefits to customizing your blog with .htaccess files, such as niceURLs, but such customizations exist outside of the scope of this document and are neither recommended nor discouraged. In short: There are no known issues with Wheatblog under Apache.

PHP Requirements top 


In the interest of code efficiency and security, Wheatblog is designed to work with servers that implement PHP>=4. Due to security issues with PHP3, the vast majority of web hosts have adopted PHP4. If this is not true in your case, we suggest emailing your hosting provider and asking them to get with the program, so to speak. ;-)


Wheatblog was specifically designed around the PHP4 language structure. There are, however, some minor bugaboos regarding the magic_quotes_gpc directive; Consult your host about the status of magic_quotes_gpc on your server.


PHP5 At this point, Wheatblog's stability on PHP5 is unknown.

Database Requirements top 

Wheatblog requires six database tables. The code provided to create this structure varies depending on which database you are using, but the semantic structure is the same.

The names of these tables and columns are flexible, but for the sake of organization, it is probably advantageous to leave them as is. If you do decide to change the table names to something personalized, You can set their names in settings.php. The SQLsyntax for creating these tables is located in the .sql file that corresponds to your database implementation. Most hosts provide a web-based GUI for setting up databases and running SQLcode to create tables; phpMyAdmin is often provided and makes this process very easy.

Below is a universal pseudocode representation of the database structure:

  1. "wbtbl_categories" - Wheatblog Categories
    "id" - Category Identifier [integer]
    An integer that represents the category, assigned in the order the category was created.
    "category" - Category Name [string]
    A string value mapped to the category ID, the default (1) is "unfiled".
  2. "wbtbl_links" - Wheatblog Index Page Links
    "id" - Link Identifier [integer]
    An integer that represents the link, assigned in the order the link was created.
    "link_name" - Link Name [string]
    A string value that is mapped to the link ID. The defaults are some crass marketing on our part.
    "link_location" - Link Location [string]
    The URL that corresponds to the given link name.
  3. "wbtbl_comments" - Wheatblog Visitor Comments
    "id" - Numerical Comment Identifier [integer]
    Value representing a given comment's position in the database
    "comment_author_name" - Comment Author Name [string]
    "comment_author_email" - Comment Author Email [string]
    "comment_author_url" - Comment Author URL [string]
    Value of the homepage, website, or blog given by the comment author
    "post_id" - Post ID [integer]
    Mapped to the numerical ID of the post
    "comment_month" - Comment Month [integer]
    Month of the year that comment was added (01-12)
    "comment_date" - Comment Date [integer]
    Date of the month comment was added (0-31)
    "comment_year" - Comment Year [integer]
    "timestamp" - Timestamp [string]
    An rfc2822 "internet date" string. eg. Tue, 24 May 2005 17:03:49 -0400
    (added in Wb 1.0 for possible future expansion)
    "comment_body" - Comment Body [string]
    The actual body text of the comment
  4. "wbtbl_posts" - Wheatblog Posts
    "id" - Numerical Post Identifier [integer]
    Value representing a given post's position in the database
    "title" - Post Title [string]
    "day" - Post Day Of Week [string]
    Day of the week that post was added (Sunday-Saturday)
    "month" - Post Month [integer]
    Month of the year that post was added (01-12)
    "date" - Post Date [integer]
    Date of the month post was added (0-31)
    "year" - Post Year [integer]
    "category" - Post Category [integer]
    Numerical Category identifier under which post is filed
    "showpref" - Post Visibility [boolean]
    Whether or not post is publicly visible
    "locked" - Post Locking [boolean]
    Whether or not post is locked (comments disallowed)
    "comments" - Number of Comments [integer]
    Numerical value of comments associated with post.
    "body" - Post Body [string]
    The actual body text of the post
    "timestamp" - Timestamp [string]
    An rfc2822 "internet date" string. eg. Tue, 24 May 2005 17:03:49 -0400
    (added in Wb 1.0 for possible future expansion)
  5. "wbtbl_users" - Wheatblog User Control
    "login" - User Login Name [string]
    User login name - Maximum length of 12 charaters
    "password" - User Password [string]
    User password- Maximum length of 12 charaters
    "flags" - User Credentials [integer]
    User access particulars (Admin, Registered, etc) see Managing Users
    "www" - User Homepage/URL [string]
    "email" - User Email Address [string]

* If you can't figure this out, ring the bell and someone will be over to hit you in the head with a tackhammer, because you are a retard. EDIT_ME


Before Version 1.0, wB was only designed to work with MySQL. Support and security for MySQL has been increased, and wB should function properly with all versions of MySQL.

Installing Wheatblog with the MySQL database

The syntax required to create a MySQL database for Wheatblog is contained in the docs/ directory of your install. this file is called wheatblog-mysql.sql, and is basically a text file that can be fed into the MySQL command-line interface or a web-based MySQL interface such as _phpMyAdmin_.


SQLite is a lightweight and powerful database system that stores information in a single file, commonly called a flatfile database. As of version 1.0, SQLite is fully supported.

Installing Wheatblog with the SQLite database

The syntax required to create a SQLite database for Wheatblog is contained in the docs/ directory of your install. this file is called wheatblog-sqlite.sql.


PostgreSQL is an Open-Source, SQLcompliant database system designed primarily for large systems where scalability is a concern. Wheatblog is not currently capable of using PostgreSQL, though support is envisioned in future releases.


Microsoft SQLServer is specifically designed to run on Microsoft Internet Information Server. Wheatblog does not currently support MSSQL, though support is planned for a subsequent release.

Installation Procedures top 

Preparing your Server for Wheatblog

Wheatblog requires more than one distinct directory on your site:

  • A base directory - where the blog resides
  • An 'admin' directory for administration-only functions
  • An 'includes' directory to hold included files, such as the header and footer sections of your pages
  • A 'language' directory which stores translations for Wheatblog's controls
  • A 'tools' directory which contains SQL syntax files
  • A 'css' directory to house the stylesheets and accompanying image elements

Throughout the development process, this structure has been shown to be the most desirable; isolating the admin and includes directories prevents any unauthorized viewing by visitors, and the language, tools and css directories are sequestered for organizational purposes.

For example, we'll assume your blog lives here:


And, we'll assume the admin interface lives here:


Add these locations and your database user/password information to the settings.php file and upload everything to your server.

Upgrading from .03b

There have been no changes to the database structure, so you can use .05b with your existing posts without making any changes to your database tables. There have been minor code changes to almost every file in the project, so if your install has many customizations, you may want to examine the code closely before trying implement it in whole or in part. The CSS file has remained largely unchanged. If you are using your own CSS file, you will only need to add the following declaration:


The main Settings file, called settings.php, is located in the main Wheatblog directory. This file contains all the variables you might need (or want) to change for your blog. Below is a list of these variables, their functions, and the values required.

$site = 'string [sql_domain]';
SQL database domain name (domain on which server resides). This represents the domain name of the SQL server you are planning to use. In many cases, the SQL server resides on the same machine as the web server; in this case, this would be set to localhost.
$user = 'string [user_name]';
SQL database user name. On a shared web host, this name can be either your login name for the host, or in the case of more advanced access to the SQL backend, assigned by you. Consult your hosting help for info on this variable.
$pass = 'string [password]';
SQL database user password
$database = 'string [database_name]';
SQL database name
$tblPosts = 'string [table_name]';
Name of Posts table in SQL database. This is the name of the POSTS table that exists in the above database. In the default installation, this is set to wbtbl_posts.
$tblUsers = 'string [table_name]';
Name of Users table in SQL database. This is the name of the USERS table that exists in the above database. In the default installation, this is set to wbtbl_users.
$tblComments = 'string [table_name]';
Name of Comments table in SQL database. This is the name of the COMMENTS table that exists in the above database. In the default installation, this is set to wbtbl_comments
$tblCategories  = 'string [table_name]';
Name of Categories table in SQL database. This is the name of the CATEGORIES table that exists in the above database. In the default installation, this is set to wbtbl_categories
$tblLinks = 'string [table_name]';
Name of Links table in SQL database. This is the name of the LINKS table that exists in the above database. In the default installation, this is set to wbtbl_links
$ui_language = 'string [language_filename]';
Interface Language. Changing this variable will ostensibly change all of the linktext, form controls, and other administrative elements to a language other than the default, English. (French?)
$front_page_max = int [int];
Concurrent posts to display. This variable controls the number of posts displayed on the index page of your blog, as well as the number of permalinks added to your RSS file. (change this behavior?)
$wb_url = 'string [url]';
URL of your blog. This variable is set to the root URL of your web page.

For example, we'll assume your main page is

and on your server, your wheatblog install is located in a directory named

In this case, $wb_url would be

http://www.your-domain.com/your_blog_directory/ .
$wb_admin_url = 'string [url]';
URL of the admin section of your blog
$wb_dir = 'string [dir]';
Server path of the directory that holds your Wheatblog installation
$wb_inc_dir  = "$wb_dir/string [dir]";
Server path of the directory (under $wb_dir) where include files are stored
$wb_lang_dir = "$wb_dir/string [dir]";
Server path of the directory (under $wb_dir) where language files are stored
$wb_admin_dir = "$wb_dir/string [dir]";
Server path of the directory (under $wb_dir) where administration-only files are stored
$blog_index_page_name = 'string [filename]';
Name of your index page (commonly index.php)
$notify_on_new_comment = boolean [true | false | 0 | 1];
Whether or not Wheatblog will email you when a new comment is added
$registered_comments = boolean [true | false | 0 | 1];
Whether or not visitors need to be registered to comment (implement if comment spam becomes an issue)
$blog_title = 'string [title]';
Name you choose to give your blog
$blog_subtitle = 'string [subtitle]';
Subtitle for your blog (optional)
$wb_rss = 'string [filename].xml';
Name of your RSS file
$wb_rss_lang = 'en_string en_[language]';
Language encoding of your RSS file (en_us is recommended)
$use_sessions = boolean [true | false | 0 | 1];
Enable Sessions Support
$session_dir = 'string [dir]';
Directory on your server that holds session information.
Assign this if you are having problems with sessions on a multiple server or mirrored system
$archive_type = 'string [daily | weekly | monthtly]';
Frequency of archive (unused as far as I know EDIT_ME)
$wb_style = 'string [css_file_name]';
The style template used for Wheatblog

Features top 

Administrative Features top 

Managing Users
Managing Categories
Managing Links

Creating and Editing Posts top 

Keeping Your Blog Valid
Avoiding Errors

Security top 

Securing your Blog top 

Wheatblog provides no extra security for the admin layer. Please password protect your admin directory. If you use Apache as your web server, you'll do this via an .htaccess file in the admin directory. You can read up on how to do that elsewhere. Most web hosting companies provide a web-based GUI that makes it really easy.

Better Living Through Sessions top 

Cookies top 

Tweaks top 

General top 

Besides the values in settings.php, all the layout is controlled by the includes/header.php, includes/footer.php, and the CSS file. Take a look at these and modify them if you'd like to get away from the default templates.

Design Manipulation top 

Changing Styles top 

Modifying Style Elements top 

.Wheatblog_textarea_002 {
color: black;
background-color: #A8A8A8;
width: 99%;
height: 32px;
font-size: 12px;
font-family: "Trebuchet MS", arial, sans-serif;

Roll Your Own top 

RSS top 

Setting Up Your RSS Feed top 

RSS is a great way to share your content with others, either by allowing syndication or through the increasingly popular use of RSS clients such as Sharpreader. The basic RSS file is called rss.xml. This file located in your blog's main directory, allowing for simple access by RSS readers and other methods of feed aggregation. You can personalize the name of this file by modifying the $wb_rss variable found in settings.php.

The rss.xml file is automatically generated by two Wheatblog processes: Adding a post and Editing a Post. This process represents a change from previous version of Wheatblog which required a manual update of the RSS file. Careful editing is necessary when posting to your blog, as many news readers will reject RSS files that are not valid. The use of HTML entities is required; Future versions of wB will contain input validation and/or regular expression modification to output well-formed XML.

Note: You MUST change the file permissions on rss.xml to 777 so that your web server can successfully create and maintain your RSS feed. Most FTP clients allow you to modify file permissions; If you have an issue, contact your hosting provider for help.

Validation top 

Syndication top 

Errata top 

Foo Errata top 

Version History top 

  • 1.0 -- ??/??/2005 -- Major improvements
  • .05b -- 03/11/2005 -- Major improvements (see CHANGELOG.txt for details)
  • .03b -- 04/25/2004 -- RSS improvements + added 'by title' archive view
  • .02b -- 04/2004 -- Complete rewrite
  • .01b -- 02/2001 -- Initial release

More information about revisions and specific versions can be found on the wB SourceForge Project Page.

Changelog top 

See Changelog for a history of changes and known issues.

Project History top 

Foo Project top 

See History for background on this project.

Future Goals top 

Foo Goals top 

Licensing and Copyright top 

GPL - General top 

Wheatblog is free as in freedom and free as in free beer. It is released under the GNU Public License (GPL). You can read about the license at http://www.gnu.org. A copy is included in with the distribution.

Wheatblog Specific top 

Please see the Official Wheatblog Copyright Disclaimer

Credits top 

  • Steven Jarvis of sjarvis.com (naturally) for the code used in the rss.php file.
  • Everyone who uses Wheatblog. We love feedback.
  • That guy who donated five bucks.
  • Hi Mom!

The Development Team top