Edit: Whoops, somehow logged in as sethwcaton. My correct username is catondesigngroup - sorry!
Please advise how to sort by year newest to oldest with current code in vehiclemanager.php - I am looking in vehiclemanager.php and finding this code below, how do I modify it, or what do I modify to sort by year newest to oldest in category view?
This very old post shows how to sort category view by year, but code is wrong for current VehicleManager files:
ordasoft.com/Forum/VehicleManager-compon...t-Inventory.html#968
Code: |
case 'alone_category':
case 'showCategory':
if (version_compare(JVERSION, '3.0', 'ge')){
$menu = new JTableMenu($database);
$menu->load($Itemid);
$params = new JRegistry;
$params->loadString($menu->params);
} else{
$menu = new mosMenu($database);
$menu->load($GLOBALS['Itemid']);
$params = new mosParameters($menu->params);
}
$layout = $params->get('categorylayout', '');
if ($layout == '' && isset($catid) && $catid != 0){
$query = "SELECT params2 FROM #__vehiclemanager_main_categories WHERE id =".$catid;
$database->setQuery($query);
$params2 = $database->loadResult();
$object_params = unserialize($params2);
if($object_params && $object_params->alone_category!='')
$layout = $object_params->alone_category;
}
if ($layout == '')
$layout = $vehiclemanager_configuration['view_type'];
if(empty($layout))$layout = 'default';
if ($catid){
PHP_vehiclemanager::showCategory($catid, $printItem, $layout);
}else{
if (version_compare(JVERSION, "1.6.0", "lt")){
$catid = $params->get('catid');
} else if (version_compare(JVERSION, "1.6.0", "ge") && version_compare(JVERSION, "3.5.100", "lt")){
$single_category_id = ''; // for 1.6
$single_category_id = $params->get('single_category');
if ($single_category_id > 0)
$catid = $single_category_id;
}
PHP_vehiclemanager::showCategory($catid, $printItem, $layout);
}
break;
|