RSS Feeds for PHPBB v3

Discussion in 'phpBB' started by hilljd00, Jan 26, 2009.

  1. #1
    Hey,

    I am after a RSS Feeds system for PHPBB v3 forum.

    Any suggestions?

    Thanks
    J
     
    hilljd00, Jan 26, 2009 IP
  2. Mobile-Monster

    Mobile-Monster Well-Known Member

    Messages:
    862
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    105
    #2
    Google "GYM for phpbb 3". It's a perfect mod/addon for what you are looking.

    Best Regards,
    MM
     
    Mobile-Monster, Jan 28, 2009 IP
  3. kailash

    kailash Well-Known Member

    Messages:
    1,248
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    190
    #3
    yeap, I also suggest to install GYM Mod for phpbb3.

    Kailash
     
    kailash, Jan 31, 2009 IP
  4. hilljd00

    hilljd00 Well-Known Member

    Messages:
    175
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #4
    Can somebody help me install this mod please
     
    hilljd00, Feb 20, 2009 IP
  5. Mobile-Monster

    Mobile-Monster Well-Known Member

    Messages:
    862
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    105
    #5
    Hmm ..ok .please provide me with the access details and i will set it up for you.

    Best Regards,
    MM
     
    Mobile-Monster, Feb 21, 2009 IP
  6. hilljd00

    hilljd00 Well-Known Member

    Messages:
    175
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #6
    Can you add me to msn please
     
    hilljd00, Feb 21, 2009 IP
  7. rsrikanth05

    rsrikanth05 Well-Known Member

    Messages:
    1,362
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    190
    #7
    Can somebody link me to a trustworthy place to download this mod?
    I can't find one.
    EDIT: NVM, got it from phpBB-SEO...
     
    rsrikanth05, Feb 21, 2009 IP
  8. Zhoog

    Zhoog Peon

    Messages:
    237
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Zhoog, Feb 21, 2009 IP
  9. scc

    scc Peon

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Hello,

    Just save as code below as rss.php and upload it to your forum's root folder.

    ;)

    
    <?php
    /**
    *
    * @package phpBB3
    * @version $Id$
    * @copyright (c) 2008 Manchumahara(Sabuj Kundu)
    * @license http://opensource.org/licenses/gpl-license.php GNU Public License
    *
    */
    
    /**
    * @ignore
    */
    
    define('IN_PHPBB', true);
    $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
    $phpEx = substr(strrchr(__FILE__, '.'), 1);
    include($phpbb_root_path . 'common.' . $phpEx);
    include($phpbb_root_path . 'language/en/common.' . $phpEx);
    
    // Start session
    $user->session_begin();
    $auth->acl($user->data);
    $user->setup();
    
    
    function make_xml_compatible($text,$bbcode_uid, $bbcode_bitfield,$bbcode_options)
    {
    	 global $config, $base_url;
    	 $text = html_entity_decode(generate_text_for_display($text, $bbcode_uid, $bbcode_bitfield, $bbcode_options));
    	 $text = nl2br($text);
             $text = str_replace('&pound', '&amp;#163;', $text);
             $text = str_replace('&copy;', '(c)', $text);
             $text = htmlspecialchars($text);
    	 return $text; 
    }
    //Get the board url address
    $board_url = generate_board_url();
    
    // Start RSS output
    header('Content-type: application/rss+xml; charset=UTF-8');
    $rss_result = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
    <rss version=\"2.0\"  xmlns:atom=\"http://www.w3.org/2005/Atom\">
    <channel>
    <atom:link href=\"".$board_url."/rss.$phpEx\" rel=\"self\" type=\"application/rss+xml\" /> 
      <title>".$config['sitename']."</title>
      <link>".$board_url."</link>
      <description>".$config['site_desc']."</description>
      <language>".$config['default_lang']."</language>
      <copyright>".$user->lang['RSS_COPYRIGHT']."  ".$config['sitename']."</copyright>     
      <managingEditor>".$config['board_email']." (".$config['sitename'].")</managingEditor>  
       <generator>".$config['sitename']."</generator>
      <ttl>1</ttl>  
    ";
            //
            // This SQL query selects the latest topics of all forum
            		
            $sql = 'SELECT f.forum_id,f.forum_name, f.forum_desc_options, t.topic_title, t.topic_id,t.topic_last_post_id,t.topic_last_poster_name, p.post_time, p.post_text, 
            	p.bbcode_uid, p.bbcode_bitfield, u.username, u.user_id
                    FROM  '. FORUMS_TABLE .'  f,'.TOPICS_TABLE.' t, '.POSTS_TABLE.' p,'.USERS_TABLE.' u
                    WHERE t.forum_id = f.forum_id
                    AND t.topic_status != 1
                    AND p.post_id = t.topic_last_post_id 
                    AND u.user_id = p.poster_id
                    ORDER BY t.topic_last_post_id DESC';	
            if(!$result = $db->sql_query_limit($sql,30))
            {
            		trigger_error($user->lang['RSS_FAILURE']);               
            }
            while($row = $db->sql_fetchrow($result))
            {
            	   $forumid=$row['forum_id'];
            	   $topicid=$row['topic_id'];
                   if($auth->acl_get('f_read',$forumid))	   //getting authentication
                   {
                   	   $post_link    = $board_url."/viewtopic.".$phpEx."?f=".$forumid."&amp;t=".$topicid."#p".$row['topic_last_post_id'];
                       $topic_link   = $board_url."/viewtopic.".$phpEx."?f=".$forumid."&amp;t=".$topicid;
                       $description  = $user->lang['POST_BY_AUTHOR']." ".$row['topic_last_poster_name']." (".$user->lang['POSTED']." ".$user->format_date($row['post_time']).")<br/>".$row['post_text']."<br /><br /><a href=\"".$topic_link."\">".$user->lang['RSS_READ_TOPIC']."</a><hr />";                          
    		           $rss_result .= "
                                      <item>
                                      <title>".$row['topic_title']."</title>
                                      <link>".$post_link."</link>
                                      <description>".make_xml_compatible($description, $row['bbcode_uid'], $row['bbcode_bitfield'], $row['forum_desc_options'])."</description>
                                            					    <pubDate>".$user->format_date($row['post_time'])."</pubDate>                                        
                                	    <guid isPermaLink=\"true\">".$post_link."</guid>		   					
                                          </item>";
                    }
            }
    
    
    $rss_result .= '</channel></rss>';
    echo $rss_result;
    $db->sql_freeresult($result);
    ?>
    
    
    Code (markup):
     
    scc, Feb 28, 2009 IP
  10. hilljd00

    hilljd00 Well-Known Member

    Messages:
    175
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #10
    Done that :) but how do i enable it for a user account?
    Only one though
     
    hilljd00, Mar 8, 2009 IP
  11. scc

    scc Peon

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    It doesn't contain anything for user accounts. I think you need something more complex. But if you want to disable some forums you should edit the SQL query and disable forum ids. If you want to disable forum#3 then use a line as "AND f.forum_id != 3".

    Here is an example;
    $sql = 'SELECT f.forum_id,f.forum_name, f.forum_desc_options, t.topic_title, t.topic_id,t.topic_last_post_id,t.topic_last_poster_name, p.post_time, p.post_text, 
            	p.bbcode_uid, p.bbcode_bitfield, u.username, u.user_id
                    FROM  '. FORUMS_TABLE .'  f,'.TOPICS_TABLE.' t, '.POSTS_TABLE.' p,'.USERS_TABLE.' u
                    WHERE t.forum_id = f.forum_id
                    AND f.forum_id != 3
                    AND t.topic_status != 1
                    AND p.post_id = t.topic_last_post_id 
                    AND u.user_id = p.poster_id
                    ORDER BY t.topic_last_post_id DESC';
    Code (markup):
     
    scc, Mar 22, 2009 IP