} else {
        $searchReleaseName = (string) $_REQUEST["searchadvr"];
        $searchFileName = (string) $_REQUEST["searchadvf"];
        $searchPoster = (string) $_REQUEST["searchadvposter"];
        $searchGroups = (string) $_REQUEST["searchadvgroups"];
        $searchCat = (string) $_REQUEST["searchadvcat"];
        $searchSizeFrom = (string) $_REQUEST["searchadvsizefrom"];
        $searchSizeTo = (string) $_REQUEST["searchadvsizeto"];
        $page->smarty->assign('searchadvr', $searchReleaseName);
        $page->smarty->assign('searchadvf', $searchFileName);
        $page->smarty->assign('searchadvposter', $searchPoster);
        $page->smarty->assign('selectedgroup', $searchGroups);
        $page->smarty->assign('selectedcat', $searchCat);
        $page->smarty->assign('selectedsizefrom', $searchSizeFrom);
        $page->smarty->assign('selectedsizeto', $searchSizeTo);
        $results = $releases->searchadv($searchStr, $categoryId, $offset, ITEMS_PER_PAGE, $orderby, -1, $page->userdata["categoryexclusions"]);
    }
    $page->smarty->assign('lastvisit', $page->userdata['lastlogin']);
    if (sizeof($results) > 0) {
        $totalRows = $results[0]['_totalrows'];
    } else {
        $totalRows = 0;
    }
    $page->smarty->assign('pagertotalitems', $totalRows);
    $page->smarty->assign('pageroffset', $offset);
    $page->smarty->assign('pageritemsperpage', ITEMS_PER_PAGE);
    $page->smarty->assign('pagerquerysuffix', "#results");
    $pager = $page->smarty->fetch("pager.tpl");
    $page->smarty->assign('pager', $pager);
}
$grouplist = $grp->getGroupsForSelect();