vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   RSS feed displayed in forumdisplay (https://vborg.vbsupport.ru/showthread.php?t=117235)

MickDoneDee 05-31-2006 07:33 PM

RSS feed displayed in forumdisplay
 
I'm not a coder but I managed, through trial and error, to get an external RSS feed to display within a scrollable table on forumdisplay. I have several different feeds displayed on separate forums.

Examples:
http://www.world-a-team.com/forumdisplay.php?f=3
http://www.world-a-team.com/forumdisplay.php?f=4
http://www.world-a-team.com/forumdisplay.php?f=7

Each separate feed requires a pair of files uploaded to your server. A php and html file. The php file contains the feed URL.
eg: $XMLfilename = "http://www.cricinfo.com/rss/wc_2007.rdf";

The HTML file contains variables that get replaced by different parts of the feed. The php file addresses the html file.
eg: $TEMPLATEfilename = "rsswc.html";

In the phpinclude_start template I use
ob_start();
require("rssaus.php");
$rssaus = ob_get_contents();
ob_end_clean();

to create a variable - eg: $rssaus which I place in a conditional in the forumdisplay template.
eg:
$header
$navbar
<if condition="$foruminfo['forumid'] == 3">$rsseng</if>
<if condition="$foruminfo['forumid'] == 4">$rssaus</if>
<if condition="$foruminfo['forumid'] == 5">$rsssaf</if>
<if condition="$foruminfo['forumid'] == 6">$rsspak</if>
<if condition="$foruminfo['forumid'] == 7">$rssind</if>

So I can display a different feed on different forums.

MickDoneDee 07-31-2007 07:04 PM

The system I used in the previous post was for my 3.0.3 version forum. I've since upgraded my forum to 3.6.7 and I no longer use the phpinclude_start template.

Instead, I create a plugin that references the PHP files. I create a Plug-in for global_start with these contents:
ob_start();
require("rssaus.php");
$rssaus = ob_get_contents();
ob_end_clean();

The plugin also contains the above code repeated for each different feed I fetch via a different PHP file, eg rsseng.php, rsspak.php etc.

The code in rssaus.php will execute and any output generated by this script will be stored in $rssaus. Then I place $rssaus in the FORUMDISPLAY template where I want the contents of the PHP file (RSS feed) to appear. For multiple feeds on different forums I use something like:

eg:
$header
$navbar
<if condition="$foruminfo['forumid'] == 3">$rsseng</if>
<if condition="$foruminfo['forumid'] == 4">$rssaus</if>
<if condition="$foruminfo['forumid'] == 5">$rsssaf</if>
<if condition="$foruminfo['forumid'] == 6">$rsspak</if>
<if condition="$foruminfo['forumid'] == 7">$rssind</if>

rnmcd 08-19-2007 02:28 AM

Can you post the plugin?

Do you think you will upgrade to 3.6.8?

MickDoneDee 08-19-2007 11:49 AM

Quote:

Originally Posted by rnmcd (Post 1320691)
Can you post the plugin?

I have posted the plugin in the previous post.
Quote:

Instead, I create a plugin that references the PHP files. I create a Plug-in for global_start with these contents:
ob_start();
require("rssaus.php");
$rssaus = ob_get_contents();
ob_end_clean();
For multiple RSS feeds simply repeat this block of code and change the name of the PHP file. For example:
Quote:

ob_start();
require("rssaus.php");
$rssaus = ob_get_contents();
ob_end_clean();
ob_start();
require("rsseng.php");
$rsseng = ob_get_contents();
ob_end_clean();
ob_start();
require("rssind.php");
$rssind = ob_get_contents();
ob_end_clean();
ob_start();
require("rssnz.php");
$rssnz = ob_get_contents();
ob_end_clean();
Please download the following free scripts and read the documentation on how to create your custom RSS PHP and HTML files:

http://www.feedforall.com/download.htm

Script 1:
RSS2HTML - free PHP script for dipslaying RSS feeds using html
(You don't have to register at feedforall.com to download this free file.)
Description:
http://www.feedforall.com/free-php-script.htm
Documentation:
http://www.feedforall.com/php-documentation.htm

Script 2:
rss2html Cache - PHP script for displaying only current items in an RSS feed.
(You are required to register at feedforall.com to download this free file)
Description:
http://www.feedforall.com/rss-cache.htm

This should work for 3.6.8.

perfphysio 08-19-2007 11:54 AM

This is a fab idea. The only issue is for a few of us that aren't so techie this abvove description is still a bit difficult to follow. Perhaps you could post a link to a step by step html page?

Many thanks if this is posibble for your time :)

MickDoneDee 08-19-2007 12:24 PM

1 Attachment(s)
In my first post I gave you an example of code to place in your forum display template:
Quote:

to create a variable - eg: $rssaus which I place in a conditional in the forumdisplay template.
eg:
$header
$navbar
<if condition="$foruminfo['forumid'] == 3">$rsseng</if>
<if condition="$foruminfo['forumid'] == 4">$rssaus</if>
<if condition="$foruminfo['forumid'] == 5">$rsssaf</if>
<if condition="$foruminfo['forumid'] == 6">$rsspak</if>
<if condition="$foruminfo['forumid'] == 7">$rssind</if>

So I can display a different feed on different forums.
I also gave you an example of the code for the plugin in my previous post.

On my server is a folder called FeedForAllCacheFiles which is CHMODed to 777 to store the cached RSS feed files. The documentation should explain this. If it doesn't let me know. I also have a PHP and HTML file corresponding to each feed. For example:

rssaus.php and rssaus.html to display the feed on the Australia forum.
rsseng.php and rsseng.html to display the feed on the England forum.
rssind.php and rssind.html to display the feed on the India forum. Etc.

To view the code of rssaus.php open the attached file. To view the html code of rssaus.html open the attached text file: rssaus.txt. I hope this helps.

tekguru 08-19-2007 03:01 PM

Sounds cool but or us newbies it it as rewritten into a Product and had an ACP entry to configure it I'd be using it.

rnmcd 08-19-2007 03:35 PM

Does anyone know if it is even possible for it to be written into a product with admincp controls?

tekguru 08-19-2007 05:15 PM

I would have thought it would be possible and get rid of the need to edit the tamplates?

rnmcd 08-22-2007 02:29 AM

If it is possible to turn this into a product/plugin I will pay to have it coded.


All times are GMT. The time now is 12:48 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01059 seconds
  • Memory Usage 1,747KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete