SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Dec 2003
    Location
    Manchester UK
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wordpress PHP Coding Problem - Where Are They Passing the Value?

    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
    Hi! I'm Rhys Wynne and I wrote bbPress Complete
    Author+ Premium Wordpress Plugin - Use Code FORUM10 for 10% Off!
    WP Email Capture - Build Your List From Inside Wordpress
    Follow Me on Twitter

  2. #2
    SitePoint Member
    Join Date
    Dec 2003
    Location
    Manchester UK
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Figured it out chaps.

    The feed had an & in it, which was getting parsed as &amp;. As such it was parsing wrong. Fixed now!
    Hi! I'm Rhys Wynne and I wrote bbPress Complete
    Author+ Premium Wordpress Plugin - Use Code FORUM10 for 10% Off!
    WP Email Capture - Build Your List From Inside Wordpress
    Follow Me on Twitter


Tags for this Thread

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
  •