Jamie Balfour BSc

Welcome to my personal website!

Technology enthusiast

I am very interested in technology, particularly relating to computer science. I am most interested in web design and development.

My main hobby is programming. One of my most well known products from this is ZPE. I also am the sole creator of BalfBlog, BalfBar and BalfSlider.

A little bit about me

In 1997, when I was six years of age, I got my very first computer. I was always very interested in the ins and outs of it and dismantled it to see how it worked.

Years later, in 2016 I received my BSc (with honours) in Computer Science, obtaining a First class degree.

I'd like to welcome you to my website and hope you enjoy using it as much as I have enjoyed building it!

Google Plus
Jamie Balfour BSc
Full stack developer



Welcome to the page on BalfBlog. You can find my BalfBlog based blog on my blog, but also with my articles and reviews as well.

There is now a deployed and open to use version of BalfBlog here.

BalfBlog is an open source blogging system that I have developed. It's purpose is to encourage the users to integrate a blog into their own website and keep their own styles. This is something that other blogging systems like WordPress struggle with.

A 280 post BalfBlog blog only weighs in at 0.43MB of MySQL storage whereas a single page WordPress website comes in at a whopping 2.43MB. This is just a small point to make since no real strategies for analysing the difference here have been used, they have simply been compared at the point of installation and inserting 1 post into WordPress and 280 posts into BalfBlog.

The BalfBlog project prides itself on simplicity and compactness by developing a lightweight content management mechanism that has been designed from the ground up with simple concepts in a framework that makes it efficient and well-designed.

To get started with BalfBlog, all that is needed is a website and a style. The stylesheet for BalfBlog is then downloaded and it's up to you how you style it.

As of ZPE 1.5.1 you can obtain BalfBlog using jget ("jamiebalfour-download", "balfblog"). Note also, jget is an internal aliase for balf_download.

Built-in features

BalfBlog provides a very flexible content management system that has many different modes. For the majority, the most used is the default mode known as Blog Mode.

Introduction Mode

As of May 2016, Introduction Mode is included in all installations of BalfBlog. This is perhaps the most confusing part of the blogging system, but it has been implemented well enough that all you need to do is provide a styling for posts that match the criteria of .blog_post.introduction.

Introduction Mode is a clever way of transforming the BalfBlog blogging system into an allround content management system. By setting the data file BALFBLOG_MODE constant to 2, posts will display an introduction instead of the full post unless they are clicked on. When they are clicked on, the full post will appear and users can view these posts as if they were just articles on the website. Take a look at how my articles/reviews and blog posts differ.

Adding features

With the sole aim of BalfBlog being to integrate well within any website, this section describes what you can set to make it fit in with your website.

Responsibilities of the developer using BalfBlog

If you are deploying a BalfBlog blog on to your webpage, you should note that BalfBlog does not provide:

  • A search box

These features must be added directly to the webpage, but they are actually really easy to do.


The whole blog system is unstyled. This is intentional. You may do what you like with it. You can however change the HTML or CSS to style it. If you change the HTML to fit your website do it through the templates. If you change your CSS just look at how it created using the HTML templates.

DIY Extra features

The following features are not included by default, but I use them on my own blog so I thought I might as well share them here.

Style the category list

New versions of BalfBlog from 2.1.10 will include this by default.

By default, the category list does not add the option to add an active element if you are visiting a category. My blog does have this feature, and it's done with PHP and JavaScript.


My categories list gets styled automatically

	echo '<script>jQuery(".bb_category_'.$balfblog->GenerateFriendlyName($_GET['cat']).'").addClass("active");</script>';

Essentially, when the cat URL parameter exists and is set, the JavaScript is placed on the page.

This will use jQuery to search through the categories and find the one that matches the selected one, provided it has been selected.

Highlight searches

New versions of BalfBlog from 2.1.10 will include this by default.

This very specific little feature is very useful. This feature will highlight each word in the text when you search for it.

This works on the concept of the search query existing, then exporting a JavaScript array ([]) and then inserting into a highlight function.

Let's look at how this is done:

	$queries = $balfblog->GenerateSearchArray($_GET['qry']);
	$qry = "[";
	$pos = 0;
	foreach($queries as $query){
		if($pos != 0){
			$out .= ', ';
		$out .= "'".$query."'";
	$out .= "]";
	echo '<script> jQuery(window).ready(function(){multi_highlight(".blog_post .content *, .blog_post .tags *", '.$out.', "highlighted");});</script>';

Most crucially is giving the GenerateSearchArray function the correct parameters. It will transform a single string, separated by spaces and joined by words in quotation marks, and return them as an array.

No actual multi_highlight function has been provided, but you could consider something like this for that exact purpose. If you are not competent with jQuery, or like me you do not want to have another jQuery plugin on your website, here is a small wrapper:

function multi_highlight(container, arr, className){
		$(container).highlight(this, className);

Using this little wrapper function will also add the multi_highlight function to your script and will enable the previous PHP function to work right out of the box.

The search box

The search box was originally included as part of version 1.0. However, as the search box was fairly specific to my website, I chose to leave this whole feature up to you. If you download something such as the Start Bootstrap Blog Post theme as I use on the ClickIt™ website, it's very easy to setup a search form from the right hand side sidebar.

To add a search box, simply add an input element as below:

<form method="get">
	<input name="qry"/>

Ajax page loading

All new versions of BalfBlog support Ajax by simply using the GeneratePostsWithCallback function:

echo $balfblog->GeneratePostsWithCallback($results, true, "");

The following is code from my own blog index.php file. This will generate everything needed since BalfBlog does all of the rest:

//Required balfblog.php file. balfblog.php creates a new $balfblog variable						
require_once 'balfblog/balfblog.php';

//Generate all the posts but only as an object, not HTML yet. Generate page meta data.
$results = $balfblog->GetPosts();
$meta = $balfblog->GetBlogMetaData($results);

//If the user has been searching for something
$qry = "";
	$qry = $_GET['qry'];

//I use variables such as $title, $desc etc. before including my head.php file which will use these variables to generate the page
$title = $meta['title'];
$desc = $meta['description'];
$keywords = $meta['keywords'];
if($meta['banner_image'] != null){
	$banner_image = $meta['banner_image'];

//Added to the end of the page after the main page has loaded
$ending = '<script>WhenLoaded(function(){'.$meta['scripts'].'});</script>';
$ending .= '<script src="'.BLOG_ROOT_PATH.'/balfblog/balfblog.js"></script>';

include $_SERVER['DOCUMENT_ROOT'].'/assets/php/dragonscript2/head.php';		

echo '<input type="text" value="'<?php echo $qry;?>'" name="qry" />'

echo $balfblog->GeneratePosts($results);

include $_SERVER['DOCUMENT_ROOT'].'/assets/php/dragonscript2/foot.php';

Known bugs

Just as with ZPE, I have chosen to record all known bugs here:

The following list are known bugs in the latest version. Fixes are currently being looked at. The bugs with an exclamation mark (!) after the number are priority bugs. I will leave all bugs from version 2.3 in this list and update them as I or someone else manages to fix them.

Bug number Description Fixed
#1! Installer does not configure all settings with defaults


Please do not use any offensive words in your comments.

Site accessibility

A lot of the original functionalities that once existed here have been removed.

This page was generated in 0.36 seconds using 2097152 bytes. Slow? Let me know.

To use project mode, the window must be greater than 920 pixels in width.
Click here to disable Project Mode.
This site uses cookies to deliver its services, to personalise ads, to store preferences and to analyse traffic. Information about your use of this site is shared with other companies. By using this site, you agree to its use of cookies.
Contact me
Contact Jamie Balfour

Get in touch with me via this form.