Need another set of eyes here. Part of my menu ceased to function after switching to a new Apache and PHP. Testing on original versions still shows broken menu. Here's an example of the problem ...absolutely no navigation here. Only Custom Solutions appears to be affected, while Outsourcing (BPO), set up the same way, functions properly.
Here is the real layout. for Services > Custom Solutions.
My menu is set up as the code below:
error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);
$title = func_get_arg(0);
$category = func_get_arg(1);
$scategory = func_get_arg(2);
$sscategory = func_get_arg(3);
$ssscategory = func_get_arg(4)
include "../db/connect.php";
$query = "select *, IF(sequence IS NULL, 99, sequence) AS sort_ord
FROM navigation
WHERE id = '".$category."'
AND active='y'
ORDER BY sort_ord ASC, title";
$result = mysql_query($query);
//this query should pull back based on alphabetical title UNLESS there is a 'sequence' number
while ($row = mysql_fetch_array($result)) {
echo '<a href="'.$row['path'].'"><img src="images/nav/heads/'.$row['image'].'" alt="'.$row['title'].'" border="0"></a><BR>';
echo '<img src="images/nav/heads/underline.gif" alt="Menu Header Underline"><BR>';
echo '<table>';
if($category == '38' && $scategory == '0') {
$query = "select *,
IF(sequence IS NULL, 99, sequence) AS sort_ord from navigation
where parent = '".$row['id']."'
AND active='y'
AND id NEQ '38'
ORDER BY sort_ord ASC, title";
} else {
$query = "select *,
IF(sequence IS NULL, 99, sequence) AS sort_ord
from navigation
where parent = '".$row['id']."'
AND active='y'
ORDER BY sort_ord ASC, title";
}
$result = mysql_query($query);
while ($row2 = mysql_fetch_array($result)) {
$selectedrow = $row2['id'];
if($selectedrow == $scategory) { //if we are on this page, show 'selected' arrow graphic
$arrow = '<img src="images/nav/arrows/arrowOn.gif" alt="Arrow On">';
//see if there are any 3rd level subcats
if($category == '38' && $scategory == '0') { //if this is the employees category...
$query3 = "select *,
IF(sequence IS NULL, 99, sequence) AS sort_ord
from navigation
where parent = '".$selectedrow."'
AND active='y'
AND id NEQ '38'
ORDER BY sort_ord ASC, title";
} else {
$query3 = "select *,
IF(sequence IS NULL, 99, sequence) AS sort_ord
from navigation
where parent = '".$selectedrow."'
AND active='y'
ORDER BY sort_ord ASC, title";
}
$result3 = mysql_query($query3);
$num_rows = mysql_num_rows($result3);
} else {
$arrow = '<img src="images/nav/arrows/arrowOff.gif" alt="Arrow Off">'; //if not on this page, show 'off' arrow graphic
}
if($row2['title'] == "Welcome - Logged in!") {
// if this is the main entry page for Employees, don't show 'Logged In' page
echo '';
} else { //continue showing the rest of the menu
echo '<tr><td>'.$arrow.'</td><td><a href="'.$row2['path'].'" class="navLink"><strong>'.$row2['title'].'</strong></a></td></tr>';
}
while($row3=mysql_fetch_array($result3)) {
echo '<tr><td align="right"><img src="images/nav/bullet.gif" alt="Bullet"></td><td align="left"><a href="'.$row3['path'].'" class="navLink2">'.$row3['title'].'</a></td></tr>';
$selectedrow = $row3['id'];
if($selectedrow == $sscategory) {
$query4 = "select *,
IF(sequence IS NULL, 99, sequence) AS sort_ord
from navigation
where parent = '".func_get_arg(3)."'
AND active='y'
ORDER BY sort_ord ASC, title";
$result4 = mysql_query($query4);
while($row4=mysql_fetch_array($result4)) {
echo '<tr><td align="right"> </td><td align="left"> <table><tr><td> - </td><td><a href="'.$row4['path'].'" class="navLink">'.$row4['title'].'</a></td></tr></table></td></tr>';
}
}
}
}
if($category == '28' || $category == '27' || $category == '38' && $scategory == '0') { //start if statement for SITEMAP or EMPLOYEE side navigation - show only one underline
echo '';
} else {
if($category == '22') {
//if this is careers/hot jobs category, then show Submit Resume button
echo '<tr><td colspan="4">';
echo "<BR><center>";
echo '<a href="/careers/oppr.php?goto=apply&id=General">';
echo '<img src="/images/buttons/submitresume.gif" border="0" alt="Submit Resume">';
echo "</a>";
echo "</center>";
echo "</td></tr>";
}
echo '<tr><td colspan="2"><img src="images/nav/heads/underline.gif" alt="Menu Header Underline"><BR>';
}
echo "</td></tr></table>";
}
With the Services > Custom Solutions area set up as so:
include('../../display.php');
//head('title_of_page",'id of MAIN category','id of subcategory if applicable','id for 3rd level dropdowns');
//title, top parent, id of above level category, id of self
switch ($multi) {
case 'newappdev':
head('Custom Solutions - New Application Development','35','36','18');
include "newappeng.php";
break;
case 'appmaint';
head('Custom Solutions - Application Maintenance','35','36','17');
include "appmaint.php";
break;
case 'legacyevol':
head('Custom Solutions - Legacy Evolotion','35','36','19');
include "legacyevol.php";
break;
default:
head('Custom Solutions','35','36');
?>
DEFAULT HTML
<?php
}
foot();
The database itself is set up something like the following:
ID | parent | title
35 | 0 | Services
36 | 35 | Custom Solutions
18 | 36 | New Application Development
17 | 36 | Application Maintenance
19 | 36 | Legacy Evolution
32 | 36 | Enterprise Solutions
8 | 32 | SAP
(etc.)