コード例 #1
0
ファイル: show-list.php プロジェクト: kaibosh/nZEDb
<?php

require_once './config.php';
use nzedb\Videos;
$page = new AdminPage();
$tv = new Videos(['Settings' => $page->settings]);
$page->title = "TV Shows List";
$tvshowname = isset($_REQUEST['showname']) && !empty($_REQUEST['showname']) ? $_REQUEST['showname'] : '';
$offset = isset($_REQUEST["offset"]) ? $_REQUEST["offset"] : 0;
$page->smarty->assign(['showname' => $tvshowname, 'tvshowlist' => $tv->getRange($offset, ITEMS_PER_PAGE, $tvshowname), 'pagertotalitems' => $tv->getCount($tvshowname), 'pageroffset' => $offset, 'pageritemsperpage' => ITEMS_PER_PAGE, 'pagerquerysuffix' => '', 'pagerquerybase' => WWW_TOP . "/show-list.php?" . ($tvshowname != '' ? 'showname=' . $tvshowname . '&amp;' : '') . "&offset="]);
$page->smarty->assign('pager', $page->smarty->fetch("pager.tpl"));
$page->content = $page->smarty->fetch('show-list.tpl');
$page->render();
コード例 #2
0
ファイル: myshows.php プロジェクト: kaibosh/nZEDb
<?php

use nzedb\Category;
use nzedb\Releases;
use nzedb\UserSeries;
use nzedb\Videos;
if (!$page->users->isLoggedIn()) {
    $page->show403();
}
$us = new UserSeries(['Settings' => $page->settings]);
$tv = new Videos(['Settings' => $page->settings]);
$action = isset($_REQUEST['id']) ? $_REQUEST['id'] : '';
$videoId = isset($_REQUEST['subpage']) ? $_REQUEST['subpage'] : '';
if (isset($_REQUEST['from'])) {
    $page->smarty->assign('from', WWW_TOP . $_REQUEST['from']);
} else {
    $page->smarty->assign('from', WWW_TOP . '/myshows');
}
switch ($action) {
    case 'delete':
        $show = $us->getShow($page->users->currentUserId(), $videoId);
        if (isset($_REQUEST['from'])) {
            header("Location:" . WWW_TOP . $_REQUEST['from']);
        } else {
            header("Location:" . WWW_TOP . "/myshows");
        }
        if (!$show) {
            $page->show404('Not subscribed');
        } else {
            $us->delShow($page->users->currentUserId(), $videoId);
        }
コード例 #3
0
ファイル: show-edit.php プロジェクト: zetas/nZEDb
<?php

require_once './config.php';
require_once nZEDb_WWW . 'pages/smartyTV.php';
use nzedb\Videos;
$page = new AdminPage();
$tv = new smartyTV(['Settings' => $page->settings]);
$video = new Videos(['Settings' => $page->settings]);
switch (isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view') {
    case 'submit':
        //TODO: Use a function that allows overwrites
        //$tv->update($_POST["id"], $_POST["title"],$_POST["summary"], $_POST['countries_id']);
        if (isset($_POST['from']) && !empty($_POST['from'])) {
            header("Location:" . $_POST['from']);
            exit;
        }
        header("Location:" . WWW_TOP . "/show-list.php");
        break;
    case 'view':
    default:
        if (isset($_GET["id"])) {
            $page->title = "TV Show Edit";
            $show = $video->getByVideoID($_GET["id"]);
        }
        break;
}
$page->smarty->assign('show', $show);
$page->title = "Edit TV Show Data";
$page->content = $page->smarty->fetch('show-edit.tpl');
$page->render();
コード例 #4
0
ファイル: series.php プロジェクト: kaibosh/nZEDb
<?php

use nzedb\Category;
use nzedb\Releases;
use nzedb\Videos;
use nzedb\UserSeries;
if (!$page->users->isLoggedIn()) {
    $page->show403();
}
$releases = new Releases(['Settings' => $page->settings]);
$tvshow = new Videos(['Settings' => $page->settings]);
$cat = new Category(['Settings' => $page->settings]);
$us = new UserSeries(['Settings' => $page->settings]);
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->searchShows(['id' => $_GET["id"]], '', '', '', 0, 1000, '', $catarray, -1);
    $show = $tvshow->getByVideoID($_GET['id']);
    if (!$show) {
        $page->smarty->assign("nodata", "No video information for this series.");
    } elseif (!$rel) {
        $page->smarty->assign("nodata", "No releases for this series.");
    } else {
        $myshows = $us->getShow($page->users->currentUserId(), $show['id']);
        // Sort releases by season, episode, date posted.
        $series = $episode = $posted = array();
        foreach ($rel as $rlk => $rlv) {
コード例 #5
0
ファイル: ajax_tvinfo.php プロジェクト: kaibosh/nZEDb
use nzedb\Releases;
use nzedb\Videos;
if (!$page->users->isLoggedIn()) {
    $page->show403();
}
if (!isset($_REQUEST["id"])) {
    $page->show404();
}
$r = new Releases(['Settings' => $page->settings]);
$rel = $r->getByGuid($_REQUEST["id"]);
if (!$rel) {
    print "No tv info";
} else {
    //print "<h3 class=\"tooltiphead\">episode info...</h3>\n";
    print "<ul>\n";
    if (isset($rel['title'])) {
        print "<li>" . htmlentities($rel["title"], ENT_QUOTES) . "</li>\n";
    }
    print "<li>Aired on " . date("F j, Y", strtotime($rel["firstaired"])) . "</li>\n";
    print "</ul>";
    if ($rel["videos_id"] > 0) {
        $t = new Videos(['Settings' => $page->settings]);
        $show = $t->getByVideoID($rel["videos_id"]);
        if (count($show) > 0) {
            if ($show["image"] == 1) {
                print "<img class=\"shadow\" src=\"/covers/tvshows/" . $show["id"] . ".jpg\" width=\"180\"/>";
            }
        }
    }
}