public function addToMovieAction(Movies $movie, \Phalcon\Http\Request $request) { //@todo 需要增加验证的环节 $movie->createAndAddToListFromRequest($request); return $this->redirectByRoute(['for' => 'movies.addToList', 'movie' => $movie->id]); }
public function getPrevious() { $rowset = Movies::query()->where('id < :id:', ['id' => $this->id])->orderBy('id DESC')->limit(1)->execute(); if ($rowset->count()) { return $rowset[0]; } else { return Movies::findFirst(['order' => 'id DESC']); } }
public function combineToSerialWith(Movies $anotherMovie) { $serial1 = $this->findOrCreateSerial(); $serial2 = $anotherMovie->findOrCreateSerial(); $serial1->serial_num = $this->getSeasonNumberFromMovie($this); $serial2->serial_num = $this->getSeasonNumberFromMovie($anotherMovie); if ($serial1->id == null && $serial2->id == null) { $tvSerial = new Tvserials(); $tvSerial->title = $this->getTVserialTitleFromMovie($this); //将当前电影的title赋值给这个系列 $tvSerial->save(); $serial1->tvSerial_id = $tvSerial->id; $serial1->save(); $serial2->tvSerial_id = $tvSerial->id; $serial2->save(); return '双空'; } if ($serial1->tvSerial_id != null && $serial2->tvSerial_id == null) { $serial2->tvSerial_id = $serial1->tvSerial_id; $serial2->save(); return '1有2空'; } if ($serial2->tvSerial_id != null && $serial1->tvSerial_id == null) { $serial1->tvSerial_id = $serial2->tvSerial_id; $serial1->save(); return '1空2有'; } if ($serial2->tvSerial_id != null && $serial1->tvSerial_id != null) { return '双有'; } return '错误,没有对上'; }
<!-- Use title if it's in the page YAML frontmatter --> <title>Projet films</title> <link href="../css/style.css" rel="stylesheet" type="text/css" /> <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> </head> <body> <?php require "topbar.php"; require_once "../modeles/movies.php"; require_once "../modeles/noter.php"; require_once "../modeles/categorie.php"; $movies = new Movies(); $noter = new Noter(); $categorie = new Categorie(); $note = $noter->getNote($_GET['id']); $film = $movies->getFilm($_GET['id']); $nomCat = $categorie->getCategorie($film['idCategorie'])['nom']; ?> <div class="contenu"> <div class="jumbotron"> <div class="row"> <div class="col-md-1"></div> <div class="col-md-4"> <img src='<?php echo "../" . $film['image']; ?>
<?php /** * Some important variables for other users to work with in code or templates: * - 'movie' is the requested movie * - 'photopath' is the path to the movie photo * - 'coverpath' is the path to the cover of the movie */ // Datamanagers require_once $loc . "/lib/db/Movies.class.php"; $moviedm = new Movies($settings["db"]); // Photo and cover path $photopath = $settings["photo"]["movies"]; $Website->assign("photopath", $photopath); $coverpath = $settings["photo"]["covers"]; $Website->assign("coverpath", $coverpath); // Retrieve a movie if (isset($_GET["id"])) { $movie = $moviedm->get($_GET["id"]); if ($movie && $movie->id > 0) { // Show movie $Website->assign("movie", $movie); } else { back(); } } // Retrieve a movie from imdb if (isset($_GET["imdbid"])) { $imdbid = $_GET["imdbid"]; // IMDB engine require $loc . "/lib/imdbphp/imdb.class.php";
<?php require_once 'connection.php'; require_once 'models/movie-model.php'; $conn = getConnection(); $movieModel = new Movies($conn); $id = ''; if (isset($_GET['id']) && $_GET['id'] != '') { //determines if there is anything after 'id' $id = $_GET['id']; //stores the id query string $movie = $movieModel->getMovieByID($id); } else { die('Please put in an ID'); } $imdbID = $movie[0]['imdb_id']; $array = $movie[0]; $found = true; if (empty($imdbID)) { $found = false; $jsonmovie = json_encode($array); $result = json_decode($jsonmovie, true); } else { $url = "http://www.omdbapi.com/?i={$imdbID}&tomatoes=true"; $json = file_get_contents($url); $result = json_decode($json, true); } ?> <!DOCTYPE html> <html lang="en"> <head>
<?php require_once '../connection.php'; require_once '../model/movies.php'; $imdb_id = $_GET['id']; $conn = getConnection(); $movieModel = new Movies($conn); $matches = $movieModel->findByMovieId($imdb_id); if (count($matches) == 1) { $url = "http://www.omdbapi.com/?i={$imdb_id}&tomatoes=true"; $json = file_get_contents($url); $movieData = json_decode($json); } ?> <!DOCTYPE html> <html lang="en"> <head> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <meta charset="UTF-8"> <link rel="icon" href="img/page-icon.png"> <title>2014 Movie Revenues</title> <!-- bootstrap css --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous"> </head> <body class="container text-center"> <?php foreach ($matches as $match) {
<?php require_once 'connection.php'; require_once 'model/movies.php'; $q = $_GET['q']; $conn = getConnection(); $movieModel = new Movies($conn); $matches = $movieModel->search($q); ?> <!DOCTYPE html> <html lang="en"> <head> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <meta charset="UTF-8"> <link rel="icon" href="img/page-icon.png"> <title>2014 Movie Revenues</title> <!-- bootstrap css --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous"> </head> <body class="container"> <h1>Movie Revenues From 2014</h1> <?php include 'views/search-view.php'; include 'views/results.php'; ?>
/** * testDestroyException. * * Assert that delete from a non existent table * throws PDOExceptions * * @expectedException PDOException */ public function testDestroyException() { $movie = Movies::destroy(1); }
public function indexAction() { $movies = Movies::find(); $this->view->movies = $movies; }
public function action_index() { $record = new Movies(); $record->title = $_POST['title']; $record->year = $_POST['year']; $record->save(); $array = array('success' => 'true', 'msg' => 'Record added successfully'); $json = json_encode($array); return $json; }
public function getRelatedMovies() { if (null == $this->relatedMovies) { $this->relatedMovies = Movies::query()->rightJoin('Listables', 'Listables.listable_type = "Movies" AND Listables.listable_id = Movies.id')->where('Listables.list_id = :id:', ['id' => $this->id])->execute(); } return $this->relatedMovies; }
public function put_index() { $data = file_get_contents('php://input'); $temp = json_decode($data); $new = Movies::find($temp->id); $new->text = $temp->text; $new->parent_id = $temp->parentId; $new->save(); $array = array('success' => 'true'); $json = json_encode($array); return $json; }
static function getMovies() { $sql = 'SELECT mov_id FROM movie;'; $sth = dbConnection()->prepare($sql); $sth->execute(); $fetch = $sth->fetchAll(); $i = 0; $movies = array(); foreach ($fetch as $row) { $movies[$i] = Movies::getMovie($row['mov_id']); $i++; } return $movies; }
public function __construct($View) { $this->view = $View; $this->dom = new DOMDocument(); //ny url av användare, hämta filmerna if ($this->view->getIsURLGiven() != null) { $this->startURL = $this->view->getIsURLGiven(); header('Location: ?url=' . $this->startURL); } if (isset($_GET['url'])) { $this->startURL = $_GET['url']; $firstPage = file_get_contents($this->startURL); if ($this->dom->loadHTML($firstPage)) { $xPath = new DOMXPath($this->dom); //Alla länkar på sidan $linksNodeList = $xPath->query('//a'); $linksArray = array(); foreach ($linksNodeList as $link) { array_push($linksArray, $link); } //Hämtar de dagar som passar sällskapet $theGoodDays = $this->calenderStart($linksArray[0]->getAttribute("href")); $movies = new Movies($this->dom, $this->startURL); //Hämtar Filmerna, tiden och dagen som går någon av dem bra dagarna $movieAndTimeArray = $movies->start($theGoodDays, $linksArray[1]->getAttribute("href")); $this->view->setResult($movieAndTimeArray, '?url=' . $this->startURL); if ($this->view->userWannaBook() != null) { $booking = $this->view->userWannaBook(); $resturant = new Resturant(); $timeForResturant = $resturant->start($this->dom, $this->startURL . $linksArray[2]->getAttribute("href"), substr($booking, 0, 5), substr($booking, 5)); $this->view->chooseResturant($timeForResturant); } } else { echo "gick inte att hämta första sidan"; } } }
public function put_index() { $data = file_get_contents('php://input'); $temp = json_decode($data); $new = Movies::find($temp->id); $new->id = $temp->id; $new->title = $temp->title; $new->director = $temp->director; $new->year = $temp->year; $new->genre = $temp->genre; $new->save(); $array = array('success' => 'true'); $json = json_encode($array); return $json; }
/** * Process file import data into application data * * @return void */ private function processFileImport() { // Disable query log to conserve on memory DB::connection()->disableQueryLog(); // Find first pending file import and eager load the csvRows $this->csv_import = CsvImport::where('status', 'pending')->with('csvRows')->first(); if (!$this->csv_import) { printf("%s \n", "Nothing to process."); exit; } // Change the status of the import to avoid it being processed again. $this->csv_import->status = 'processing'; $this->csv_import->save(); if (count($this->csv_import->fileImportContent)) { // Get the header from the import $header = $this->csv_import->fileImportContent->first()->header; // Flip the values to keys and explode into array $header = array_flip(explode(',', $header)); foreach ($this->csv_import->fileImportContent as $row) { // Convert the raw row data into array $row_array = explode(',', $row->content); // Build array of import properties $import_array = $header; // Match data array to the header array foreach ($import_array as $index => $key) { $import_array[$index] = $row_array[$key]; } /** * Here we can perform additional validation * for each data field and save it to the database */ // Build array of parameters for our user import $user = User::firstOrCreate(['first_name' => $import_array['first_name'], 'last_name' => $import_array['last_name'], 'email' => $import_array['email']]); $movies = Movies::firstOrCreate(['user_id' => $user->id, 'movie_list' => $import_array['movies']]); $music = Music::firstOrCreate(['user_id' => $user->id, 'music_list' => $import_array['music']]); } $this->csv_import->status = 'processed'; $this->csv_import->save(); } else { $this->csv_import->status = 'error'; $this->csv_import->save(); //Log error exit; } }
} else { if (isset($_POST["login"])) { Users::editUser(new User($_POST["login"], $_POST["password"], $_POST["firstname"], $_POST["lastname"])); } } } if ($_POST["action"] == 'sendInsertForm') { if (isset($_FILES['image'])) { if (Movies::insertImage($_FILES["image"])) { Movies::insertMovie(new Movie(0, $_POST["title"], $_POST["short_description"], $_POST["long_description"], $_POST["director"], $_POST["year"], $_FILES["image"]["name"])); } } } if ($_POST["action"] == 'sendDeleteForm') { if (isset($_POST["id"])) { Movies::deleteMovie($_POST["id"]); } else { if (isset($_POST["login"])) { Users::deleteUser($_POST["login"]); } } } if ($_POST["action"] == 'sendSubscribeForm') { Users::insertUser(new User($_POST["login"], password_hash($_POST["password"], PASSWORD_DEFAULT), $_POST["firstname"], $_POST["lastname"])); } header('Location: .'); exit; } } catch (Exception $e) { header('Location: .?error=' . $e->getMessage()); }
<?php require_once 'connection.php'; require_once 'models/movie-model.php'; $title = ''; //gets query string after the word 'title'. Search for how to test if a query string is empty php. if (isset($_GET['title'])) { //determines if there is anything after 'title' $title = $_GET['title']; //set the $title equal to the title the user searched for } $conn = getConnection(); //makes connection with database $movieModel = new Movies($conn); // Creates a new movie model with the connection $movies = $movieModel->getAllMovies($title); //Calls getAllMovies() to do just that /* echo '<pre>'; var_dump($movies[0]['imdb_id']); */ ?> <!DOCTYPE html> <html lang="en"> <head> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <meta charset="UTF-8"> <title>LAMP Server</title> <link type="text/css" rel="stylesheet" href="stylesheets/main.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.5/css/materialize.min.css"> <link href='https://fonts.googleapis.com/css?family=Bangers' rel='stylesheet' type='text/css'>
function displayGridAllMovies() { ?> <!-- div contenant la liste des films--> <div id="films" class="panel panel-default"> <!-- Table --> <table class="table"> <thead> <tr> <th>Titre</th> <th>Réalisateur</th> <th>Année de sortie</th> <th>Actions</th> </tr> </thead> <?php foreach (Movies::getMovies() as $m) { ?> <tr> <td><a href=".?page=movie&id=<?php echo $m->id; ?> "><?php echo escape($m->title); ?> </a></td> <td> <?php echo escape($m->director); ?> </td> <td> <?php echo $m->year; ?> </td> <td> <a class="btn btn-info btn-xs" href=".?page=edit&id=<?php echo escape($m->id); ?> " title="Editer" role="button"><span class="glyphicon glyphicon-edit"></span></a> <a class="btn btn-danger btn-xs" href=".?page=delete&id=<?php echo escape($m->id); ?> " title="Supprimer" role="button"><span class="glyphicon glyphicon-remove"></span></a> </tr> <?php } ?> </table> </div> <?php }
/** * @return Movies */ public function getMovie() { if (null == $this->movie) { $this->movie = Movies::query()->leftJoin('Serials', 'Serials.movie_id = Movies.id')->where('Serials.id = :serial_id:', ['serial_id' => $this->serial_id])->execute()->getFirst(); } return $this->movie; }
<!-- Use title if it's in the page YAML frontmatter --> <title>Projet films</title> <link href="../css/style.css" rel="stylesheet" type="text/css" /> <link href="../lib/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> </head> <body> <?php require "../lib/topbar.php"; require_once "../modeles/movies.php"; require_once "../modeles/utilisateurs.php"; require_once "../modeles/Categorie.php"; $movies = new Movies(); $utilisateurs = new Utilisateurs(); $categorie = new Categorie(); ?> <div class="contenu"> <h1 class="titre">Administration</h1> <ul class="nav nav-tabs"> <li class="active"><a data-toggle="tab" href="#film">Films</a></li> <li><a data-toggle="tab" href="#utilisateur">Utilisateurs</a></li> <li><a data-toggle="tab" href="#catego">Catégories</a></li> </ul> <div class="tab-content"> <div id="film" class="tab-pane fade in active">
<!--creates individual php page for each movie with additional details about the movie--> <?php //establish connection with database table movies require_once 'connection.php'; require_once 'models/movie-model.php'; //capture id of movie that is clicked on $id = $_GET['id']; $conn = getConnection(); $movieModel = new Movies($conn); $matches = $movieModel->details($id); //access IMDB API to show Rotten Tomatoes rating information if (count($matches) == 1) { $imdb_id = $matches[0]['imdb_id']; $url = "http://www.omdbapi.com/?i=" . $imdb_id . "&tomatoes=true"; $json = file_get_contents($url); $data = json_decode($json); } ?> <!DOCTYPE html> <html lang="en"> <head> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <meta charset="UTF-8"> <link rel="icon"> <title>Movie Detail</title> <!-- bootstrap css --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
public function getSerialListMovies() { if ($this->serialListMovies == null) { $movies = Movies::query()->leftJoin('Serials', 'Serials.movie_id = Movies.id')->Where('Serials.tvSerial_id = :tvSerial_id:', ['tvSerial_id' => $this->id])->orderBy('Serials.year,Serials.serial_num')->columns(['Movies.*', 'Serials.*'])->execute(); $result = []; foreach ($movies as $m) { $movie = $m->movies; $movie->serial_num = $m->serials->serial_num; $movie->serial_id = $m->serials->id; $result[] = $movie; } $this->serialListMovies = $result; } return $this->serialListMovies; }
public function movies() { //@todo 为什么此处返回的不是Moives的对象呢?这里比较奇怪! $movies = Movies::query()->rightJoin('Taggables', 'Taggables.taggable_id = Movies.id')->where('Taggables.tag_id = :id:', ['id' => $this->id])->andWhere('Taggables.taggable_type = :type:', ['type' => 'Movies'])->groupBy('Movies.id')->execute(); return $movies; }
<?php require_once "../modeles/movies.php"; require_once "../modeles/categorie.php"; $movies = new Movies(); $categorie = new Categorie(); /** Fonction qui permet d'ajouter un film * **/ if (isset($_POST['addMovie'])) { $uploadfile = "C:\\xampp\\htdocs\\mymovies-TyrkoDev\\images\\" . str_replace(' ', '', $_FILES['image']['name']); //Insert le chemin de l'image dans la BDD et la télécharge sur le serveur if (move_uploaded_file($_FILES['image']['tmp_name'], $uploadfile)) { $movies->ajouterFilm(htmlspecialchars($_POST['title']), htmlspecialchars($_POST['shortDescription']), htmlspecialchars($_POST['longDescription']), htmlspecialchars($_POST['director']), htmlspecialchars($_POST['year']), htmlspecialchars($_POST['categorie']), 'images/' . str_replace(' ', '', $_FILES['image']['name'])); } require "../lib/ajoutfilm.php"; } else { if (isset($_POST['supprimerMovie'])) { $movies->supprimerFilm(htmlspecialchars($_POST['id'])); require "../lib/administration.php"; } else { if (isset($_POST['editerMovie'])) { $uploadfile = "C:\\xampp\\htdocs\\mymovies-TyrkoDev\\images\\" . str_replace(' ', '', $_FILES['image']['name']); //Insert le chemin de l'image dans la BDD et la télécharge sur le serveur move_uploaded_file($_FILES['image']['tmp_name'], $uploadfile); $movies->editerFilm(htmlspecialchars($_POST['id']), htmlspecialchars($_POST['title']), htmlspecialchars($_POST['shortDescription']), htmlspecialchars($_POST['longDescription']), htmlspecialchars($_POST['director']), htmlspecialchars($_POST['year']), htmlspecialchars($_POST['categorie']), 'images/' . str_replace(' ', '', $_FILES['image']['name'])); require "../lib/administration.php"; } else { if (isset($_POST['addCategorie'])) { $categorie->ajouterCategorie(htmlspecialchars($_POST['title'])); require "../lib/ajoutCategorie.php";
function main() { try { global $locale; global $RSS; global $session; global $gs; global $searchTitle; global $thisURI; global $PAGE_MAX; global $curOffset; global $editable; $curOffset = trim($_GET['offset']); $curOffset = $curOffset == "" ? 1 : $curOffset; $removes = array(); $movs = new Movies(); $catID = $_GET['catID']; $searchTitle = $_POST['txtSearch']; if ($searchTitle == '') { $searchTitle = $_GET['txtSearch']; } if ($searchTitle == '') { if ($editable) { $movs->LoadWhere('nowPlaying=1'); } else { $movs->LoadWhere('nowPlaying=1 AND visible=1'); } } else { if ($editable) { $movs->Search($searchTitle); } else { $movs->SearchWhereVisiable($searchTitle); } $session->Searched('Movies', $searchTitle); } $movs->Sort('Title'); if ($catID != '') { foreach ($movs as $mov) { $cats = $mov->Categories(); if (!$cats->Contains($catID)) { $removes[] = $mov; } } foreach ($removes as $remove) { $movs->Remove($remove); } } if ($RSS) { RSS($movs); } else { $session->Viewed("Movies", 0, $gs->ActionMsg2ID("ViewedNowPlaying")); } $rssLink = AppendKVP($thisURI, "RSS=1"); ?> <a type="application/rss+xml" href="<?php echo $rssLink; ?> ">RSS</a> <br/> <?php $i = $printedCnt = 0; $extraQryKVPs = array(); if ($catID != "") { $extraQryKVPs[] = "catID={$catID}"; } if ($searchTitle != "") { $extraQryKVPs[] = "txtSearch={$searchTitle}"; } $nav = NavHTML($movs, $curOffset, $PAGE_MAX, $extraQryKVPs); ?> <table> <tr> <td align="center"> <?php echo $nav; ?> </td> </tr> <tr> <td> <?php foreach ($movs as $mov) { if (++$i < $curOffset) { continue; } if (++$printedCnt > $PAGE_MAX) { break; } $otherSiteLinks =& $mov->OtherSiteLinks(); $reviewLinks =& $mov->ReviewLinks(); $trailerLinks =& $mov->TrailerLinks(); $stars =& $mov->Stars(); $writers =& $mov->Writers(); $directors =& $mov->Directors(); $stars->Sort('Name'); $writers->Sort('Name'); $directors->Sort('Name'); $movID =& $mov->ID(); ?> <br/> <table bgcolor="#dddddd" frame="border" width="800"> <tr valign="top"> <?php if (file_exists($mov->MainPicture())) { ?> <td> <a href="movie.php?id=<?php echo $mov->ID(); ?> "> <img src="<?php echo $mov->MainPicture(); ?> " alt=""/></a> </td> <?php } ?> <td> <table cellspacing="1" width="700"> <tr> <td colspan="2" bgcolor="#cccccc"> <b><a href="movie.php?id=<?php echo $mov->ID(); ?> "> <?php echo $mov->Title(); ?> </a></b> </td> </tr> <tr> <td> <?php if ($stars->Count() > 1) { print "<b>" . GetCap('capStars') . ": </b>"; } else { print "<b>" . GetCap('capStar') . ": </b>"; } ?> </td> <td> <?php foreach ($stars as $per) { $id = $per->ID(); $name = $per->Name(); print "<a href=\"person.php?id={$id}\">{$name}</a> "; } ?> </td> </tr> <tr> <td> <?php if ($directors->Count() > 1) { print "<b>" . GetCap('capDirectors') . ": </b>"; } else { print "<b>" . GetCap('capDirector') . ": </b>"; } ?> </td> <td> <?php foreach ($directors as $per) { $id = $per->ID(); $name = $per->Name(); print "<a href=\"person.php?id={$id}\">{$name}</a> "; } ?> </td> </tr> <tr> <td> <?php if ($writers->Count() > 1) { print "<b>" . GetCap('capWriters') . ": </b>"; } else { print "<b>" . GetCap('capWriter') . ": </b>"; } ?> </td> <td> <?php foreach ($writers as $per) { $id = $per->ID(); $name = $per->Name(); print "<a href=\"person.php?id={$id}\">{$name}</a> "; } ?> </td> </tr> <tr> <td valign="top"> <b><?php echo GetCap('capPlot'); ?> : </b> </td> <td> <?php echo wordwrap($mov->PlotOutline($locale), 75, '<br />'); ?> </td> </tr> <tr> <td> <b><?php echo GetCap('capCategories'); ?> :</b> </td> <td> <?php $cats =& $mov->Categories(); $writers =& $mov->Categories(); $directors =& $mov->Categories(); foreach ($cats as $cat) { $catID0 = $cat->ID(); $name = $cat->Name($locale); print "<a href=\"movies.php?catID={$catID0}\">{$name}</a> "; } ?> </td> </tr> <tr> <td> <b><?php echo GetCap('capTrailers'); ?> : </b> </td> <td> <?php foreach ($trailerLinks as $link) { ?> <a href="<?php echo $link->URL(); ?> "><?php echo GetCap($link->Source()); ?> </a> <?php } ?> </td> </tr> <tr> <td> <b><?php echo GetCap('capReviews'); ?> : </b> </td> <td> <?php foreach ($reviewLinks as $link) { ?> <a href="<?php echo $link->URL(); ?> "><?php echo GetCap($link->Source()) . ' (' . $link->Author() . ')'; ?> </a> <?php } ?> </td> </tr> <tr> <td> <b><?php echo GetCap('capOtherSites'); ?> : </b> </td> <td> <?php foreach ($otherSiteLinks as $link) { ?> <a href="<?php echo $link->URL(); ?> "><?php echo GetCap($link->Source()); ?> </a> <?php } ?> </td> </tr> </table> </td> </tr> </table> <?php } ?> </td> </tr> <tr> <td align="center"> <?php echo $nav; ?> </td> </tr> </table> <?php } catch (Exception $ex) { ProcessException($ex); } }
/** * @return Movies */ public function getMovie() { if (null == $this->movie) { $this->movie = Movies::query()->where('id = :id:', ['id' => $this->movie_id])->execute()->getFirst(); } return $this->movie; }
/** *将电影变成internet链接,以便于用everything软件来快速的检索到,这个将来可以将图书也弄成这种形式,方便检索 */ private function dumpMoves2internetLinks() { $movies = Movies::find(); foreach ($movies as $movie) { $title = $movie->title; $url = $this->url->get(['for' => 'movies.show', 'movie' => $movie->id]); echo $title . '-' . $url . '<br>'; $data = '[InternetShortcut] URL=' . $url; $filename = 'temp/' . $title . '.url'; $filename = iconv('UTF-8', 'GBK//IGNORE', preg_replace('|:|', ' ', $filename)); file_put_contents($filename, $data); } }