Quote:
Originally Posted by Lynne
1. Post your code and maybe we can see why the author isn't showing up.
2. If you aren't having the problem by doing f=barbie, then just make the call that way.
3. I don't think you can do that with css inline. Maybe with javascript, but not css. You should define it on the bottom of your Main CSS page and then use that class in your code.
|
Thanks Lynne ( you really are a star you know )
Code is as follows:
Code:
<HTML>
<HEAD>
<TITLE> Test </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<BODY>
<?php
// ######################################################
// ## configuration
// ##
$rss2_file = 'http://www.yobromofo.com/forum/external.php?type=RSS2&f=barbie';
// ## configuration end
// ######################################################
// ## Do not touch code below!
$is_item = false;
$tag = '';
$title = '';
$description = '';
$link = '';
$date = '';
$author = '';
function character_data($parser, $data)
{
global $is_item, $tag, $title, $description, $link, $date, $author;
if ($is_item)
{
switch ($tag)
{
case "TITLE":
$title .= $data;
break;
case "DESCRIPTION":
$description .= $data;
break;
case "LINK":
$link .= $data;
break;
case "PUBDATE":
$date .= $data;
break;
case "AUTHOR":
$author .= $data;
break;
}
}
}
function begin_element($parser, $name)
{
global $is_item, $tag;
if ($is_item)
{
$tag = $name;
}
else if ($name == "ITEM")
{
$is_item = true;
}
}
function end_element($parser, $name)
{
global $is_item, $title, $description, $link, $date, $author, $rss2_output;
if ($name == "ITEM")
{
$rss2_output .= "<dt><strong>
<a href='" . trim($link) . "'target=\"_blank\"><span style=\"font-family: sergo UI,sans-serif;font-size:16px;text-decoration: underline;color: #73a202; margin-left: 20px\">" . htmlspecialchars(trim($title)) . "</span></a></strong> - <span style=\"font-family: sergo UI,sans-serif;font-size:12px;color: #92b5e7\">" . htmlspecialchars(trim($date)) . "</span> <span style=\"font-family: sergo UI,sans-serif;font-size:14px;color: #bbbbbb\">" . htmlspecialchars(trim($author)) . "</span><br /><span style=\"font-family: sergo UI,sans-serif;font-weight:bold;font-size:14px;color: #bbbbbb; margin-left: 20px\">" . htmlspecialchars(trim($description)) . "</span></dt><br />";
$title = "";
$description = "";
$link = "";
$date = "";
$author = "";
$is_item = false;
}
}
$parser = xml_parser_create();
xml_set_element_handler($parser, "begin_element", "end_element");
xml_set_character_data_handler($parser, "character_data");
$fp = fopen($rss2_file,"r");
while ($data = fread($fp, 4096))
{
xml_parse($parser, $data, feof($fp));
}
fclose($fp);
xml_parser_free($parser);
?>
<?php echo $rss2_output;?>
</BODY>
</HTML>