コード例 #1
0
require_once WWW_DIR . "/lib/userseries.php";
$releases = new Releases();
$tvinfo = new TvInfo();
$cat = new Category();
$us = new UserSeries();
if (!$users->isLoggedIn()) {
    $page->show403();
}
if (isset($_GET["id"]) && ctype_digit($_GET['id'])) {
    $category = -1;
    if (isset($_REQUEST["t"]) && ctype_digit($_REQUEST["t"])) {
        $category = $_REQUEST["t"];
    }
    $catarray = array();
    $catarray[] = $category;
    $rel = $releases->searchbytvinfoId($_GET["id"], '', '', 0, 1000, "", $catarray, -1);
    $tvinforow = $tvinfo->getByID($_GET['id']);
    $page->smarty->assign('tvinforow', $tvinforow);
    if (!$tvinforow) {
        $page->show404();
    } elseif (!$rel) {
        $page->smarty->assign("nodata", "No releases for this series.");
    } else {
        $myshows = $us->getShow($users->currentUserId(), $_GET['id']);
        //sort releases by season, episode, date posted
        $season = $episode = $posted = array();
        foreach ($rel as $rlk => $rlv) {
            $season[$rlk] = $rlv['season'];
            $episode[$rlk] = $rlv['episode'];
            $posted[$rlk] = $rlv['postdate'];
        }