On the order side bar menu... I read a post that explained changing the Order By to CategoryID. I tried this and it does not seem to work? If there is an easier way, please let me know.
PS - Here is the code: (sidemenu.php)
<?php
function getCatAccordion($StartWith=0,$prevLevels=0) {
$retHTML = "";
$retScript = "";
mysql_select_db($GLOBALS['database_PowerStoreConnection'], $GLOBALS['PowerStoreConnection']);
$query_SubCategoryList = "SELECT * FROM ps4_categories WHERE CategoryParent = ".$StartWith . " ORDER BY CategoryID";
$SubCategoryList = mysql_query($query_SubCategoryList, $GLOBALS['PowerStoreConnection']) or die(mysql_error());
$totalRows_SubCategoryList = mysql_num_rows($SubCategoryList);
$row_SubCategoryList = mysql_fetch_assoc($SubCategoryList);
$totalRows_SubCategoryList = mysql_num_rows($SubCategoryList);
$first = ($StartWith==0 && $prevLevels==0);
$selected = -1;
if ($row_SubCategoryList) {
$retHTML .= '<div id="Accordion'.$row_SubCategoryList["CategoryID"].'" class="Accordion" tabindex="0">' . "\n";
$retScript .= 'var Accordion'.$row_SubCategoryList["CategoryID"].' = new Spry.Widget.Accordion("Accordion'.$row_SubCategoryList["CategoryID"].'", { useFixedPanelHeights: false, defaultPanel: [defalutPanel] });' . "\n";
$CatCount = 0;
while ($row_SubCategoryList) {
$suboptions = getCatAccordion($row_SubCategoryList["CategoryID"],(1 + $prevLevels));
$retScript .= $suboptions[1];
$retHTML .= ' <div class="AccordionPanel'.(($prevLevels==0)?" AccordionTop":"").'" >' . "\n";
$retHTML .= ' <div catcount="'.$CatCount.'" class="AccordionPanelTab' . (($first)?" AccordionPanelFirst":""). '" onclick="doHighlighlight(this);updateContant(\'products_results_xml.php?Search=1&ProductCategoryID[]='.$row_SubCategoryList["CategoryID"].'\')" style="padding-left:'.(10+($prevLevels*5)).'px;">'.$row_SubCategoryList["CategoryName"].'</div>' . "\n";
$linkTo = 'products_results.php?Search=1&ProductCategoryID[]='.$row_SubCategoryList["CategoryID"];
$viewingPage = (basename($_SERVER['PHP_SELF'])."?".$_SERVER['QUERY_STRING']);
if (strtolower($viewingPage) == strtolower($linkTo) || $suboptions[3] >= 0) {
$selected = $CatCount;
}
if ($suboptions[0]!="") {
$retHTML .= ' <div class="AccordionPanelContent" >' . "\n";
$retHTML .= $suboptions[0];
$retHTML .= ' </div>' . "\n";
}
$retHTML .= ' </div>' . "\n";
$first = false;
$totalRows_SubCategoryList--;
$last = ($totalRows_SubCategoryList < 1);
$row_SubCategoryList = mysql_fetch_assoc($SubCategoryList);
$CatCount++;
}
$retHTML .= '</div>' . "\n";
}
$retScript = str_replace("[defalutPanel]",$selected,$retScript);
return array($retHTML,$retScript,$totalRows_SubCategoryList,$selected);
}
$Accordion = getCatAccordion();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="../../../SpryAssets/SpryAccordion.css" rel="stylesheet" type="text/css" />
<script src="../../../SpryAssets/SpryAccordion.js" type="text/javascript"></script>
<script type="text/javascript" src="sidemenu.js"></script>
<link rel="stylesheet" type="text/css" href="sidemenu.css">
</head>
<body>
<?php echo($Accordion[0]); ?>
<script type="text/javascript">
<!--
<?php
echo($Accordion[1]);
?>
//-->
</script>
</body>
</html>