Hi all,
i have a big problem with my navigation bar..
the thing is i can get all of the work apart from when you click a department name you go inside that department you can see the tabs but when you select on the last item in the list it displays the content but the navigation bar disappears
i want the menu to basically only change the first time the user goes into the department not when they are in there ... is that clear
[php]this my code for the navigation so far
$content_catego ries_id = $_REQUEST['content_catego ries_id'];
if ($content_categ ories_id > 0){
//isset($_REQUEST['categories']);
//$content_catego ries_id < 5;
//content
echo '<div id="page2">';
//Query the database
$query = "SELECT u.content_id, title, summary, contents FROM contents AS u, content_associa tions AS ca WHERE u.content_id = ca.content_id AND u.content_id=$c ontent_categori es_id AND ca.approved = 'Y' ORDER BY content_categor ies_id DESC";
$result = mysql_query($qu ery) or die('Error : ' . mysql_error());
$row = mysql_fetch_arr ay($result, MYSQL_ASSOC);
$title = $row['title'];
$summary = $row['summary'];
$contents = $row['contents'];
$nav2 .= "<h1>$title </h1> <p><strong>$sum mary</strong></p> <p>$contents</p>";
$nav2 .= '</div>';
//navigation
$self = $_SERVER['PHP_SELF'];
//$query = "SELECT u.content_id, title, summary, contents FROM contents AS u, content_associa tions AS ca WHERE u.content_id = ca.content_id AND ca.content_cate gories_id=$cont ent_categories_ id AND ca.approved = 'Y' ORDER BY ca.content_cate gories_id DESC";
$query = "SELECT u.content_id, title, summary, contents FROM contents AS u, content_associa tions AS ca WHERE u.content_id = ca.content_id AND ca.content_cate gories_id=$cont ent_categories_ id AND ca.approved = 'Y' ORDER BY ca.content_cate gories_id DESC";
$result = mysql_query($qu ery);
// create the content list
echo '<div id="sub-navigation">';
$nav = '<ul>';
while($row = mysql_fetch_arr ay($result, MYSQL_NUM))
{
list($content_c ategories_id, $categories) = $row;
$nav .= "<li><a href=\"$self?co ntent_categorie s_id=$content_c ategories_id\"> $categories</a></li>\r\n";
}
$nav .= '</ul></div>';
echo $nav;
echo $nav2;
} else {
//$content_catego ries_id = 0;
// this will display the front page
echo '<div id="page2">';
$query = "SELECT u.content_id, title, summary, contents FROM contents AS u, content_associa tions AS ca WHERE u.content_id = ca.content_id AND u.content_id=10 ";
$result = mysql_query($qu ery) or die('Error : ' . mysql_error());
$row = mysql_fetch_arr ay($result, MYSQL_ASSOC);
$title = $row['title'];
$summary = $row['summary'];
$contents = $row['contents'];
$nav2 .= "<h1>$title </h1> <p><strong>$sum mary</strong></p> <p>$contents</p>";
$nav2 .= '</div>';
$self = $_SERVER['PHP_SELF'];
$query = "select * from content_categor ies ";
$result = mysql_query($qu ery);
//create the content list
echo '<div id="sub-navigation">';
$nav = '<ul>';
while($row = mysql_fetch_arr ay($result, MYSQL_NUM))
{
list($content_c ategories_id, $categories) = $row;
$nav .= "<li><a href=\"$self?co ntent_categorie s_id=$content_c ategories_id\"> $categories</a></li>\r\n";
}
$nav .= '</ul></div>';
echo $nav;
echo $nav2;
}[/php]
Please enclose any code within the proper code tags. See the Posting Guidelines on how to do that. - moderator