Loading...
October 14, 2011#

Custom Post Types Plugin WordPress

I’ve been impressed by how WordPress integrates custom content types into it’s interface whilst maintaining the ease of use of the CMS. Rather than using a database approach, it is all code based. There are a lot of tutorials available but I found the one by Think Vitamin the easiest to run through. My one issue with it, however, is that there is a lot of code required for each type you create. I was recently re-developing a site to using a CMS from using CodeIgniter and decided to give the custom types a go myself.
Continue Reading

October 7, 2011#

Converting Seconds to Hours, Minutes and Seconds in PHP

echo date('G:i:s',mktime(0,0,round($seconds,0),0));

To do this in a single line use this. By plugging the number of seconds into mktime, you account for any timezone issues you would otherwise encounter passing the number of seconds into the date function. Since we’re not after the date itself in this instance, it’s irrelevant we’re looking at Jan 1st 1970.

March 10, 2011#

SQL for pulling out recent logins

Some SQL for pulling out usernames and last login dates from the db, most recent first…
Continue Reading

February 20, 2011#

Umbraco debug plugin

After making a big update to an Umbraco site I work on, it became slightly annoying having to add umbdebugshowtrace=true to every page in order to show the debug. As a result, I’ve setup a basic Firefox extension to automate the task. A button is added to the status bar which reloads the current page with the debug showing underneath when you click on it.
Continue Reading

February 19, 2011#

Turning off the ezinfo “about” view

The ezinfo module provides useful information about your eZ Publish build. Unfortunately though, by default, it provides a public view for any user to view information about your eZ Publish version, and about any extensions you have installed (visit yoursite/ezinfo/about). Although as a developer this is useful it really is less than ideal that this information is available to all but luckily it is easy to turn off.
Continue Reading

January 8, 2011#

Selenium Case Study – Part Two: Selenium Remote Control

In the first part of this case study, I covered the usage of Selenium IDE for automating UI testing. The second part will introudce Selenium Remote Control (Selenium RC). Selenium RC allows for tests to be produced in a server side language and then run on browsers and operating systems of your choice. In this case study, the PHP implementation will be used (the PHP version uses the PHPUnit library).

We will start by exporting the tests created in Part One. These will be used to demonstrate the features of Selenium RC, such as the production of test suites and allowing you to use multiple systems/browsers for your testing. Following this I will show what else is possible using Selenium RC and limitations of the system.
Continue Reading

December 22, 2010#

Selenium Case Study – Part One: Selenium IDE

Selenium provides automated User Interface testing for web applications. There are two main ways of using it:

  • Selenium IDE – A firefox plugin that records your actions and allows you to play them back later. The actions are run through the javascript based Selenium Core which is the original version of the testing system. There as quite a few limitations in the JS based language such as a lack of any possible iterative or selection statements (although some things like this can be added through additional extensions, such as this one).
  • Selenium Remote Control – A client/server setup which allows you to programme the tests within server based languages to provide a greater level of functionality within your tests. It also allows you to test within particular browser/operating system combinations. For PHP, PHPUnit provides the functionality to allow you to effectively run Selenium tests.

In part one of this case study, I will demonstrate the functionality available within the IDE and the limitations of it. In Part two I will cover the basics of Selenium RC before exporting the tests created by Selenium IDE into PHP files for use with RC. I will then demonstrate how RC can be used to test Flash applications and also it’s usage within a couple of PHP Frameworks and Content Management Systems.
Continue Reading

November 8, 2010#

Using menu.ini for your tabs and menus

When writing admin based modules in your extensions, the menu.ini is essential for creating the tab you need to access your functionality. This functionality is easy to utilise. There are also a number of settings which make it appear straightforward to create your own .ini based left menu, unfortunately though this is not the case.

Continue Reading

August 17, 2010#

Creating Admin Templates in eZ Publish

Adding your own tabs and content to the CMS is essential for some extensions you build. This enables you to isolate functionality for authorised users and embed this functionality into the back office they are familiar with. This tutorial will cover the basics for creating CMS based views and modules which you can use as a base for your own extensions.
Continue Reading

July 25, 2010#

Extended Attribute Filters in eZ Publish

For a previous article I covered the various ways you can export user data using eZ Publish. In the article, I suggested how you can export all users who have logged in over the previous month using an extended attribute filter. In this article I will cover creating several different Extended Attribute Filters so you can see how they may be implemented in your code.

We’ll start by creating an extension to house our filters followed by building a basic filter to return a list of users who have forgotten their passwords. We will then create a filter to tell us how many/which users have logged in over the past month. We’ll also cover how you can add Extended Attribute Filters to both your template files and your PHP scripts.
Continue Reading