Page 1 of 2

RSS BBCode

Posted: 09 Mar 2010, 21:35
by Stoker
RSS BBCode

With the RSS BBCode You can insert RSS feeds in the topics in Your phpBB3 forum.
You can also put a RSS feed on the forum page.
Image

How to do the modifications:
Get Your own Google AJAX Feed API here: http://code.google.com/apis/ajaxfeeds/signup.html
Download the 2 files mentoined in Step 2: here: http://www.dynamicdrive.com/dynamicinde ... player.htm
(gfeedfetcher.js and indicator.gif)
Upload both files to Your root folder.

Prosilver:

Open styles/prosilver/template/overall_header.html
Find:

Code: Select all

</head>
Before add:

Code: Select all

<script type="text/javascript" src="http://www.google.com/jsapi?key=Your Google API Here">
</script>                                                                                                                                                           
<script type="text/javascript" src="gfeedfetcher.js">
/***********************************************
* gAjax RSS Feeds Displayer- (c) Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>
Attention!! Find this: Your Google API Here in the above code and insert Your Google API key instead.

Open styles/prosilver/theme/colours.css
At the bottom, on a newline, add:

Code: Select all

.labelfield{ /*CSS for label field in general*/
color: #AD2C2C;
font-size: 90%;
}

.datefield{ /*CSS for date field in general*/
color: #828282;
font-size: 90%;
}

#example1 a{ /*CSS specific to demo 3*/
text-decoration: underline;
font-weight: bold;
}

#example1 p{ /*CSS specific to demo 3*/
margin-bottom: 2px;
}

code{ /*CSS for insructions*/
color: red;
}

Subsilver2:

Open styles/subsilver2/template/overall_header.html
Find:

Code: Select all

</head>
Before add:

Code: Select all

<script type="text/javascript" src="http://www.google.com/jsapi?key=Your Google API Here">
</script>                                                                                                                                                           
<script type="text/javascript" src="gfeedfetcher.js">
/***********************************************
* gAjax RSS Feeds Displayer- (c) Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>
Attention!! Find this: Your Google API Here in the above code and insert Your Google API key instead.

Open styles/subsilver2/theme/stylesheet.css
Scroll down to the bottom and ad this code:

Code: Select all

.labelfield{ /*CSS for label field in general*/
color: #AD2C2C;
font-size: 90%;
}

.datefield{ /*CSS for date field in general*/
color: #828282;
font-size: 90%;
}

#example1 a{ /*CSS specific to demo 3*/
text-decoration: underline;
font-weight: bold;
}

#example1 p{ /*CSS specific to demo 3*/
margin-bottom: 2px;
}

code{ /*CSS for insructions*/
color: red;
}
Save and upload both files. Refresh templates and themes.

BBCode
Go to ACP and create the RSS BBCode.

BBCode:

Code: Select all

[rss]{IDENTIFIER},{URL1},{NUMBER}[/rss]
HTML Code:

Code: Select all

<span style="font-size: 125%; line-height: 116%;"><span style="font-weight: bold;">{TEXT} News</span></span><br />
<script type="text/javascript">
var socialfeed=new gfeedfetcher("example1", "example1class", "_new")
socialfeed.addFeed("{IDENTIFIER}", "{URL1}") //Specify "label"
socialfeed.displayoptions("label datetime snippet")
socialfeed.setentrycontainer("div")
socialfeed.filterfeed({NUMBER}, "date")
socialfeed.init() //Always call this last
</script>
Helpline:

Code: Select all

RSS:  [rss]Name of RSS,RSS Url,Number of entries[/rss]
Example:

Code: Select all

[rss]CNN,http://rss.cnn.com/rss/cnn_latest.rss,10[/rss]
Demo:
rss.png
(BBCode not installled, demo not available)

Remember!
You can only use one RSS per page.

Tested in Firefox, IE7 and Opera8

Addon:

If You also want to show RSS news on Your forum index, follow this install instructions:

Open styles/prosilver/template/index_body.html
Find:

Code: Select all

<!-- INCLUDE forumlist_body.html -->
After add:

Code: Select all

<div class="forabg">
			<div class="inner"><span class="corners-top"><span></span></span>
			<ul class="topiclist">
				<li class="header">
					<dl class="icon">
                  <dt>RSS News</dt>
                                             </dl>
				</li>
			</ul>
			<ul class="topiclist forums">
			<li>
<div class="content" style="width: auto; height: auto; padding: 10px;">

<script type="text/javascript">
var socialfeed=new gfeedfetcher("example1", "example1class", "_new")
socialfeed.addFeed("USATODAY", "http://rssfeeds.usatoday.com/usatoday-NewsTopStories")
socialfeed.addFeed("CNN", "http://rss.cnn.com/rss/cnn_latest.rss")
socialfeed.addFeed("ABC", "http://feeds.feedburner.com/AbcNews_TopStories")
socialfeed.displayoptions("label datetime snippet")
socialfeed.setentrycontainer("p")
socialfeed.filterfeed(15, "date")
socialfeed.init()
</script>
</div></li></ul>
		<span class="corners-bottom"><span></span></span></div></div>
Open styles/subsilver2/template/index_body.html
Find:

Code: Select all

<!-- INCLUDE forumlist_body.html -->
After add:

Code: Select all

<br clear="all" />
<table class="tablebg" width="100%" cellspacing="1">
   <tr>
      <th>RSS Nyheder</th>
   </tr>
   <tr>
      <td class="row1">
                <div style="width: auto; height: auto; padding: 10px;">

<script type="text/javascript">
var socialfeed=new gfeedfetcher("example1", "example1class", "_new")
socialfeed.addFeed("USATODAY", "http://rssfeeds.usatoday.com/usatoday-NewsTopStories")
socialfeed.addFeed("CNN", "http://rss.cnn.com/rss/cnn_latest.rss")
socialfeed.addFeed("ABC", "http://feeds.feedburner.com/AbcNews_TopStories")
socialfeed.displayoptions("label datetime snippet")
socialfeed.setentrycontainer("p")
socialfeed.filterfeed(10, "date")
socialfeed.init() //Always call this last

</script>
</div>
                </td>
   </tr>
   </table>
<br clear="all" />
Upload files and refresh templates.

Authors words

The gfeedfetcher.js script has a built in Alert function.
I find it quite annoying and unnecassary.
The thing is that You get a popup if the feed contains errors. You have to click OK before You can do anything.
You dont need a blocking popup to see if there is a feed error which often is a single entry. The rest of the feed is shown anyway.
To removes this alert do this.
Open gfeedfetcher.js script
Find ad delete:

Code: Select all

if (thisfeed=="") //if error has occured fetching feed
      alert("Google Feed API Error: "+result.error.message)

Explanation

How to configure the script?
This:

Code: Select all

socialfeed.addFeed("USATODAY", "http://rssfeeds.usatoday.com/usatoday-NewsTopStories")
tells the name and link to the feed
This:

Code: Select all

socialfeed.displayoptions("label datetime snippet")
Label tells where the feed is from. Datetime tells which date the entry is created and snippet is the text.
This:

Code: Select all

socialfeed.filterfeed(10, "date")
tells how many entrys is shown and how they are sorted.

Visit Dynamic Drive for more info.

Re: RSS BBCode

Posted: 26 Mar 2010, 00:33
by asrock
Quick question folks... for this Mod to work correctly on my own forum, do I need to allow guests option for my forum? In other words I have Guests in my ACP set as No Access so would I need to enable that so the Mod / RSS can grab the forum post updates / new posts and stuff?

Re: RSS BBCode

Posted: 26 Mar 2010, 01:46
by Steve
asrock » 25 Mar 2010, 23:33 wrote:Quick question folks... for this Mod to work correctly on my own forum, do I need to allow guests option for my forum? In other words I have Guests in my ACP set as No Access so would I need to enable that so the Mod / RSS can grab the forum post updates / new posts and stuff?
There is no settings in the ACP for this mod bbcode. So the answer NO. ;)
what version of phpBB3 are you using ?

Re: RSS BBCode

Posted: 26 Mar 2010, 02:15
by cisco007
great thing this mod, i have been looking for it for a while, I integrated it into the simpleportal mod! DEMO:
http://layerbabuena.org/portal.php

Re: RSS BBCode

Posted: 26 Mar 2010, 16:39
by asrock
vectra-mods » 26 Mar 2010, 00:46 wrote:
asrock » 25 Mar 2010, 23:33 wrote:Quick question folks... for this Mod to work correctly on my own forum, do I need to allow guests option for my forum? In other words I have Guests in my ACP set as No Access so would I need to enable that so the Mod / RSS can grab the forum post updates / new posts and stuff?
There is no settings in the ACP for this mod bbcode. So the answer NO. ;)
what version of phpBB3 are you using ?
I'm using 3.0.7-PL1.

Re: RSS BBCode

Posted: 13 Jul 2010, 11:52
by Mess
cisco007 » 26 Mar 2010, 01:15 wrote:great thing this mod, i have been looking for it for a while, I integrated it into the simpleportal mod! DEMO:
http://layerbabuena.org/portal.php
Hi cisco007,
Would you mind sharing the code you added to achieve the results you got? It looks great, except it seems the news has the wrong labels.

Re: RSS BBCode

Posted: 13 Jul 2010, 18:15
by cisco007
I created a html file named feeds.html and inserted it on my simpleportal_body.html with this <!-- INCLUDE feeds.html --> where I wanted it!

these are the contents!

Code: Select all

<script type="text/javascript" src="http://www.google.com/jsapi?key=your API key here!">
</script>
<script type="text/javascript" src="path/to/your/gfeedfetcher.js"></script>
<script type="text/javascript" src="path/to/your/gajaxticker.js">

/***********************************************
* gAjax RSS Ticker- (c) Dynamic Drive (www.dynamicdrive.com)
* Requires "gfeedfetcher.js" class
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

</script>
<div class="forabg">
         <div class="inner"><span class="corners-top"><span></span></span>
         <ul class="topiclist">
            <li class="header">
               <dl class="icon">
                  <dt>RSS News</dt>
                                             </dl>
            </li>
         </ul>
         <ul class="topiclist forums">
         <li>
<div class="content" style="width: auto; height: auto; padding: 10px;">
<script type="text/javascript">

var socialfeed=new gfeedrssticker("example2", "example2class", 5000, "")
socialfeed.addFeed("your tag here", "link to your feed here") //Specify "label" plus URL to RSS feed
//socialfeed.addFeed("") //Specify "label" plus URL to RSS feed
socialfeed.addFeed("your tag here", "link to your feed here") //Specify "label" plus URL to RSS feed
socialfeed.displayoptions("label datetime snippet") //show the specified additional fields
socialfeed.setentrycontainer("p") //Display each entry as a DIV
socialfeed.filterfeed(20, "label") //Show 15 entries, sort by label
socialfeed.entries_per_page(5)
socialfeed.init() //Always call this last

</script>
</div></li></ul>
      <span class="corners-bottom"><span></span></span></div></div>

Re: RSS BBCode

Posted: 14 Jul 2010, 00:14
by Mess
Thanks mate, Ill play with it tomorrow. :)

Re: RSS BBCode

Posted: 01 Sep 2010, 13:38
by Mess
Dear Stoker,
Could you please provide the bbcode for these 3 also. :D

http://www.dynamicdrive.com/dynamicinde ... roller.htm

I have been trying all day, but I just can't get it to show. Yours is working as intended. But these I just can't get to show anything.

Re: RSS BBCode

Posted: 01 Sep 2010, 17:12
by Stoker
Sorry, I dont have much time at the moment.