TinyPortal

Development => Support => Topic started by: Cartis on January 26, 2009, 10:18:27 AM

Title: RSS-feed-blocks don't work for me
Post by: Cartis on January 26, 2009, 10:18:27 AM
I am trying to use the built-in RSS-feed-function but it doesn't seem to work.
The RSS-blocks turn up empty regardless of the RSS I use.
Please help.

Link to my site: http://www.goldenhillspelaren.se
SMF version: SMF 1.1.7
TP version: 1.0.6 beta 2
Theme name and version: Mesh114
Mods installed: Treasury, SMF Gallery Lite
Related Error messages:
Cartman    idag kl. 11:09:16
http://www.goldenhillspelaren.se/index.php
2: fclose(): supplied argument is not a valid stream resource
Fil: /www/webvol7/vc/pu4cjkytr24ir0q/goldenhillspelaren.se/public_html/Sources/TPmodules.php
Rad: 1330

Cartman idag kl. 11:09:16
http://www.goldenhillspelaren.se/index.php
2: fread(): supplied argument is not a valid stream resource
Fil: /www/webvol7/vc/pu4cjkytr24ir0q/goldenhillspelaren.se/public_html/Sources/TPmodules.php
Rad: 1321

Cartman idag kl. 11:09:16
http://www.goldenhillspelaren.se/index.php
2: fopen(http://www.sportix.se/sida.php?sport=Ishockey&lag=AIK) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: no suitable wrapper could be found
Fil: /www/webvol7/vc/pu4cjkytr24ir0q/goldenhillspelaren.se/public_html/Sources/TPmodules.php
Rad: 1317

Cartman idag kl. 11:09:16
http://www.goldenhillspelaren.se/index.php
2: fopen() [<a href='function.fopen'>function.fopen</a>]: URL file-access is disabled in the server configuration
Fil: /www/webvol7/vc/pu4cjkytr24ir0q/goldenhillspelaren.se/public_html/Sources/TPmodules.php
Rad: 1317
Title: Re: RSS-feed-blocks don't work for me
Post by: G6Cad on January 26, 2009, 10:27:12 AM
Your host have closed the option on the server to fetch the feeds.
They need to set the Fopen option to ON for it to work.
I doubt they will if they have closed it as it is a security issue to have it open

If you look at the errors, you see that they have it closed, so you need to contact your host and ask them to enable the external links options.

Title: Re: RSS-feed-blocks don't work for me
Post by: Cartis on January 26, 2009, 10:30:34 AM
Thanks for the fast reply.

Isn't there any way around this?
I also have the site www.grumpygents.com with a RSS-feed that works. It is placed at the same host.
Title: Re: RSS-feed-blocks don't work for me
Post by: G6Cad on January 26, 2009, 10:42:46 AM
No way around this inside SMF or TP, TP only render the feex, it doesent make or hold the settings for it.

It's a host account issue, so if it works on the same host on another account, i cant see why they have closed it for this site your asking about.
But there is nothing we can do to help, you host needs to change the settings for your account for the site your asking about.
Title: Re: RSS-feed-blocks don't work for me
Post by: Cartis on January 26, 2009, 12:07:21 PM
I talked to the support at the hotel. They have (as you say) set Fopen to OFF for security reason.
But they refer to cURL as a solution. Can anybody help me with this? I'm not really a programmer.

<?php
$ch 
curl_init();
curl_setopt($chCURLOPT_URL"http://exempel.com/filnamn.php");
curl_setopt($chCURLOPT_HEADER0);
curl_exec($ch);
curl_close($ch);
?>



Instead of file_get_contents():
<?php
$url 
"http://www.example.org/";
$ch curl_init();
curl_setopt ($chCURLOPT_URL$url);
curl_setopt ($chCURLOPT_CONNECTTIMEOUT5);
curl_setopt ($chCURLOPT_RETURNTRANSFERtrue);
$contents curl_exec($ch);
if (
curl_errno($ch)) {
  echo 
curl_error($ch);
  echo 
"\n<br />";
  
$contents '';
} else {
  
curl_close($ch);
}

if (!
is_string($contents) || !strlen($contents)) {
  echo 
"Failed to get contents.";
  
$contents '';
}

echo 
$contents;
?>



http://php.net/curl
And in Swedish: http://support.loopia.se/kb256
Title: Re: RSS-feed-blocks don't work for me
Post by: G6Cad on January 26, 2009, 01:03:11 PM
Try and use a php block and where they refer to a link, add in the rss feed link and save the block

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "the rss feed url here");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);


Du kan också få hjälp på Svenska i vår skandinaviska forum del
Translated "You can also get help in Swedsih in our Scandinavian support board"