FeedForAll Forum Index  
 Home  •  FAQ  •   Search   •  Register   •  Profile   •  Log in
 ItemDescription field includes HTML tags View next topic
View previous topic
Post new topicReply to topic
Author Message
peterharris



Joined: 06 Mar 2012
Posts: 4

PostPosted: Tue Mar 06, 2012 5:04 pm Reply with quoteBack to top

The following feed from a website developed using DRUPAL shows HTML tags in the ItemDescription field.

I'm using the rss2html.php RSS feed to HTML webpage script

RSS= http://www.kingstonroyals.co.uk/?q=rss.xml

The output is displayed here

Website URL = http://www.peterharris.biz/krsc/noticeboard.php

The script as is works perfectly for other rss xml feeds. The issue appears to be specific to Drupal

Interesting the RSS URL displays correctly in IE and Safari, but not Chrome or Firefox.

Any ideas?
View user's profile
Tech Support



Joined: 27 Aug 2004
Posts: 2793

PostPosted: Tue Mar 06, 2012 5:22 pm Reply with quoteBack to top

Can you open your rss2html.php file in an editor and past the first 20 lines into a reply? I want to see what version you are running.

Also, can you post a link to your template file, so I can see if perhaps a change in there could help.

Thanks

_________________
Create RSS Feeds
Audio Recording and Editing
View user's profile
peterharris



Joined: 06 Mar 2012
Posts: 4

PostPosted: Tue Mar 06, 2012 5:33 pm Reply with quoteBack to top

I presume this is the file renamed to noticeboard.php

<?php

//v1.50: Correctly orders results again (thanks, Tiffany in Oxnard CA, USA)
// fix for uninitialised variable (thanks, Daryl in Harrison OH, USA)
// debug now reports server's local time, which might be handy.
// potential fix for events appearing on wrong day (thanks, Ashok)
// replacement of deprecated eregi_replace (thanks, Sean in Iowa)
// Updated 5 February 2012
//v1.41: Small fix for max-results, which had disappeared. Thanks, Pete in Chicago
//v1.40: ...and now we have a cache, thanks to Emilio Velis who got @ramayac to
// write it for him. Which is excellent. Updated 21 February 2011
//v1.30: Daylight savings time *is*, honestly, now properly dealt with.
// thanks Kevin Grewohl for pointing out that it wasn't! ;)
// Updated 21 February 2011
//v1.20: Daylight savings time is now properly dealt with
//v1.10: This code now deals correctly with events that have a date range lasting more
// than one day. Thank you, David Power, for the fix!
//v1.01: Some small bugfixes//30 Jun 2010
//v1.00: Rewrite to remove SimplePie completely, and simply use PHP's inbuilt XML parser.
// Updated 29 June 2010
//v0.93: Added "make email addresses clickable". Thank you, Bjorn!
//v0.92: Fixed an issue with 'a section of dates' in amendable code. Thank you Kevin!
//v0.91: Nice error message if there are no events to display, requested by Tomas. Thanks!
//v0.90: Feature: clickable links in descriptions (start them http://). Thank you, Adam!
// Feature: display end times, requested by Lucy. Thanks!
// Feature: group by date, requested by Lucy. Thanks!
// http://james.cridland.net/code

Template file = http://www.peterharris.biz/krsc/sample-template1.html
View user's profile
Tech Support



Joined: 27 Aug 2004
Posts: 2793

PostPosted: Tue Mar 06, 2012 6:32 pm Reply with quoteBack to top

This is part of your template:

Code:

            <TR>
                <TD>
                    <!--    ~~~ItemDescription~~~   -->

               <?php strip_tags(?>~~~ItemDescription~~~<?php ); ?>
                    <BR>
                </TD>
            </TR>


Notice how the ~~~ItemDescription~~~ line has been commented out and it is replaced with a similar line that is using the PHP strip_tags function.

I believe that is causing the problem.

Try putting that part of the template back to this:
Code:

            <TR>
                <TD>
                    <!--    ~~~ItemDescription~~~   -->

               <?php strip_tags(?>~~~ItemDescription~~~<?php ); ?>
                    <BR>
                </TD>
            </TR>


It may fix this problem, but the strip_tags might be in there for a reason, and other content might need it to display correctly. It might be a catch-22 situation.

_________________
Create RSS Feeds
Audio Recording and Editing
View user's profile
peterharris



Joined: 06 Mar 2012
Posts: 4

PostPosted: Tue Mar 06, 2012 6:43 pm Reply with quoteBack to top

Ah yes, I put strip_tags in there in an attempt to fix the problem.

It made no difference

I've now reverted it back to the original format, and the problem is still there

Peter
View user's profile
Tech Support



Joined: 27 Aug 2004
Posts: 2793

PostPosted: Wed Mar 07, 2012 7:33 am Reply with quoteBack to top

I think you might be using an older version of rss2html. I just tried using that feed and your template with the current version, and it seems to work fine.

Here is a link to my test:
http://www.feedforall.com/temp/rss2html.php?TEMPLATE=template.html&XMLFILE=http://www.kingstonroyals.co.uk/%3Fq=rss.xml

_________________
Create RSS Feeds
Audio Recording and Editing
View user's profile
peterharris



Joined: 06 Mar 2012
Posts: 4

PostPosted: Wed Mar 07, 2012 1:53 pm Reply with quoteBack to top

Sorry, I'm confused. I can see your version works, but I've just downloaded what I believe to be the latest version from this page

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

and downloaded the following zip file:

RSS2HTML - free PHP script for dipslaying RSS feeds using html

and still get the same issues, having changed the $XMLfilename line only and uploaded all 4 files

I guess I'm downloading the wrong version. Where and which is the correct download?

Here are the first 20 lines or so of the file http://www.kingstonroyals.co.uk/mobile/rss2html.php



<?PHP
//
// rss2html.php RSS feed to HTML webpage script
//
// Copyright 2004-2007 NotePage, Inc.
// http://www.feedforall.com
//
// This script may be used and modified freely for business or personal use
// This script may not be resold in any form
// This script may only be redistributed in its original form
//
//
// $Id: rss2html.php,v 3.15 2010/03/16 22:31:38 housley Exp $
//

//
// ==========================================================================
// Configuration options
// ==========================================================================
//
// Set the following variable useFopenURL to one if you want/need to use
// fopen() instead of CURL or FeedForAll_fopen()
$useFopenURL = 0;

//
// If XLMFILE is passed as part of the URL, XMLFILE=, then it will be used
// otherwise the the file below is used.
//$XMLfilename = "http://examlple.com/sample.xml";
$XMLfilename = "http://www.kingstonroyals.co.uk/?q=rss.xml";
View user's profile
Tech Support



Joined: 27 Aug 2004
Posts: 2793

PostPosted: Thu Mar 08, 2012 8:17 am Reply with quoteBack to top

The version your downloaded (3.15) is the latest, and is the one I used in the previous test.

Try grabbing a copy of the template.html from our site (http://www.feedforall.com/temp/template.html) and using it.

So basically put the new rss2html.php and the test template.html I used, in a temp folder on your server. Then use a link similar to this to test it:

http://www.peterharris.biz/temp/rss2html.php?TEMPLATE=template.html&XMLFILE=http://www.kingstonroyals.co.uk/%3Fq=rss.xml

_________________
Create RSS Feeds
Audio Recording and Editing
View user's profile
Display posts from previous:      
Post new topicReply to topic


 Jump to:   



View next topic
View previous topic


Powered by phpBB © 2001, 2002 phpBB Group :: FI Theme