«
»

Chris' Brain, PHP

WordPress 2.1 and Mint

01.30.07 | 3 Comments

I recently decided to ditch using Google Analytics for my stats tracking and installed Mint as my website stats tracking module. I'm really liking it, and it's easily worth the $30 you have to pay for it. C'mon, don't be cheap and steal everything, okay?

Mint has a really cool plugin architecture that they call Pepper, and you can grab all sorts of cool addons. I saw one called Bird Feeder Pepper, which can track what's going on with your various feeds. Now, the installation is fairly easy but there was a weird bug that was appearing, where a check to see if you are running a licensed copy of Mint kept getting triggered when I tried to access my feeds via a feed alias. The solution? An ugly hack, if you ask me. To implement Bird Feeder Pepper and use the seeds (track individual items in your feed), there's a snippet of PHP code you have to insert in the various PHP files WordPress uses: wp-rss.php, wp-rss2.php, wp-atom.php and wp-rdf.php. Place this snippet AFTER the line in the PHP file that executes a 'header' command and BEFORE the code that outputs the beginnings of the XML. Here's an example:

PHP:
  1. header('Content-type: text/xml; charset=' . get_option('blog_charset'), true);
  2. $more = 1;
  3.  
  4. // BEGIN CODE TO IMPLEMENT BIRD FEEDER PEPPER SEEDS
  5. global $Mint;
  6. define('BIRDFEED', 'Articles (RSS)');
  7. include($_SERVER['DOCUMENT_ROOT'].'/feeder/index.php');
  8. // END CODE TO IMPLEMENT BIRD FEEDER PEPPER SEEDS
  9. ?>
  10. <?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>

Hope that helps anyone else who was struggling to get Bird Feeder Pepper working with WordPress 2.1.

3 Comments


«
»