I finally got around to upgrading my WordPress blog software to version 1.5.2 today. I also took this opportunity to apply Kimmo’s entity patch, which takes care of HTML entities ½ and ¾, and probably some others as well. At least I remembered to reapply the tags patch this time!
Applying these patches got me thinking about folks that aren’t “patch-aware”, i.e. don’t know how to apply patches. It’s almost trivially simple. On a Unix (or Unix-like) system, the command is:
patch original-file patch-file
where patch-file is the name of the file containing the patch(es), while original-file is the file that you are going to fix. This works fine as long as only one file is affected, as is the case with Kimmo’s patch. You can tell this by reading the patch file and looking for long lines of punctuation such as
***************
or
===================================================================
If you see more than one of these lines, there are multiple files affected. Such is the case with Felix Wong’s tags patch. For this one, the command is:
patch -p1 <patch-file
which should be executed from your wordpress directory. Explaining this command requires knowledge of directories/file structures, which I don’t want to cover right now.
Thanks to Joseph and my blogroll, I saw the WordPress 1.5.1.3 security update. I forgot to re-apply the tags patch from Felix Wong’s tags plugin the first time through. Doh! Thanks for posting this, Joseph.
Just thinking about what still needs to be done to get tags support in my other themes…
Steam will need to have 4 files modified:
- archive.php
- index.php
- sidebar.php
- and single.php
I’ve already modified at least one of these files for other reasons, but I have saved original copies of all the files that have been/need to be modified.
I need to clean up my earlier work on Borderline Chaos, and then add tags support to it. I’ve got the original theme files in another directory, still need to see which files I’ve already changed. Files to be modified for tags support:
- 404.php
- archives.php
- index.php
- links.php
- search.php
- sidebar.php
- single.php
Sigh…
Elvgren looks like only index.php needs to be modified. I don’t remember if I have already modified this theme, so I’ll need to download a fresh copy.
Journalized-Blue and Sharepoint Like are already finished. The WordPress Default and the pirate theme (”Yaaarr, ’tis me blog!”) will probably remain tag-less, and may even be deprecated. The WordPress Classic theme will certainly be removed.
A bit of hacking on Felix’s tags plugin (version 0.3.0) has cleaned up the Sharepoint theme. I added a new parameter, “countposts” (default true), to the listtags() function. This controls the display of number of posts. The patch is here, just right-click and save locally or use your browser’s “view source” command.
This code could probably be much cleaner, but it gets the job done for me right now. Enjoy!
Update: 2005-09-03 05:36 UTC–the patchfile has been fixed. See this article for more info.
I’ve got tags working in “Sharepoint like”, but the tags list (left column) looks pretty ugly. The CSS for this theme doesn’t work well with the output of listtags(), since the CSS sort of expects category listings to contain only anchors (<a>), while listtags() outputs an anchored tag name followed by the article count as plain text.
This is a bummer. I really like the Sharepoint theme, and I much prefer tags over categories. I may have to hack the tags plugin to add a function to list the anchored tags without article counts, or perhaps add another parameter to the list_tags() function to control this.
It’s getting late, I think that’s enough theme hacking for one night. I’ll look at this with fresh eyes in the morning.
I finished hacking up Journalized-Blue to support the tags plugin. Since this is the only theme I have finished (wrt tags), I have made this the default theme for my blog.
Replacing categories with tags for this theme turned out to involve only two files, index.php and leftcolumn.php. Patches for both files are below. I made the theme “tags aware”, so if you have the tags plugin, the theme will show tags wherever it now shows categories. If you want both tags and categories, it’d be very simple to hack the patched files so that categories were always displayed.
The patches are .txt files. I can’t recall how to force these to display “as is” (my http-fu is weak, I’ll admit), but you can either right-click on these links and save the files locally or simply click on the links and then use your browser’s “view source” command to see the straight .txt files.
Update: 2005-09-03 05:32 UTC
I’ve created a single patchfile of all the changes I’ve made to Journalized-blue. More information is available in this article.
I hacked up Journalized-Blue’s index.php to replace the category listing with Felix Wong’s tags plugin. I still need to grep the rest of this theme for categories and fix them as well. Then I’ll have to see which of the rest of my themes are worth the effort. (I guess it’s not that tough to add tags support, it’s just a matter of finding all the places where categories are listed in all of the theme php files.)
I should probably also be a good citizen and post the modified themes.
Well, I finally got on the blog bandwagon. I was interested in blog software which supported pingback and trackback, and which I could install on Pair’s systems without root access. After checking out a few packages, I settled on WordPress.
Anti-spam plugins that I’ve bolted on include Farook’s WPBlacklist and Meyer’s WP-Gatekeeper. I wasn’t able to get the blacklist to use URI updating, due to “URL file-access is disabled in the server configuration” error, so I just browsed the blacklist and saved the contents locally. This will need to be manually updated from time to time :(, but it’s a reasonable start.
After browsing Joseph Scott’s blog, I decided to supplement the category system by adding Felix Wong’s WP-Tags plugin.
I decided to leave the blog timezone set to UTC, since I live in the Pacific timezone while my server’s timezone is 2 or 3 hours ahead of me.