wet_slimpattern: Integrate SlimStat with Textpattern

26. Dezember 2005

wet_slimpattern is a plugin which integrates Textpattern with SlimStat, an open source web statistics package developed by Stephen Wettone.

The common way of doing things

Integration of SlimStat into Textpattern is usually accomplished by modifying index.php in the root folder of your Textpattern installation to include an invocation of the hit-logging code provided by SlimStat. This is a no-brainer and works as simple as it should, but it requires you to modify a file which is part of the Textpattern distribution. That tiny modification might cause headaches in case of upgrades and has to be kept track of.

The textpatterned way of doing things

As an alternative way of integration the both packages, wet_slimpattern comes handy. Using a plugin approach it requires no modifcation to any of Textpatterns core code files but works by simply uploading this plugin through the usual plugin administrative interface.

As a side effect you can flip statistic logging by simple enabling or disabling this plugin. No need to edit index.php anymore.

Usage:

wet_slimpattern assumes that you have previously installed SlimStat successfully. You can omit the final step of SlimStat’s installation which would direct you to include the hit logging code inc.stats.php somewhere into your pages.

Instead, install wet_slimpattern and enable it. Logging should start immediately whenever your website attracts visitors. If you chose to install SlimStat into a different folder that the default /slimstat/ you will need to edit this plugin in Textpattern’s plugin administration screen and change the line reading

$statslogger = "/slimstat/inc.stats.php";

to reflect the actual path you chose.

The list of ignored URLs and query strings is kept in a regular expression just at the head of the plugin code. By default, all feed URLs are exluded from logging. Expand to your liking…

$ignore = '/\/&|^\/rss\/|^\/rss$|^\/atom\/|[...];

Licence

This plugin is released under the Gnu General Public Licence.

Download

Get it here: wet_slimpattern.txt.

Resources and Relateds

Express your suggestions, report bugs and discuss enhancements in this thread in the Textpattern forum.

Change log

Date Version Notes
2005-12-26 0.1 Initial release
2006-07-05 0.3 Customizable filter for URLs and query strings
2007-03-01 0.4 URL and query string filter employs regular expressions
2007-03-02 0.4.1 Fix brainless typo…