« Updated Look
» Have I Become A Grumpy Old Programmer?

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

have your say

Add your comment below, or trackback from your own site. Subscribe to these comments.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

:

:


« Updated Look
» Have I Become A Grumpy Old Programmer?