예제 #1
0
 $genreId = array();
 if (isset($_GET["genre"])) {
     $genreId = explode(",", $_GET["genre"]);
 } else {
     $genreId[] = -1;
 }
 $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->searchAudio(isset($_GET["artist"]) ? $_GET["artist"] : "", isset($_GET["album"]) ? $_GET["album"] : "", isset($_GET["label"]) ? $_GET["label"] : "", isset($_GET["track"]) ? $_GET["track"] : "", isset($_GET["year"]) ? $_GET["year"] : "", $genreId, $offset, $limit, $categoryId, $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;
 //
 // search book releases
 //