First release of a Flinders plugins

One of my current tasks at Flinders University is to be the administrator for the Blogs at Flinders website. The website is running WordPress MU and uses a number of plugins to give us the extra functionality that we require.

Today I added a new page to the site listing all of the plugins that we are currently using. All of them provide some functionality that is vital to us being able to provide the services that our users require. Where I haven’t been able to find a plugin that has met our needs I have written one.

Thanks to the Director of Information Services who gave his permission, I’m now able to start tidying up some of the plugins and releasing them under the GPL. We’ve gotten so much from the WordPress community that we thought it would be a good idea to start to give something back.

The initial plugin “Flinders Comment Notify” is very simple. I hope it will help any other WordPress administrators who have the same requirement that we have.

I’ll upload the additional plugins and post about them here as time allows.

Updated Blogroll to Google CSE Plugin

Today I released a new version of the Blogroll to Google CSE plugin that I’ve developed with the kind folks over at the Libraries Interact blog. There have been some important changes.

Firstly the plugin now uses the Shortcode API that was introduced in WordPress version 2.5. This is an important change in that it modifies the way the plugin works.

It means that:

  • Where you used to use [blogroll-google-cse] on the page where you want to display the search form and list of links, you now use [search-blogroll-google-cse]
  • You no longer use [blogroll-google-cse-results] on the page where you want to display the search results, you now must use [results-blogroll-google-cse]

The main benefit of this approach is that you can now instruct the plugin to show the search box and not the list of links. To do this you use the following shortcode:

[search-blogroll-google-cse links="no"]

Additional changes have been made to ensure the administrative UI is easier to use, and the plugin now detects the appropriate location of core WordPress files and URLs using the technique outlined in this post by Ozh.

Please try out this new version, and let me know what you think

A social media revolution?

Today I stumbled across “The revolution may not be blogged” on the Unleashed website run by the ABC. It was interesting because it starts to explore some of the aspects of social media that I’ve not thought of for a while.

It was also interesting because it wasn’t the usual “social media is best” type of post which I’ve been reading lately. Sometimes I worry that I’m reading about this stuff in areas that are in effect just an echo chamber. It is good to read something that draws you to the output of a topic from time to time.

Counting Average Number of Posts

Recently I was asked by MPOW to determine the number of new posts that we added to our blog in a day. To count the average number of posts we add in a day I used the following SQL script.


SELECT COUNT(p.id) as post_count
FROM wp_posts p
AND p.post_date IS NOT NULL
AND DAYOFYEAR(p.post_date) IS NOT NULL
GROUP BY DAYOFYEAR(p.post_date)

YourStats are MyStats

Many people who have websites, blogs included, are obsessive about their stats. Always wondering about questions like:

  • Which pages are more popular than others?
  • Where are visitors to my site coming from?
  • How did they find my site?
  • How many subscribers do I have to my RSS feed?

It is this last one that has been bothering me at MPOW for a little while now. If you ask this question, the most obvious answer, especially if you run your own blog, is to use a service like FeedBurner.

But what do you do if you can’t use service like this? The blog server I manage at my MPOW will potentially host many blogs. I can’t create accounts at FeedBurner for earch one. It would be too administratively burdensome.

Fortunately kind people like Ken Varnum from RSS4Lib have been thinking about this same question and have done more than think, they’ve done something about it. Ken has built the YourStats tool. You can read more about it on the RSS4Lib blog.

What’s wonderul about the tool is that you can upload your webserver log file, and the tool will work its magic and estimate the number of subscribers you have to your RSS feed.

For those of us, such as me, who can’t transfer logfiles out of our organisations Ken will kindly share the source code of the tool.

Now I’ve got one more statistic in my bag of tricks to help show how popular our blog is.

Listing Subscribe2 Subscription Preferences

At MPOW we use a blog to help us communicate with our users. We’ve affectionately called our blog “The ORB” following a successful naming competition that we held earlier in the year.

An integral part of the blog is the Subscribe2 plugin. I think I can safely say that without this plugin our blog would not have gotten past the planning stage. This is primarily because we migrated away from an email list to the blog platform and needed a way to continue this mailing list functionality.

This morning I needed to find out which categories a specific user had subscribed to in order to recieve email updates. The SQL I used is as follows.


SELECT wpt.name
FROM wp_terms wpt
WHERE term_id IN (
    SELECT wpum.meta_value
    FROM wp_users wpu, wp_usermeta wpum
    WHERE wpu.user_login = 'USER'
    AND wpu.id = wpum.user_id
    AND wpum.meta_key LIKE 's2_cat%' )
ORDER BY wpt.name

Replace USER with the code above with the user name of the user you are investigating

Counting posts in WordPress

Yesterday I needed to get a count of the number of posts in a WordPress blog in each category. I used the following SQL code.


SELECT wpt.name, COUNT(wptr.object_id) as post_count
FROM wp_terms wpt, wp_term_taxonomy wptt, wp_term_relationships wptr
WHERE wpt.term_id = wptt.term_id
AND wptt.taxonomy = 'category'
AND wptt.term_taxonomy_id = wptr.term_taxonomy_id
GROUP BY wpt.name

The same technique will work with WordPress MU based blogs as well. Just substitute the table names with those for the specific blog in the WordPress MU system.

Something to keep in mind is that the if you add up the total of the ‘post_count’ fields reported by this query it is likely to be more than the total number of posts in your blog. This is because posts can be in one or more categories.

A tunnel of water drops

I captured this tunnel of water drops as the water came out of the spouts in the second of the two fountains in front of the State Library in Adelaide, South Australia.


(Click image for larger version)

Copying a Digital Video Disc using Ubuntu

 Earlier today I needed to copy a non encrypted Digital Video Disc (DVD) to make a few backup copies. The disc contained a movie recorded on a video camera of someone that MPOW is collaborating with on a project. As always I used my laptop running the Ubuntu Linux distribution.

I first tried to use the Brasero Disc Burning application to make the copy. Unfortunately the application tried to make the copy as if it was a DVD containing files and data and not a DVD containing a movie. This meant that the copy was corrupt and would not play.

To make a copy of the disc I made a copy of it first as an ISO file by using this command:

cat /dev/dvdrw > ~/backup-copy.iso

Please note that the /dev/dvdrw path may be different on your system, for example it may be /dev/cdrom. The filename, after the >, is also arbitrary.

Once the copy using cat completed, which took some time, I was able to use the Brasero Disc Burning application to burn the ISO image just like any other image.

This technique resulted in a perfect copy and I can use theĀ ISO image file as many times as I need to make as many copies as I need.

The “Water droplet on a DVD” photo was uploaded to Flickr by -j0n-.

DSpace in a Virtual Box

Last night I decided to set myself a challenge, possibly for the beginning of a new project. I wanted to install the latest DSpace open source repository software, currently version 1.5, on an Ubuntu based environment.

Knowing that I’d need to have things like a PostgreSQL database, and have Apache Tomcat running, I wanted to explore this project in a virtual machine environment. I wanted to do this so as to reduce the likelihood of it interfering with the existing services and development environment I have on my laptop running Ubuntu.

Below are notes about the things that I learnt. This isn’t in any way meant to be a full procedure manual, it is more about highlighting potential issues that I experienced along the way and hopefully act as some documentation for myself at a future time.

Read the rest of this entry »