Need help fixing a PHP coding error

Discussion in 'PHP' started by The Bird of Prey, Oct 18, 2008.

  1. #1
    I'm a bit of a noob when it comes to PHP, and I'm having some trouble getting a bit of code to show properly on the page.

    The code is supposed to pull a CC image from flickr and display the image along with the required credit and description for the image pulled.

    I've tried several times to reach the original site designer without success. I've discovered quite a few sites designed by the same fellow that all have the same problem I'm seeing.

    Using IE7 (I don't know if it shows this way in other browsers) take a look at the photo in the middle of this page. feel free to view source as well to see what is happening.

    http://consolidationlibrary.com/Consolidation-photos.php

    notice the blue link line just to the left of the image and the blue link line surrounding the image.
    Those and the fact that it doesn't show the description and credit lines are what I want to get fixed.
    I'm hoping it's a simple super quick fix (add a " or remove a ") but if not I am willing to pay a reasonable amount for the time taken to make this work the way it is supposed to work. It shouldn't be too hard to point this error out to the other site owners and get "fix it" work from them too. So please take that into consideration.
    PM me if you think you can fix this and let me know what it will cost.

    Thanks,
    BOP
     
    The Bird of Prey, Oct 18, 2008 IP
  2. allancass

    allancass Active Member

    Messages:
    120
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #2
    The issue is related to the styles. PM me if you like this fixed.
    Cheers.
     
    allancass, Oct 18, 2008 IP
  3. Icheb

    Icheb Peon

    Messages:
    1,092
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #3
    And this is related to PHP... how?
     
    Icheb, Oct 18, 2008 IP
  4. The Bird of Prey

    The Bird of Prey Greenhorn

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #4
    With all due respect... I believe the problem is in the PHP code that calls the image in from flickr. I've been through the styles (as the other respondent suggested) numerous times. No change to the styles has had any effect on the output.
    In an attempt to make it more clear, perhaps you can tell me why the following code tries to put TWO of the same image on the page.

     
    The Bird of Prey, Oct 18, 2008 IP
  5. Icheb

    Icheb Peon

    Messages:
    1,092
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #5
    The OUTPUT most certainly isn't PHP, so this is no PHP error. You are even TELLING people to view source, so what do you see when you do that? PHP? No. :rolleyes:
     
    Icheb, Oct 19, 2008 IP
  6. The Bird of Prey

    The Bird of Prey Greenhorn

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #6
    Well,

    That was most helpful. I bow to your all knowing wisdom. May your grace and kindness serve you well all the days of your life.

    The above may or may not contain sarcasm
     
    The Bird of Prey, Oct 19, 2008 IP
  7. logylaps

    logylaps Active Member

    Messages:
    761
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    85
    #7
    This last part...
    if (isset($rss_channel["ITEMS"])) {
    if (count($rss_channel["ITEMS"]) > 0) {
    if (count($rss_channel["ITEMS"]) > $flickrlimit) {$NumberOfItems = $flickrlimit;}
    else {$NumberOfItems = count($rss_channel["ITEMS"]);}
    for($i = 0;$i < $NumberOfItems;$i++) {
    if (isset($rss_channel["ITEMS"][$i]["LINK"])) {
    print ("\n<div class=\"noshow\"><a target=\"_blank\" href=\"" . $rss_channel["ITEMS"][$i]["LINK"] . "\">" . $rss_channel["ITEMS"][$i]["TITLE"] . "</a></div>");
    } else {
    print ("\n<div class=\"noshow\">" . none . "</div>");
    }
    print ("<div class=\"instant\" id=\"none\">" . preg_replace($patterns,$replacements,$rss_channel["ITEMS"][$i]["DESCRIPTION"]) . "</div>"); }
    } else {
    print ("No News Found");
    }
    }
    ?>
    PHP:
    Im not making any guarantees, but try replacing with this:

    if (isset($rss_channel["ITEMS"])) {
    if (count($rss_channel["ITEMS"]) > 0) {
    if (count($rss_channel["ITEMS"]) > $flickrlimit) {$NumberOfItems = $flickrlimit;}
    else {$NumberOfItems = count($rss_channel["ITEMS"]);}
    for($i = 0;$i < $NumberOfItems;$i++) {
    if (isset($rss_channel["ITEMS"][$i]["LINK"])) {
    print ("\n<div><a target=\"_blank\" href=\"" . $rss_channel["ITEMS"][$i]["LINK"] . "\">" . $rss_channel["ITEMS"][$i]["TITLE"] . "</a></div>");
    } else {
    print ("\n<div>" . none . "</div>");
    }
    print ("<div>" . preg_replace($patterns,$replacements,$rss_channel["ITEMS"][$i]["DESCRIPTION"]) . "</div>"); }
    } else {
    print ("No News Found");
    }
    }
    ?>
    PHP:
     
    logylaps, Oct 19, 2008 IP
  8. The Bird of Prey

    The Bird of Prey Greenhorn

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #8
    Thank you very much! That is a great improvement! Now If I can just get the style part right I think this is licked.
    +rep to you (tis the least I can do!)
     
    The Bird of Prey, Oct 19, 2008 IP