Code Hacks: WordPress WP-Filebase Pro

I updated my WordPress installations to 3.7 “Basie” this weekend and found that the file download stopped working for all users except admins. The files affected are those for which permissions are required (Subscriber and above).

I made a workaround to get it working for my physics teachers resource site at In classes/Item.php, within function CurUserCanAccess($for_tpl=false, $user = null), above the loop that checks user roles, you have to populate the roles array by calling get_role_caps(), thus:

if(empty($frs)) return true; // item is for everyone!
foreach($user->roles as $ur) { // check user roles against item roles
 if(in_array($ur, $frs))
 return true;

It looks like it’s working for now. I’ve posted the fix to the Plugin support forum.

Mavericks OSX 10.9 Update php fix

I updated to OSX 10.9 Mavericks this week, and as with all updates, it broke PHP. I run a local MAMP server for development purposes and it all works OK except that you have to re-enable PHP in the apache configuration file. I found a useful guide over at which included these steps:

Open a terminal window and edit the httpd.conf file:

sudo nano /etc/apache2/httpd.conf

Uncomment this line:

LoadModule php5_module libexec/apache2/

Write out and save the file, then restart apache:

sudo apachectl restart

… and Robert’s your Mother’s Brother.


f2Jon Baird’s film of Irvine Welsh’s book, Filth, has to stand head and shoulders above almost all of the other movies I have seen in the past ten years, and certainly outclasses every one of those that was spat out by the regressive Hollywood machine. This movie is so different from those that it almost warrants a class of its own. If other films join it, they will undoubtedly be made in Scotland.

The story is set in the beautiful city of Edinburgh, and begins in a vein somewhere between Ashes to Ashes and Chewin’ the fat, with plenty of proper Scots comedy, banter and swearing, as we see the central figure, Bruce Robertson (James McAvoy), vie for promotion using every desperate measure he can think of. His misogyny is developed through the film as we see him struggle with the battle for promotion, a cocaine habit and something deeper. I’ll not spoil the plot for you but be prepared for a significant shift in how you think about and empathise with  Bruce Robertson, as McAvoy puts in the performance of his life in crafting the twisting evolution of the character on the screen before your eyes.

Be prepared also for some stunning visual comedy throughout the film, from the police party photocopy-your-penis contest to the expanding head of Roberston’s shrink, played brilliantly by Jim Broadbent in a burlesque on the Clockwork Orange side of Cabaret. Watch out for Eddie Marsan’s outstanding portrayal of Robertson’s Masonic brother and victim Bladesey and a musical cameo from David Soul.

This is a stunning, stunning quality film, bound for cult status. Don’t miss it.

Scottish Learning Festival ’13, Day 2

I was lucky enough to be able to attend both days of the SLF this year. The focus on the second day for me was very much that of professional development for teachers.

gridThis began with a little reflection on the variability in the quality of CPD accessed by teachers. In my experience, this has ranged in two dimensions from very good to very bad and from relevant to irrelevant. I was thinking in particular of Wednesday night’s teachmeet, which, like all teachmeets I’ve attended, contained a range of talks and professional development which I would plot somewhere mid-to-right-of-centre on our grid, ranging between ±70% of the relevancy scale. The plot shown here is meant to be representative, not a specific critique of any presentation or session.

Professor Petra Wend, Chair of the NIB

Petra Wend chaired a round table session with some of her colleagues on the National Implementation Board providing short stimulus talks: Graeme Logan, Susan Quinn and Glenn Rodger. Delegates, aided by table facilitators, debated several questions around the challenges faced by the NIB and came up with a number of key questions which expressed the consensus of the principal concerns of those present. The output of the round table will be published at the Teaching Scotland’s Future website. Whilst you’re clicking around, take a look some of these other places, too: firstly, the Aspiring Teachers site which includes a check of literacy and numeracy for those thinking about a career in teaching in Scotland. Are you up to the minimum standard to teach here?

Second, the Framework for Educational Leadership is of direct relevance to you as a teacher, even if you think that “leadership” is something that ambitious, unprincipled putative deputes are desperate to shove up your nose. We are all leaders of learning and the opportunities provided by CfE to break out of the silos that have traditionally bunkered our creativity are going to be realised when all teachers take on the mantle of true educational leadership in order to bring the best of opportunities to their students. Look out for the development and sharing of good examples, called for by delegates at the round table today. Get ready for the Scottish College for Educational Leadership, coming very soon. There’s a heads-up on Margery McMahon’s blog (I was at Margery’s table today).

Finally, is the GTCS Practitioner enquiry resource which will give you a heads up on the new expectations for all teachers to evaluate methods, ditching those that don’t work and replacing them with those that do, based upon evidence from action research in their own classrooms.

The last session I attended at the SLF this year was a good example of practitioner enquiry and professional update: Caroline Bayne and Pauline Gilhooley gave a fascinating presentation of Edinburgh’s model for professional development course called, “Enhancing Classroom Practice”, which follows a well-established model rooted in masters-level reading, critical thinking, practitioner enquiry and reflection. Broadly the model follows these steps in three phases of the course, which will not be unfamiliar to those who undertook the Chartered Teacher programme:

  • Literature review
  • Critical reading
  • Research methods
  • Changes to practice
  • Measurement of impact
  • Evaluation

Although the Edinburgh course does not as yet attract accreditation, it looks like it might be possible in the right partnership with a local university and I am sure that dialogue along these lines will have taken place.

I’ll wrap up my report of the second day of the SLF with a (remembered) quote, shared by Professor Wend in the round table this morning:

research shows that having better qualified teachers results in better learning experiences

Personally, I would rather this was stated as “better educated” teachers, but the point is well made. If you know what you’re doing, then what you do, you do better.

Scottish Learning Festival ’13, Day 1

sparseThe Scottish Learning Festival this year looks at first sight to be less than it once was. The exhibition space is significantly reduced and the footprint of the event on the SECC seems similarly diminished. Indeed, when I arrived at my usual time of a little before 8 to catch up with the “usual crowd”, they and the coffee culture bars were conspicuous in their absence.

Eventually, however, the buzz of teachers revelling in a day’s respite from the pressures of CfE, assessment, reporting, The Management, development and the NAR, soon filled the corridors of the venue. Estimates of four thousand delegates or more for this year seem optimistic but the registration desks were busy with people grabbing the opportunity to attend some of the many seminars and events running this year.

FeorleanBy the time I was shuffling into the Lomond for the Minister’s keynote, I had pressed the flesh with a good number of “the usual suspects” and was feeling good about coming through to the wild west for the day. The keynote itself was what it always is with Mike Russell – a stunning display of eloquent fast thinking, masterly deflection and a little more party political dogma than the delegates were comfortable with or entitled to. The presentation of the inaugural Robert Owen award seemed a little weird, with so many incredibly innovative educators in Scotland, as it was awarded to a fully-deserving-but-never-heard-of-in-Scotland educator from overseas who happened to be speaking at the conference this year. Doug Belshaw expressed the zeitgeist well.

It’s often a bit of a gamble when picking seminars to attend and I have once or twice been disappointed in the past. This year was no exception as the first session I attended was pitched as, “Science Challenges to Inspire and Motivate”. I forgave myself for thinking that this was going to be innovative and new. It wasn’t. It was no more than a badly-delivered sales pitch from an independent sector head of Chemistry who has set himself up a wee business on the side selling ideas remarkably similar to those found in other places, including the courses I teach at Edinburgh University.

In contrast, the afternoon session I attended on Developing early number concepts, delivered by Craig Lowther and Mandy Milton from Moray, was a high-quality and pragmatic session which itself used exemplary andragogy. This team shared some really rich ideas for developing number concepts in young children, including some highly effective and dirt-cheap resources, backed up by evidence of its efficacy and clear strategies for supporting teachers and parents. This was one of the best sessions I have seen in the past 6 years at the SLF.

CLA_20bigcolour72dpiAlthough the rest of the day was busy with meetings, touring the small exhibition, chatting to exhibitors and other delegates, the evening teachmeet event at the SQA was the butter icing in the cake of the day. The event was recorded and will be available to listen to over at There was the usual eclectic but nevertheless interesting mix of talks and round tables. I joined in with Frank Crawford‘s session on what makes a great teacher and really enjoyed the debate as we tried to identify what we, as educators, thought made a great one.

A number of us finished the day in a bar, eating and drinking, courtesy of the teachmeet sponsors CLA (thank you), who not only facilitated the event itself, but also contributed to the “common weal” by delivering a short talk on copyright and schools.

So, I’m sitting in the Key West cafe at the SECC as the place wakes up, having demanded coffee, pastries and a place to write well before opening time. I’ve been accommodated with all of these and the cheery people-centric demeanour of the staff here that is the characteristic of this curate’s egg of a country. For all that it’s a work in progress, I still believe that it offers the best place to work in education, in the world.

Code hacks: Internet Explorer Compatibility mode

guess-browserI’ve been developing a site for a national competition to be launched in October and ran into a little difficulty with Internet Explorer. Despite this browser losing ground amongst even the unthinking default user community, it is still sufficiently popular that I needed to look at the problem.

The site is running WordPress on a LAMP server using Konstantin Kovshenin‘s Expound theme. One of the testers noticed the letters “Ski” next to the Home menu item. Mousing over it produces a fleeting grey box to appear top left of the browser window. This turned out to be only visible in IE8, IE9 and IE 10 in “compatibility mode”, a feature of IE that allows the browser to render sites that are broken by IE’s shockingly poor implementation of standards, using a model from an earlier version. It’s what a code monkey might call a Kludge.

SkiThe “Ski” is in fact, the first few letters of “Skip to content”. It is one of several features of the site’s theme implementation which are broken in IE’s compatibility mode.

There are several suggestions in the forums designed to force IE into non-compatibility mode and render the site properly. Most rely on delivering a <Doctype> tag on the very first line, followed immediately by a X-UA-Compatible meta tag. Unless this tag is placed on the line immediately after the Doctype tag, IE ignores it.

I considered trying to knock up a plugin to make this work in some kind of customisable way. Editing the theme’s header.php file seemed doomed to be overwritten on the next update, and branching a child theme felt like too much hard work for such a small fix to accommodate a browser that I personally would like everyone to stop using. Part of me wants all sites to look broken when viewed with IE so as to encourage the masses to make an intelligent choice for once. Let’s not start talking about democracy.

Anyway, a little more digging found a really elegant solution which suited my particular needs from Reza Qorbani, which is to use the .htaccess file to have the Apache server sniff the browser and send the metatag. This is what I finished up with:

BrowserMatch MSIE best-standards-support
Header set X-UA-Compatible IE=edge env=best-standards-support

It works a treat. Thanks, Reza!

This is a text


“… a text is the medium through which ideas, experiences, opinions and information can be communicated.”

So runs the CfE definition of a text. Therefore, this is a physics text. In the hands of a competent physics teacher, this image, of the first electric chair, tells the story of the current wars in which Westinghouse and Tesla fought Edison over which type of current would deliver energy from the generation plant to consumers: AC or DC. Edison secretly paid Harold P Brown to design and build the electric chair, to show the lethality of alternating current. He promoted the phrase, to be “Westinghoused” to mean executed by electrocution. In the event, the first electrocution failed to kill the prisoner, William Kemmler, due to a miscalculation. Westinghouse remarked that they would have done better using an axe.

With the right text, sufficient knowledge and passion, the competent teacher can bring even the dullest curriculum alive. Consider National 4 Physics Key Area: “Advantages and disadvantages of different methods of electricity generation and distribution.”

Pro Git and more MX DNS

Continuing the summer of code into the early autumn, I have been developing, enhancing and debugging the new server. New and migrated sites are stable and responding well within the resource limits I’ve chosen of 10GB disk, 50GB traffic (although we’re close to whacking this one) and 256/512 MB RAM/Swap space. Uptime has been 100% for over 60 days now.

Within the suite of services running on the server are database, web server, CGI, mail, stats and monitoring. What is not, is the DNS service, which I have learned to keep in a different place, with the registrar. Setting up reverse DNS for the mail service to work correctly is important: I discovered that one client had been having difficulties receiving mail from just one of his friends. This was because the MX DNS entry for his domain pointed to an IP address which some service providers will reject as it doesn’t comply with the RFC. Changing it to the host domain of the server’s IP, however, stopped all mail getting through to the client. This was finally resolved by pointing the MX record for the domain to the domain itself: A
@            MX 10

If you want to know how the Internet works, by the way, a really good place to start is the Internet Engineering Task Force (IETF). They have a good introduction here. Many internet standards are defined in RFC documents.

Other services on the server operate as database-driven php suites such as the WordPress CMS, Moodle, LimeSurvey or phpBB. All of these are subject to modifications, code hacks and tweaks to make them work to the needs of the site owner. Whilst the Parallels Plesk Panel allows install-at-a-click for many application suites, I prefer to manage the installation and customisation of these myself. Until now, I had used the download-unzip-upload over FTP method but I’m going to try using the more elegant command-line facility offered by Git. I’m getting started by using their excellent online documentation. This should allow me a much faster update route and potentially a way to be a better contributor to open source than the consumer I have been.

AudioBoo for Education

audioboo-t_7I’ve been a user of AudioBoo for some time now, and have recorded a few dozen commentaries, some of which have been listened to thousands of times. I find it an excellent tool for easy podcasting and most of my broadcasts are automatically cross-posted to iTunes and I’m pleased to find that audioBoo have launched this week a facility for educators who might consider the power of audio for their learners. From the announcement:

…we’re delighted to announce the launch of Audioboo for Education: a new initiative to help students and educators to enrich the learning experience and encourage conversation and debate through the power of audio.

Apart from ideas and examples of how audioBoo can be used to support and enhance learning, there’s also an intelligent and useful app for Edmodo, the VLE of choice for many teachers.

New channels of engagement are essential to the flipped classroom and the enabling of access to education on the learner’s terms, which is something that if you’re an educator and not driving it, then it will soon be driving you. Why not try it? It’s free, it’s easy and it offers leverage to your impact on learners: if you want an example, my most recent public talk has reached hundreds more through the podcast than it did in the flesh, so to speak.

The Heat Death of the Universe

This is a recording of a public talk I gave this afternoon at the Embassy Gallery in Minto house, Edinburgh, as part of an installation by the artist Joseph Buckley titled, “One Third of a Series of Elegies : III, VII, XII, XIII, XV & XVIII : An Eternal September”


You can download a transcript here.