Results 1 to 4 of 4

Thread: RSS feed displaying "'"

  1. #1
    Join Date
    Jul 2005
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default RSS feed displaying "'"

    Hi there,

    I hav installed the RSS Display Boxes:

    http://www.dynamicdrive.com/dynamici...ybox/index.htm

    but for some reason, the titles are displaying '
    For example:

    Hairdressing 'not just for girls'

    Any ideas how I can remove these?

    Thanks!

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    ' is a XML entity for quotes I believe. The problem most likely is due to Simplepie skipping it among the characters it should decode.

    Inside main.php, the below line is what outputs the actual contents of each RSS entry to be shown:

    Code:
    outputbody($item, $templatename); //call custom outputbody() function
    You can try doing a search and replace of ', and replacing that with a normal single quote:

    Code:
    preg_replace(/'/, "'", outputbody($item, $templatename)); //call custom outputbody() function
    Untested, but that's the general idea at least.

  3. #3
    Join Date
    Jul 2005
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks, but when I paste it into the main.php file, the RSS feeds don't seem to show up. Am I placing it in the correct file?

    PHP Code:
    preg_replace(/'/, "'"outputbody($item$templatename)); //call custom outputbody() function 

  4. #4
    Join Date
    Jan 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I had this problem and ended up using the PHP str_replace function in outputbody.php - I'm just using the default template which I changed as follows:

    if ($template=="" || $template=="default"){ //DEFAULT TEMPLATE
    ?>
    <DIV class="rsscontainer">
    <div class="rsstitle"><a href="<?php echo $item->get_permalink(); ?>"><?php echo str_replace("&apos;", "'", $item->get_title()); ?></a></div>
    <div class="rssdate"><?php echo $item->get_date('d M Y g:i a'); ?></div>
    <div class="rssdescription"><?php echo str_replace("&apos;", "'", $item->get_description()); ?></div>
    </DIV>
    <?
    } //end default template

    This seems to deal with the problem with &apos; no longer appearing in the titles and descriptions. However, I'm no PHP expert and there may be a better way.

    Works for me though - maybe it'll help you out.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •