I’m working on a little PHP script to allow for variables and inheritance in CSS. I know there’s a ruby script that does this somewhere, but I fancy seeing if we can’t get a pure PHP version up & running between us. If you’re somebody that writes their own CSS and are willing to have a play with it to see what problems occur then I’d really appreciate it. If you want to tighten up my regular expressions a bit as well then it probably won’t go amiss, as I’ve only spent 5 minutes on them so far ;)
It’s fairly straightforward, and at the moment just runs some simple find & replace on a stylesheet, nothing too fancy, and it seems to hold it’s own on my dev server, but I’d be interested to see if it works in the hands of others. I don’t have much spare time but will be adding attribute inheritance next – which could be very cool.
you can grab the PHP here, and implement it by saving it as PCSS.php (or whatever you choose) and then linking to your stylesheet as follows:
In case that isn’t clear – instead of linking to your stylesheet within the <head> tag, you link to my PHP file and then tag a ‘?’ and the filename of your stylesheet onto the end.
once running you can declare variables in your stylesheet ‘thusly’, ensuring each begins with a $ and ends with a line-break:
Continuing my foray into the video blog world, I pretend to invent a whole new genre. I didn’t really. Technically I think it was invented by Bob Dylan but who can really tell?
Pointless video really as a precursor to more pointless stuff, probably.
I’ve been meaning to get on these for a while now. I intend to cover some real basic PHP introduction stuff, maybe some dev app guides and so on. Obviously, the common WordPress hacks that people ask me to do.
For now though here’s me just saying ‘hello’ and introducing you to my hamster, Joe Namath.
I’ve had an ongoing relationship with Tim Matcham for a while now, having done a little maintenance here and there on The Garden Network over the past year. Tim approached me with a view to giving his site a bit of an overhaul, and wanted to incorporate his wordpress hosted blog at the same time.
With limitations imposed by his current hosting provider, Tim decided to move to my servers and asked me to organise the migration of his site and blog and to sugest possible ideas for a ‘freshen up’. After a brief discussion, we decided that the best course of action would be to hack around an existing theme to get it to look and function in the way we wanted. This gave a site that reflected Tim’s branding, but with minimal development costs.
The Geek Stuff
The site has been built using WordPress as a content management system (CMS), and uses a modified version of the Cutline WordPress Theme and various pre-built plugins including WP-sIFR. The WP export tool made bringing across all the blog posts, pages and comments an absolute breeze, until a bunch of folks decided to add more comments before I had a chance to go live. This meant trying to grab just a handful of comments from a sprawling XML file to import. Quite a pain – it would be nice to see some functionality added to the export tool in WP that allowed limitation my date or post type. All or Nothing can prove quite problematic at times. Still, we get by…
The purpose of this site was simple, to provide an upcoming gig listing, a contact form, an MP3 player and links to the various social networking sites that the band are involved in. Expandability was key, with future plans to incorporate photo galleries and online sales to be kept in mind.
After stripping the content down to its bare essentials, I decided that anything other than a single page would be unnecessary. A sense of ‘web-site’ rather than ‘web-page’ was created by spreading the content across a large area and using an up/down auto-scrolling navigation.
The Flavours needed a site to reflect their DIY eithic, but one that also captured their individuality and irreverent sense of fun. The minimal use of colour and the use of ‘courier’ and hand-drawn fonts kept the site ‘lo-fi’, and the strong areas of black/white contrast create a striking visual effect, especially when flying past the screen on the auto-scroll.
The Geek Stuff
Site management needed to be kept as simple as possible for the guys, so the ‘random player’ (hats off to premiumbeat for the OS love) is based on a PHP script that picks a random mp3 file that has been uploaded into a perticular directory on the server, and then grabs all the other info necessary from the metatags of the file.
The gig guide reads from a spreadsheet uploaded to the same directory, and automatically wipes any listings that are in the past.
Obviously a big helping of JQuery and associated plugins, the detail of which I’ll go into at a later point.