Separating Presswork Theme Customizations

Wooden Fence and Leaves by Barb Ballard (scidmail) on Stock.xchng

One of the fundamental problems with tweaking a theme is that, when it is inevitably updated, the new files will undo your changes.  Typically, when I update a theme, I need to remember to (a) add back in my Google Analytics code, (b) add back in my meta tags for Google and Bing Webmaster tools, and (c) fix anything else that has been overwritten.

I liked the Arras theme for its separation of CSS.  When I selected Presswork, I started adding in my CSS changes to the global style sheet.  I also started tweaking the actions.php file to enable the theme to do a couple of small things that I wanted.  This is not optimal because it means I have to document my changes so that, in event of an update, I can re-insert them.

It was useful to read this post about NOT hacking the actions file and, instead, create a custom CSS and custom actions file that Presswork will incorporate.  The CSS was a no-brainer, so I dragged my style customizations over into a file called custom.css, placed it in the /wp-content/uploads folder, and Presswork immediately adopted the styles.  When I forced my site’s cache to empty and do a refresh in my browser, the site looked exactly the same despite the global style sheet lacking my original changes.  They had all been added from my custom file.

The custom-actions.php file was not as simple for me to get working.  This is largely because I’m usually operating just on the edge of my known universe.  It took me a while to parse what the examples meant.

You create the custom-actions.php file and drop it in the same /wp-content/uploads folder.  The file needs to start with a <?php and end with a ?>.  You can then add your own actions into this file.  What I wanted to do was to customize actions (functions) that they had in the original actions.php file.  I copied and pasted the pw_posts and pw_single_post functions (essentially everything between the function line that starts off the function and the next large comment line (look for the pound or hash # characters).

No problem.  Saved the file.  Gave it the correct permissions and ownership on the server and refreshed the site.  Bonk.  Something was wrong in the file, and my site would no longer respond.

The trained eye (developer) will not have made this error.  Since I was using the original functions, I needed to include a remove_action call before each of the function to disable the original function, pick up the new one, and then activate it.  [For all I know, I have this wrong, but it worked, so I’m going to stick with it for now].  At the bottom of each of the two functions were a number (5 and 2, respectively) of add_action() lines.  I copied and pasted those from the bottom of the function to the line above the function, changed them to remove_action(), and then edited the name of the function.  For example, I started with:

<?php

function pw_posts() {

and, after cutting and pasting and changing the necessary lines, I had

<?php
remove_action(‘pw_archive_post_middle’, ‘pw_posts’);
remove_action(‘pw_author_post_middle’, ‘pw_posts’);
remove_action(‘pw_category_post_middle’, ‘pw_posts’);
remove_action(‘pw_search_post_middle’, ‘pw_posts’);
remove_action(‘pw_index_post_middle’, ‘pw_posts’);

function custom_pw_posts() {

 Then I went back to the bottom of the function, and edited the original add_action line so that, instead of using pw_posts, it used my new custom function, custom_pw_posts.  I know, this probably seems obvious to anyone with half a wit who read the original Presswork blog post so perhaps I need some reading glasses or need to spend more time on the site.

I repeated it for the pw_single_post function, saved the file, reloaded my site, and I was in tall cotton.  To make sure that it had worked, I reinstalled the original Presswork files, and my tweaks were still working.

This is a great way to balance the benefit of a nicely designed, free WordPress theme with the inevitable interest that sites have in customizing the theme.  By separating out the cascading style sheet and actions.php files so that customizations are not lost between upgrades, it means that maintaining and personalizing a site that relies on Presswork becomes that much easier.  Yet another positive for using this great theme.

Conference Planning with Google Docs

Using Google Docs drawing application to manage program selection for conference planning

Planning is under way for the 2012 Canadian Association of Law Libraries annual meeting.  We’ll be meeting in Toronto in May and I’ve been working with some colleagues on the program planning.  Our planning has started to take on a decidedly Google flavor over time.

We started with a Google Sites wiki as a place to store ideas – a list of potential speakers, program ideas that started to bubble up, etc. – and that eventually grew to be a wiki for the entire conference planning committee.  When it came time to seek program submissions from the membership, we used a Google spreadsheet and form to gather that information.  The form was built using the wizard within Google Docs, so the form created the spreadsheet, rather than the other way around.

The online form was pretty nice.  It is limited in features – we couldn’t have active hyperlinks to past conferences or to our list of possible ideas, suggested by attendees at the prior conference – but was easy to use and fast.  We collected over 30 program ideas and, at the cut off date, were able to disable the form and switch over to the spreadsheet.

This is the weakest of the tools, as far as I’m concerned.  The spreadsheet cells sometimes held large chunks of text as the submitter added the description of what the program would cover.  Google Docs doesn’t allow you to scroll easily between cells, so if a cell extends off the page, you can’t see the bottom of it.  I thought about resizing the spreadsheet horizontally but in the end decided not to use the native spreadsheet.  Instead, I downloaded the data in Excel format, then created a Microsoft Word mail merge document that pulled in all of the information so that each program appeared on a separate page.  This was easier for me, and meant that there was something pretty easy to read when distributing it to the committee.

The selection process was a challenge, logistically.  Our committee is dispersed across Canada and I wanted to come up with a way to move through through the program selection efficiently but we would have to rely on phone and Web.  Personally, I struggled with how to visualize what my own preferences for programs would be, as the committee built consensus on final selections.  I ran across a post talking about the drawing application within Google Docs, and this turned out to be the solution for my problem.

Google Docs has a drawing function that I had never used, assuming it was a bit like a paint or image manipulation program.  The post I read talked about using it for mind mapping, though, and also discussed the collaborative aspects because it was within Docs.  I ended up popping open the drawing and creating a new one.

It was ideal.  I created a small rectangle for each program, coloring it as I went to flag whether I thought it applied to a particular law library environment (firm, government, etc.) or had other features that needed to be considered.  Then I dropped in rectangles for the program slots that needed to be filled.  With all of this in place, I selected all of the program rectangles and selected send to front so that they would sit on top of the program slot rectangles, all of which were black.

Using Google Docs drawing application to manage program selection for conference planning
Using Google Docs drawing application to manage program selection for conference planning

Now I could just slide the programs around and drop them in or out as I started to build out my personal grid.  In the end, this worked so well for me that I suggested it to the committee and we used it as a group.  Because you can share Google Docs with others, I shared this file and any of the committee members could move elements (program rectangles) around as well.  Even though we were spread around the country, we could do this in real-time over the Web.

Mostly.  A couple of our members had Microsoft Internet Explorer and some versions don’t support interactivity on Google Docs without installing the Google Chrome Frame application.  It is free but law libraries are often in business, firms, governments, and corporations that inhibit downloading of any additional software.  The other choice, installing Google Chrome, suffers from the same issue.  I installed it for IE8 on my machine and it fixed the problem, although I tend to use Chrome anyway.

The overall effort was successful, in that we were able to work through our list and complete our program grid in an hour.  Everyone was able to contribute verbally over the phone and we could share the visual over the Web.

 

Book Review: Practical Lock Picking

Locks by clarita on Morguefile.com

The whole concept of locksport or the competitive, hobby activity of picking locks was totally unfamiliar to me until I read Robert Vamosi’s book – When Gadgets Betray Us – that discussed gadgets and technology and its vulnerabilities.  It mentioned Deviant Ollam and included a lengthy discussion of the vulnerability of locks.  After reading about Ollam, I decided to see what was available as an introduction to lock picking.

Mr. Ollam has a how-to guide on lock picking called Practical Lock Picking:  a Physical Penetration Tester’s Training Guide.  As the title states, the emphasis is on the practical side.  This book is ideal for the novice locksport, for the curious, but also for those who are involved in physical security.  The text is informal and easy to understand.  I was a bit wary when approaching the subject but there are so many diagrams and designs that it was not long before I had the difference between driver and key pins completely clear in my head.

The interesting thing to me was how useful the information is from a personal privacy standpoint.  I finished the initial chapters that talked about key bitting and how the depth of the key notches are sometimes written on your key with a number.  I pulled out my house key and there was a 5 digit number, which makes it easy for a locksmith to replace my key.  Or someone else to figure out how each digit corresponds to a pin in the lock and speed access to picking it!

That is what I liked about this text.  By the end, I understood much more about what my keys and locks represented as well as the things I should look for in purchasing locks for my house or business.

I thought of Simon Singh’s The Code Book as I read Ollam’s lock picking information.  The books themselves are completely different in tone and scope but both deal with the explanation of a security measure and then the development of a countermeasure.  That countermeasure is then itself countered, and so on.  Ollam walks you through the basics of lock picking, the developments by lock makers of key channels that inhibit picking, of specialty key and driver pins to inhibit picking, and then techniques the locksport community have developed for getting around those improvements.

This is an interesting book in many ways, and whether you are thinking about locksport or just curious about those things that protect your house and office, it is worth reading.

Ubuntu Wi-Fi Haters

Bubble Pattern by darrenhester at Morguefile.com

Ubuntu 11.10 is the latest version of that Linux based operating system to adorn my Dell Mini 9.  We started with 8.04 and have been through fits and twists sometimes to get drivers working, etc. but it is now as reliable and more enjoyable an operating system to work in than my Windows 7 environment.  Both are on the Dell Mini, so I can dual boot into either.  Twice now I have had to boot into Windows 7 in order to get onto wireless.  Not because Ubuntu’s wireless isn’t working, but because it could not complete the connection properly.

I first ran into this at the Toronto Public Library, where they use a local provider to enable wireless and they have a terms and conditions page.  Ubuntu will find the wireless network but this Web page requiring your acknowledgement will not be sent to an Ubuntu machine.  If I reboot and connect on Windows, no problem.  A call to the service provider confirmed that Linux wasn’t supported.

A conference I attended recently had the same issue.  In this case, Ubuntu saw the network but, when it connected, it prompted for a password.  Problem was, this was not a secured network.  This was confirmed when, rebooting into Windows 7, the connection was immediately picked up and completed.

This may be a setting I can change in Ubuntu to have it treat some networks in a particular way but I was surprised to find that there were instances that one operating system couldn’t connect to wireless.  This is especially true when both of these wireless networks were intended for broad general use.