
Originally Posted by
Nile
Ok, try this:
PHP Code:
<?php
echo "<h3>Sociology</h3>";
echo "<ul>";
$theuri = $_SERVER['REQUEST_URI'];
if ($myxml!=simplexml_load_file('research_sociologyindex.xml')){
die('Error reading the XML file');
}
foreach($myxml as $article){
if ( ($theuri == $article->link) ) {
$itemis ="<li><b> $article->title </b></li>";
} else {
$itemis = "<li><a href=$article->link>$article->title</a></li>";
}
}
echo "</ul>";
?>
Also, can I please see the
whole code, that may help...
That outputs the same thing as originally. That basically is the whole script. I can include these scripts I use that I deduced I would be able to set this up: research_sociologyindex.xml
Code:
<?xml version="1.0" encoding="utf-8" ?>
<sociology>
<article>
<title>Thoughts on the Evolution of Social Inequality: A Paradigmatic Analysis</title>
<description>American anthropology is in a state of theoretical crisis. Unlike most mature scientific disciplines anthropolologists seem unable even to agree on the structure of our discipline or the most important research questions to ask, let alone the best way to develop theory and increase our understanding of the human world. How is productive research possible in such an intellectual climate? In the early 1960’s, philosopher Thomas Kuhn argued that scientific disciplines periodically pass through "revolutionary" changes in theory (1970). According to Kuhn, these changes occur when a dominant paradigm or theoretical framework fails to account for empirical observations and when a better paradigm is developed...</description>
<link>research_sociology_toteosiapa.htm</link>
</article>
<article>
<title>Why we hate complexity</title>
<description>Natural and social systems are complex -- that is, not entirely knowable, unpredictable, resistant to cause-and-effect analysis, in a word, mysterious. For our first three million years on Earth we humans, like every other species on the planet, accepted that mystery. We adapted rather than trying to change our environment. We evolved by learning to accommodate ourselves to our environment. Those unable to accommodate perished....</description>
<link>research_sociology_wwhc.htm</link>
</article>
</sociology>
I have catagory index pages setup using similiar XML files, EXAMPLE using code:
PHP Code:
<?php
if (!$myxml=simplexml_load_file('research_sociologyindex.xml')){
echo 'Error reading the XML file';
}
foreach($myxml as $article){
echo '<center><img src=','images/upperlotushalf.jpg','></center>';
echo '<blockquote><h3> ' . $article->title . '</h3>';
echo '' . $article->description . '<br />';
echo '<a href=','' . $article->link . '',' class=','button','><span>Continue reading...</span></a></blockquote><br />';
}
?>
rightside_sociologyresearch.php
PHP Code:
<?php
echo "<h3 class='leftrightheader'>Sociology</h3>";
$theuri = $_SERVER['REQUEST_URI'];
echo "<ul>";
if ( ($theuri =="/research_sociology_toteosiapa.htm") ) {
$itemis = "<li><b>Thoughts on the Evolution of Social Inequality: A Paradigmatic Analysis</b></a></li>";
} else {
$itemis = "<li><a href='research_sociology_toteosiapa.htm'>Thoughts on the Evolution of Social Inequality: A Paradigmatic Analysis</a></li>";
}
echo $itemis;
if ( ($theuri =="/research_sociology_wwhc.htm") ) {
$itemis = "<li><b>Why we hate complexity</b></a></li>";
} else {
$itemis = "<li><a href='research_sociology_wwhc.htm'>Why we hate complexity</a></li>";
}
echo $itemis;
echo "</ul>";
?>
I figured I would be able to set something up where I wouldent have to constantly update any of the "rightside_whateverresearch.php" files everytime I load a new article.
Best Regards
~Spine
Bookmarks