");
$this->main_comment = substr ($this->page["Title"], $comment_s - $comment_s_fix, $comment_e - $comment_s + $comment_s_fix);
$this->main_comment = preg_replace("/a href\=\"\//i","a href=\"http://".$this->imdbsite."/",$this->main_comment);
$this->main_comment = preg_replace("/http:\/\/[a-zA-Z.-]+\/images\/showtimes\//i","pic/imdb_pic/",$this->main_comment);
$this->main_comment = preg_replace("/<\/?div.*>/i","",$this->main_comment);
$this->main_comment = preg_replace("/
/i","",$this->main_comment);
}
return $this->main_comment;
}
/** Return votes for this movie
* @method votes
* @return string votes
*/
function votes () {
if ($this->main_votes == "") {
if ($this->page["Title"] == "") $this->openpage ("Title");
$vote_s = strpos ($this->page["Title"], "User Rating:");
if ( $vote_s == 0) return false;
if (strpos ($this->page["Title"], "awaiting 5 votes")) return false;
// $vote_s = strpos ($this->page["Title"], "page["Title"], "votes", $vote_s);
// $this->main_votes = substr ($this->page["Title"], $vote_s, $vote_e - $vote_s);
preg_match('/href=\"ratings\".*>([0-9,][0-9,]*)/', $this->page["Title"], $matches);
$this->main_votes = $matches[1];
$this->main_votes = "imdbsite."/title/tt".$this->imdbID."/ratings\">" . $this->main_votes . "";
}
return $this->main_votes;
}
/** Get movies original language
* @method language
* @return string language
*/
function language () {
if ($this->main_language == "") {
if ($this->page["Title"] == "") $this->openpage ("Title");
$lang_s = strpos ($this->page["Title"], "/Sections/Languages/");
if ( $lang_s == 0) return FALSE;
$lang_s = strpos ($this->page["Title"], ">", $lang_s);
$lang_e = strpos ($this->page["Title"], "<", $lang_s);
$this->main_language = substr ($this->page["Title"], $lang_s + 1, $lang_e - $lang_s - 1);
}
return $this->main_language;
}
/** Get all langauges this movie is available in
* @method languages
* @return array languages (array[0..n] of strings)
*/
function languages () {
if ($this->main_languages == "") {
if ($this->page["Title"] == "") $this->openpage ("Title");
$lang_s = 0;
$lang_e = 0;
$i = 0;
$this->main_languages = array();
while (strpos($this->page["Title"], "/Sections/Languages/", $lang_e) > $lang_s) {
$lang_s = strpos ($this->page["Title"], "/Sections/Languages/", $lang_s);
$lang_s = strpos ($this->page["Title"], ">", $lang_s);
$lang_e = strpos ($this->page["Title"], "<", $lang_s);
$this->main_languages[$i] = substr ($this->page["Title"], $lang_s + 1, $lang_e - $lang_s - 1);
$i++;
}
}
return $this->main_languages;
}
/** Get the movies main genre
* @method genre
* @return string genre
*/
function genre () {
if ($this->main_genre == "") {
if ($this->page["Title"] == "") $this->openpage ("Title");
$genre_s = strpos ($this->page["Title"], "/Sections/Genres/");
if ( $genre_s === FALSE ) return FALSE;
$genre_s = strpos ($this->page["Title"], ">", $genre_s);
$genre_e = strpos ($this->page["Title"], "<", $genre_s);
$this->main_genre = substr ($this->page["Title"], $genre_s + 1, $genre_e - $genre_s - 1);
}
return $this->main_genre;
}
/** Get all genres the movie is registered for
* @method genres
* @return array genres (array[0..n] of strings)
*/
function genres () {
if ($this->main_genres == "") {
if ($this->page["Title"] == "") $this->openpage ("Title");
$this->main_genres = array();
$genre_s = strpos($this->page["Title"],"/Sections/Genres/") -5;
if ($genre_s === FALSE) return array(); // no genre found
if ($genre_s < 0) return array(); // no genre found
$genre_e = strpos($this->page["Title"],"/rg/title-tease/",$genre_s);
$block = substr($this->page["Title"],$genre_s,$genre_e-$genre_s);
$diff = $genre_e-$genre_s;
$genre_s = 0;
$genre_e = 0;
$i = 0;
while (strpos($block, "/Sections/Genres/", $genre_e) > $genre_s) {
$genre_s = strpos ($block, "/Sections/Genres/", $genre_s);
$genre_s = strpos ($block, ">", $genre_s);
$genre_e = strpos ($block, "<", $genre_s);
$this->main_genres[$i] = substr ($block, $genre_s + 1, $genre_e - $genre_s - 1);
$i++;
}
}
return $this->main_genres;
}
/** Get colors
* @method colors
* @return array colors (array[0..1] of strings)
*/
function colors () {
if ($this->main_colors == "") {
if ($this->page["Title"] == "") $this->openpage ("Title");
$color_s = 0;
$color_e = 0;
$i = 0;
while (strpos ($this->page["Title"], "/List?color-info", $color_e) > $color_s) {
$color_s = strpos ($this->page["Title"], "/List?color-info", $color_s);
$color_s = strpos ($this->page["Title"], ">", $color_s);
$color_e = strpos ($this->page["Title"], "<", $color_s);
$this->main_colors[$i] = substr ($this->page["Title"], $color_s + 1, $color_e - $color_s - 1);
$i++;
}
}
return $this->main_colors;
}
/** Get the main tagline for the movie
* @method tagline
* @return string tagline
*/
function tagline () {
if ($this->main_tagline == "") {
if ($this->page["Title"] == "") $this->openpage ("Title");
$tag_s = strpos ($this->page["Title"], "Tagline:");
if ( $tag_s == 0) return FALSE;
$tag_s = strpos ($this->page["Title"], ">", $tag_s);
$tag_e = strpos ($this->page["Title"], "<", $tag_s);
$this->main_tagline = substr ($this->page["Title"], $tag_s + 1, $tag_e - $tag_s - 1);
}
return $this->main_tagline;
}
/** Get the main Plot outline for the movie
* @method plotoutline
* @return string plotoutline
*/
function plotoutline () {
if ($this->main_plotoutline == "") {
if ($this->page["Title"] == "") $this->openpage ("Title");
$plotoutline_s = strpos ($this->page["Title"], "Plot:");
if ( $plotoutline_s == 0) return FALSE;
$plotoutline_s = strpos ($this->page["Title"], ">", $plotoutline_s);
$plotoutline_e = strpos ($this->page["Title"], "<", $plotoutline_s);
$this->main_plotoutline = substr ($this->page["Title"], $plotoutline_s + 1, $plotoutline_e - $plotoutline_s - 1);
}
return $this->main_plotoutline;
}
/** Get the movies plot(s)
* @method plot
* @return array plot (array[0..n] of strings)
*/
function plot () {
if ($this->plot_plot == "") {
if ($this->page["Plot"] == "") $this->openpage ("Plot");
$plot_e = 0;
$i = 0;
$this->plot_plot = array();
while (($plot_s = strpos ($this->page["Plot"], "", $plot_e)) !== FALSE)
{
$plot_e = strpos ($this->page["Plot"], "
", $plot_s);
$tmplot = substr ($this->page["Plot"], $plot_s + 19, $plot_e - $plot_s - 19);
$tmplot = str_replace("href=\"/", "href=\"http://". $this->imdbsite ."/", $tmplot);
$this->plot_plot[$i] = $tmplot;
$i++;
}
}
return $this->plot_plot;
}
/** Get all available taglines for the movie
* @method taglines
* @return array taglines (array[0..n] of strings)
*/
function taglines () {
if ($this->taglines == "") {
if ($this->page["Taglines"] == "") $this->openpage ("Taglines");
$tags_e = 0;
$i = 0;
$tags_s = strpos ($this->page["Taglines"], "", $tags_e);
$tagend = strpos ($this->page["Taglines"], " |