just replaced every block with
Code:
<actinic:block php="true" selectable="false" >
$connect = odbc_pconnect("ActinicCatalog9","","", 1);
/***************************************************************
*
* MakeNav for V9 -
* PLEASE TEST BEFORE PRODCTION USE
* @author Gabriel Crowe 3:50 PM 5/22/2008
*
* usage example:
MakeNav($sectid,$recursedepth,$prestyle,$thissect)
***************************************************************/
function GetParentSections($connect,$sectref)
{
$query = "SELECT [Section Text], [nParentSectionID], [nSectionID] FROM [Catalog Section] WHERE [nSectionID] LIKE '".$sectref."'";
$result = odbc_exec($connect, $query);
$returnstring="";
while(odbc_fetch_row($result)){
$SectionText = odbc_result($result, 1);
$nParentSectionID = odbc_result($result, 2);
$nSectionID = odbc_result($result, 3);
if ($nSectionID!=0) {$returnstring=GetParentSections($connect,$nParentSectionID).$nSectionID."|";}
}
odbc_free_result($result);
//odbc_close($connect);
return $returnstring;
}
function GetParentSectionsWrapper($sectid) {
$connect = odbc_pconnect("ActinicCatalog9","","", SQL_CUR_USE_ODBC);
$resultage = GetParentSections($connect,$sectid);
odbc_close_all();
return $resultage;
}
function useful_odbc_num_rows($result){
$num_rows=0;
while($temp = odbc_fetch_into($result, &$counter))
{
$num_rows++;
}
@odbc_fetch_row($result, 0); // reset cursor
return $num_rows;
}
function SectionList($connect,$sectid,$recursedepth,$rendermode,$thispatharr,$stylecounter) {
$recursedepth=$recursedepth-1;
$stylecounter=$stylecounter+1;
$query = "SELECT [sPageName], [Section text], [nSectionID] FROM [Catalog Section] WHERE [nParentSectionID]=".$sectid." AND [bHideOnWebSite]=0 ORDER BY [Catalogue Section Sequence] ASC";
$result = odbc_exec($connect, $query);
$numrows = useful_odbc_num_rows($result);
if ($numrows!=0) {echo "\n\n<ul class=\"ul".$stylecounter."\">\n";}
while(odbc_fetch_row($result)){
$sPageName = odbc_result($result, 1);
$Sectiontext = odbc_result($result, 2);
$nSectionID = odbc_result($result, 3);
$thisstyle="";
$expandthis=false;
foreach ($thispatharr as $value) {
if ($value==$nSectionID) {
$thisstyle="_selected";
$expandthis=true;
}
}
$linkitem="<a href=\"#link#\" class=\"link".$stylecounter."\">";
echo "\t<li class=\"li".$stylecounter."\">";
echo str_replace("#link#",$sPageName,$linkitem);
echo trim($Sectiontext);
echo "</a>";
//recurse
if ($rendermode == 1) { $expandthis=true; }
if ($recursedepth>=1 and $expandthis==true){
SectionList($connect,$nSectionID,$recursedepth,$rendermode,$thispatharr,$stylecounter);
}
echo "</li>\n";
}
if ($numrows!=0) { echo "</ul>\n\n"; }
odbc_free_result($result);
}
function MakeNav($sectid,$recursedepth,$rendermode,$thissect) {
$thispath = GetParentSectionsWrapper($thissect);
$thispatharr = explode("|",$thispath);
//sPagetitle, sPageName, sMetaKeywords, sMetaDescription, sSectionImageFile, sSectionDescription, sSectionText
$connect = odbc_pconnect("ActinicCatalog9","","", SQL_CUR_USE_ODBC);
SectionList($connect,$sectid,$recursedepth,$rendermode,$thispatharr,0);
odbc_close_all();
$connect = null;
}
<link href="menu.css" rel="stylesheet" type="text/css"> <div class="navcontainerment"> .... </div>
foreach ($thispatharr as $value) {
if ($value==$nSectionID) {
$thisstyle="_selected";
$expandthis=true;
}
$linkitem="<a href=\"#link#\" class=\"link".$stylecounter."\">";
$linkitem="<a href=\"#link#\" class=\"link".$stylecounter.$thisstyle."\">";
class="link1_selected"
class="link2_selected"
class="link2"
echo "\t<li class=\"li".$stylecounter."\">";
echo "\t<li class=\"li".$stylecounter.$thisstyle."\">";
<li class="li1_selected"></li>
Comment