Ejemplo n.º 1
0
if (!isset($_GET['type']) || $_GET['type'] != 'actors') {
    if ($_GET['page']) {
        $page = $_GET['page'];
        $i = ($page - 1) * $numPerPage;
    }
    $searchlimit = min($movieCount, $i + $numPerPage);
}
$query = "SELECT * FROM movies INNER JOIN imdb ON movies.id=imdb.id WHERE movies.genres LIKE '%{$genre}%' {$orderQuery} LIMIT {$numPerPage} OFFSET {$i}";
$ids = array();
if ($s1 = $mysqli->query($query)) {
    while ($r1 = mysqli_fetch_assoc($s1)) {
        $ids[] = $r1['id'];
    }
}
$movies = getMoviesShort($ids);
gen_page_header(ucwords($genre) . " | readyto.watch");
?>

<body>

<?php 
include 'includes/navbar.php';
include 'includes/left_navbar.php';
?>
<div id="container">
	
	<?php 
if ($movieCount > 0) {
    echo "<p>";
    echo "We have <b>" . ($movieCount == 1 ? "1</b> <span class=\"genre-tag\">{$genre}</span>movie" : number_format($movieCount) . "</b><span class=\"genre-tag\">{$genre}</span>movies") . ($movieCount > $numPerPage ? $i == 0 ? ": showing first {$numPerPage} movies." : ": showing movies {$i} - {$searchlimit}." : ".");
    echo "</p>";
Ejemplo n.º 2
0
<?php

include 'includes/mysqli_connect.php';
include 'includes/functions.php';
include 'includes/login_check.php';
include 'includes/track_page_view.php';
gen_page_header('readyto.watch', '<style>html{height:100%}.dropdown-menu.typeahead{z-index:10000;width:530px}.footer{position:initial}.tooltip{border-style:hidden;}
	@media (max-width: 320px) { .dropdown-menu.typeahead { width: 100% } }
	</style>');
?>

<body id="home">

<?php 
$navbarPage = 1;
include 'includes/left_navbar.php';
// get background image
$backgroundQuery = "SELECT p.id, p.type, m.title, m.backdrop, m.year, m.img_link FROM popular p\nINNER JOIN movies m\nON m.id = p.id\nWHERE p.type!='crackle'\nAND LENGTH(m.backdrop) > 0\nORDER BY RAND() LIMIT 1";
//$backgroundQuery =
if ($bgq = $mysqli->query($backgroundQuery)) {
    if ($bg = mysqli_fetch_assoc($bgq)) {
        $backgroundUrl = "http://image.tmdb.org/t/p/w780{$bg['backdrop']}";
    }
}
$availableLink = false;
if ($bg['id']) {
    $avQuery = "SELECT link FROM {$bg['type']} WHERE id={$bg['id']}";
    if ($availableQ = $mysqli->query($avQuery)) {
        if ($available = mysqli_fetch_assoc($availableQ)) {
            $availableLink = $available['link'];
            if ($bg['type'] == "itunes") {
Ejemplo n.º 3
0
<?php

include 'includes/functions.php';
include 'includes/mysqli_connect.php';
include 'includes/login_check.php';
include 'includes/track_page_view.php';
gen_page_header('About Us | readyto.watch');
?>

<body>
<?php 
include 'includes/navbar.php';
$navbarPage = 7;
include 'includes/left_navbar.php';
?>
<div id="container">

	<div class="logo-header">
		<img src="images/readytowatch.png">
	</div>
	
	<div class="box about-content">	
		<h2>Our Mission</h2>
		<p>
			Watching a movie in the age of the Internet shouldn't be hard. You can find virtually any movie ever made, and stream it online instantly; but that process isn't always easy.
		</p>
		<p>
			You dig through websites like IMDb or Rotten Tomatoes for hours, only to find that the rare gem you haven't seen yet isn't available on Netflix. So you venture over to the iTunes Store, where it's only available for purchase at a scandalous $19.99. You go over to Amazon, and huzzah! It's free... for Amazon Prime subscribers. You finally give up, furious, teary-eyed.
			But look &#8212; <i>it's not your fault</i>.
		</p>
		<p>
Ejemplo n.º 4
0
if (strpos($account['image'], '//graph.facebook.com') !== false) {
    $account['image'] .= '?width=550';
}
$signedUpQuery = $mysqli->query("SELECT timestamp FROM session_history WHERE user_id={$account['id']} AND (type='fb_signup' OR type='signup')");
$signedUp = mysqli_fetch_assoc($signedUpQuery);
$signedUpTimestamp = $signedUp ? date('F j, Y', strtotime($signedUp['timestamp'])) : false;
$lastLoggedInQuery = $mysqli->query("SELECT timestamp, type FROM session_history WHERE user_id={$account['id']} AND (type='fb_login' OR type='login') ORDER BY timestamp DESC LIMIT 1");
$lastLoggedIn = mysqli_fetch_assoc($lastLoggedInQuery);
$lastLoggedInMessage = $lastLoggedIn ? "Last logged in" . ($lastLoggedIn['type'] == 'fb_login' ? " (Facebook)" : "") . ": " . "<span class='timestamp' data-timestamp='" . strtotime($lastLoggedIn['timestamp']) . "'" : false;
if (isset($_GET['error'])) {
    if ($_GET['error'] == '1') {
        $error = "<span class='message-danger'><i class='fa fa-times-circle'></i> This Facebook account is already linked to a user. Log out above, then log in with Facebook.</span><br>";
    }
}
$addedStyle = "<style>\n  .tab-pane { margin-left: 18% }\n  .form-control { width: 70%; float: right;}\n  label { position: relative; top: 10px; font-weight:200; }\n  label i { margin-right: 5px; }\n  h3 { padding-bottom: 10px; font-size: 30px; margin-top: 5px; border-bottom: 1px solid #e4e4e4; }\n  .prefs { width: 35%; top:3px;}\n  .label { font-size: 110%; }\n  #password-change { width: 70%; float: right; }\n</style>";
gen_page_header('Account Settings | readyto.watch', $addedStyle);
?>

<body>
<?php 
include 'includes/navbar.php';
$navbarPage = 3;
include 'includes/left_navbar.php';
?>

  <div id="container">
    <div class='account-nav-left'>
      <ul class="nav nav-pills nav-stacked">
        <li class="active"><a href="#accountsettings" data-toggle="tab">Account settings</a></li>
        <li><a href="#movieprefs" data-toggle="tab">Movie preferences</a></li>
      </ul>
Ejemplo n.º 5
0
<?php

// signup
include 'includes/functions.php';
include 'includes/mysqli_connect.php';
include 'includes/login_check.php';
include 'includes/track_page_view.php';
if (isset($_SESSION['user'])) {
    header('Location: account');
}
$prevUser = isset($_SESSION['user_prev']) ? $_SESSION['user_prev'] : "";
gen_page_header('Sign Up | readyto.watch');
?>

<body>
<?php 
require_once 'includes/navbar.php';
include 'includes/left_navbar.php';
?>
  <div id="container">
    <div class="jumbotron text-center login-jumbotron box" style="padding: 10px 0 40px">
        <h1>Welcome.</h1>
          <button type="button" class="btn btn-default help-popover-btn" data-container="body" data-html="true" data-toggle="popover" data-placement="bottom" 
            title="<b>Why should I sign up?</b>" 
            data-content="<p>By signing up, you get to customize what kind of search results you'll get (i.e. what services we display), and set alerts for when movies become available to stream. It also lets us 
            track what kind of stuff you like so we can offer suggestions to you later.</p>" style="right: 4%">
            <i class="fa fa-lightbulb-o" style="color: #c20427; margin-right: 5px; font-size: 18px"></i> Why should I sign up?
          </button>
        <p>Please join us, so we can personalize your browsing experience. It's free!</p>
          <div class="well">
            <a href="FacebookSDK/fbconfig.php"><div class="btn btn-primary fb-login" style="width: auto"><i class="fa fa-facebook-official"></i> Sign up with Facebook</div></a>
Ejemplo n.º 6
0
<?php

// login
// for now, assume the user is logged in
include 'includes/functions.php';
include 'includes/mysqli_connect.php';
include 'includes/login_check.php';
include 'includes/track_page_view.php';
if ($loggedIn) {
    header('Location: account');
}
gen_page_header('Reset your password | readyto.watch');
?>

<body>
<?php 
require_once 'includes/navbar.php';
include 'includes/left_navbar.php';
?>

  <div id="container">

<?php 
if (isset($_GET['email']) && isset($_GET['resetHash'])) {
    if ($mysqli->query("SELECT * FROM users WHERE email='" . $_GET['email'] . "' AND resetHash='" . $_GET['resetHash'] . "'")->num_rows > 0) {
        // they match
        ?>
    <div class="jumbotron text-center login-jumbotron" style="padding-top: 10px">
        <p style="font-size: 23px">Your password has been reset. Please choose a new one:</p>
          <div class="well">
            <form role="form" id="reset-form" action="login?r=1" method="post" style="width: 50%; margin: 0 auto; text-align:left">
Ejemplo n.º 7
0
$query = filter_query($arr, 'movies.id');
$total = $mysqli->query($query)->num_rows;
$page = 1;
if ($_GET['page']) {
    $page = $_GET['page'];
    $i = ($page - 1) * $numPerPage;
}
$searchlimit = min($total, $i + $numPerPage);
$ids = array();
if ($s1 = $mysqli->query($query . " LIMIT {$numPerPage} OFFSET {$i}")) {
    while ($r1 = mysqli_fetch_assoc($s1)) {
        $ids[] = $r1['id'];
    }
}
$movies = getMoviesShort($ids);
gen_page_header('Filter Search Results | readyto.watch');
$navbarPage = 5;
include 'includes/left_navbar.php';
?>

<body>
<div id="container">
	<?php 
if ($total > 0) {
    echo "Your search returned <b>" . ($total == 1 ? "1</b> result:" : "{$total}</b> results:") . " showing " . ($total > $numPerPage ? $i == 0 ? "first {$numPerPage} movies." : "movies " . ($i + 1) . " - {$searchlimit}." : "all {$total} movie" . ($total == 1 ? "." : "s."));
    ?>
	
		<p>Can't find the movie you were looking for? Return to <a href='search/filter'>the Filter Search</a>.</p>
		
		<?php 
    foreach ($movies as $movie) {
Ejemplo n.º 8
0
<?php

// login
// for now, assume the user is logged in
include 'includes/functions.php';
include 'includes/mysqli_connect.php';
include 'includes/login_check.php';
include 'includes/track_page_view.php';
include 'includes/resetPasswordCheck.php';
if ($loggedIn) {
    header('Location: account');
}
$prevUser = isset($_SESSION['user_prev']) ? $_SESSION['user_prev'] : "";
gen_page_header('Log In | readyto.watch');
?>

<body>
<?php 
require_once 'includes/navbar.php';
include 'includes/left_navbar.php';
?>
  <div id="container">
    <div class="jumbotron text-center login-jumbotron box" style="padding-top: 10px">
        <h1>Hello again.</h1>
        <p>
          <?php 
if ($resetPass) {
    echo 'You can now log in with your new password.';
} else {
    echo 'Please log in, just so you feel right at home.';
}
Ejemplo n.º 9
0
if (!isset($_GET['type']) || $_GET['type'] != 'actors') {
    if ($_GET['page']) {
        $page = $_GET['page'];
        $i = ($page - 1) * $numPerPage;
    }
    $searchlimit = min($movieCount, $i + $numPerPage);
}
$query = "SELECT movies.id FROM movies INNER JOIN imdb ON movies.id=imdb.id INNER JOIN movie_keywords ON movie_keywords.id = movies.id WHERE movie_keywords.keyword_id = {$kid} {$orderQuery} LIMIT {$numPerPage} OFFSET {$i}";
$ids = array();
if ($s1 = $mysqli->query($query)) {
    while ($r1 = mysqli_fetch_assoc($s1)) {
        $ids[] = $r1['id'];
    }
}
$movies = getMoviesShort($ids);
gen_page_header(ucwords($keyword) . " | readyto.watch");
?>

<body>

<?php 
include 'includes/navbar.php';
include 'includes/left_navbar.php';
?>
<div id="container">
	
	<?php 
if ($movieCount > 0) {
    echo "<p>";
    echo "We have <b>" . ($movieCount == 1 ? "1</b> movie" : number_format($movieCount) . "</b> movies") . " with keyword <b>{$keyword}</b>" . ($movieCount > $numPerPage ? $i == 0 ? ": showing first {$numPerPage} movies." : ": showing movies {$i} - {$searchlimit}." : ".");
    echo "</p>";
Ejemplo n.º 10
0
<?php

//search
include 'includes/mysqli_connect.php';
include 'includes/functions.php';
include 'includes/login_check.php';
if (!$loggedIn) {
    header('Location: login');
}
include 'includes/track_page_view.php';
gen_page_header('Favorites | readyto.watch');
?>

<body>

<?php 
include 'includes/navbar.php';
$navbarPage = 6;
include 'includes/left_navbar.php';
?>
<div id="container">
	<h1><?php 
echo $fb ? $account['fb_fname'] : $account['username'];
?>
's Favorites</h1>

<?php 
$countquery = "SELECT COUNT(movie_id) FROM favorites WHERE user_id={$account['id']}";
$total = mysqli_fetch_assoc($mysqli->query($countquery))['COUNT(movie_id)'];
$i = 0;
$page = 1;
Ejemplo n.º 11
0
<?php

include 'includes/functions.php';
include 'includes/mysqli_connect.php';
include 'includes/login_check.php';
include 'includes/track_page_view.php';
gen_page_header('Search History | readyto.watch');
?>

<body>
<?php 
include 'includes/navbar.php';
$page = 4;
include 'includes/left_navbar.php';
?>
<div id="container">
<h1>History</h1>
<p>View up to 30 of your most recent searches here.</p>
  <?php 
if ($loggedIn) {
    date_default_timezone_set("America/New_York");
    $i = 0;
    $query = "SELECT * FROM history WHERE user_id={$account['id']} ORDER BY timestamp DESC";
    if ($t = $mysqli->query($query)) {
        echo "<ul class='history box'>";
        while (($result = mysqli_fetch_assoc($t)) && $i < 30) {
            // if we have history for this user
            echo "<li><a href='search?q=" . urlencode($result['search']) . "'><b>" . $result['search'] . "</b></a><span class='history-time'> - " . gen_time_ago($result['timestamp']);
            echo "</span></li>";
            $i++;
        }
Ejemplo n.º 12
0
include 'includes/functions.php';
include 'includes/mysqli_connect.php';
include 'includes/login_check.php';
include 'includes/track_page_view.php';
$ymax = date("Y");
$ymin = 1950;
//if ($test = mysqli_query($mysqli,"SELECT MIN(NULLIF(year, 0)) FROM movies")) $ymin = mysqli_fetch_assoc($test)['MIN(NULLIF(year, 0))'];
//if ($test = mysqli_query($mysqli,"SELECT MAX(runtime) FROM movies"))
$min = 0;
$max = 200;
// $max = mysqli_fetch_assoc($test)['MAX(runtime)'];
//if ($test = mysqli_query($mysqli,"SELECT MIN(NULLIF(runtime, 0)) FROM movies")) $min = mysqli_fetch_assoc($test)['MIN(NULLIF(runtime, 0))'];
$totalMovies = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT(*) FROM movies WHERE year <= {$ymax}"))['COUNT(*)'];
$totalMoviesFormatted = number_format($totalMovies);
gen_page_header('Filter Search | readyto.watch', "<link type='text/css' rel='stylesheet' href='css/slider.css' />");
?>

<body>
<?php 
include 'includes/navbar.php';
$page = 5;
include 'includes/left_navbar.php';
?>
<div id="container">
  <h1>Filter Search</h1>

  <button type="button" class="btn btn-default help-popover-btn" data-container="body" data-html="true" data-toggle="popover" data-placement="bottom" 
title="<b>About the Filter Search</b>" 
data-content="<p>The Filter Search is still in beta mode, and we are working on improving it and adding more features.</p><p>We eventually want people to be able to use the Filter Search to find interesting movies that they haven't seen yet.</p>">
  <i class="fa fa-lightbulb-o" style="color: #c20427; margin-right: 5px; font-size: 18px"></i> About the Filter Search
Ejemplo n.º 13
0
<?php

// signup
include 'includes/functions.php';
include 'includes/mysqli_connect.php';
include 'includes/login_check.php';
include 'includes/track_page_view.php';
include 'includes/verify_check.php';
gen_page_header('Verify | readyto.watch');
?>

<body>
<?php 
require_once 'includes/navbar.php';
include 'includes/left_navbar.php';
?>
<div id="container" style="text-align:center">
  <?php 
if ($match > 0) {
    ?>
  <h1>Thank you!</h1>
  <p class="success-message well">
    <i class="fa fa-check-circle fa-2x"></i>Awesome, your email has been verified! You can now log in.
  </p>
<div class="login-jumbotron" style="margin-top:10px">
  <div class="well">
   <form role="form" id="p-form" action="account" method="post">
     <div class="form-group">
       <label for="p-username">Username</label>
       <input type="text" class="form-control" id="p-username" placeholder="Enter username" name="login_username" value="<?php 
    echo $username;
Ejemplo n.º 14
0
        $page = $_GET['page'];
        $i = ($page - 1) * $numPerPage;
    }
    $searchlimit = min($movieCount, $i + $numPerPage);
}
//$searchQuery = "SELECT SQL_CALC_FOUND_ROWS m.id,m.title,m.year,m.runtime,m.genres,m.adult,m.synopsis,m.tagline,m.director,m.img_link,m.language,m.mpaa,m.imdb_id,i.imdb_rating,
$searchQuery = "SELECT id,\n\t\t\t\tCASE WHEN title = '{$fSearch}' THEN 1 ELSE 0 END\n\t\t\t\tAS score,\n\t\t\t\tMATCH(title) AGAINST('{$fSearch}%')\n\t\t\t\tAS relevance\n\t\t\t\tFROM movies\n\t\t\t\tWHERE MATCH(title) AGAINST ('{$fSearch}')\n\t\t\t\tOR title LIKE '{$fSearch}'\n\t\t\t\t{$adult} \n\t\t\t\tORDER BY score DESC, popularity DESC, relevance DESC \n\t\t\t\tLIMIT {$numPerPage} \n\t\t\t\tOFFSET {$i};";
$movies = array();
$ids = array();
if ($s1 = $mysqli->query($searchQuery)) {
    while ($r1 = mysqli_fetch_assoc($s1)) {
        $ids[] = $r1['id'];
    }
}
$movies = getMoviesShort($ids);
gen_page_header("{$search} | readyto.watch");
?>

<body>

<?php 
include 'includes/navbar.php';
$navbarPage = 2;
include 'includes/left_navbar.php';
?>
<div id="container">
	
	<ul id="results-tabs" class="nav nav-pills">
		<li<?php 
echo isset($_GET['type']) && $_GET['type'] == 'actors' || sizeof($actor_ids) > 0 && $movieCount == 0 ? "" : " class='active'";
?>
Ejemplo n.º 15
0
<?php

//search
include 'includes/mysqli_connect.php';
include 'includes/functions.php';
include 'includes/login_check.php';
if (!$loggedIn) {
    header('Location: login');
}
include 'includes/track_page_view.php';
gen_page_header('My Alerts | readyto.watch');
?>

<body>

<?php 
include 'includes/navbar.php';
$navbarPage = 9;
include 'includes/left_navbar.php';
?>
<div id="container">
	<button type="button" class="btn btn-default wrong-link" data-container="body" data-html="true" data-toggle="popover" data-placement="bottom" 
		title="<b>Setting an alert</b>" 
		data-content="<p>Movies are frequently added to the iTunes Store, Netflix, etc. If you want us to email you when a movie is available, then set alerts on the movie's page or in search results.</p>">
  		<i class="fa fa-lightbulb-o" style="color: #c20427; margin-right: 5px; font-size: 18px"></i> What are alerts?
	</button>
	<h1>My Alerts</h1>

	<?php 
$q = $mysqli->query("SELECT * FROM alerts WHERE user_id={$account['id']} AND any+itunes+amazon+netflix+youtube+crackle+google_play>0");
$total = $q->num_rows;
Ejemplo n.º 16
0
//                   ORDER BY roles.star DESC";
// if($s = $mysqli->query($starringQuery)) {
//   while ($actor = mysqli_fetch_assoc($s)) {
//     $actors[] = $actor;
//   }
// }
$noActors = sizeof($movie['actors']) ? false : true;
$actors = $movie['actors'];
//$photos[] = ((strlen($actor['photo']) > 0) ? 'http://image.tmdb.org/t/p/w185' . $actor['photo'] : "images/no_actor_found.png");
$noResult = false;
$params = $movie['params'];
//echo (sizeof($params)) ? "yes" : "no";
if (!$params) {
    $noResult = true;
}
gen_page_header(($noResult ? "Not valid" : "{$params['title']} ({$params['year']})") . " | readyto.watch");
?>

<body>

<?php 
include 'includes/navbar.php';
include 'includes/left_navbar.php';
?>
<div id="container">
<?php 
if (!$noResult) {
    include 'templates/gen_movie_page.php';
} else {
    echo "<div class='message-danger'><i class='fa fa-exclamation-triangle'></i> This is not a valid movie! <a class='return-to-search'>Try another search</a>.</div>";
}
Ejemplo n.º 17
0
<?php

// signup
if (!isset($_POST['reg-user'])) {
    header('Location: account');
}
include 'includes/functions.php';
include 'includes/mysqli_connect.php';
include 'includes/login_check.php';
include 'includes/track_page_view.php';
include 'includes/register_check.php';
gen_page_header('Authenticate | readyto.watch');
?>

<body>
<?php 
require_once 'includes/navbar.php';
include 'includes/left_navbar.php';
?>
  <div id="container" style="text-align:center">
        <h1>Thank you!</h1>
          <button type="button" class="btn btn-default help-popover-btn" data-container="body" data-html="true" data-toggle="popover" data-placement="bottom" 
            title="<b>Account authentication</b>" 
            data-content="<p>By authenticating your email, we can make sure you are a real user, and not a bot.</p>">
            <i class="fa fa-lightbulb-o" style="color: #c20427; margin-right: 5px; font-size: 18px"></i> Why send me an email?
          </button>
        <p class="success-message well"><i class="fa fa-rocket fa-2x"></i> You're almost there! Click the verification link we just sent to your email and you'll be up and running in no time. (Make sure to check your spam folder!)</p>
  </div> <!-- #container -->

<?php 
include 'includes/footer.php';
Ejemplo n.º 18
0
        $photo = $actor['photo'];
        $about = $actor['about'];
        $dob = $actor['dob'];
        $dod = $actor['dod'];
        $imdb_id = $actor['imdb_id'];
        $backdrop = $actor['backdrop'];
        $backdrop_id = $actor['backdrop_id'];
        $person_id = $actor['person_id'];
        $type = $actor['label'];
    }
}
$noResult = false;
if ($t->num_rows == 0) {
    $noResult = true;
}
gen_page_header(($noResult ? "Not valid" : $name) . " | readyto.watch");
$backdropQuery = $mysqli->query("SELECT title, year FROM movies WHERE id={$backdrop_id}");
if ($backdropQuery->num_rows > 0) {
    $backdropMovie = mysqli_fetch_assoc($backdropQuery);
}
$acted = false;
$directed = false;
if ($person_id == 3) {
    $acted = true;
    $directed = true;
} else {
    if ($person_id == 1) {
        $acted = true;
    } else {
        if ($person_id == 2) {
            $directed = true;