Ahh, I see.
I still have a couple specific, but small problems with using this whole setup on my site. How do I return the article title itself to parse between <title></title> in the basic HTML; In the script I have ' . $article->title . ' which displays the article title from XML <title>The Last Question</title>. I really don't want a generic page title that is the same across every news article.
And I also have <subtitle>seconday title text</subtitle> that I will only be using on a few articles. There must be a way that I could go like so: <subtitle active="false"></subtitle> and the PHP will then ignore the line I have in bold so that I don't have an unnecessary line of whitespace:
Code:
<?php
$variable = $_GET['id'];
if (!$myxml=simplexml_load_file($variable.'.xml')){
echo 'Error reading the XML file';
}
foreach($myxml as $article){
echo '<h2> ' . $article->title . '<span></span></h2>';
echo '<b>' . $article->subtitle . '</b><br />';
echo '<a href=','' . $article->link . '','>' . $article->source . ' | ' . $article->publishdate . '</a><br />';
echo '' . $article->content . '';
echo '<p class=','meta','> <span class=','posted','>Posted by <a href=','mailto:admin@integralbuddha.net','>Ross Vaughn</a> on ' . $article->publishdate . '</span> <a href=','' . $article->permalink . '',' class=','permalink','>Permalink</a></p>';
}
?>
This is the link I'am testing the script on http://www.integralbuddha.net/n/v.htm?id=2
Bookmarks