Results 1 to 2 of 2

Thread: Why am I getting the default value returned for this function?

  1. #1
    rhyswynne is offline Hello World
    Join Date
    Jan 2010
    Posts
    7

    Default Why am I getting the default value returned for this function?

    Hi everybody, having an odd problem with one of my plugins.

    The plugin is designed to pull in ebay feeds. Here's one of the functions.

    PHP Code:
    function ebay_feeds_for_wordpress_notecho($dispurl ""$dispnum "") {
    include_once(
    ABSPATH WPINC '/rss.php');
    $link get_option("ebay-feeds-for-wordpress-link");
    if (
    $dispurl == "")
    {
    $dispurl get_option('ebay-feeds-for-wordpress-default');
    }

    if (
    $dispnum == "")
    {
    $dispnum get_option('ebay-feeds-for-wordpress-default-number');
    }

    /* ======================================== */


    $display .= "FEED URL: " $dispurl;
    $disprss fetch_feed($dispurl);


    /* ======================================== */


    $disprss_items $disprss->get_items(0$dispnum);


    $display .=  "<div class='ebayfeed'>";
    foreach (
    $disprss_items as $dispitem ) {
    $display .= "<h4><a href='".$dispitem->get_permalink()."'>".$dispitem->get_title()."</a></h4>";
    $display .= $dispitem->get_description();
    $display .= "<br/>Title: " $dispitem->get_title();
    }
    $display .= "</div>";
    if (
    $link == 1)
    {
        
    $display .= "<a href='http://bloggingdojo.com/wordpress-plugins/ebay-feeds-for-wordpress/'>eBay Feeds for WordPress</a> by <a href='http://www.bloggingdojo.com'>The Blogging Dojo</a><br/><br/>";
    }


    return 
    $display;


    Now, if $dispurl is empty, then the feed uses the default feed (call it http://www.feed1.com/). However, I am supplying a URL to this code (http://www.feed2.com/). When I run the code I get http://www.feed2.com/ shown in the first line highlighted (between the commented ==='s), yet the feed fetched is http://www.feed1.com/, with incorrect URL's

    I'm completely and utterly confused by it. Any ideas will be greatfully appreciated!

    Cheers :)

    Rhys

  2. #2
    rhyswynne is offline Hello World
    Join Date
    Jan 2010
    Posts
    7

    Default

    Figured it out chaps.

    The feed had an & in it, which was getting parsed as &amp;. As such it was parsing wrong. Fixed now! :)

Posting Permissions

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