Dkozikowski
02-08-2007, 03:33 PM
How to implement Mint's Bird Feeder Pepper with pixelpost's RSS 2.0 Feed.
A How to guide for pixelpost 1.5
NOTE! This following procedure requires "hacking" the index.php file. Currently, there is no way for an addon to perform this function that i know of!
Please make a backup of your index.php file and rename it to index-bak.php and store it in a safe place!
Step 01
Download the latest release of Bird Feeder from http://haveamint.com/peppermill/
Extract the Bird Feeder pepper and continue following the steps bellow.
Step 02
Upload the /birdfeeder/ directory and its contents to /mint/pepper/shauninman/. If the directory /shauninman/ doesn't exist, create it.
Step 03
Login to your Mint installation and in the Preferences click "Install" under Pepper.
Click the Bird Feeder Pepper "Install" button. Click "Okay".
While you're here, if you also have the User Agent 007 Pepper installed, remember to enable reader detection. You can do this by visiting the User Agent 007 preferences pane.
NOTE: If you are using the .htaccess method to attach Mint to your pages you are on your own! Additional steps are required and although the bellow steps will apply to you, I'm not going to support this method in this thread! Refer to the readme file included with Bird Feeder.
OK, now you can continue with the installation steps outlined below.
Step 04
Unzip and upload the /feeder/ directory to the root of your site.
Visit http://yourdomain.com/feeder/. If you see an error, please visit the
Mint Forum for a solution.
Step 05
Open index.php
Find the following, (on lines 764, 765, 766 & 767 of an un-hacked index.php file)
<?php // Do not add this line if you are copying and pasting!
if(isset($_GET['x'])&&$_GET['x'] == "rss")
{
$output = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
Add replace with this
<?php // Do not add this line if you are copying and pasting!
if(isset($_GET['x'])&&$_GET['x'] == "rss")
{
define('BIRDFEED', 'Article (RSS)'); // Mint Bird Feeder Hack
$output = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
NOTE: You may change 'Article (RSS)' to 'Whatever You Want'
This will give your feed a name while viewing your Mint Stats.
Find the following, (on line 790 of an un-hacked index.php file)
$query = mysql_query("SELECT id,datetime,headline,body,image FROM ".$pixelpost_db_prefix."pixelpost WHERE (datetime<='$cdate') ORDER BY datetime desc limit 10");
Copy and paste the bellow code directly bellow the line of code mentioned above.
include($_SERVER['DOCUMENT_ROOT'].'/feeder/index.php'); // Mint Bird Feeder Hack
Find the following, (on line 808 of an un-hacked index.php file)
<link>".$cfgrow['siteurl']."?showimage=$id</link>
and replace with this:
<link>".$BirdFeeder->seed($headline, "{$cfgrow['siteurl']}?showimage={$id}", true)."</link> <!-- Mint Bird Feeder Hack -->
Step 06
You're done!
Save index.php and visit http://yourdomain.com/?x=rss and mouse over a link while looking in the status bar to make sure Bird Feeder is working. You will be able to tell due to the nastiness of the Bird Feeder Url.
You may also visit my RSS feed for an example (uses post slug urls described bellow).
Mouse over one of the links to see what the actual Bird Feeder link looks like.
Click on the link to see how the Bird Feeder uses that link to record (invisible to users) and redirect you to the proper image.
http://dwilkinsjr.com/rss.xml
(don't mind the rss.xml part. I use mod-rewrite to change the url. index.php?x=rss also works)
A How to guide for pixelpost 1.5
NOTE! This following procedure requires "hacking" the index.php file. Currently, there is no way for an addon to perform this function that i know of!
Please make a backup of your index.php file and rename it to index-bak.php and store it in a safe place!
Step 01
Download the latest release of Bird Feeder from http://haveamint.com/peppermill/
Extract the Bird Feeder pepper and continue following the steps bellow.
Step 02
Upload the /birdfeeder/ directory and its contents to /mint/pepper/shauninman/. If the directory /shauninman/ doesn't exist, create it.
Step 03
Login to your Mint installation and in the Preferences click "Install" under Pepper.
Click the Bird Feeder Pepper "Install" button. Click "Okay".
While you're here, if you also have the User Agent 007 Pepper installed, remember to enable reader detection. You can do this by visiting the User Agent 007 preferences pane.
NOTE: If you are using the .htaccess method to attach Mint to your pages you are on your own! Additional steps are required and although the bellow steps will apply to you, I'm not going to support this method in this thread! Refer to the readme file included with Bird Feeder.
OK, now you can continue with the installation steps outlined below.
Step 04
Unzip and upload the /feeder/ directory to the root of your site.
Visit http://yourdomain.com/feeder/. If you see an error, please visit the
Mint Forum for a solution.
Step 05
Open index.php
Find the following, (on lines 764, 765, 766 & 767 of an un-hacked index.php file)
<?php // Do not add this line if you are copying and pasting!
if(isset($_GET['x'])&&$_GET['x'] == "rss")
{
$output = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
Add replace with this
<?php // Do not add this line if you are copying and pasting!
if(isset($_GET['x'])&&$_GET['x'] == "rss")
{
define('BIRDFEED', 'Article (RSS)'); // Mint Bird Feeder Hack
$output = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
NOTE: You may change 'Article (RSS)' to 'Whatever You Want'
This will give your feed a name while viewing your Mint Stats.
Find the following, (on line 790 of an un-hacked index.php file)
$query = mysql_query("SELECT id,datetime,headline,body,image FROM ".$pixelpost_db_prefix."pixelpost WHERE (datetime<='$cdate') ORDER BY datetime desc limit 10");
Copy and paste the bellow code directly bellow the line of code mentioned above.
include($_SERVER['DOCUMENT_ROOT'].'/feeder/index.php'); // Mint Bird Feeder Hack
Find the following, (on line 808 of an un-hacked index.php file)
<link>".$cfgrow['siteurl']."?showimage=$id</link>
and replace with this:
<link>".$BirdFeeder->seed($headline, "{$cfgrow['siteurl']}?showimage={$id}", true)."</link> <!-- Mint Bird Feeder Hack -->
Step 06
You're done!
Save index.php and visit http://yourdomain.com/?x=rss and mouse over a link while looking in the status bar to make sure Bird Feeder is working. You will be able to tell due to the nastiness of the Bird Feeder Url.
You may also visit my RSS feed for an example (uses post slug urls described bellow).
Mouse over one of the links to see what the actual Bird Feeder link looks like.
Click on the link to see how the Bird Feeder uses that link to record (invisible to users) and redirect you to the proper image.
http://dwilkinsjr.com/rss.xml
(don't mind the rss.xml part. I use mod-rewrite to change the url. index.php?x=rss also works)