Malleable Musings

July 28, 2010

A digression

Filed under: PHP, RSS Feeds, simple hacks, Wordpress — Brendan @ 11:39 pm

I was invited in to a meeting at work a couple of weeks ago in which we were talking about blogging. After the meeting Stu threw a document up on Digress.It.

The document got a few mentions around the place and soon it started gathering a few comments (60 at the time of writing).

Digress.It is a really interesting platform however I think something went wrong with the comments.

I got a call of frustration from a member of the Marketing and Comms team earlier this week, who had been away on annual leave. She was amazed at how many really useful comments there had been. She’d seen some of them but wasn’t sure that she’d read them all of them and she certainly couldn’t do what she wanted which was to print off all of the comments alongside the original document.

I said I’d help and started by working out which RSS feeds were actually functioning (the comments by authors and the comments by numbered paragraph both seemed OK but the later certainly wasn’t displaying properly on Digress.It).

I realised early on that I was never going to manage to script a whole solution and it took a little while, until tonight, when I managed to clear enough time to complete this little digression. So I settled for a quick hack of an existing PHP script with some manual intervention.

What I did was to re-create the document in a Google Spreadsheet alongside the paragraph numbers (which are the keys for the RSS feeds of paragraph comments) and hacked the PHP script to include a request parameter. I also changed the end output slightly so it allowed me to pull down the comments and place them in to the cell next to the original text.

I know there must be a more elegant way of doing this but the document wasn’t that long whilst my time was short and my CSS and PHP skills and knowledge of ASCII/ANSI characters and regular expressions are all a little rusty.

From the spreadsheet it was a simple matter to copy and paste columns C&D in to a table in Word, run a couple of find and replaces, add some minor formatting and hey presto we have something more readable.

It was a nice little refresher for me as I’ve a feeling that I’m going to need to get reacquainted with regular expressions over the coming weeks.


December 6, 2009

Anti-social blogging

Filed under: Volleyball, Wordpress — Brendan @ 10:43 pm

Last weekend I did a WordPress installation. (I also finally got around to having a five minute play on Google Wave.)

Whilst doing this I was reminded that I’ve written before that tools are used differently by different people.  I was reminded of this because I didn’t start waving publicly and I had no intention of using WordPress conventionally as a blog.

Instead I’m thinking of using WordPress as a simple web back-end for a five web-page site for my volleyball club because:

  1. It can be updated easily from an iPhone which is important for updating scores from the game.  From this tweet it seems that I’m not the only person thinking in this way.
  2. I wanted to produce a better browsing experience for iPhone/smartphone users.  I could have done this by looking at writing some new CSS but it probably would have meant additional JQuery work whereas WordPress has a great WP-touch plugin that can just be turned on.  So I figured that it might just be simpler and better to move the site over to WordPress (as it also adds a great deal of flexibility e.g. the site could be easily updated by others within the club if need be).

The installation was extremely straightforward – as they claim it really is a five minute installation.  Although it was far from a five minute job to get the site up and running.  In fact although I’ve got something working well in a subfolder I’ve not replaced the current site yet.

I’ve spent a couple of hours on this little project over the course of a week (and have made a note of what I’ve done so far below for my own reference):

1) I dropped some content in to blog pages.

2) Find some way of displaying Google Maps on the blog. I tested a few different variants but settled on the Google Maps Plugin for WordPress primarily because it’s incredibly simple and allows relative scaling of the map.

3) I also needed the Exec-PHP plug-in as I use this to run a simple include lifting the league table from the Associations webpages and inserting it on the Results and Fixtures page.

4) Find a theme that I could easily modify.  I settled on Starscape.  To modify it I did the following (N.B. again I’ve listed these in full to remind myself of what I did):

  • Knock off some of the features that I didn’t want – e.g. date icons on posts, the links to home and RSS in the header, one of the sidebars and the footer.
  • Added a new favicon.
  • Moved the search below the sidebar
  • Centralised and reduced the size of the text in the header.
  • Created three PNG images for the header and footer – center and top and footer images (although I think I might need to re-look at these as I don’t think that they work in the way I’d like yet).
  • Modded a couple of the php files (Page Template – page.php) – e.g. changing words from things like “Published” to “Last updated” etc.

5) Installed and configured the WP-Touch plug-in.  This was actually far easier than modifying the theme.  All it really took was choosing what not to show, shortening the name of the site and uploading a couple of icons.  I did have a bit of difficulty with the home page redirection setting.  It claimed that there were too many redirects.  However simply changing this to the default WordPress setting made all of the difference.

This was the first time I’d played about with WordPress or looked properly at what it can do.  Having seen various  plug-ins and options I know I’ve not even scratched its surface yet.

My only difficulty so far has been finding option settings.  For example when installing the Google Maps Plugin the documentation said “install it in the plugin’s admin page under Options”.  This left me a little lost.  I couldn’t immediately see the admin page and spent some time searching around the php files before eventually realising the admin page can be found under Settings on WordPress rather than within the plugins section.

I still need to do a bit more testing before I send my little site live.  However having got this far I can see myself catching a bug and writing my own custom themes.