$page->show403(); } $moviecats = $cat->getChildren(Category::CAT_PARENT_MOVIE); $mtmp = array(); foreach ($moviecats as $mcat) { $mtmp[$mcat['ID']] = $mcat; } $category = Category::CAT_PARENT_MOVIE; if (isset($_REQUEST["t"]) && array_key_exists($_REQUEST['t'], $mtmp)) { $category = $_REQUEST["t"] + 0; } $catarray = array(); $catarray[] = $category; $page->smarty->assign('catlist', $mtmp); $page->smarty->assign('category', $category); $browsecount = $movie->getMovieCount($catarray, -1, $page->userdata["categoryexclusions"]); $offset = isset($_REQUEST["offset"]) && ctype_digit($_REQUEST['offset']) ? $_REQUEST["offset"] : 0; $ordering = $movie->getMovieOrdering(); $orderby = isset($_REQUEST["ob"]) && in_array($_REQUEST['ob'], $ordering) ? $_REQUEST["ob"] : ''; $results = $movies = array(); $results = $movie->getMovieRange($catarray, $offset, ITEMS_PER_PAGE, $orderby, -1, $page->userdata["categoryexclusions"]); foreach ($results as $result) { $result['genre'] = $movie->makeFieldLinks($result, 'genre'); $result['actors'] = $movie->makeFieldLinks($result, 'actors'); $result['director'] = $movie->makeFieldLinks($result, 'director'); $movies[] = $result; } $title = isset($_REQUEST['title']) && !empty($_REQUEST['title']) ? stripslashes($_REQUEST['title']) : ''; $page->smarty->assign('title', $title); $actors = isset($_REQUEST['actors']) && !empty($_REQUEST['actors']) ? stripslashes($_REQUEST['actors']) : ''; $page->smarty->assign('actors', $actors);
} if (isset($_GET['iDisplayStart'])) { $start = $_GET['iDisplayStart']; } else { $start = 0; } $movie = new Movie(); if (isset($_GET['sSearch']) && $_GET['sSearch']) { $movies = $movie->getList(null, $start, $per_page, $sortby, $sortdir, $_GET['sSearch']); } else { $movies = $movie->getList(null, $start, $per_page, $sortby, $sortdir); } $res = array(); $res['sEcho'] = $echo; if (isset($_GET['sSearch']) && $_GET['sSearch']) { $res['iTotalDisplayRecords'] = $movie->getMovieCount($_GET['sSearch']); } else { $res['iTotalDisplayRecords'] = $movie->getMovieCount(); } $res['iTotalRecords'] = count($movies); $res['aaData'] = array(); if (count($movies)) { foreach ($movies as $key => $val) { extract($val); if (strlen($description[$default_language]) > 100) { $description[$default_language] = substr($description[$default_language], 0, 97) . "..."; } $res['aaData'][] = array('<input type="checkbox" name="row_sel" class="row_sel" value="' . $key . '" id="movie_checkbox_' . $key . '" />', '<a href="' . $baseurl . '/thumbs/' . $thumb . '" title="" class="cbox_single thumbnail"><img alt="" src="' . $baseurl . '/thumbs/' . $thumb . '" style="height:70px;width:50px"></a>', '<a href="http://www.imdb.com/title/' . $imdb_id . '" target="_blank">' . $imdb_id . '</a>', $title[$default_language], $description[$default_language], $embed_count, '<a href="javascript:void(0);" onClick="deleteMovie(' . $key . ')">Delete</a>', '<a href="index.php?menu=movies_new&movie_id=' . $key . '">Edit</a>'); } } print json_encode($res);