当前位置: 首页>>代码示例>>PHP>>正文


PHP Movie类代码示例

本文整理汇总了PHP中Movie的典型用法代码示例。如果您正苦于以下问题:PHP Movie类的具体用法?PHP Movie怎么用?PHP Movie使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Movie类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_most_view_movie

 function get_most_view_movie()
 {
     Doo::loadClass('Movie');
     $mv = new Movie();
     $mostview = array();
     $cache_name = "get_most_view_movie";
     $mostview = $this->cache->get($cache_name);
     if (!$mostview || $this->clearcache) {
         $query = "select (select sum(total) FROM cron_trending_view b where a.stats_id = b.stats_id) as totalx, stats_id, param, total  \n\t\t\t\t      from cron_trending_view a where tipe = 'new_vod' OR tipe = 'tovi' GROUP BY stats_id ORDER BY totalx desc LIMIT 50";
         $rs = $this->dbAAA2()->fetchAll($query);
         /* $filter = "ga:pagePath=~^/stats/view/tovi* || ga:pagePath=~^/stats/view/vod";
         			$this->requestReportData(Doo::conf()->ga_profile['uid'], array('pagePath','pageTitle'), array('pageviews'),array('-pageviews'), $filter,  date("Y-m-d",strtotime ( '-30 day' )), date("Y-m-d"),1, 30);*/
         //foreach($this->getResults() as $result)
         foreach ($rs as $result) {
             $param = json_decode($result['param'], true);
             //$mn = str_replace(' - UseeTV','',$result->getPageTitle());
             $mv_metadata = $mv->get_movie_detail_by_vodId($param['vod_id']);
             //var_dump($mv_metadata); exit;
             if (!$mv_metadata) {
                 continue;
             }
             $mostview[] = array('data' => $mv_metadata, 'view' => $result['totalx'], 'buy' => $mv->get_total_order_by_void($param['vod_id']));
         }
         $this->cache->set($cache_name, $mostview, $this->cache_time);
     }
     return $mostview;
 }
开发者ID:berlianaputri,项目名称:rps,代码行数:27,代码来源:_GA.php

示例2: CreateMovie

 private function CreateMovie()
 {
     $movie = new Movie();
     $data = array();
     $data['title'] = $_POST['title'];
     $url = $this->uploadImage($_FILES['poster']);
     if ($url != false) {
         $data['poster'] = $url;
     }
     $data['rating'] = $_POST['rating'];
     $data['description'] = $_POST['description'];
     $data['genre'] = $_POST['genre'];
     $data['type'] = $_POST['type'];
     $data['year'] = $_POST['year'];
     $data['release_time'] = $_POST['release_time'];
     $data['run_time'] = $_POST['run_time'];
     $data['keyword'] = $_POST['keyword'];
     $img = $this->uploadImage($_FILES['big_picture']);
     if ($img != false) {
         $data['big_picture'] = $img;
     }
     if (!empty($_POST['parent'])) {
         $sql = mysql_query("SELECT * FROM Movies WHERE title LIKE '%" . $_POST['parent'] . "%'");
         $result = mysql_fetch_assoc($sql);
         $data['parent_id'] = $result['id'];
     } else {
         $data['parent_id'] = 0;
     }
     $movie->setMovie($data);
     return $movie;
 }
开发者ID:Bixls,项目名称:Movies-website,代码行数:31,代码来源:MovieAdapter.php

示例3: try_load_movie

 public function try_load_movie($movie_id, &$plugin_cookies)
 {
     // hd_print(__METHOD__  . ': ' . print_r($plugin_cookies, true)) ;
     HD::print_backtrace();
     if (!$this->base_url) {
         $this->base_url = EmplexerConfig::getInstance()->getPlexBaseUrl($plugin_cookies, $this);
     }
     $url = $this->base_url . $movie_id;
     $xml = HD::getAndParseXmlFromUrl($url);
     $movie = new Movie($movie_id);
     // $movie->set_data("American",'The American','Alone among assassins, Jack is a master craftsman. When a job in Sweden ends more harshly than expected for this American abroad, he vows to his contact Larry that his next assignment will be his last. Jack reports to the Italian countryside, where he holes up in a small town and relishes being away from death for a spell. The assignment, as specified by a Belgian woman, Mathilde, is in the offing as a weapon is constructed. Surprising himself, Jack seeks out the friendship of local priest Father Benedetto and pursues romance with local woman Clara. But by stepping out of the shadows, Jack may be tempting fate.','http://192.168.2.9:32400/library/metadata/4376/thumb/1342928192',1050,'2010','Anton Corbijn','Hiporã',
     // "George Clooney \n Jack,Thekla Reuten|Mathilde,Bruce Altman|Larry,Violante Placido|Clara|,Paolo Bonacelli|Father Benedetto",'Crime,Drama,Suspense,Thriller',6.4000000953674299,10,'R','USA','1 real');
     $grandparentTitle = (string) $xml->Video->attributes()->grandparentTitle;
     $title = $grandparentTitle ? "Episode " . (string) $xml->Video->attributes()->index . ' : ' . (string) $xml->Video->attributes()->title : (string) $xml->Video->attributes()->title;
     // (string)$xml->Video->attributes()->summary
     $movie->set_data($name = $grandparentTitle, $name_original = $title, $description = (string) $xml->Video->attributes()->summary, $poster_url = $this->base_url . '/photo/:/transcode?width=' . THUMB_WIDTH . '&height=' . THUMB_HEIGHT . '&url=' . $this->base_url . (string) $xml->Video->attributes()->thumb, $length_min = (double) $xml->Video->attributes()->duration / 1000 / 60, $year = (string) $xml->Video->attributes()->year, $directors_str = $this->geDirectorStr($xml), $scenarios_str = null, $actors_str = $this->getRolesStr($xml), $genres_str = $this->getGenreStr($xml), $rate_imdb = (double) $xml->Video->attributes()->rating, $rate_kinopoisk = null, $rate_mpaa = (string) $xml->Video->attributes()->contentRating, $country = $this->getCountryStr($xml), $budget = null);
     $tab = '     ';
     $details = array('Video' => '_', $tab . 'Bitrate' => (string) $xml->Video->Media->attributes()->bitrate, $tab . 'Width' => (string) $xml->Video->Media->attributes()->width, $tab . 'Height' => (string) $xml->Video->Media->attributes()->height, $tab . 'Aspect Ratio' => (string) $xml->Video->Media->attributes()->aspectRatio, $tab . 'Video Resolution' => (string) $xml->Video->Media->attributes()->videoResolution, $tab . 'Video Frame Rate' => (string) $xml->Video->Media->attributes()->videoFrameRate, $tab . 'Container' => (string) $xml->Video->Media->attributes()->container, $tab . 'Codec' => (string) $xml->Video->Media->attributes()->videoCodec);
     $movie->details = $details;
     $httpVidelUrl = EmplexerConfig::getInstance()->getPlexBaseUrl($plugin_cookies, $this) . (string) $xml->Video->Media->Part->attributes()->key;
     $nfsVideoUrl = 'nfs://' . $plugin_cookies->plexIp . ':' . (string) $xml->Video->Media->Part->attributes()->file;
     if ($plugin_cookies->connectionMethod == 'smb') {
         $smbVideoUrl = 'smb://' . $plugin_cookies->userName . ':' . $plugin_cookies->password . '@' . $plugin_cookies->plexIp . '/' . (string) $xml->Video->Media->Part->attributes()->file;
         $videoUrl[SMB_CONNECTION_TYPE] = $smbVideoUrl;
     }
     $videoUrl[HTTP_CONNECTION_TYPE] = $httpVidelUrl;
     $videoUrl[NFS_CONNECTION_TYPE] = $nfsVideoUrl;
     $v = $videoUrl[$plugin_cookies->connectionMethod];
     hd_print(__METHOD__ . ":-----------videoUrl = {$v}-----------");
     $movie->add_series_data(1, $movie->name, $v, true);
     // hd_print(__METHOD__ . ':' . print_r($movie, true));
     $this->set_cached_movie($movie);
     hd_print(print_r($this, true));
 }
开发者ID:basstreumer,项目名称:emplexer,代码行数:34,代码来源:emplexer_vod.php

示例4: testChargeChildren

 public function testChargeChildren()
 {
     $toystory = new Movie('Toy Story', Movie::CHILDREN);
     $this->assertEquals(1.5, $toystory->getCharge(2));
     $this->assertEquals(1.5, $toystory->getCharge(3));
     $this->assertEquals(3, $toystory->getCharge(4));
 }
开发者ID:jails,项目名称:refactoring-php-example,代码行数:7,代码来源:MovieTest.php

示例5: processMovies

 public function processMovies()
 {
     if ($this->site->lookupimdb == 1) {
         $movie = new Movie($this->echooutput);
         $movie->processMovieReleases();
     }
 }
开发者ID:ehsanguru,项目名称:nnplus,代码行数:7,代码来源:postprocess.php

示例6: post_save

 public function post_save()
 {
     $movie = new Movie();
     $movie->nombre = Input::get('nombre');
     $movie->duracion = Input::get('duracion');
     $movie->save();
     return Redirect::to('movie');
 }
开发者ID:mdela,项目名称:movie-series,代码行数:8,代码来源:MovieController.php

示例7: buildDomainObject

 protected function buildDomainObject($row)
 {
     $movie = new Movie();
     $movie->setId($row['mov_id']);
     $movie->setTitle($row['mov_title']);
     $movie->setDescriptionS($row['mov_description_short']);
     return $movie;
 }
开发者ID:DorianeV,项目名称:MyMovies,代码行数:8,代码来源:MovieDAO.php

示例8: crawl

 public function crawl()
 {
     $dir = $this->getOption('dir');
     $minSize = $this->getOption('minSize');
     $cachedir = $this->getOption('cachedir');
     $photodir = $this->getOption('photodir');
     $cacheage = $this->getOption('cacheage');
     if (!is_dir($dir)) {
         throw new Crawler_Exception('Directory not found: ' . $dir);
         return false;
     }
     $files = $this->exe(sprintf('find %s -size +%s', $dir, $minSize));
     $movies = array();
     $cnt = 0;
     foreach ($files as $file) {
         if (strtolower(pathinfo($file, PATHINFO_EXTENSION)) == 'vob') {
             $file = dirname($file);
             //trigger_error('Think this is a DVD. Using: '. $file, E_USER_NOTICE);
             if (basename($file) == 'VIDEO_TS') {
                 $file = dirname($file);
                 //trigger_error('Think this is a DVD. Using: '. $file, E_USER_NOTICE);
             }
         }
         $cnt++;
         $relativeFile = substr($file, strlen($dir) + 1);
         $slug = Movie::fileslug($file);
         $cacheFile = $cachedir . '/' . $slug . '.json';
         #$imgFile	  = $photodir.'/'.$slug.'.jpg';
         $imgFile = Movie::imageFromFile($file, $photodir);
         if (file_exists($cacheFile) && filemtime($cacheFile) > time() - $cacheage) {
             // Load cache
             $movies[$relativeFile] = json_decode(file_get_contents($cacheFile), true);
         } else {
             $Movie = new Movie($file);
             $details = $Movie->getDetails();
             if (false === $details) {
                 echo 'No movie info found for: ' . $Movie->cleanedName . ', ' . $file . "\n";
             } else {
                 // Use this
                 $movies[$relativeFile] = $details;
                 // Save photo
                 if (!file_exists($imgFile) && !empty($details['photo'])) {
                     if (false === $this->wget($details['photo'], $imgFile)) {
                         trigger_error('wget error', E_USER_ERROR);
                         return false;
                     }
                 }
                 // Save cache
                 file_put_contents($cacheFile, json_encode($details));
             }
         }
         //			if ($cnt > 5) {
         //				break;
         //			}
     }
     return $movies;
 }
开发者ID:nsyed,项目名称:kvzlib,代码行数:57,代码来源:crawler.php

示例9: buildDomainObject

 protected function buildDomainObject($row)
 {
     $movie = new Movie();
     $movie->setId($row['mov_id']);
     $movie->setContent($row['mov_description_short']);
     if (array_key_exists('cat_id', $row)) {
         // Find and set the associated category
         $categoryId = $row['cat_id'];
         $category = $this->categoryDAO->find($categoryId);
         $movie->setcategory($category);
     }
     return $movie;
 }
开发者ID:DorianeV,项目名称:MyMovies,代码行数:13,代码来源:CategoryDAO.php

示例10: beforeInsert

 private function beforeInsert()
 {
     $this->log_content = Callback::searchMovie($this->query);
     foreach ($this->getContent() as $movie_info) {
         if (!Movie::model()->with('attributes')->find('tmdb_id=:id', array(':id' => $movie_info['imdb_id']))) {
             $movie = new Movie();
             $movie->setUrlKey($movie_info);
             $movie->tmdb_id = $movie_info['id'];
             $movie->imdb_id = $movie_info['imdb_id'];
             $movie->save();
         }
     }
 }
开发者ID:unused,项目名称:yii-lmdb,代码行数:13,代码来源:SearchLog.php

示例11: scrape

 public function scrape()
 {
     $cinema = $this->get_cinema();
     $id_cidade = $this->get_id_cidade_do_site();
     $id_cinema = $this->get_id_cinema_do_site();
     $url = "http://www.cinemark.com.br/horarios/?cidade={$id_cidade}&cine1={$id_cinema}";
     $curl_handle = curl_init();
     curl_setopt($curl_handle, CURLOPT_URL, $url);
     curl_setopt($curl_handle, CURLOPT_REFERER, "http://cinemark.com.br/home.html");
     curl_setopt($curl_handle, CURLOPT_FOLLOWLOCATION, true);
     curl_setopt($curl_handle, CURLOPT_USERAGENT, 'Firefox');
     curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
     $buffer = curl_exec($curl_handle);
     curl_close($curl_handle);
     if (!empty($buffer)) {
         phpQuery::newDocument($buffer);
         //tabela de excecoes dos horarios
         $this->excecoes = pq('#legenda #legenda_meio div.b');
         $content = pq('#cont_esq');
         $cine = pq('#titulo', $content);
         $prog = pq('#prog_hora_meio');
         $filmes = pq('div.a ,div.b, div.premiere, div.xd', $prog);
         foreach ($filmes as $key => $value) {
             $filme = new Movie();
             $filme->name = trim(pq('div.titulo a', $value)->text());
             $filme->age = trim(pq('input', $value)->attr('value'));
             $legenda = pq('div.legenda span', $value)->attr('onmouseover');
             $legenda = strtolower($legenda);
             $pattern = '(legendado|dublado|nacional)';
             preg_match($pattern, $legenda, $matches);
             $legenda = trim($matches[0]);
             $filme->subtitle = $legenda;
             $horarios = pq('div.horas > span', $value);
             foreach ($horarios as $key => $value) {
                 $horario = pq($value)->text();
                 if (!empty($horario)) {
                     //recupera a legenda que identifica o dia que o filme vai passar ou não.
                     $excecao_horario = pq('span:gt(' . $key . '):first', pq($value)->parent())->attr('onmouseover');
                     if ($this->tem_sessao_hoje($excecao_horario)) {
                         $horario = str_replace("h", ":", $horario);
                         $filme->set_showtime($horario);
                     }
                 }
             }
             if ($filme->showtimes) {
                 $cinema->set_movie($filme);
             }
         }
         return $cinema;
     }
 }
开发者ID:xxdf,项目名称:showtimes,代码行数:51,代码来源:CinemarkAdapter.php

示例12: remove

 /**
  * Remove a movie.
  * @param Movie $movie
  * @param string $photopath
  * @param string $coverpath
  */
 public function remove($movie, $photopath = false, $coverpath = false)
 {
     if (!$photopath) {
         global $photopath;
     }
     if (!$coverpath) {
         global $coverpath;
     }
     $m = $this->database->load("movies", $movie->id);
     if ($m) {
         $this->database->trash($m);
         // Remove its photo and cover
         $movie->removePhoto($photopath);
         $movie->removeCover($coverpath);
     }
 }
开发者ID:Rattatouille,项目名称:myaqa_test,代码行数:22,代码来源:Movies.class.php

示例13: run

 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 20) as $index) {
         Movie::create(['title' => $faker->sentence(), 'year' => $faker->year($max = 'now'), 'poster_url' => str_replace('public', '', $faker->image($dir = 'public/img', $width = 125, $height = 200)), 'description' => $faker->paragraph(2), 'director' => $faker->name(), 'stars' => $faker->name() . ', ' . $faker->name(), 'note' => $faker->numberBetween($min = 0, $max = 5), 'genre' => $faker->sentence(1), 'watched' => $faker->boolean($chanceOfGettingTrue = 30)]);
     }
 }
开发者ID:metalikium,项目名称:watch-it-later,代码行数:7,代码来源:MoviesTableSeeder.php

示例14: get_link

 public static function get_link($movieId)
 {
     $link = self::find_by_id($movieId);
     $exists = $link ? true : false;
     if ($link && days_from_now($link->timestamp) < LINK_UPDATE_DAYS) {
         // good
     } else {
         $exists = $link ? true : false;
         $movie = Movie::find_by_id($movieId);
         $link = new YouTube();
         $link->id = $movieId;
         $link->timestamp = gen_timestamp();
         $title = urlencode($movie->title);
         $endpoint = "https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=10&q={$title}&type=video&videoCategoryId=30&key=AIzaSyBOaDIBNUCfbthPQ0XSZScnqI8jyxJ9G5Q";
         $m = self::getData($endpoint);
         foreach ($m->items as $mov) {
             $desc = $mov->snippet->description;
             if (levenshtein($title, $mov->snippet->title) < 2) {
                 foreach ($castArr as $actor) {
                     if (strpos($desc, $actor) !== false) {
                         $link->videoId = $mov->id->videoId;
                         break 2;
                         // break out of both foreach loops
                     }
                 }
             }
         }
         if ($exists) {
             $link->update();
         } else {
             $link->create();
         }
     }
     return $link;
 }
开发者ID:vincentbello,项目名称:api-readytowatch,代码行数:35,代码来源:youtube.php

示例15: run

 public function run()
 {
     DB::table('movies')->delete();
     Movie::create(array('title' => 'Man of steel', 'releaseDate' => date('2013-06-19'), 'genre' => 'Fantasy', 'synopsis' => 'A young journalist is forced to confront his secret extraterrestrial heritage when Earth is invaded by members of his race.', 'poster' => 'http://ia.media-imdb.com/images/M/MV5BMjI5OTYzNjI0Ml5BMl5BanBnXkFtZTcwMzM1NDA1OQ@@._V1_SY317_CR1,0,214,317_.jpg'));
     Movie::create(array('title' => 'Star Trek Into Darkness', 'releaseDate' => date('2013-06-12'), 'genre' => 'Fantasy', 'synopsis' => 'After the crew of the Enterprise find an unstoppable force of terror from within their own organization, Captain Kirk leads a manhunt to a war-zone world to capture a one man weapon of mass destruction.', 'poster' => 'http://ia.media-imdb.com/images/M/MV5BMTk2NzczOTgxNF5BMl5BanBnXkFtZTcwODQ5ODczOQ@@._V1_SX214_.jpg'));
     Movie::create(array('title' => 'Monstres Academy', 'releaseDate' => date('2013-07-10'), 'genre' => 'Animation', 'synopsis' => "A look at the relationship between Mike and Sulley during their days at Monsters University -- when they weren't necessarily the best of friends.", 'poster' => 'http://ia.media-imdb.com/images/M/MV5BMTUyODgwMDU3M15BMl5BanBnXkFtZTcwOTM4MjcxOQ@@._V1_SX214_.jpg'));
 }
开发者ID:ladmerc,项目名称:laravel4-angularjs-security,代码行数:7,代码来源:MovieTableSeeder.php


注:本文中的Movie类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。