Update to Studiowhiz.com

Filed Under (Code, News & Events) by Mr K on 31-03-2008

Well, it looks like Wordpress 2.5 is out. I’ll be looking to update around here, however I have to make sure things keep working ey! This is why there haven’t been too many posts just now. Trying to sort out a few things before we look to update.

Microformats - Simple data formats for the masses

Filed Under (Code, Darren131) by darren131 on 25-02-2008

Tagged Under : , , ,

A Short Primer

You have probably already heard about Microformats. You’ve probably also wondered what they are. So let me tell you: microformats are set a of predefined attributes that you add to already existing markup. These enable both humans and machines to easily access the data they hold. Simply, they are small semantic tweaks to your web pages’ HTML/XHTML that make available previously inaccessible information. This information can include:

  • Contact information
  • Event information
  • Resume information
  • Reviews
  • Bookmark information
  • Syndication information

The beauty of microformats is that they don’t affect how your web pages are rendered by a browser. They are built upon already existing standards that you know and love: the class, rel and rev attributes.

An Example

This is a review taken from a popular online store.

A review from a popular online store

This is how the code looks:

<div>
<p>
 <img src="/img/5-stars.png" alt="5 star rating"/>

 <strong>this book will change your life</strong>, January 3, 2007</p>
 <p>Reviewer: <a href="some-link">kristen</a> (San Francisco, CA) -
 <a href="some-link">See all my reviews</a>

</p>
<p>If you build web sites (or intend to have one built for you), and you
 haven't read this book, then stop what you are doing and buy it. When
 it arrives, stop what you are doing, and read it. It is awesome, and
 funny (believe it or not) and you will be happy that you did.</p>
</div>

Now consider the following code:

<div class="hreview">
 <p>

  <img src="/img/5-stars.png" alt="5 star rating" title="5" class="rating" />
  <strong class="summary">this book will change your life</strong>,
  <abbr class="dtreviewed" title="20070103T1146">January 3, 2007</abbr></p>

  <p>Reviewer: <a href="some-link" class="reviewer vcard"><span class="fn">kristen</span></a> (San Francisco, CA) -
  <a href="some-link">See all my reviews</a>

 </p>
 <span class="type" style="dispay:none;">product</span>
 <div class="item" style="display: none;">

  <a class="fn url" href="http://www.amazon.com/Designing-Web-Standards-Jeffrey-Zeldman/dp/0321385551/sr=8-1/qid=1171921047/ref=pd_bbs_sr_1/102-6812629-1991344?ie=UTF8&s=books">Designing with Webstandards</a>
 </div>
 <p class="description">If you build web sites (or intend to have one built for you),
 and you haven’t read this book, then stop what you are doing and buy it. When it
 arrives, stop what you are doing, and read it. It is awesome, and funny (believe
 it or not) and you will be happy that you did.</p>

</div>

Not that much different - just a few extra class attributes (in bold) and a new HTML element here and there. That is what makes Microformats so cool - you don’t need to learn any new markup language - it’s all the same stuff you work with everyday!

How is this useful?

Having all this information available in a format that can easily be gathered is the key to Microformats. Not only can third party web applications easily access this data, but desktop applications can store it, too.

Imagine a world where you visit a web site and your browser tells you there is contact/event information available on that page and gives you the option to save the date to your address book/calendar application of choice.

Imagine a world with search engines that return resumes, reviews or events from millions of web sites. All this can be achieved by using Microformats.

Currently there are few smart applications and bits of software that can deal with Microformats:

  • Finda
    All finda’s company listings are marked up using hCard so you can simply save their vCard to your address book
  • .Mac Webmail
    The .Mac Webmail service now supports hcard
  • Microformats Extensions for Dreamweaver
    Dreamweaver Microformats Extensions (download) support authoring hCard, hCalendar, XFN, rel-tag, rel-license
  • Firefox Extensions
    Operator - provides an architecture for Microformat parsing which is likely to be incorporated into the core of future versions of Firefox.

    Tails - The Tails Firefox Extension allows you to view microformats embedded on a web page, and perform customizable actions on the microformats via Tails Scripts.

  • hKit Microformats Toolkit for PHP5
    A php toolkit to extract common Microformats from a page
  • Technorati Contacts Feed Service
    Technorati Contacts Feed Service is a deployment of X2V to convert hCards to vCard (.vcf) format.
  • Technorati Events Feed Service
    Technorati Events Feed Service is a deployment of X2V to convert hCalendar events to iCalendar (.ics) format.
  • Technorati Microformats Search
    Technorati Microformats Search. Search for contacts (hCard), events (hCalendar), or reviews (hReview) published on blogs and other web sites.
  • Upcoming.org
    Upcoming.org - hCalendar support in events listings and individual events.
  • X2V

    Brian Suda has created several XSLT files to extract microformats from HTML. From that the X2V webservice/favelet emerged. The XSLT and favelet extracts hCard and to produces .vcf (vCard) files and hCalendar to produce .ics (iCal) files.

  • Yahoo Local
    Yahoo local supports hCard, hCalendar, and hReview.
  • Yahoo UK Movies

    Yahoo! UK Movies supports hReview.

Conclusion

We - as web professionals - need to start using Microformats in everything we build. The more we use Microformats in our web development the quicker it’ll be embraced by software houses and application developers. We need to bring Microformats to the mainstream and it’s only you and I that can help that push!

Don’t be scared of Microformats. Embrace them, use them, love them. It’s easy!

Studiowhiz Hosting: support us a we grow

Filed Under (Code, Technology, Web) by Mr K on 20-02-2008

Hey there all you web nutters … I’m thinking of a little side project. And I need your input. If studiowhiz was to offer hosting to you would you consider using it? I’m not just talking any old hosting, I’m talking about hosting that will allow you the ability to run PHP beside ASP, Perl beside Ruby on Rails, MySQL beside MSSQL, pop, imap and all that usual stuff.

We could give you the flexibility you need to build the web apps you always dreamed of. Our hosting would scale as you do, with a small monthly fee & pay as you go add ons, hosting with us could be the advantage you need. You’d have access to 24hr, 7day support, your site would be hosted on some of the most robust systems on the net today.

Would you be interested? I’m considering this as one way of helping grow Studiowhiz. As this site continues to grow and I have more ideas we need community support to do that. By offering a service we all need & use we can get fantastic hosting and any profit will be funneled directly into the growth of Studiowhiz from a blog to a resource.

I would need 10 people/websites to consider driving this forward (that would see you paying around US$13 a month). Oh and yes this would potentially be a ‘cloud computing’ solution (don’t ya love buzz words). Register your interest by either a comment or drop me an email webmaster [at] studiowhiz (you figure the rest out).

Edit:
I now have 2 or 3 other parties interested so need maybe 7 more to register interest

PHP tricks

Filed Under (Code, Web) by Mr K on 17-02-2008

phpAs you know from my earlier post I’m rusty when it comes to coding. We’ll I’m working on a small project in my weekends (which I’ll unveil in the coming weeks) and while it’s more a proof of concept than anything, I’m using it as an excuse to brush up on my PHP skills - not that I program any more in my day job (yeah!)

So I thought I’d share a couple of things I’ve found - that are probably old news to you.

Remove duplicates from an array: a really, really simple thing to do.
Lets say I have an array $myArray = (’Red’, ‘Green’, ‘Red’, ‘Blue’, ‘Red’, ‘Yellow’) and I didn’t want Red in there 3 times. PHP has a nice little function called array_unique().

$myArray = ('Red', 'Green', 'Red', 'Blue', 'Red', 'Yellow');

$clean_array =  array_unique($myArray);

$clean_array now looks like (’Red’, ‘Green’, ‘Blue’, ‘Yellow’)

Insert multiple rows with one insert:
I always thought you couldn’t add multiple rows to a table with an insert. I thought each insert had to be a single row. Well this is not so as I found out today. Lets say you are adding 10 items to a ‘tag’ table (id, tag) you can do it like this:

INSERT INTO 'tag' (tag) VALUES
    ('apple'), ('windows'),
    ('css'), ('seo'), ('html'),
    ('design'), ('xhtml'), ('lcd'),
    ('usb'), ('crt');

Of course you can dynamically build the values and pop in many rows at once. I saw a post on some blog (I’ve misplaced the link since getting this to work) that mentioned adding many megabytes of data this way - I can’t say I’d recommend that as a particularly efficient way - but for adding maybe 50 tags it’s jolly fast.

On a side note, anyone know of anyway to get mysql to return the id’s for the rows it just added. If you are adding one row at a time of course you can use ‘mysql_insert_id()’ to return the id (only if you are using auto_increment) of the previous insert. Sadly this doesn’t seem to work with multirow inserts.

Rusty coding

Filed Under (Code, Design, Technology) by Mr K on 28-01-2008

I used to develop full time, that is designing, programming and full development of websites. Of course that was a number of years ago, and my job now, while requiring a growing understanding of the internet, doesn’t see me coding or developing.

I’m starting to set up a small website in the evenings, just a small site I hope people will enjoy. It should be the sort of site I can set up and only touch once in a while. Read the rest of this entry »

A better WordPress

Filed Under (Code, Technology) by Mr K on 14-01-2008

I enjoy using WordPress, after all it is pretty much the leading blogging software. It’s been through a number of iterations and has become a pretty solid hunk of code.

However I have to say, WordPress upgrading sucks. I’ve just completed an upgrade here and seriously, all that downloading, unzipping, making sure I backup my files and then uploading the new ones. Bah humbug. Why can’t WordPress have an auto-upgrade feature?

How hard is it to have the system know what files have changed, and simply update those directly? Sure allow the admin of the site to verify file updates (in-case they have hacked the odd file).

Maybe I should just switch to a hosted version of WordPress ey?

Mix ‘n’ Match

Filed Under (Code, Technology, Technology & Software) by Mr K on 21-12-2007

Tagged Under : , , ,

phpGetting a website or online business online is not the easiest thing, especially if you are not a coder. Trying to find out what CSS, PHP, ASP and other terms mean is hard. When you start looking at off the shelf products it makes it even more confusing.

I’ve just been asked by a friend if he can mix and match a PHP application with a website built in ASP. Strangely enough he’s the 3rd person to ask me this in the last 7 days.

Well the short answer is no, you can not install a PHP application on an ASP server. (By the way, ASP & PHP are coding languages used to build web applications - look for more explanation in my upcoming Jargon Explained series). Trying to install PHP on an ASP server is like trying to put Diesel in your Petrol car.

Read the rest of this entry »

DIY CSS Framework

Filed Under (Code, Design, Favourites) by Mr K on 19-12-2007

CSS (cascading style sheets) is the defining layer of any website. For those not sure, CSS is the bit of a web page, that tells your browser where to put things when rendering (drawing) the page.

CSS is fantastic, however with little to no Web Standards between the many browsers out there you can’t be gauranteed that your layout will always work. For example a default paragraph may have more margins in one browser over another.

Darren Wood is someone I would class as a CSS Guru (although I’m not sure he’ll agree with that). He spoke at the recent BarCamp mini-conference in Auckland specifically about this. He has some tricks to help level the playing feild & he’s kind enough to share his files for you to learn and work from.

I’m adding this to my ‘Must Recommend’ list for any web designer, hobbiest or professional. Starting your web project with Darrens framework, means you will have less headaches.

» Darren Wood » DIY CSS Frameworks

Tags: , , , ,