1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

Downloads: Fix for drop-down category ordering.

This commit is contained in:
Cameron 2017-04-19 17:15:32 -07:00
parent 2b92696822
commit 6f348e1940
2 changed files with 5 additions and 11 deletions

View File

@ -2027,7 +2027,7 @@ class e_db_mysql
/**
* Return a sorted list of parent/child tree with an optional ordering field.
* Return a sorted list of parent/child tree with an optional where clause.
* @param string $table Name of table (without the prefix)
* @param string $parent Name of the parent field
* @param string $pid Name of the primary id
@ -2036,7 +2036,7 @@ class e_db_mysql
* @todo Add extra params to each procedure so we only need 2 of them site-wide.
* @return boolean | integer with the addition of _treesort and _depth fields in the results.
*/
public function selectTree($table, $parent, $pid, $where=null, $order=null)
public function selectTree($table, $parent, $pid, $order, $where=null)
{
if(empty($table) || empty($parent) || empty($pid))
@ -2110,14 +2110,8 @@ class e_db_mysql
}
if($order === null)
{
$qry .= " ORDER BY _treesort";
}
else
{
$qry .= " ORDER BY ".$order;
}
$qry .= " ORDER BY _treesort";
return $this->gen($qry);

View File

@ -53,7 +53,7 @@ class download_sitelink // include plugin-folder in the name.
$where = "download_category_class IN (".USERCLASS_LIST.")";
$sql->selectTree('download_category','download_category_parent', 'download_category_id', $where, 'download_category_order');
$sql->selectTree('download_category','download_category_parent', 'download_category_id', 'download_category_order', $where );
while($row = $sql->fetch())
{