Index: trunk/kernel/include/category.php =================================================================== diff -u -N -r4121 -r4126 --- trunk/kernel/include/category.php (.../category.php) (revision 4121) +++ trunk/kernel/include/category.php (.../category.php) (revision 4126) @@ -314,28 +314,37 @@ $path_parts = Array(); $nav_parts = Array(); $named_parts = Array(); + $cateogry_template = ''; + $item_template = ''; - do - { - $rs = $this->adodbConnection->Execute('SELECT ParentId, Name, Filename FROM '.$this->tablename.' WHERE CategoryId = '.$Id2); + do { + $rs = $this->adodbConnection->Execute('SELECT ParentId, Name, Filename, CachedCategoryTemplate, CachedItemTemplate FROM '.$this->tablename.' WHERE CategoryId = '.$Id2); $path_parts[] = $Id2; $nav_parts[] = $rs->fields['Name']; $named_parts[] = $rs->fields['Filename']; + if (!$cateogry_template && $rs->fields['CachedCategoryTemplate']) { + $cateogry_template = $rs->fields['CachedCategoryTemplate']; + } + + if (!$item_template && $rs->fields['CachedItemTemplate']) { + $item_template = $rs->fields['CachedItemTemplate']; + } + $Id2 = ($rs && !$rs->EOF) ? $rs->fields['ParentId'] : '0'; - }while ($Id2 != '0'); + } while ($Id2 != '0'); $parent_path = '|'.implode('|', array_reverse($path_parts) ).'|'; $nav_bar = implode('>', array_reverse($nav_parts) ); $named_path = implode('/', array_reverse($named_parts) ); - if($this->Get('ParentPath') != $parent_path || $this->Get('CachedNavbar') != $nav_bar || $this->Get('NamedParentPath') != $named_path ) - { - $this->Set('ParentPath', $parent_path); - $this->Set('CachedNavbar', $nav_bar); - $this->Set('NamedParentPath', $named_path); - $this->Update(); - } + $this->Set('ParentPath', $parent_path); + $this->Set('CachedNavbar', $nav_bar); + $this->Set('NamedParentPath', $named_path); + $this->Set('CachedCategoryTemplate', $cateogry_template); + $this->Set('CachedItemTemplate', $item_template); + $this->Update(); + } function GetCachedNavBar()