Rockstar
30th June 2008, 07:04
I've got the app running, working and it looks decent.
I've read over and over the tutorial for Magpie and I only want five items to appear instead of all the items that appear now from the feed and I just don't understand at all where I put the code:
$items = array_slice($rss->items, 0, 5);
Here is what my file looks like:
<?php
include('conf.php');
//define('MAGPIE_CACHE_DIR', $magpie_cache_dir);
define('MAGPIE_CACHE_ON', 0);
//define('MAGPIE_CACHE_AGE', 600);
require_once('../../rss/rss_fetch.inc');
$rss = @fetch_rss($feed);
$fbml .= '
<meta name="medium" content="blog"/>
<meta name="title" content="'.htmlspecialchars(strip_tags($rss->channel['title'])).'"/>
<meta name="description" content="'.htmlspecialchars(strip_tags($rss->channel['description'])).'"/>
<link rel="target_url" href="'.$rss->channel['link'].'"/>
</td></tr></table>';
foreach ($rss->items as $item) {
$fbml .= '<div style="border-bottom: 0px solid #CCCCCC; padding-bottom:3px;"><br><div style="border-bottom: 1px dotted #CCCCCC; border-top: 1px dotted #CCCCCC;"><table border="0" width="100%" style="margin: 5px 5px 5px 5px;"><tr><td valign="top" width="1000%"><a href="'.$item['link'].'" style="font-weight: bold;">'.$item['title'].'</a></td><td valign="top" width="100%">
<meta name="medium" content="blog" />
<meta name="title" content="'.htmlspecialchars(strip_tags($item['title'])).'" />
<meta name="description" content="'.htmlspecialchars(strip_tags($item['description'])).'" />
<link rel="target_url" href="'.$item['link'].'" />
</fb:share-button></td></tr></table></div>';
$fbml .= '</div>';
}
$fbml .= '</div>';
echo $fbml;
?>
I've read over and over the tutorial for Magpie and I only want five items to appear instead of all the items that appear now from the feed and I just don't understand at all where I put the code:
$items = array_slice($rss->items, 0, 5);
Here is what my file looks like:
<?php
include('conf.php');
//define('MAGPIE_CACHE_DIR', $magpie_cache_dir);
define('MAGPIE_CACHE_ON', 0);
//define('MAGPIE_CACHE_AGE', 600);
require_once('../../rss/rss_fetch.inc');
$rss = @fetch_rss($feed);
$fbml .= '
<meta name="medium" content="blog"/>
<meta name="title" content="'.htmlspecialchars(strip_tags($rss->channel['title'])).'"/>
<meta name="description" content="'.htmlspecialchars(strip_tags($rss->channel['description'])).'"/>
<link rel="target_url" href="'.$rss->channel['link'].'"/>
</td></tr></table>';
foreach ($rss->items as $item) {
$fbml .= '<div style="border-bottom: 0px solid #CCCCCC; padding-bottom:3px;"><br><div style="border-bottom: 1px dotted #CCCCCC; border-top: 1px dotted #CCCCCC;"><table border="0" width="100%" style="margin: 5px 5px 5px 5px;"><tr><td valign="top" width="1000%"><a href="'.$item['link'].'" style="font-weight: bold;">'.$item['title'].'</a></td><td valign="top" width="100%">
<meta name="medium" content="blog" />
<meta name="title" content="'.htmlspecialchars(strip_tags($item['title'])).'" />
<meta name="description" content="'.htmlspecialchars(strip_tags($item['description'])).'" />
<link rel="target_url" href="'.$item['link'].'" />
</fb:share-button></td></tr></table></div>';
$fbml .= '</div>';
}
$fbml .= '</div>';
echo $fbml;
?>