Index: trunk/kernel/parser.php =================================================================== diff -u -r5218 -r5254 --- trunk/kernel/parser.php (.../parser.php) (revision 5218) +++ trunk/kernel/parser.php (.../parser.php) (revision 5254) @@ -1253,28 +1253,31 @@ if(getArrayValue($attribs,'_fullpath') || getArrayValue($attribs,'_currentcategory')) { $CurrentCat = $objCatList->CurrentCategoryID(); - if((int)$CurrentCat>0) - { - $c = $objCatList->GetCategory($CurrentCat); - if($attribs["_fullpath"]) - { - $path = $c->Get("CachedNavbar"); + if((int)$CurrentCat>0) + { + $c = $objCatList->GetCategory($CurrentCat); + if($attribs["_fullpath"]) + { + $path = $c->Get("CachedNavbar"); - if(strlen($path)) - $ret .= " - ".$path; - } - else - { - if($attribs["_currentcategory"]) - { - $f = $attribs["_catfield"]; - if(!strlen($f)) - $f = "Name"; - $ret .= " - ".$c->Get($f); - } - } - } - } + if(strlen($path)) + $ret .= " - ".$path; + } + else + { + if($attribs["_currentcategory"]) + { + $f = $attribs["_catfield"]; + if (!strlen($f)) { + $f = "Name"; + } + + if ($f == 'Name') $f = $objCatList->TitleField; + $ret .= " - ".$c->Get($f); + } + } + } + } $ret = stripslashes($ret); return $ret; } @@ -1705,7 +1708,14 @@ // echo "TEST:
$sql
\n"; $objSearchCats->Query_Item($sql); $where = "ItemType=1"; - + + $Keywords = GetKeywords($objSession->GetVariable("Search_Keywords")); + //echo "SQL Loaded ItemCount (".get_class($this).'): '.$this->NumItems().'
'; + for($i = 0; $i < $objSearchCats->NumItems(); $i++) + { + $objSearchCats->Items[$i]->Keywords = $Keywords; + } + if(is_numeric($CountVal[1])) { $objSearchCats->QueryItemCount = $CountVal[1]; @@ -1897,7 +1907,7 @@ if ($keywords) { foreach ($objSearchCats->Items as $cat) { - if (strstr(strip_tags(strtolower($cat->Data['Name'])), strtolower($_POST['keywords'])) || strstr(strip_tags(strtolower($cat->Data['Description'])), strtolower($_POST['keywords']))) { + if (strstr(strip_tags(strtolower($cat->Data[$cat->TitleField])), strtolower($_POST['keywords'])) || strstr(strip_tags(strtolower($cat->Data[$cat->DescriptionField])), strtolower($_POST['keywords']))) { $ret++; } } @@ -1969,7 +1979,7 @@ foreach($objSearchCats->Items as $cat) { //$cat->Keywords = GetKeywords($objSession->GetVariable("Search_Keywords")); -/* $keywords_found = strstr( strip_tags(strtolower($cat->Data['Name'])), strtolower($keywords)) || strstr(strip_tags(strtolower($cat->Data['Description'])), strtolower($keywords)); +/* $keywords_found = strstr( strip_tags(strtolower($cat->Data[$objCatList->TitleField])), strtolower($keywords)) || strstr(strip_tags(strtolower($cat->Data[$cat->DescriptionField])), strtolower($keywords)); if(!$keywords) $keywords_found = true; if ($keywords_found) {*/ if($row==0 && strlen($attribs["_firstitemtemplate"])) @@ -3408,7 +3418,7 @@ /*if ($keywords) { foreach ($objSearchCats->Items as $cat) { - if (strstr(strip_tags(strtolower($cat->Data['Name'])), strtolower($keywords)) || strstr(strip_tags(strtolower($cat->Data['Description'])), strtolower($keywords))) { + if (strstr(strip_tags(strtolower($cat->Data[$objCatList->TitleField])), strtolower($keywords)) || strstr(strip_tags(strtolower($cat->Data[$cat->DescriptionField])), strtolower($keywords))) { $ret++; } } @@ -3537,7 +3547,7 @@ */ function m_sitemap($attribs = array()) { - global $objModules, $objConfig; + global $objModules, $objConfig, $objCatList; $html_attribs = ExtraAttributes($attribs); @@ -3616,7 +3626,7 @@ foreach ($_C_catList as $cat) { - $text = $cat->Get("Name"); + $text = $cat->Get($objCatList->TitleField); $val = $cat->Get("CategoryId"); $sub_path = $cat->Get("ParentPath"); @@ -3645,7 +3655,7 @@ $ParentPath = empty($_RootCat) ? '|'.$val.'|%' : '|'.$_RootCat.'|'.$val.'|%'; $_Where = GetTablePrefix()."Category.ParentPath LIKE '$ParentPath' AND ".GetTablePrefix()."Category.CategoryId!=$val AND Status=1"; - $_OrderBy = " ORDER BY ".GetTablePrefix()."Category.ParentPath ASC, ".GetTablePrefix()."Category.Name ASC"; + $_OrderBy = " ORDER BY ".GetTablePrefix()."Category.ParentPath ASC, ".GetTablePrefix()."Category.".$objCatList->TitleField." ASC"; $old_value = $objConfig->Get($_C_objCatSubs->PerPageVar); $objConfig->Set($_C_objCatSubs->PerPageVar, (int)$MaxCats); @@ -3657,7 +3667,7 @@ { foreach ($SubCats as $subcat) { - $SubCatName = $subcat->Get("Name"); + $SubCatName = $subcat->Get($objCatList->TitleField); $SubCatId = $subcat->Get("CategoryId"); $SubPath = $subcat->Get("ParentPath");