TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

March 29, 2024, 05:29:40 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,105
  • Total Topics: 21,213
  • Online today: 336
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 335
  • Total: 335

Rss readers v1.2 from Tufat with TinyPortal v.86 on SMF v1.1rc2-1.

Started by nite0859, April 02, 2006, 08:56:27 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nite0859

Attempting to implement : RSS Readers v1.2 from Tufat.com (http://www.tufat.com/s_rss_rdf_feed_reader.htm) inside Tiny Portal's Block on frontpage. I made a phpblock on the frontpage with this code :

echo '<iframe width="350" height="300" src="http://www.myservername.com/forum/rss/index.html"></iframe>';


Location of rss readers v1.2 on myserver : /myservername.com/forum/rss.

Rss readers comes with a customizable feedlist.xml that is called from the index.html found inside the /myservername.com/forum/rss directory.

Files inside /myservername.com/forum/rss

config.xml
feedList.xml
index.html
rssProxy.php
rssReader01.swf


Problem is that the <iframe> really does put a white frame around the rss feed box. That white "frame" around the rss feed box really has to go. How else would I tell the phpbox to go and open the index.html file ?

Has anyone ever played with this one before ? I thought it may be interesting to use the Rss feeds already built into SMF to display through this Flash Rss reader. Potentially, you could use Flash to scroll your recent topics, user list, or news from Yahoo!, Google, or whoever else offers an Rss feed.

nite0859

I realize that Tiny Portal allows you to select an RSS feed; however, in my case, this feature does not work. If I put in

http://finance.yahoo.com/rss/topstories


into the RSS feed link, I see nothing. The flash script does allow me to see things.

feral

well for your first question i would just try using an include instead of an iframe

include("http://www.myservername.com/forum/rss/index.html");


as for the second i just tested the rss on my site using that same yahoo feed and it worked fine for me. so i cant help on that. sorry

nite0859

I know why rss fails on my site.

The PHP option allow_url_fopen would normally allow a programmer to open, include or otherwise use a remote file using a URL rather than a local file path. For security reasons, my host provider has disabled this feature.

From my host's wiki :

Many developers include files by pointing to a remote URL, even if the file is within the local system. For example:
<?php include("http://example.com/includes/example_include.php"); ?>
With allow_url_fopen disabled, this method will not work. Instead, the file must be included with a local path, and there are three methods of doing this:

By using a relative path, such as ../includes/example_include.php.
By using an absolute path (also known as relative-from-root), such as /home/username/example.com/includes/example_include.php.
By using the PHP environment variable $_SERVER['DOCUMENT_ROOT'], which returns the absolute path to the web root directory. This is by far the best (and most portable) solution. The example that follows shows the environment variable in action:

Example Include
<?php include($_SERVER['DOCUMENT_ROOT']."/includes/example_include.php"); ?>

Processing Differences (and passing variables to an included file)
It is worth mentioning that the alternative solutions presented here will result in a difference in the way the include() function is handled. The alternative solutions all return the PHP code from the included page; however, the now-unavailable remote URL method returns the result from the included page. One result of this behavior is that you cannot pass a querystring using the alternative solutions. You define the variables locally before performing the include:

Example
To achieve the effect of this:

<?php include("http://example.com/includes/example_include.php?var=example"); ?>


You must instead use this:

<?php
$var 
"example";
include(
$_SERVER['DOCUMENT_ROOT']."/includes/example_include.php");
?>



Adding Flexibility
For maximum flexibility (when multiple includes are required, for example), it may be easier to create a variable:

<?php
$doc_root 
$_SERVER['DOCUMENT_ROOT'];
include(
"$doc_root/includes/example_include.php");
include(
"$doc_root/includes/example_include2.php");
include(
"$doc_root/includes/example_include3.php");
include(
"$doc_root/includes/example_include4.php");
?>



Note: The technique works in the same way, regardless of whether you are using include() or require().


feral

*hate hosts that limit what you can do* altho i under stand it. well it that case you limited in your options. you can ask your host if they can open that sevice for your site. or if you are hosted on an apache server you may be able to over ride it in the htaccess file but dont ask me how it is just a thought =/

TwinsX2Dad

You get what you pay for - then again, sometimes you overpay for what you get...

For more on .htaccess files, see the Apache documentation.