WordPress and Smarty

I was drafted in to help on WordPress a long time ago. Unfortunately I haven’t done much work on any OSS projects in a while and it was bothering me.
I did do some useful work though – I found out that the Smarty register_resource construct was buggy when using caching. That rules out using MySQL as a backend to hold templates. (I posted a mail to the Smarty list but nothing came of it. *shrug*)
Finally, after re-installing Linux on my new hard drive last weekend I Smartyised WP! Here’s a WIP snapshot.
What does it do? Well, I wrapped some of the Smarty template API (ie. bloginfo(), etc) in Smarty functions of the same names. I’ve only done enough to get the default template working, as it’s laborious work and I wanted to get something out quickly!
The template is split up into 3 parts: top.tpl, post.tpl and end.tpl. They live in users/main/templates/ and can be edited there with a text editor. The online editor from b2++ will make it’s way there eventually probably.

Before trying this, please be sure to backup your WP installation. The files in the tarball don’t conflict with the files in CVS but I can’t guarantee that this won’t delete all your WP install files if you’re not careful!

Download the WP – Smarty mod. (40Kb)

F 16

Wow! Amazing photo of an F16 at an air show in Poland.
At the Chicago Air and Water Show last August I went snap happy but never got anything near as good as this shot. He was lucky the fighter was banking just over his head (see the comments).
I tried in vain to snap 600mph jets as they passed a few hundred feet away but by the time I’d found them in the sky and zoomed back, in the plane was a few miles away..

Photo archiving

Bah! This summer I’ve had 2 drives die on me at home. The first was a drive I used for many years so it was no surprise it died. Unfortunately it died just after I came home from the USA in July. Thankfully I had backups from last November done, and was able to recover the photos from 2003 up to the end of June before the drive died permanently. The second drive was the one I brought back from the States so I’m not surprised it died after a plane journey.
I’ve backed up all my photographs twice now. There’s 2 CDR copies of each backup, just in case.
Now this article from The Register throws some doubt on this strategy. No premium brands were tested but cheaper CDRs become unusable after a few months. I can confirm that this does happen as quite a few CDs I burned in the past are now unusable.
I’d like to look at DVD burners now. It’ll be a lot easier to reburn 2-4 DVDs rather than 12-16 CDs every year. Liam on suggested the Pioneer 106 and I’ll look around, so if you’ve used a DVD burner with Linux I’d like to hear about it in the comments below.

That baseball game

After seeing some of the photos from last weekends games in the newspapers I’ve come to the conclusion it’s bloody difficult to get good shots at a game without a press-pass, and a big lense on a decent camera. That said, here’s my contribution to the sporting history of the Chicago White Sox:

Almost hit it!
almost hit it

When the ball is pitched, it travels of speeds between 80mph and 93mph! Even if they don’t have to run around as much as in other team sports, their reflexes have to be very sharp! They have stamina too. Sitting down, drinking beer, or munching on a sandwich for 2-3 hours is easy. Concentrating and running around is another matter!

Watching the game

White Sox fans will recognise these players. I haven’t a clue who they are, except for Lee, for obvious reasons! Lee went on later, and made a great catch on a high ball.

Did he make it?

See that ball in the air over his head? A low ball, delivered right into the hands of a White Sox player ensured this guy was out!

The End

Css, Printer Friendly Pages & Page Breaks

I’m working on a user list at work, and one requirement is a printer friendly version, listing one user per page. What I’ve done in the past is have the user click on a button to download a .doc file with End Of Page characters embedded in it. Word would oblige by skipping to a new page.
I decided for this application I wanted to go the CSS route to printing.
All the “Printer Friendly Pages with CSS” tutorials were useless when it came to inserting page breaks, but after a bit of searching on Google (mainly because I didn’t use the term ‘page break’) but I eventually came across this thread on devshed.

#break
{
PAGE-BREAK-AFTER: always;
}
…..
<P ID=”break”>some content</P>

This will print a page break after the text some content!
Now I have a really nice web based list of users, and hitting print on the browser produces a neat pile of pages, one user per page.
I also found a bug in Mozilla Firebird! While in “Print Preview” mode, refresh the page using ctrl-r. It’ll bring up the original page but will keep the browser in the preview mode! Yes, I’ll take a look in Bugzilla for it tomorrow. I’m off home now!

C64 people and the good ol' days..

I’m stuck in work late, yet again, and plouging through a long list of things when I get an email titled, ‘remember me?’ from Andrew Fisher. Andrew was a member of the c64 demo group ‘Ozone’ that I formed with Ciaran Langford many a year ago.
I haven’t heard from Andrew in a long time so I took the opportunity to call him and we had a great chat catching up, and reminising about the ‘good ol’ days’ 🙂
Prompted by a visit to his homepage I searched for mention of the demo I worked on for Ozone and found it nestled away in a C64 demo archive. Thanks Andrew for submitting it there!

Sammy Sosa, Baseball & corked bats

At the start of June Sammy Sosa, Chicago Cubs’ star player broke his bat during a game. Cork was discovered inside the bat, lending him an unfair advantage while hitting. I was there with Martina, and although I didn’t realise the full extent and implications of what was happening, I snapped a few photos. It made headline news for about 2 weeks afterwards! You can find more about this via Google.


Referees and inspectors walk off the field. You can clearly see the bat Sammy used, and there’s a slight shadow in the middle. Is that where the cork was?


The bat was inspected at the side of the field. Shortly after they walked off and the game continued.


But not before members of the Cubs and one of their officials had a good talk..


As the game restarted, the Cubs pitched..

Our Family Cat, Puss

You know, we never named our cat. I like to think it’s because cats are always half wild and you’re never sure what they’ll do. That’s certainly true for Puss. One moment you’re rubbing her soft fur, or scratching behind her ear, she’s purring and you’re relaxed. The next moment she has her claws into your wrist and her jaws are going for the flesh between your thumb and first finger.. ah.
Come to think of it, that pain doesn’t compare to the time she got caught up a tree in a gale. Yours truely had to go up fetch her down. As I dropped her down to my brother on the ground she did not want to let go of my hand at all!
She was a damn lucky cat too. While holidaying with my aunt, my brother and sister found her in Co. Cork up the side of mountain trail. She was meowing and thin and looking for food. For some reason they took her the many miles home to Cork. In the late Summer of 1989 we didn’t have a pet, never had one, and weren’t going to have one. However despite that, it was clear from the start that she adopted us.
“I want food!” “Give me attention!” “Go away, I’m tired!”
Such is the life of a cat.
Did I say she was lucky? She’s had her scrapes. On St. Stephen’s Day (Boxing Day) 1990 she jumped out of her box late at night. Unfortunately there was a fishing hook hanging down from the shelf above. She got caught in it and raced up the garden in great pain. When I heard the commotion, the meowing and the crying, I raced outside in pijamas, picked her up and cradled her as I took her indoors. The hook had lodged in her belly and her paw had stuck in the briars at the other end of the hook. I cradled her for what seemed like ages while my father rang a vet. I’m not sure at this stage did he call out to us, or did we call to his surgery, but he sorted her out. We continued to bring both Spring and Puss to the same vet for the last 14 years.
I rang home last Saturday to hear bad news. Unfortunately, Puss hadn’t been too well of late, she wasn’t eating, and was very lethargic. When I left for Chicago I guessed there might not be too much time left for her. I was right.
She was put to sleep last Wednesday. It must have been very hard on my father and brother to bring her to the vet, but it was the only humane thing to do.
Cats are known to be solitary creatures, they like their own company and shy away from human contact. Maybe that’s true in the wild, but I wouldn’t believe it for a moment when it comes to domesticated cats. Puss was part of the family, as was Spring.