#1  
Old 30th June 2008, 06:04
Rockstar Rockstar is offline
Junior Member
 
Join Date: Jun 2008
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
Default Facebook RSS App

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:

Code:
$items = array_slice($rss->items, 0, 5);
Here is what my file looks like:

Code:
<?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;

?>
Reply With Quote
Sponsored Links
  #2  
Old 30th June 2008, 20:04
Rockstar Rockstar is offline
Junior Member
 
Join Date: Jun 2008
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
Default

After further reading I've realized that the

Code:
$items = array_slice($rss->items, 0, 5);
Doesn't seem to be included in the part where I was trying to put it before.

Any help would be greatly appreciated. I have NO idea where I put the code to display only five items. The tutorial doesn't say where exactly the code goes, the cookbook for MagpieRSS doesn't make it clear either.

Any assistance would be greatly appreciated

Forgive my unfamiliarity as this is one of my first times attempting something like this and I'm about to give up.
Reply With Quote
  #3  
Old 30th June 2008, 20:21
Rockstar Rockstar is offline
Junior Member
 
Join Date: Jun 2008
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
 
Default

I actually figured it out after searching the forums. I found another thread that doesn't deal with the same problem but with the description length. The solution was to place it in the rss.php file. So I figured I'd try placing my code in that file as well and it worked
Reply With Quote
The Following User Says Thank You to Rockstar For This Useful Post:
falko (1st July 2008)
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Facebook RSS feed app invite page deprecated godrox HOWTO-Related Questions 16 29th January 2010 07:37
Facebook RSS odd symbol melat0nin HOWTO-Related Questions 7 6th June 2008 17:13
Facebook RSS reader question / problem Shutez HOWTO-Related Questions 3 4th June 2008 19:44
Facebook RSS truncate item? melat0nin HOWTO-Related Questions 4 29th May 2008 18:28
Facebook RSS reader app - error!? parakeet HOWTO-Related Questions 1 12th December 2007 12:05


All times are GMT +2. The time now is 21:37.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.