morans

We get a lot of attempted comment spam, as I am sure all bloggers do. I just had a look at an item in the moderation queue and had a bit of a laugh. The idiot spammer actually included rel="nofollow" in the links that he was trying to insert onto Pinkjoint. This is a tag that tells search engines to ignore the link, which is exactly contrary to the spammer’s purpose. Morans.

Irony, The New Fragrance By Gonza

http://gonzascorner2.blogspot.com/2005/12/best-firefox-extension-ever.html

Have to say, very nice idea and with this kind of tools , updating a blog is much easier and faster and less time comsuming.

And yet: despite being Internetless until this point in the new year, I’ve somehow managed to post before him. It’s amazing. Gonza: offline posting is the future. Try w.bloggar.

MSN Spaces Architect on AJAX

Scott from MSN (the SiteExperts space) is running a fascinating series on the technology behind the AJAX-y MSN Spaces, with interesting and compelling insights into bringing software engineering back into web-enabled design.

But that’s only half the story – the comments in each post to /siteexperts/ seems to bring out the crazies like no other!

Recommended reading, both for the design patterns and the crazy people in the comments.

When Bugs Become Patterns
Event Handlers
Why AJAX is so 1999, Part 2
Why AJAX is so 1999, Part 1

You may have noticed that Pinkjoint is 99.9% AJAX- (and hype-) free. That’s a design choice. We still thought deeply about it.

Exporting all posts from a .Text (dottext) blog via RSS

I recently started moving my personal blog from .Text (dottext) to WordPress. WordPress has the ability to import from many other blogging systems, but .Text is not one of them. Luckily WordPress is able to import an RSS file. The only problem: .Text has a hard limit of the 10 most recent posts in the RSS feed. There is the option to change this number in the admin interface, but it does not work. I knew that what I needed was an RSS feed of all of my posts from the last 6 years, all at once. So I dug out the code.

It turns out that it was not very difficult to solve this problem, some minor changes and we have an unlimited* number of posts in the feed at the same time. As an extra bonus I turned off the aggbug, which is appended to every post in the RSS feed and is used to provide statistics to .Text. Below I have shown the 2 lines of code that have to be changed in order to get your super feed.

from Entries.cs

121: return GetConditionalEntries(99999999,PostType…etc);

from RssWriter.cs

42: this.UseAggBugs = false;

I appreciate that many of you are likely to be as lazy as me, so here are the pre-compiled DLL’s.

Method:

  1. Backup everything including database and DLL files
  2. Extract the 2 DLL files that you downloaded above and place them in the bin folder of your .Text folder on your webserver
  3. Open your RSS feed in your browser and save it as RSS.xml
  4. Overwrite the new DLL’s with the backed up originals
  5. Profit!

Disclaimer: Although I can’t imagine what would go wrong, something might. I am not responsible for any Bad Things that happen as a result of following the advice in this post including, but not limited to: explosions, fires and massive data loss. If any Good Things happen, then I am responsible. If you are afraid of my pre-compiled DLL’s, just compile your own.

If you need the .Text source code, it can be downloaded from the GDN workspace here.

In a future post I will cover exporting comments from .Text and importing them into WordPress.

*there is a limit, it is 99,999,999 posts. I figure you probably have less than that, but if you need more then just change the 99999999 in Entries.cs to a number of your choice.

Getting friendly URLs to work for WordPress on IIS

Friendly URLs make a site a lot easier for both humans and search engines to understand. For example, this post can be accessed by two URLs, a friendly URL and traditional URL.

The friendly URL:
https://www.pinkjoint.com/archives/software/blog-systems/getting-friendly-urls-to-work-for-wordpress-on-iis/

The traditional URL:
https://www.pinkjoint.com/?p=8

You are probably wondering why such a long URL would be considered friendly; after all who would want to type out all of that? You would be right on that point, but that is not what we mean by ‘friendly’. What makes this URL friendly is that it is made of words, so the URL gives you an idea of the subject matter. So ‘friendly’ = easier to understand.

So what does this have to do with WordPress or IIS?

WordPress is a blog publishing system written in PHP and using a MySQL database. PHP sites are more commonly run on Apache, and that Apache is likely running on a server using the Linux operating system. Apache can run on Windows, and the Windows web server (Internet Information Services or IIS) can be made to serve PHP pages.

Since WordPress is most likely to be run on an Apache server, the developers have made it capable of taking advantage of some of Apache’s features. One of these is mod_rewrite, which can rewrite a URL on the fly, using the URL as a query string and passing it to a php file for interpretation. So you could consider mod_rewrite as being able to process virtual URLs. mod_rewrite gets its configuration information from a file called .htaccess.

When you first setup WordPress on an IIS server it is by default configured to use traditional URLs, which work fine. After a bit of a look around you will find the Permalinks page, which is inside Options in Site Admin. It gives a few examples and allows you to enter your own URL structure. So you enter a structure, such as /index.php/archives/%category%/%postname%/, and test it out. You get a blank page. Perhaps you did something wrong? You try a few combinations, and even the examples give you the same result: a blank page. This is because IIS does not have mod_rewrite, or .htaccess files, and there is an undocumented step that needs to be taken before your beautifully crafted friendly URLs will work. You need to make a change to the php.ini file that is in the root directory of your WordPress installation.

First, if you have a php.ini file already, BACK IT UP. You will need the following two lines added to the file:

cgi.fix_pathinfo = 1
cgi.force_redirect = 0

If you don’t feel like copying and pasting all of that, here’s one I made earlier. Just save it as php.ini and upload to the root of your WordPress installation. Like magic, your friendly URLs will just work.