} elseif (!is_numeric($_GET["maxage"])) { showApiError(201); } else { $maxage = $_GET["maxage"]; } } $users->addApiRequest($uid, $_SERVER['REQUEST_URI'], $hosthash); $limit = 100; if (isset($_GET["limit"]) && is_numeric($_GET["limit"]) && $_GET["limit"] < 100) { $limit = $_GET["limit"]; } $offset = 0; if (isset($_GET["offset"]) && is_numeric($_GET["offset"])) { $offset = $_GET["offset"]; } $reldata = $releases->searchBook(isset($_GET["author"]) ? $_GET["author"] : "", isset($_GET["title"]) ? $_GET["title"] : "", $offset, $limit, $maxage); $page->smarty->assign('offset', $offset); $page->smarty->assign('releases', $reldata); $page->smarty->assign('rsshead', $page->smarty->fetch('rssheader.tpl')); $output = trim($page->smarty->fetch('apiresult.tpl')); if ($outputtype == "xml") { header("Content-type: text/xml"); echo $output; } else { header('Content-type: application/json'); echo json_encode(responseXmlToObject($output)); } break; // // get nzb //