5
« on: August 12, 2017, 09:02:43 PM »
Hello,
Thank you for the reply. In ACP in settings I only see Categories no subcategories to sort. And the categories are already sorted by name ASC.
In toplist.php in the script there is a sort indication by cat_id and matches the way the list is sorted. Does this have anything to do with this? Can this be changed to sort by sub category name?
$sql2 = "SELECT cat_id, cat_name, cat_parent_id FROM ".$table_prefix."categories WHERE cat_id='".$row['cat_id']."' ORDER BY cat_id ASC";
$result2 = $site_db->query($sql2);
while ($row2 = $site_db->fetch_array($result2)){
if ($row2['cat_parent_id'] >= 1)
{
$sql3 = "SELECT cat_name FROM ".$table_prefix."categories WHERE cat_id='".$row2['cat_parent_id']."' ORDER BY cat_id ASC";
Helio