function tempCell($temp)
{
    if ($temp == '' || intval($temp) > 0) {
        return XmlCell($temp);
    } else {
        return XmlCell($temp, "style='background-color:blue;color:white;'");
    }
}
Beispiel #2
0
    $parser = new xmlParser();
    $parser->parse($url);
    $status = $parser->output[0]['attrs']['STAT'];
    // FOR DEBUGGING PURPOSES
    //print $status;
    //print "<hr><pre>";
    //print_r($parser->output);
    //print "</pre>";
    $content =& $parser->output[0]['child'][0]['child'];
    foreach ($content as $item) {
        if ($item['name'] == "PHOTO") {
            print "<tr>";
            // "_s" suffix specifies a 75x75 pixel format
            $photourl = "http://farm" . $item['attrs']['FARM'] . ".static.flickr.com/" . $item['attrs']['SERVER'] . "/" . $item['attrs']['ID'] . "_" . $item['attrs']['SECRET'] . "_s.jpg";
            //print "<p><img src='".$photourl."'>";
            print XmlCell($photourl);
            print XmlCell($item['attrs']['TITLE']);
            print XmlCell($item['attrs']['OWNERNAME']);
            print XmlCell($item['attrs']['DATETAKEN']);
            print XmlCell($item['attrs']['TAGS']);
            print "</tr>";
            $cnt++;
        }
    }
}
print "\n" . "</rows>";
echo "\n</response></ajax-response>";
function XmlCell($value)
{
    return "<td>" . htmlspecialchars($value) . "</td>";
}