} else { if ($_REQUEST['relation']) { $format = $config["entities"][$_REQUEST['relation']]["record_types"][0]; } else { $format = $config["entities"][$_REQUEST['resource']]["record_types"][0]; } } if ($search) { $j = new JangleSearch($request_uri); } else { $j = new JangleFeed($request_uri); } if ($_REQUEST["id"]) { if ($_REQUEST["relation"]) { if ($_REQUEST["category"]) { $entries = $resources->relationFindByFilter($_REQUEST["id"], $_REQUEST["relation"], $_REQUEST["category"], $offset, $format); $j->setTotalResults($resources->relationFilterCount($_REQUEST["id"], $_REQUEST["relation"], $_REQUEST["category"])); $j->addCategory($_REQUEST['category']); } else { $entries = $resources->relationFind($_REQUEST["id"], $_REQUEST["relation"], $offset, $format); if (count($entries) == 0) { header("HTTP/1.1 404 Not Found"); exit; } $j->setTotalResults($resources->relationCount($_REQUEST["id"], $_REQUEST["relation"])); } addAlternateFormatsToFeed($j, $format, $config["entities"][$_REQUEST["relation"]]["record_types"], $config["record_types"]); } else { $entries = $resources->find($_REQUEST["id"], $offset, $format); if (count($entries) == 0) { header("HTTP/1.1 404 Not Found");