case "Importance":
        $order = "sum_cnt DESC";
        break;
    case "Urgency":
        $order = "software.urgency DESC";
        break;
    case "Name":
        $order = "software.name ASC";
        break;
    case "Date":
    default:
        $by = "Date";
        $order = "software.modification DESC";
        break;
}
$limit = "{$iter},10";
$query = "SELECT *,SUM(app_cnt+homepage_cnt+download_cnt+changelog_cnt+rpm_cnt+deb_cnt+tgz_cnt+cvs_cnt+screenshots_cnt+mailarch_cnt) AS sum_cnt FROM software,counter WHERE section='{$section}' AND category='{$category}' AND status='A' AND software.appid=counter.appid AND name LIKE '{$with}' GROUP BY software.appid ORDER BY {$order} LIMIT {$limit}";
$sort = $t->translate("sorted by") . ": " . "<a href=\"" . htmlentities($sess->self_url() . $sess->add_query(array("section" => $section, "category" => $category, "with" => "{$with}", "find" => "{$find}", "by" => "Date"))) . "\">" . $t->translate("Date") . "</a>" . " | <a href=\"" . htmlentities($sess->self_url() . $sess->add_query(array("section" => $section, "category" => $category, "with" => "{$with}", "find" => "{$find}", "by" => "Importance"))) . "\">" . $t->translate("Importance") . "</a>" . " | <a href=\"" . htmlentities($sess->self_url() . $sess->add_query(array("section" => $section, "category" => $category, "with" => "{$with}", "find" => "{$find}", "by" => "Urgency"))) . "\">" . $t->translate("Urgency") . "</a>" . " | <a href=\"" . htmlentities($sess->self_url() . $sess->add_query(array("section" => $section, "category" => $category, "with" => "{$with}", "find" => "{$find}", "by" => "Name"))) . "\">" . $t->translate("Name") . "</a>\n";
$bs->box_strip($sort);
appcat($query, $section . "/" . $category, $iter + 1);
if ($numiter > 1) {
    $url = "appbycat.php";
    $urlquery = array("section" => $section, "category" => $category, "with" => "{$with}", "find" => "{$find}", "by" => $by);
    show_more($iter, $numiter, $url, $urlquery);
}
?>
<!-- end content -->

<?php 
require "./include/footer.inc";
@page_close();
        break;
    case "Name":
        $order = "software.name ASC";
        break;
    case "Date":
    default:
        $by = "Date";
        $order = "software.modification DESC";
        break;
}
$limit = "{$iter},10";
$sort = $t->translate("sorted by") . ": " . "<a href=\"" . htmlentities($sess->url("appbydev.php") . $sess->add_query(array("developer" => $developer, "email" => $email, "with" => "{$with}", "find" => "{$find}", "by" => "Date"))) . "\">" . $t->translate("Date") . "</a>" . " | <a href=\"" . htmlentities($sess->url("appbydev.php") . $sess->add_query(array("developer" => $developer, "email" => $email, "with" => "{$with}", "find" => "{$find}", "by" => "Importance"))) . "\">" . $t->translate("Importance") . "</a>" . " | <a href=\"" . htmlentities($sess->url("appbydev.php") . $sess->add_query(array("developer" => $developer, "email" => $email, "with" => "{$with}", "find" => "{$find}", "by" => "Urgency"))) . "\">" . $t->translate("Urgency") . "</a>" . " | <a href=\"" . htmlentities($sess->url("appbydev.php") . $sess->add_query(array("developer" => $developer, "email" => $email, "with" => "{$with}", "find" => "{$find}", "by" => "Name"))) . "\">" . $t->translate("Name") . "</a>\n";
$bs->box_strip($sort);
if (empty($developer)) {
    $devnam = "Unknown";
} else {
    $devnam = $developer;
}
$query = "SELECT {$columns} FROM {$tables} WHERE {$where} ORDER BY {$order} LIMIT {$limit}";
appcat($query, $t->translate("Author") . ": " . stripslashes($devnam), $iter + 1);
if ($numiter > 1) {
    $url = "appbydev.php";
    $urlquery = array("developer" => $developer, "email" => $email, "with" => "{$with}", "find" => "{$find}", "by" => $by);
    show_more($iter, $numiter, $url, $urlquery);
}
?>
<!-- end content -->

<?php 
require "./include/footer.inc";
@page_close();
    case "Importance":
        $order = "sum_cnt DESC";
        break;
    case "Urgency":
        $order = "software.urgency DESC";
        break;
    case "Name":
        $order = "software.name ASC";
        break;
    case "Date":
    default:
        $by = "Date";
        $order = "software.modification DESC";
        break;
}
$limit = "{$iter},10";
$db->query("SELECT *,SUM(app_cnt+homepage_cnt+download_cnt+changelog_cnt+rpm_cnt+deb_cnt+tgz_cnt+cvs_cnt+screenshots_cnt+mailarch_cnt) AS sum_cnt FROM software,counter WHERE license='{$license}' AND status='A' AND software.appid=counter.appid AND name LIKE '{$with}' GROUP BY software.appid ORDER BY {$order} LIMIT {$limit}");
$sort = $t->translate("sorted by") . ": " . "<a href=\"" . htmlentities($sess->self_url() . $sess->add_query(array("license" => $license, "with" => "{$with}", "find" => "{$find}", "by" => "Date"))) . "\">" . $t->translate("Date") . "</a>" . " | <a href=\"" . htmlentities($sess->self_url() . $sess->add_query(array("license" => $license, "with" => "{$with}", "find" => "{$find}", "by" => "Importance"))) . "\">" . $t->translate("Importance") . "</a>" . " | <a href=\"" . htmlentities($sess->self_url() . $sess->add_query(array("license" => $license, "with" => "{$with}", "find" => "{$find}", "by" => "Urgency"))) . "\">" . $t->translate("Urgency") . "</a>" . " | <a href=\"" . htmlentities($sess->self_url() . $sess->add_query(array("license" => $license, "with" => "{$with}", "find" => "{$find}", "by" => "Name"))) . "\">" . $t->translate("Name") . "</a>\n";
$bs->box_strip($sort);
appcat($query, $t->translate("License") . ": " . $license, $iter + 1);
if ($numiter > 1) {
    $url = "appbylic.php";
    $urlquery = array("license" => $license, "by" => $by);
    show_more($iter, $numiter, $url, $urlquery);
}
?>
<!-- end content -->

<?php 
require "./include/footer.inc";
@page_close();