本文整理汇总了PHP中Releases::getBrowseRange方法的典型用法代码示例。如果您正苦于以下问题:PHP Releases::getBrowseRange方法的具体用法?PHP Releases::getBrowseRange怎么用?PHP Releases::getBrowseRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Releases
的用法示例。
在下文中一共展示了Releases::getBrowseRange方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isset
// Output is either json or xml.
$outputXML = isset($_GET['o']) && $_GET['o'] == 'json' ? false : true;
switch ($function) {
// Search releases.
case 's':
verifyEmptyParameter('q');
$maxAge = maxAge();
$page->users->addApiRequest($uid, $_SERVER['REQUEST_URI'], $hosthash);
$categoryID = categoryid();
$limit = limit();
$offset = offset();
if (isset($_GET['q'])) {
$relData = $releases->search($_GET['q'], -1, -1, -1, -1, -1, 0, 0, -1, -1, $offset, $limit, '', $maxAge, $catExclusions, "basic", $categoryID);
} else {
$totalRows = $releases->getBrowseCount($categoryID, $maxAge, $catExclusions);
$relData = $releases->getBrowseRange($categoryID, $offset, $limit, '', $maxAge, $catExclusions);
if ($totalRows > 0 && count($relData) > 0) {
$relData[0]['_totalrows'] = $totalRows;
}
}
printOutput($relData, $outputXML, $page, $offset);
break;
// Search tv releases.
// Search tv releases.
case 'tv':
verifyEmptyParameter('q');
verifyEmptyParameter('rid');
verifyEmptyParameter('season');
verifyEmptyParameter('ep');
$maxAge = maxAge();
$page->users->addApiRequest($uid, $_SERVER['REQUEST_URI'], $hosthash);
示例2: array
$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"];
}
if (isset($_GET["q"])) {
$reldata = $releases->search($_GET["q"], $categoryId, $offset, $limit, $sort, $maxage, $catexclusions, $groupName, $minsize, $maxsize);
} else {
$orderby = array();
$orderby[0] = "post\tdate";
$orderby[1] = "asc";
$totrows = $releases->getBrowseCount($categoryId, $maxage, $catexclusions, $groupName);
$reldata = $releases->getBrowseRange($categoryId, $offset, $limit, "", $maxage, $catexclusions, $groupName);
if ($totrows > 0 && count($reldata)) {
$reldata[0]["_totalrows"] = $totrows;
}
}
$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));
}
示例3: array
if (isset($_REQUEST["t"]) && ctype_digit($_REQUEST["t"])) {
$category = $_REQUEST["t"];
}
$grp = array();
if (isset($_REQUEST["g"])) {
$grp = explode(",", $_REQUEST["g"]);
}
$catarray = array();
$catarray[] = $category;
$page->smarty->assign('category', $category);
$browsecount = $releases->getBrowseCount($catarray, -1, $page->userdata["categoryexclusions"], $grp);
$offset = isset($_REQUEST["offset"]) && ctype_digit($_REQUEST['offset']) ? $_REQUEST["offset"] : 0;
$ordering = $releases->getBrowseOrdering();
$orderby = isset($_REQUEST["ob"]) && in_array($_REQUEST['ob'], $ordering) ? $_REQUEST["ob"] : '';
$results = array();
$results = $releases->getBrowseRange($catarray, $offset, ITEMS_PER_PAGE, $orderby, -1, $page->userdata["categoryexclusions"], $grp);
$page->smarty->assign('pagertotalitems', $browsecount);
$page->smarty->assign('pageroffset', $offset);
$page->smarty->assign('pageritemsperpage', ITEMS_PER_PAGE);
$page->smarty->assign('pagerquerybase', WWW_TOP . "/browse?t=" . $category . (count($grp) > 0 ? "&g=" . $grp[0] : "") . "&ob=" . $orderby . "&offset=");
$page->smarty->assign('pagerquerysuffix', "#results");
$pager = $page->smarty->fetch("pager.tpl");
$page->smarty->assign('pager', $pager);
$section = '';
if ($category == -1 && count($grp) == 0) {
$page->smarty->assign("catname", "All");
} elseif ($category != -1 && count($grp) == 0) {
$cat = new Category();
$cdata = $cat->getById($category);
if ($cdata) {
$page->smarty->assign('catname', $cdata["title"]);