A painting of me

Building a Link-Log in Textpattern 4.0

   23 March 2006, early evening

While upgrading to the latest version of Textpattern, I decided to clean up the way I implemented my Link-Log. The goal was to minimize the number of hacks needed to get things working. This article should explain what I have done, and should be as terse as possible.

Read the rest of this post. (168 words)

Comment [1] |  

Feed Auto-discovery Plugin

   28 February 2006, late evening

I’ve finally fixed the feed auto-discovery links on this site, and in doing so made a new plugin. This plugin will generate the auto-discovery links that you place in the head section of your HTML document. These are what feed-readers use to find the feeds available at your site. This plugin lets you specify whether you want the feeds to be “smart” (aware of what section and category they are in) or not. You can download the plugin here.

This plugin will produce audo-discovery feed links. There are two parameters:

  • smart – this can equal 1 or 0. If it is 1, then the feed links will be section and category aware.
  • flavour – this can equal ‘rss’ or ‘atom’. This is how you set what sort of feed link to produce.

Also, if you find my feeds are all really broken, please let me know.

Download the plugin: rsx_feed_auto_discovery_link-0.1.txt

Comment |  

A Referrer Filter Pepper

   12 December 2005, mid-morning

I will write a proper post about the Referrer Filter Pepper shortly. Till then, briefly, the Referrer Filter Pepper is a plugin for the web statistics package Mint. This plugin is a more generic version of the Google Images Pepper I wrote for Mint 1.14.

Download the referrer filter pepper: funkaoshi-referrer-filter-pepper.zip
View the forum topic in the Mint Forum: [New Pepper] Referrer Filter

Comment |  

Search Engine Metatags Plugin

   15 November 2005, late evening

I’ve written a simple plugin to generate the meta information used by the google bot to decide whether to index a page or not. If the page generated is an individual article page, then the plugin will generate:<meta name="robots" content="index,follow">; if the page generated is anything else, the plugin generates: <meta name="robots" content="noindex,follow">.

Scribbling.net has a couple good articles on this which are worth checking out: Noindex and Help the Googlebot understand your web site

Download the plugin: rsx_search_engine_meta.txt

Update Nov 14th 2005: The plugin has been updated so it works correctly in TXP 4.0.2.

Comment [1]  

If Section Different Plugins

    8 November 2005, late at night

This plugin will let you use two new conditional tags when building pages, <txp:rsx_if_next_section_different /> and <rsx_if_prev_section_different />. I use these tags to display my link-log mixed in with my regular posts. <txp:rsx_if_next_section_different /> is true if the current article’s section is different than the next article’s section. If the current article is the first article this condition is always true. <txp:rsx_if_prev_section_different /> is true if the previous article’s section is different than the current article’s section. If the article is the last article on the page this condition is always true. You can use <txp:else /> as you would expect.

Download the plugin: rsx_section_conditionals.txt.

Update: Damn it! I just noticed that you need edit your publish.php file to use this plugin, thus making it even more niche. You will need to add the following line of code to publish.php, after the line 766: $out['posted_rsx'] = $Posted;. (The previous line of code should be: $out['posted'] = $uPosted;.) We must do this because the plugin needs to have access to the database value Posted, which is not stored by default. (The unix timestamped version of the value is stored, but this is not much use.)

Comment [2]  

A Google Images Pepper

   19 October 2005, late at night

I get a lot of hits from Google images. They end up cluttering up the referrer pane in my copy of Mint. The latest version of Mint lets you filter out domains you don’t want to see in your referrer pane anymore, which is nice and all, but it would still be nice to have these hits tracked somewhere. Being a tech-savvy guy, I thought I would try my hand at writing a plugin for Mint that does this very task, tracking hits from Google Images.

Read the rest of this post. (220 words)

Comment [9] |  

Friendly Time Plugin

    5 January 2005, late evening

I’ve written plugin implements the idea discussed by Dunstan on his personal blog about displaying the time a post was published in a friendly manner. Simply place the <txp:rsx_time_of_day /> tag in an article template form and it will print out the time in a friendlier manner. For example, 12:00 will get turned into “lunch time”. I’ve basically copied his code verbatim. You can go and change what is output by editing the switch statement.

Download the plugin: rsx_time_of_day.txt

update: Bug Fix, $timeoffset was not declared as a global variable.

Comment [9]  

Import Moveable Type Export File into Textpattern

   18 December 2004, late morning

I’ve modified the Wordpress Moveable Type import script so that it will import posts, comments, and primary categories from a moveable type export file into a textpattern database. I think that under the GNU license my changes are OK.

Read the rest of this post. (413 words)

Comment [16] |  

Testing Memory Allocation Failure

   15 December 2004, late afternoon

When programming in C a programmer must use the malloc function to request memory on the heap. In C++ one can use malloc, but generally the proper thing to do is use new, and for arrays new[]. The new operator, when successful, returns a chunk of memory big enough for the object or array you wish to store. Unfortunately, sometimes new and malloc will fail to find any memory.

Read the rest of this post. (410 words)

Comment [7] |  

Building a 404 Error Page in Textpattern

   29 July 2004, late afternoon

This is a concise outline of what I did to get a custom 404 page working with Textpattern. You can read my earlier post on such pages for background.

Read the rest of this post. (550 words)

Comment [6] |  

Request Count

   26 July 2004, mid-afternoon

I’ve written a Textpattern plugin to count the number of times an individual article is requested. This isn’t the most accurate way to gauge the popularity of an article, but it is probably the simplest.

Read the rest of this post. (184 words)

Comment [5]  

Building a Links Log in Textpattern

   23 July 2004, late evening

Here are the very gory details on how I went about merging my del.icio.us links into my textpattern site, and how I intend to post links hence forth. A horrible account of what I did follows…

Read the rest of this post. (1437 words)

Comment [23] |  

My Textpattern Install

   10 July 2004, lunch time

I’ve been asked a few times how I went about modifying Textpattern to end up with the URLs I have. I was planning on writing it all up in a tutorial of some sort, but I have been lazy.

Read the rest of this post. (282 words)

Comment [8]  

Accessible Comment Forms in Textpattern

    6 July 2004, early evening

A question was posed on the textpattern forum on how one can set up the comment forms in textpattern so they are more accessible. What follows is how I went about doing so.

Read the rest of this post. (265 words)


Open Comments in Textpattern after an Import

   15 June 2004, the wee hours

Here is a script you can run after the fact to open up commenting on posts imported by my script.


Place the script in your textpattern directory, rename it from open-comments.php.txt to open-comments.php, and run it by browsing to the page in your web browser. I’ve ran it on my install at home, and it seems to work fine. It will run the following query:

update textpattern
set annotate = 1;

This will open up commenting on ALL your posts. This script is meant for people who don’t have access to phpMyAdmin, or don’t want to run a SQL query themselves.

Comment [1]  

A Blog is a Book you Read Backwards

   27 May 2004, early evening

Weblogs are usually formatted so that the most recent post is the first thing you read, with posts being displayed in reverse chronological order. So, when you assign page numbers to the pages in your weblog, in a sense you are assigning them all backwards. Worse still, after a few posts, entries that used to be on page 1 will now be on page 2, those on page 2 on page 3, and so on and so forth. For this reason, I’m not sure how worthwhile it is to use page numbers as a navigation tool for most weblogs.

I’ve updated my page number plugin. You can now generate page number lists as navigation elements. If you have a 50 page entry weblog, and you are viewing page 10, then the tag will generate something like this: 1 … 8,9,10,11,12 … 50. Each number would be a link to the appropriate page.

The tag generates an unordered list, so you will need to style it to have it display as I’ve shown above. The CSS you will want to use would be the following:

ul.rsx-page-num-list li {
    display: inline;

Please let me know if you find any problems.


Comment [6] |  

Page Number Plugin

   18 May 2004, terribly early in the morning

I’ve written a plugin for textpattern that will display the current page of you are on when viewing an articles list page. Someone on the Textpattern forum asked for such a thing. Hopefully this is what she wanted.


Update May 18th: The plugin now can be used to find the current page, and the total number of pages. There is also a tag that will generate a navigation widget that looks something like “ << Page 4 of 7 >> “.

Update May 19th: The plugin now lets you specify what text to use for the right and left navigation, and is enclosed in span so you can style the navigation element with css.

Update Sept 2nd 2005: The un-linked page number in the list generated by rsx_page_number_list is now wrapped in a span tag with a class of unlinked.

Update Oct 20th 2007: Jean Rajotte has updated the plugin; more details can be found on his web site.

Comment [20] |  

A Word Count plugin.

   10 May 2004, evening time

There was a request in the Textpattern forum for a word count plugin. I got to work on one shortly after reading the post, because it sounded like something that would be easy to do. The result of my work is this plugin. This is my firsrt plugin for Textpattern. My next goal is to make some of the modifications I made to this site into plugins. As it stands, upgrading to the next version of Textpattern is going to be a pain in the ass.

Update: My plugin works, but I have switched to using Plek’s Word Count plugin as it gives slightly more accurate numbers.

Comment [6]  

Clean URLs in Textpattern

    2 May 2004, early afternoon

How I went about getting cleaner URLs in TXP 1.18a.

Read the rest of this post. (796 words)

Comment [21] |  

→ → →