\n";
// --- Paragraph format ---
if ($val[1] == 'para') {
// Image
if ($rss->image[url] != '') {
$title = $rss->image[title];
$link = htmlentities($rss->image[link]);
$url = $rss->image[url];
$disp .= "\t
\n";
}
// Title, copyright, and description
$title = $rss->channel[title];
$copy = $rss->channel[copyright];
$link = htmlentities($rss->channel[link]);
$desc = $rss->channel[description];
$disp .= "\t$title
\n";
if ($copy != '') $disp .= "\t$copy
\n";
if ($desc != '') $disp .= "\t$desc
\n";
$disp .= "\n\t
\n";
// For each item...
foreach($rss->items as $item) {
$title = $item[title];
$link = htmlentities($item[link]);
$desc = $item[description];
if ($title != '') $disp .= "\t$title\n
";
if ($desc != '') $disp .= "\t$desc\n
";
}
// --- List format ---
} elseif ($val[1] == 'list') {
// Feed title, description, link, & copyright
$title = $rss->channel[title];
$link = htmlentities($rss->channel[link]);
$copy = $rss->channel[copyright];
$disp .= "\t$title
\n";
if ($copy != '') $disp .= "\t$copy
\n";
$disp .= "\n\t
\n";
// Item title, description, & link
foreach($rss->items as $item) {
$title = $item[title];
$link = htmlentities($item[link]);
if ($title != '') $disp .= "\t$title
\n";
}
}
// --- Not Found ---
} else {
$disp = "\nFirstRSS ERROR: "$url" NOT FOUND!
\n";
}
// --- Replace ---
$find = $val[0];
$replace = $disp;
}
// --- Display Credits? ---
// Yes, you can remove this line. If I were you, I would. Any questions?
if ($used) $appendage .= "\n
Powered by FirstRSS Plugin
\n"; // --- Return --- return str_replace($find, $replace, $content) . $appendage; } // --- Filter --- add_filter('the_content', 'ujc_firstrss'); ?>