Exemplo n.º 1
0
function parse_feed($feedurl, $htmldata)
{
    $result = '';
    $proxy = new SourceProxy();
    $source = $proxy->makeSourceFromAddress($feedurl, $result);
    //simple_fetch($feedurl, $result);
    if ($source) {
        if (isset($source->logo)) {
            $chanimg = "<a href=\"{$source->link}\"><img src=\"{$source->logo}\" title=\"{$source->title}\" style=\"border: 0px;\" /></a>";
        } else {
            $chanimg = '';
        }
        $htmldata = str_replace("{formaction}", $_SERVER['PHP_SELF'] . '?zfaction=addnew', $htmldata);
        $htmldata = str_replace("{feedurl}", htmlentities($feedurl), $htmldata);
        $htmldata = str_replace("{encfeedurl}", urlencode($feedurl), $htmldata);
        $htmldata = str_replace("{htmlurl}", $source->link, $htmldata);
        $htmldata = str_replace("{chanimg}", $chanimg, $htmldata);
        $htmldata = str_replace("{chantitle}", $source->title, $htmldata);
        $htmldata = str_replace("{chandesc}", $source->description, $htmldata);
        $htmldata = str_replace("{chanlink}", $source->link, $htmldata);
        $htmldata = str_replace("{shownitems}", ZF_DEFAULT_NEWS_COUNT, $htmldata);
        return $htmldata;
    } else {
        return "{$result} {$feedurl}.";
    }
}
Exemplo n.º 2
0
 public static function fromAddress($xmlurl)
 {
     $proxy = new SourceProxy($xmlurl);
     return $proxy->makeSourceFromAddress($xmlurl);
 }