Browse > Home / Archive by category 'Tutorials'

| Subcribe via RSS

Quick Tip - Installing Eaccelerator with Litespeed

April 12th, 2008 | 2 Comments | Posted in Tutorials, development

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

As mentioned in an earlier post, I am currently in the process of moving web hosts. As late as this morning I was perfectly happy with the configuration I had set up using the Nginx webserver and was ready to start the move, until I decided to make life easier for myself and try the Litespeed webserver (which WordPress.com uses) instead. Installation went swimmingly, despite a 3 hour power cut at a critical stage, up until the point I decided to install Eacceelerator as well and then things sort of stopped. For those of you who find yourself in the same situation - there is an extra step you need to perform to get Litespeed to see your Eaccelerator extension.

Once you have compiled Eaccelerator on your server (even if you use the Litespeed PHP compiler built into the administration website), you may find that you will need to copy the eaccelerator.so from the standard directory into the very strange looking Litespeed extensions directory before it can be enabled in your php.ini file.

To find out the directory you need, create a php file with the following content on your webserver:

and load it in your browser. You are looking for a line under PHP Core that looks like this:

You may need to create the directory, as on my installation it didn’t exist, but once you have the eaccelerator.so file in the right place you can add the following to your php.ini file:
extension="eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"

Finally, restart the Litespeed server, create the cache directory (shown in the above configuration details if it doesn’t already exist) and run your phpinfo() page again. If it has all worked you should see the following at the bottom of the first block of information:

More notes on this issue can be found here and here

Tags: , , , ,

Hacking Kses

April 11th, 2008 | 4 Comments | Posted in Tutorials, development

As I spent a great deal of time (and hunting on the Internets) on this I thought I would share the result of my efforts and hopefully save your sanity and hairline.

kses is an HTML/XHTML filter written in PHP. It removes all unwanted HTML elements and attributes, and it also does several checks on attribute values. kses can be used to avoid Cross-Site Scripting (XSS).

It is built into WordPress and WordPress MU and acts on all the content you enter into your posts and pages and strips out all the nasties that WordPress doesn’t think you should be using. 99% of the time you won’t even notice that it is there, but everynow and then you will try to include something in your post and it just won’t save. In a round-a-bout way, this is the situation I found myself in earlier this week.

Try as I might, I just couldn’t get WordPress MU to accept style attributes (this is also the case for normal WordPress). Everytime I saved a post the style would be stripped out completely (MU also removes class and id attributes as well). Most annoying and after pulling out what little hair I had left I turned to the Oracle of all knowledge.

More »

Tags: , , , , ,

My favourite functions - onpage

January 29th, 2008 | No Comments | Posted in Tutorials

Being the generous and kind-hearted person that I am, I thought that I would share some of the little tips, tricks and functions that I use or have found useful whilst developing WordPress plugins.

Most of these functions or code snippets have made it into a number of my sites or plugins - a few of them are even in the core library I include with all my projects now. That doesn’t mean, however, that they are completely error free or of any use to anyone other than me.

More »

Tags: , , , ,

How to make a more stylish search widget

January 27th, 2008 | No Comments | Posted in Tutorials

An effective search facility is the most important functionality for a website. Whilst WordPress performs the nitty-gritty of searching very well, I have always felt that the default search widget is very basic in both looks and functionality.

This tutorial will take you through the steps required to create a more stylish search widget for your blog and maybe teach you a few little tricks along the way. It is written as a very basic tutorial so the more experienced amongst you may find the going a little slow. If you aren’t interested in the tutorial and just want the plugin, then just scroll down to the bottom of the page to grab the completed code.

More »

Tags: , , ,

Using Google Docs for Blogging

October 2nd, 2007 | 1 Comment | Posted in Tutorials

I’ve been using Google Docs quite a bit over the past few weeks. Mainly for writing upcoming blog posts and articles, not that you would know it from the lack of posts on this blog over the past week or so. It has been very handy to have a central location for all of my thoughts and ramblings that I could access if I didn’t have my laptop with me (which doesn’t happen often).

One of the things I had always thought Google Docs should have is an Export to Blog option, or something along those lines. Having to cut and paste my blog post and then re-format it in WordPress just didn’t appeal to me in the slightest.

Well, after a quick search, it turns out that it does have that functionality, hidden away on the Publish tab.

To send your completed document to your Blog, simply click on the Publish tab displayed in the top right hand corner of your document.

Towards the bottom of the Publish page you will see

docstoblog

If you have not posted to your Blog from within Google Docs before, then click on the set your blog site settings link and provide the requested details, then click on Post to blog and you’re done.

I can already see how this is going to streamline my current slow and tedious process, and who knows it could get me back in to the writing habit.

As a side note, apparently the English don’t blog. At least the word isn’t in the English(UK) Google Docs dictionary, our American cousins have no such problems though.

Tags: , ,

How to: WordPress 2.3 upgrade via SVN on Mediatemple Grid Server

September 24th, 2007 | 5 Comments | Posted in Tutorials

It’s about that time of the week when I am feeling invincible and somewhat foolhardy, so I decided I would bring this blog up-to date and install the current release candidate (2.3-RC1) of WordPress.

Rather than have to do a manual upgrade with every new release (even though the WordPress automatic upgrade plugin worked quite well) I thought that I would follow in the foot steps of others and set up a new WordPress installation that I could quickly upgrade using Subversion.

The steps to do this have been documented on the WordPress codex site, but I will target them towards the Mediatemple girdserver and go through the steps I took to enable this blog for subversion updates.

Note: You will need to enable ssh access on your Grid server account to follow these steps. To do that login to your Mediatemple control panel, go to the Server administrator section and scroll down the section labeled SSH option. Make sure this is set to Enabled and save your changes.

Note 2: If you are not comfortable using the command line, then I can recommend using this plugin instead.

More »

Tags: , , , , , , ,

Availability calendar hidden features

September 13th, 2007 | 2 Comments | Posted in Tutorials, plugins

When we released the current version (version 1.0) of our WordPress Availability calendar plugin, we added quite a few new features as well as improving the overall speed and functionality of the code.

Unfortunately due to our work load at the time, we never got around to detailing all of the extra bits in the documentation. Prior to completing the documentation for our much anticipated (well by us anyway) new version, I have decided to highlight a few of the more useful features here.

More »

Tags:

MyDashboard gadget development tutorial

August 1st, 2007 | No Comments | Posted in Tutorials

I have recently completed the first gadget development tutorial for the MyDashboard plugin.

It still needs some work on the grammar and wording, but I wanted to get a tutorial up and running quickly, rather than worry about all of the niggling rules of the English language.

The tutorial will walk you through the creation of a (very) basic gadget, but I think it will serve as a good foundation. I would appreciate any comments on it, and what you would like to see in future tutorials.

Tags:

How to view the Facebook status of your friends in your WordPress dashboard

July 30th, 2007 | No Comments | Posted in Tutorials

This tutorial shows how to pull information in from other websites and display it on your WordPress dashboard. In this tutorial we use the RSS feed showing your friends status reports in Facebook.

The tutorial requires that you have the MyDashboard WordPress plugin installed.

1. Get the Status update RSS link from Facebook

From your Facebook home page click on the link in the top right hand corner of the page, next to the heading that says Status Updates, or if you are logged into Facebook, click on the following link http://www.facebook.com/statusupdates/

Towards the bottom right of this page you will see a section that looks like the image below.

Facebook rss

Hover your mouse over the RSS icon (the little blue square), or the text next to it and click on the right mouse button. Click the short-cut menu item labelled “Copy Link” or “Copy Link Location” - the exact text will differ depending on the browser you are using. This will copy the link address into your computers clipboard for later use.

2. Add an RSS Feed gadget to your Dashboard

Login to the administration section of your WordPress site. You will need to have installed and activated the MyDashboard plugin to continue with this tutorial.

On the Dashboard, click on the Link, in the top right hand corner, labelled Add Gadgets to open the Dashboard gadget library. Once the library has opened, locate the following gadget.
RSS gadget library

Click on the Add to page link under the gadget to add an RSS Feed gadget to your dashboard page.

In the left hand column you will see a new gadget that looks something like the following image (the actual look will depend on the skin you are using for your dashboard).

blank rss feed

3. Add the Facebook feed details.

Click on the Edit Settings button on the header bar of the added Gadget (in this case it is the little button that looks like a V) to open up the settings panel.

open blank feed

In the box labelled “Feed url“, paste in the URL we copied in Step 1 of this tutorial. You can go back to Facebook at this point to re-copy the link if you need to.

Set the number of items to show to a relatively high number. You can experiment with this, but if you have 20 friends, and want to see all of their status’s (assuming they have set them), then you will want to set this to 20 or 21.

If you only want to see the latest status changes, then set it to show something like 10 items. The Facebook RSS feed displays the most recently updated status’s first.

Click on the Update settings button and the RSS Feed gadget will go and retrieve the entered Facebook RSS Feed.

Feed loaded

Finally, click the Edit Settings button on the header bar, again , to close the edit panel.

You can now drag the Gadget to where ever you want on the Dashboard page (I have mine placed in the top right hand corner). It will automatically update the Feed everytime you refresh the page or navigate to the Dashboard, so you will always be up to date with the status reports of you friends.

Tags:

Tutorials section

July 30th, 2007 | No Comments | Posted in Tutorials

As we progress on a number of development projects (including our own plugins for WordPress, MODx and Facebook), we have come across many development stumbling blocks and niggley little problems that stopped us in our tracks for a few hours (and in one case an entire week).

So to help others out-there who may find themselves throwing their laptop, or other item, across the room (an Apple Mighty mouse makes a very effective projectile) we have decided to start writing up some little tutorials and snippets of code that helped us. We will also add some little software and application tricks that you can use to make life a little bit easier.

If you would like to know how to do something that you have seen in our software, then please ask by either posting a comment, or sending us an email. We’ll be glad to share.

Tags: