mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 12:48:26 +02:00
Downloads: Fix for drop-down category ordering.
This commit is contained in:
@@ -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 $table Name of table (without the prefix)
|
||||||
* @param string $parent Name of the parent field
|
* @param string $parent Name of the parent field
|
||||||
* @param string $pid Name of the primary id
|
* @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.
|
* @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.
|
* @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))
|
if(empty($table) || empty($parent) || empty($pid))
|
||||||
@@ -2110,14 +2110,8 @@ class e_db_mysql
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if($order === null)
|
$qry .= " ORDER BY _treesort";
|
||||||
{
|
|
||||||
$qry .= " ORDER BY _treesort";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$qry .= " ORDER BY ".$order;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->gen($qry);
|
return $this->gen($qry);
|
||||||
|
|
||||||
|
@@ -53,7 +53,7 @@ class download_sitelink // include plugin-folder in the name.
|
|||||||
|
|
||||||
$where = "download_category_class IN (".USERCLASS_LIST.")";
|
$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())
|
while($row = $sql->fetch())
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user