A painting of me

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.

From the help:

This plugin will let you keep tabs on the number of times an article is requested. Every time a user requests to read an individual article, a counter in the database is incremented. You can do whatever you want with the value returned, or choose not to display anything at all.

To use the plugin, begin by running the following SQL statement to add a new column to the textpattern table: ALTER TABLE 'textpattern' ADD 'request_count' INT DEFAULT '0' NOT NULL;. Next, place the <txp:rsx_request_count /> tag in an article form you use
to post articles on your site.

If you do not want the tag to return any value, you simply want to keep track of the information in the database, use the noshow option—i.e use the following tag <txp:rsx_request_count no_output="1"/>

If you want to use the plugin, download this file: rsx_request_count.txt. (update: fixed link.)



  1. Have you been pleased with Textpattern? I’ve been looking through your archives trying to find the reason for your switch from MT to Textpattern. I also used blogger and MT (for blogs that no longer exist) and just recently started using PmachinePro. But I’ve been curious about Textpattern. I’m sure you have an entry explaining everything. Would you mind pointing me to it?

  2. I switched in part because I liked the interface and general feel of Textpattern more then Moveable Type. Also, I know PHP much more then I know Perl, so I had an easier time modifying the system to suit my needs. I also don’t like how you have to rebuild your site in Moveable Type to see changes you are making. I still use Moveable Type for my photoblog, and I think it’s great. If you are happy with it I wouldn’t switch. I was just looking for something different really.

  3. dssdf

  4. I wonder if the above comment is a sign the spam is coming?

  5. Hi, it´s great idea. I translated your instruction for installing to czech language.

    You can find here: rsx_request_count – po?ítadlo p?e?tených ?lánk?

Don't be shy, you can comment too!

Some things to keep in mind: You can style comments using Textile. In particular, *text* will get turned into text and _text_ will get turned into text. You can post a link using the command "linktext":link, so something like "google":http://www.google.com will get turned in to google. I may erase off-topic comments, or edit poorly formatted comments; I do this very rarely.