Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 05-31-2006, 07:33 PM
MickDoneDee MickDoneDee is offline
 
Join Date: Mar 2003
Location: Sydney
Posts: 170
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 07-31-2007, 07:04 PM
MickDoneDee MickDoneDee is offline
 
Join Date: Mar 2003
Location: Sydney
Posts: 170
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
  #3  
Old 08-19-2007, 02:28 AM
rnmcd rnmcd is offline
 
Join Date: Aug 2004
Posts: 399
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you post the plugin?

Do you think you will upgrade to 3.6.8?
Reply With Quote
  #4  
Old 08-19-2007, 11:49 AM
MickDoneDee MickDoneDee is offline
 
Join Date: Mar 2003
Location: Sydney
Posts: 170
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by rnmcd View Post
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.
Reply With Quote
  #5  
Old 08-19-2007, 11:54 AM
perfphysio's Avatar
perfphysio perfphysio is offline
 
Join Date: Sep 2006
Location: London, UK
Posts: 212
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #6  
Old 08-19-2007, 12:24 PM
MickDoneDee MickDoneDee is offline
 
Join Date: Mar 2003
Location: Sydney
Posts: 170
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Attached Files
File Type: php rssaus.php (47.7 KB, 20 views)
File Type: txt rssaus.txt (1.3 KB, 21 views)
Reply With Quote
  #7  
Old 08-19-2007, 03:01 PM
tekguru tekguru is offline
 
Join Date: May 2007
Posts: 366
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 08-19-2007, 03:35 PM
rnmcd rnmcd is offline
 
Join Date: Aug 2004
Posts: 399
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does anyone know if it is even possible for it to be written into a product with admincp controls?
Reply With Quote
  #9  
Old 08-19-2007, 05:15 PM
tekguru tekguru is offline
 
Join Date: May 2007
Posts: 366
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would have thought it would be possible and get rid of the need to edit the tamplates?
Reply With Quote
  #10  
Old 08-22-2007, 02:29 AM
rnmcd rnmcd is offline
 
Join Date: Aug 2004
Posts: 399
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

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


All times are GMT. The time now is 02:02 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04441 seconds
  • Memory Usage 2,280KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete