Index: trunk/kernel/include/parseditem.php =================================================================== diff -u -r1433 -r1462 --- trunk/kernel/include/parseditem.php (.../parseditem.php) (revision 1433) +++ trunk/kernel/include/parseditem.php (.../parseditem.php) (revision 1462) @@ -1913,58 +1913,58 @@ $this->Query_SortOrder = array(); } - function QueryOrderByClause($EditorsPick=FALSE,$Priority=FALSE,$UseTableName=FALSE) - { - global $objSession; - - if($UseTableName) - { - $TableName = $this->SourceTable."."; - } - else { - $TableName = ""; - } + function QueryOrderByClause($EditorsPick=FALSE,$Priority=FALSE,$UseTableName=FALSE) + { + global $objSession; - $Orders = array(); + if($UseTableName) + { + $TableName = $this->SourceTable."."; + } + else { + $TableName = ""; + } - if($EditorsPick) - { - $Orders[] = $TableName."EditorsPick DESC"; - } - if($Priority) - { - $Orders[] = $TableName."Priority DESC"; - } - - if(count($this->Query_SortField)>0) - { - for($x = 0; $x < count($this->Query_SortField); $x++) - { - $FieldVar = $this->Query_SortField[$x]; - $OrderVar = $this->Query_SortOrder[$x]; + $Orders = array(); - if(is_object($objSession)) - { - $FieldVarData = $objSession->GetPersistantVariable($FieldVar); - //echo "FieldVar: $FieldVar
"; - if(strlen($FieldVarData)>0) - { - $Orders[] = trim($TableName.$objSession->GetPersistantVariable($FieldVar) . " ". - $objSession->GetPersistantVariable($OrderVar)); - } - } - } - } - - if(count($Orders)>0) - { - $OrderBy = "ORDER BY ".implode(", ",$Orders); - } - else - $OrderBy=""; - //echo "ORDER BY: $OrderBy
"; - return $OrderBy; - } + if($EditorsPick) + { + $Orders[] = $TableName."EditorsPick DESC"; + } + if($Priority) + { + $Orders[] = $TableName."Priority DESC"; + } + + if(count($this->Query_SortField)>0) + { + for($x = 0; $x < count($this->Query_SortField); $x++) + { + $FieldVar = $this->Query_SortField[$x]; + $OrderVar = $this->Query_SortOrder[$x]; + + if(is_object($objSession)) + { + $FieldVarData = $objSession->GetPersistantVariable($FieldVar); + //echo "FieldVar: $FieldVar
"; + if(strlen($FieldVarData)>0) + { + $Orders[] = trim($TableName.$objSession->GetPersistantVariable($FieldVar) . " ". + $objSession->GetPersistantVariable($OrderVar)); + } + } + } + } + + if(count($Orders)>0) + { + $OrderBy = "ORDER BY ".implode(", ",$Orders); + } + else + $OrderBy=""; + //echo "ORDER BY: $OrderBy
"; + return $OrderBy; + } function AddSortField($SortField, $SortOrder) {