Jump to content

Recommended Posts

Hi Jack,

 

Until today your contribution worked great!

Now the page gives this error:

Warning: fopen(http://www.rssdomain.com/rss/seat.rss) [function.fopen]: failed to open stream: Bad file descriptor in c:\domains\mydomain.nl\wwwroot\mydir\includes\modules\rss_reader.php on line 112
could not open XML input

Any idea?

Share this post


Link to post
Share on other sites

Me again. I think it has something to do with a special character. In this feed. Could the '€' euro character cause the error?

 

If I try another feed there's no problem. The feed I use works fine on my Netvibes page.

So i would put my money on the '€' character. How to fix this?

Share this post


Link to post
Share on other sites

Maybe it was some character in one of the sub-feeds that was attached when it was failing?

 

Jack

Share this post


Link to post
Share on other sites

I meant an article in that feed. They change frequently, depending upon the feed. So if a feed works one time and not the next, that is probably the reason. It should happen, of course, but is probably the reason.

 

Jack

Share this post


Link to post
Share on other sites

I am trying to move your code for the box from column_left or column_right directly into the bodyof the index.php. When I place the below code into the body of index.php

		   <tr>
		<td class="pageHeading">
<?php   
		if (SHOW_RSS_NEWS == 'true') 
		  if (basename($PHP_SELF) != 'rss_reader.php') 
		  include(DIR_WS_BOXES . 'rss_news.php');
?>
		 </td>
	  </tr>

 

I get this error....

Fatal error: Cannot redeclare startelement() (previously declared in /home/xxxxx/public_html/includes/modules/rss_reader.php:46) in /home/xxxxx/public_html/includes/modules/rss_reader.php on line 68

 

This is the code from that function in modules/rss_reader.php

function startElement($parser, $name, $attrs) {
  	global $rss_channel, $currently_writing, $main;
  	switch($name) {
  		case "RSS":
  		case "RDF:RDF":
  		case "ITEMS":
  			$currently_writing = "";
  			break;
  		case "CHANNEL":
  			$main = "CHANNEL";
  			break;
  		case "IMAGE":
  			$main = "IMAGE";
  			$rss_channel["IMAGE"] = array();
  			break;
  		case "ITEM":
  			$main = "ITEMS";
  			break;
  		default:
  			$currently_writing = $name;
  			break;
  	}
}

 

My question becomes, can we use this module in the body of the index page?

Share this post


Link to post
Share on other sites

Not by including the code from the column box. There is a page already setup to display the feeds in the contribution. You can take the portions of it that have to do with the feed and paste it into the index file in the correct places and it will do what you want.

 

Jack

Share this post


Link to post
Share on other sites

Hi Jack,

 

Long time ago but I have a new question. I'm using your RSS News 1.3 page on my website to show new items of my blog. What I would like to have is a RSS feed of the page showing the news on my own website. So I would like to have the traffic first on my website and from there to my blog.

 

I'm using page2rss and twitterfeed to feed my Twitter but i'm not happy with it. All the traffic goes to page2rss instead of my website.

Could you please help me to add an rss to the RSS News page?

 

Greetings from Holland,

osCshop

Share this post


Link to post
Share on other sites

I don't currently have this contribution setup here so I can't check it but there should be an option in admin to create a feed. I don't think it was very powerful but it can create the baisc feed, which can then be edited by hand, if needed. This was mentioned previously in this thread so you may want to read through it.

 

Jack

Edited by Jack_mcs

Share this post


Link to post
Share on other sites

If you mean the RSS Create function under Tools in admin; I've tried it but nothing happend (probably because I don't use the info box)

So i'm not sure how it works but I don't think I can create a dynamic rss feed with that.

I need a dynamic feed from the rss_reader page..

Share this post


Link to post
Share on other sites

Then this won't do it as it is. The rss feed contribution allows you to create an rss feed of your products but not a way to display it as this one does, last I looked. There are probably sites around that will allow you to create a feed from your site. That would be an on-going job though if your products change much.

 

Jack

Share this post


Link to post
Share on other sites

OK, thanks for the reply. I'll check if there are better solutions then page2rss which I use now..

Share this post


Link to post
Share on other sites

hi,

 

did anyone find a work around for the error :

 

Warning: fopen() [function.fopen]: URL file-access is disabled in the server configuration in /includes/modules/rss_reader.php on line 112

 

Warning: fopen(http://newsrss.bbc.co.uk/rss/sportonline_uk_edition/football/rss.xml) [function.fopen]: failed to open stream: no suitable wrapper could be found in /includes/modules/rss_reader.php on line 112 could not open XML input

 

I amended the rss_reader.php to use a relative url :

 

hack  <!--      <td><?php echo '<a target="_blank" title="'. $rss_channel["TITLE"] .'" href="' . $rss_channel["LINK"] . '">' . '<img border="0" src="' .$rss_channel["IMAGE"]["URL"] .' align="middle" alt="' .$rss_channel["IMAGE"]["TITLE"] .'"> ' . '</a>'; ?></td> //-->

               <td><?php echo '<a target="_blank" title="'. $rss_channel["TITLE"] .'" href="http://newsrss.bbc.co.uk/rss/sportonline_uk_edition/football/rss.xml">' . '<img border="0" src="' .$rss_channel["IMAGE"]["URL"] .' align="middle" alt="' .$rss_channel["IMAGE"]["TITLE"] .'"> ' . '</a>'; ?></td>

Share this post


Link to post
Share on other sites

It is because of a setting on your server. You might try asking your host to see if they can find away around it. It is possible but some host won't do it and some just don't know how.

Share this post


Link to post
Share on other sites

hi,

 

I use "1and1" as my hosting company... and php5

 

I created a php.ini in the root directory with the following parameters in it....

 

allow_url_fopen = On

allow_url_include = on

 

now works fine... B)

 

Many thanks

Share this post


Link to post
Share on other sites

I am struggling with my search for a specific application of RSS. I hate to just start implementing the various contribs just to try to figure out what they can do and most of the descriptions are so incomplete you just can't tell what the capabilities are. Hopefully if I describe what I am looking for, someone can tell me if this contrib will work or maybe even if you know of another one that will. I am also not opposed to taking a contrib and modifying it to get to where I need to be.

 

I am developing a special interest store front. There are many RSS feeds associated with the area of interest. I want to pick some of the best feeds and include a box on my page that lists the feeds so a customer can link to those feeds if they see one they are interested in. It's just a way to let my customers know I have the same interests as they do.

 

Ideally the mod would have an admin option where I could specify the URLs containing the feeds I want to add. It would also let me tell it how many items to save, i.e. the latest 5. A cron job would run regularly that would go to each RSS URL and update a table or directory with the latest RSS items. When the customer goes to my store front I can then include a display for the feed items so they can link to the complete news article.

 

Will this contrib support that functionality? If not, would it be a good foundation to generate a new contrib that would?

 

I appreciate anyone's comments!!!

Share this post


Link to post
Share on other sites

I haven't looked at it in a while but it will do some, if not all, of them, as I recall.

Share this post


Link to post
Share on other sites

Hi Jack, me again :huh:

 

I have installed this contrib without issue.

 

I am a complete RSS noob, I've never been into blogging or anything so I've never used it. However my customers are asking for an RSS feed of new products. How would I go about creating on of these? Would I need to use the "RSS Create" tool? Sorry for the stupid question, but how?

 

Thanks so much for all the help you provide :thumbsup:

Adam

Share this post


Link to post
Share on other sites

Yes, as I recall, you can use the create tool. I think some code had to be added to have it work - see perviously in this thread. But then it is only setup to do them manually, I think. I'm sorry for not knowning for sure but I haven't looked at this contribution in a while and I don't have it setup here to test it. I keep meaning to update it but keep running out of time.

Share this post


Link to post
Share on other sites

No need to be sorry mate, the work you do already is amazing!

I'll have a look in the morning and see what I can find.

 

Cheers :thumbsup:

 

Yes, as I recall, you can use the create tool. I think some code had to be added to have it work - see perviously in this thread. But then it is only setup to do them manually, I think. I'm sorry for not knowning for sure but I haven't looked at this contribution in a while and I don't have it setup here to test it. I keep meaning to update it but keep running out of time.

Share this post


Link to post
Share on other sites

stirnpanzer - your fix worked a treat!! I was being driven mad by the fopen error and it is now working like a charm.

 

For anyone else interested, my shop is actually contained in an addon domain within my hosting account. I dropped the php.ini file into the root of the addon domain.

 

Thanks!

Tim.

 

hi,

 

I use "1and1" as my hosting company... and php5

 

I created a php.ini in the root directory with the following parameters in it....

 

allow_url_fopen = On

allow_url_include = on

 

now works fine... B)

 

Many thanks

Share this post


Link to post
Share on other sites

I've just added some code to rss_news.php to take <pubdate> from the RSS feed and display the date underneath the headline.

 

$text_string .= date('D j M', strtotime($rss_channel["ITEMS"][$i]["PUBDATE"])) . '<br>';

 

In the snippet below I've added some styling so that the date is smaller & slightly greyed out.

 

I hope someone finds this useful and if anyone knows how to make this code any tidyer then please share, I'm a long way from a php pro!

 

 

<?php
 include(DIR_WS_MODULES . '/' . FILENAME_RSS_READER);
 $info_box_contents = array();
 $info_box_contents[] = array('text' => BOX_HEADING_RSS_NEWS);

 new infoBoxHeading($info_box_contents, false, false);

$text =  array();

if (isset($rss_channel["ITEMS"])) {
if (count($rss_channel["ITEMS"]) > 0) {
  $maxLength = MAX_CHARACTERS;
	$maxCount = (count($rss_channel["ITEMS"]) > MAX_ARTICLE) ? MAX_ARTICLE : count($rss_channel["ITEMS"]); 
   $text_string = '<div class="smallText" style="color: #cccccc;">';
	for($i = 0;$i < $maxCount; $i++) {
	 $text_string .= '<strong>' . $rss_channel["ITEMS"][$i]["TITLE"] . '</strong><br>';
	 $text_string .= '<div style="color: #898989; font-size: 0.9em">';
	 $text_string .= date('D j M', strtotime($rss_channel["ITEMS"][$i]["PUBDATE"])) . '<br>';
	 $text_string .= '</div>';
	 $length = strlen(html_entity_decode($rss_channel["ITEMS"][$i]["DESCRIPTION"]));
   $snip = substr(html_entity_decode($rss_channel["ITEMS"][$i]["DESCRIPTION"]),0, ($length > $maxlength) ? $maxLength : $length);
   $text_string .=  $snip;
	 if ($length > $maxLength) {
	  $text_string .= '...<br>';
     $text_string .= '<a target="_blank" href="' . $rss_channel["ITEMS"][$i]["LINK"] . '"><font color="#dd0000">[see article]</font></a><hr>';
	 }
	 else
	  $text_string .= '<br><hr>'; 
	}	 
	$text_string .= '</div>';
	if (count($rss_channel["ITEMS"]) > 5)
	  $text_string .= '<a title="More Feeds" href="' . tep_href_link(FILENAME_RSS_READER, '', 'NONSSL') . '"><font color="#dd0000">More News...</font></a>';
}
} 

 $info_box_contents = array();
 $info_box_contents[] = array('text' => $text_string);


 new infoBox($info_box_contents);
?>

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×