Testing Charm, a console based blogging application

Posted: July 7th, 2011 | Author: Rob Searles | Filed under: General | Tags: , , | Comments

One of my favourite blog is Motho ke motho ka botho. It’s all about Linux and getting the most out of old and low powered machines. As you probably expect, it heavily promotes console based applications – which is great for me and my continual search for lightweight efficiency (read as happily playing about with new things and possibly not getting too much done).

In the list of software is a little application called Charm. This is a console based publishing tool for (amongst others) Wordpress. Well, I had to give it a go – which is exactly what I am doing right now. It is pretty simple to set up, and fortunately allowed me to switch my editor from Vim to Emacs (and start flamewares…now).

I still have to have a good poke around, I don’t know if it can schedule posts, or save as drafts etc etc, but so far it looks pretty good. I also want to test out Emacs’s Weblogger Mode, the quest for my console based utopia continues.


Upgraded Wordpress

Posted: October 15th, 2009 | Author: Rob Searles | Filed under: Uncategorized | Tags: | Comments

In my small and meandering steps to improve this blog I have now upgraded to the latest version of Wordpress. I has been about a year since I installed this blog, so I thought it was about time – and also I felt increasingly guilty as the Wordpress admin was screaming for me to upgrade. We’ll I’ve done it now, and hopefully everything is up and running and back to normal.

If you spot any oddities, please drop me a comment and let me know!


Disqus Comments Installed

Posted: July 14th, 2009 | Author: Rob Searles | Filed under: General | Tags: | Comments

In my never ending quest to improve this blog and your experience whilst reading it I have installed the Disqus comment system. I’ve seen this on a number of other blogs and it appears to work well. Hopefully this will encourage comments and improve the discussion.

The wordpress plugin that I used can be found here – took about one and a half minutes to install.


Wordpress: Multiple Content Columns

Posted: July 5th, 2009 | Author: Rob Searles | Filed under: Open Source, PHP, Tutorials | Tags: , , | Comments

I’ve been working on a Wordpress site for a client with one of our developers Tom Hartnell. The design of this particular site was that some pages would need content displayed over multiple columns. This content had to be updatable by the client, as such it could not be hard coded into the template files.

We had a look around and we found a potential solution on this blog post.

We played around with this for a while but found that, whilst it was a good solution, it wasn’t quite suitable for our needs. What we needed was a solution which allowed us to have any number of columns and for each column to contain completely different content. The solution in the post demanded that each column start with the same HTML tag (H2 in the example). We decided to rewrite the function described above, based on the same principals, but updated and improved so it would fit our needs.

To see what the end result is, you can see a demo page.

Read the rest of this entry »


Wordpress Plugin – Registered Only – Fix

Posted: December 12th, 2008 | Author: Rob Searles | Filed under: Open Source | Tags: | Comments

In my “real life” I manage a number of blogs for both clients and friends, mostly Wordpress. One of the blogs had a requirement that was to completely password protect the entire site – i.e. only registered users could view any page/post.

For this I initially set up .htaccess password protection – quick and simple.

However, we found out that this prevented the Wordpress iPhone App from login in and doing it’s stuff. So we had to look for another solution.

After doing some Googling I found a post all about password protecting wordpress on the Cre8d Design blog. This pointed me to the “Registered Only” plugin. Whilst it is quite old (4 years since last commit) it should have been just what I was looking for, so I downloaded it, installed and activated (taking care to follow the readme and remove the RSS feeds)

When testing it out it displayed the login box on first visit to the site – prefect. However, I logged in, but it still showed the login box. I assumed I typed in the wrong password, so I tried again. Same result.

Argh, a bug!

Probably because it was meant for a much older version of Wordpress (this blog was using 2.6.3 – now upgraded to2.7)

There was only one thing for it, I had to view the source! Which turned out to be relatively simple:

function carthik_bouncer() {
    if (substr($_SERVER['SCRIPT_NAME'], -12) != "wp-login.php") {
        auth_redirect();
    }
}
add_action('init', 'carthik_bouncer');

The problem was clearly the auth_redirect() function. After some searching, I found this thread in the Wordpress Support forums, after which I dutifully modified the code to this:

function carthik_bouncer() {
    if (substr($_SERVER['SCRIPT_NAME'], -12) != "wp-login.php") {
	    if (!is_user_logged_in()) { auth_redirect(); }
    }
}
 
add_action('init', 'carthik_bouncer');

Success! It works prefectly.

If you need to know, here is a patch:

--- registered-only-old.php	2008-12-12 14:00:09.000000000 +0100
+++ registered-only-new.php	2008-12-12 14:01:21.000000000 +0100
@@ -26,7 +26,7 @@
 
 function carthik_bouncer() {
     if (substr($_SERVER['SCRIPT_NAME'], -12) != "wp-login.php") {
-        auth_redirect();
+	    if (!is_user_logged_in()) { auth_redirect(); }
     }
 }