Categories
Technology Weblogging

Just around the corner

If I were a betting woman, I would bet that WordPress 1.3 (or would it be 2.0?) is releasing sooner rather than later. At least it looks that way from the code, though the developers are going back and forth on a couple of items. Even though I plan on doing my own development from this release on, I’m still interested in WordPress, and plan on being so in the future. After all, my decision to go a new direction has less to do with WordPress and more to do with wanting to try some ideas of my own.

Who knows, maybe some of those ideas will make their way back into WordPress. Life is full of both surprises and variety.

I’ve helped several people move to WordPress, and thought it might be of use to write out the major changes that I’m seeing in this release, and point to any additional information of which I am familiar. That’s the great thing about an open source project that’s being implemented in an open environment – we can all peek in while the work is underway.

Themes

I’ve been using themes over at Kitchen, and just implemented a Theme Switcher, so that the readers can pick their favorite. Ryan Boren wrote an anatomy of a theme, and the WordPress Codex wiki has an overview of how to develop a theme.

From a user perspective, a theme consists of two parts: one or more templates, and an associated stylesheet. The theme template can be as simple as a single index.php, which replaces the one that exists within the weblog root directory; or it can consist of a whole group of template files, such as comments.php, sidebar.php, footer.php, index.php, and so on.

The template files and the stylesheet and any incidental material is placed in it’s own subdirectory under wp-contents/themes/. For instance, one we have at Kitchen is called “Kitchen One”, which is located in a subdirectory called kitchen-one.

When the files are copied into the wp-content/themes directory, they’ll show up automatically within the themes selection list in the new Presentation page within the WordPress administation page. You can then activate whichever theme you want to use. Currently the theme at Kitchen is Kubrick, but that could change tomorrow.

The style sheet is named style.css, and this is critical because the theme name and what pulls it together is found in the stylesheet. The theme definition block for Kitchen One is:

/*
Template: gemini
Theme Name: Kitchen One
Description: A deep warm rich kind of style.
Author: Joni Mueller and Shelley Powers
Author URI: http://itkitchen.info/

Odyssey interface and Gemini template for WordPress 1.3 designed and built
by Root http://www.atthe404.com/blog/

CSS Design by Joni Mueller http://jonimueller.com/wordpress/ and Shelley Powers
Photo by Elaine Nelson
*/

The values on the left have meaning to the theme system and should be written as shown here. From the top, these provide for the theme name, a description, the author, the author’s web site, and any incidental information. The key variable is the one named ‘Template’. This points to the template being used for the one theme, because one template can be used in many themes. In fact, all the themes at Kitchen use the Gemini template except for one, Kubrick.

In this case, the Gemini theme is a simple one – a single index.php page. For all other functionality, this theme uses the existing default files, such as wp-comments.php. For Kubrick, the theme uses several template files: 404.php, archive.php, archives.php, comments.php, footer.php, header.php, links.php, page.php, search.php, searchform.php, sidebar.php, and single.php.

So how can a system handle one theme that has one file, and other theme that has many? Simple, it checks for the existence of files when a page is accessed, and if the file exists in the theme, it’s used. If not, the default file is used instead.

So for Kubrick, when you access a single entry page using index.php, the application checks to see if there is a single.php page in the template subdirectory. If there is, it loads this; if there isn’t the index.php page handles the request. The same functionalty is used for archives, category, author, searching, and so on.

This is a very effective way of managing file-based templates without having to worry about overwriting a user’s existing modification when you upgrade the application. No more going, “Oh crap, I just copied over the index.php file.”

You can check out the use of templates and themes at Kitchen, and even use the new theme switcher (look at the bottom of the right hand column).

Pages

Another significant change with the next release of WordPress is the existence of pages. A page is like a post except that it’s not included as part of the archives or categories. For instance, the link titled “How to Participate” at the Kitchen is built using the page functionality, not the post. If you click the link, you’ll see it opens at the top-level of the site.

The challenge with a page is that each one requires a new entry within the .htaccess file. So if you want to create a page and have it immediately accessible, you have to make your .htaccess file writeable. Or you have to re-generate the permalink entry for .htaccess every time you create a page.

Still, you’re not going to create that many pages. Rather than make .htaccess writable, I’d recommend creating the pages, and then generating the permalink entries for .htaccess all at once.

There is a new status appearing in WordPress code of ’static’, which makes me wonder if these pages are going to be created using the regular weblog post page and then statically generated – which would make more sense for this type of page. Once one moves past the same problems we’ve had with writing to a directory. Stay tuned…

Paging

Nothing more fun than to go to a weblog that’s been around for years and search on a popular term. What returns is an extremely long page with every entry that matches that search term. If you’re lucky, you’ll only see excerpts. If you’re not, you’re in for a long wait.

WordPress has dealt with the problems associated with too many entries being returned by implementing a thing called ‘paging’. You can see it in the Kitchen, if you access a popular category like Administration, a frequent poster, like The Chef, search on a popular term like weblog, or access an entire month’s entries. At the top and bottom of the page is navigation to go from the current group of posts to the previous, and so on.

The count of posts displayed is based on the same number of posts that you display on the front page of your weblog. You include the navigation bar using something like the following, from the Kubrick theme:

<div class=”alignleft”><?php posts_nav_link(‘’,’’,’« Previous Entries’) ?>&;lt;/div>
<div class=”alignright”><?php posts_nav_link(‘’,’Next Entries »’,’’) ?></div>

At this time, the Gemini template does not have the navigation links. What will happen, then, is that the last specified number of posts show in the results, but there is no navigation for older posts.

Which is a very effective demonstration about how themes can have different behaviors, as well as different appearances and layouts. This has some interesting possibilities for experimentation.

Change is Change

There are some changes that may or may not make it into the finished problem. For instance, the previous nightly build included enclosures, which would automatically pull images and audio files into enclosures in RSS feed. This has subsequently been removed, and hopefully will be implemented as an option.

There is no longer an option to turn auto pinging on or off at the page level, but you’ll want to turn it off for the application, because it’s a performance killer.

There’s a new one that allows users with rank of 9+ to post as another person. Based on this, I’ve updated all the Kitchen writers that were 9 to 8, and changed the menu options accordingly. There’s discussion about turning moderation on automatically for all posts over ten days old, but most of us are doing this anyway. Or closing old posts off completely.

The global variables such as $tableposts are now deprecated, but should be around for at least one release so that old plug-ins won’t break when the application first releases.

There is now a WordPress export, which will be handy if you’re merging weblogs, which I had to do recently. From what I can see, there’s also been improvements in the other imports.

And looks like we’ll be able to have email list management to all users. That’s good news for the Kitchen.

And so on

There are a lot of other changes, many of which take place under the skin so to speak. The development team is working on new comment spam prevention techniques, as well as doing some good code clean up such as moving SQL statements into the functions and out of the pages. The GEO fields have been moved from the administration pages to a plug-in, though I know most people didn’t use this. Then there’s the mysterious Dashboard, but we probably won’t get a peek at that until the tool releases.

All in all, some very tasty additions, with only a few hiccups now and again.

Didn’t notice until today that the WordPress development team released a heads up on 1.3 at the Development weblog November 17th. This lists out some other new features, and confirms the themes and pages additions.

Categories
Technology

Can I reformat my life next?

After leaving the hard disk recovery process running all night, this morning I decided that a better bet would be just to reformat the hard drive and start fresh.

After installing the OS, and running Software Update to ensure I had the newest versions of everything, I reinstalled PicturePerfect, Adobe Photoshop CS, my Dimage software for my Minolta scanner, Firefox, Thunderbird, and Fugu for secure FTP. This took about an hour, mainly because Photoshop CS has got to be the most stuffed full, compressed software installation there is.

When I installed Panther (Mac OS X 10.3), I checked the option to install X11 so I could use OpenOffice. Downloading this software and installing it took about ten minutes. I also installed the X Code development tools, just for grins and giggles.

I tried to use wget to access WordPress, when I remembered that this isn’t installed on any version of OS X greater than 10.1. I used cURL, instead, though it’s going to be hard to break the wget habit. I also downloaded MySQL and ran its installation program, turned on personal web sharing, and adjusted the httpd.conf file to allow PHP. This took about ten minutes–once I remembered how to use cURL.

My system is much happier now that the hard drive had been reformatted; the performance has improved significantly, and I now have oodles of free space. This whole thing ended up being a piece of cake, and my PowerBook is now a buff little beastie–leaner and meaner.

If only we could reformat our lives so easily.

Categories
Technology

Oh my oh

Tried to upgrade OS on my Mac, and it has failed badly. I’m right now in the middle of running fsck -yf to try and repair the volume, though it seems to be hanging on “Repairing volume” an awfully long time. I’m beginning to worry.

I’ll try all the tricks I can and then probably troop back to the Apple store, only to hear I’m sure that this is something else the ‘geniuses’ can’t handle.

Disc Warrior might be able to repair this. Or I’m looking at the possibility of formatting and re-installing. Everything. That’s not something to contemplate lightly.

Just a little reality injected into the rosy glow of happy Appledom.

Categories
Technology Web

The whole thing

Recovered from the Wayback Machine.

The Architecture of the World Wide Web, First Edition was just issued as a W3C recommendation. I love that title – it reminds me of Monty Python’s “The Meaning of Life”, volume one.

Interesting bit about URIs in the document. To address the ‘resource as something on the web’ as compared to ‘resource as something that can be discussed on the web’ issue, the document describes a resource thusly:

By design a URI identifies one resource. We do not limit the scope of what might be a resource. The term “resource” is used in a general sense for whatever might be identified by a URI. It is conventional on the hypertext Web to describe Web pages, images, product catalogs, etc. as “resources”. The distinguishing characteristic of these resources is that all of their essential characteristics can be conveyed in a message. We identify this set as “information resources”.

This document is an example of an information resource. It consists of words and punctuation symbols and graphics and other artifacts that can be encoded, with varying degrees of fidelity, into a sequence of bits. There is nothing about the essential information content of this document that cannot in principle be transfered in a representation.

However, our use of the term resource is intentionally more broad. Other things, such as cars and dogs (and, if you’ve printed this document on physical sheets of paper, the artifact that you are holding in your hand), are resources too. They are not information resources, however, because their essence is not information. Although it is possible to describe a great many things about a car or a dog in a sequence of bits, the sum of those things will invariably be an approximation of the essential character of the resource.

The document then gets into URI collision:

By design, a URI identifies one resource. Using the same URI to directly identify different resources produces a URI collision. Collision often imposes a cost in communication due to the effort required to resolve ambiguities.

Suppose, for example, that one organization makes use of a URI to refer to the movie The Sting, and another organization uses the same URI to refer to a discussion forum about The Sting. To a third party, aware of both organizations, this collision creates confusion about what the URI identifies, undermining the value of the URI. If one wanted to talk about the creation date of the resource identified by the URI, for instance, it would not be clear whether this meant “when the movie was created” or “when the discussion forum about the movie was created.”

Social and technical solutions have been devised to help avoid URI collision. However, the success or failure of these different approaches depends on the extent to which there is consensus in the Internet community on abiding by the defining specifications.

Categories
Technology

Bye bye Windows Bye bye Linux

Recovered from the Wayback Machine.

Over the last several months, I’ve been moving more and more of my work from my Windows/Linux dual-boot laptop to my Mac. Now with the open source development environment working so effortlessly in my PowerBook, there’s little reason to stay with my other machine.

I still get Excel spreadsheets and Word documents, but today I upgraded my OpenOffice environment to 1.1.2, and the performance and ease of use with this application has now reached a point that I can do without Office. My printer doesn’t work with my Mac, but to be honest the print drivers don’t work with many of my Windows applications. Besides my roommate’s printer just died, and he could use a new one.

Next week I’ll take my Powerbook down to the Apple Store, to the so-called Genius Bar (how pretentious can one get?) and have them fix the battery, and tell me how much it would cost to upgrade my hard driver to a larger size. After that, I’ll spend the next week cleaning out my Windows laptop and re-installing the software from scratch; giving the box and the printer to my roommate and buying a new photo-capable printer, desktop keyboard and possibly a stylus and pad for my Mac. (Suggestions on all of these would be welcome.)

At that point, for the first time since I was a tester of the earliest beta release of Windows, back in the 80’s, I won’t be using a Windows box as my primary work machine.

A few years ago, I never would have thought this could occur. I had written a best-selling book on COM/COM+ and ASP for O’Reilly, I was a member of the Microsoft Development Network, had passed several Windows certification tests, attended Windows conferences almost exclusively, and programmed primarily in VB and VC++ and just a little Java. In addition, I scoffed at the Macs with their cute graphics, and decided if I were to go with a second environment, away from my beloved Windows, it would be Linux.

This weekend, though, I was able to install several open source applications far more easily than I ever could on Linux, primarily because Mac users won’t tolerate piecemeal packages, cryptic installation instructions, and a hackers attitude of “well, if you have to ask how something works, you shouldn’t use it”. Best of all, they work out of the box on the Mac — no mucking around with Windows ‘tweaks’.

I am now become one of the Mac people I used to look askance at years ago; you know, the starry eyed ones that wax on and on enthusiastically about their machines. However, I draw the line at standing in line for an Apple Store opening, or spending time in the Mac forums comparing the size of my local Genius Bar with those of other members.