示例#1
0
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
require_once 'config.php';
require_once 'addict_database.php';
$user = $_GET['user'];
if (preg_match('/\\d+/', $user)) {
    $user = (int) $user;
} else {
    echo '<h1 class="error">Invalid User ID</h1>';
    die;
}
$ad = new AddictDatabase();
/*
// This page will go into a completley different page, called view
//If a user is defined in the url, see if that user added the app
$submit = true;
if($facebook->api_client->users_isAppUser($_GET['user']) && isset($_GET['user'])) {
	$user = $_GET['user'];
	$submit = false;
}
*/
$list = $_GET['list'];
if ($list == 'afi') {
    $list = 'afi';
    $tabvalue = 8;
    $total = '100';
    $list_movies = $ad->getAFIMovies();
<?php

require_once 'config.php';
require_once 'addict_database.php';
$list = "<table>";
$list .= "<thead><td>Rank</td><td>Title</td></thead>";
$ad = new AddictDatabase();
foreach ($ad->getMovies() as $movie) {
    if ($movie['instant']) {
        $list .= "<tr><td>" . $movie['imdb_rank'] . "</td><td><a href=\"http://www.netflix.com/WiPlayer?movieid=" . $movie['netflix_id'] . "\">" . $movie['title'] . "</a></td></tr>";
    }
}
$list .= "</table>";
?>

<html>
<body>
<h1>IMDB Top 250 + Netflix Watch Instantly = Crazy Delicious</h1>
<?php 
echo $list;
?>
</body>
</html>
示例#3
0
<?php

require 'hulu.php';
require 'addict_database.php';
$hulu = new Hulu();
$ad = new AddictDatabase();
$movies = $ad->getMovies();
foreach ($movies as $movie) {
    if ($hulu->available($movie['title'])) {
        echo $movie['title'] . "<br>";
    }
}
示例#4
0
require_once 'facebook.php';
// Create the Facebook application
$facebook = new Facebook($appapikey, $appsecret);
$user = $facebook->require_login();
// Retrieve array of friends who've already added the app.
$fql = 'SELECT uid FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=' . $user . ') AND is_app_user = 1';
$_friends = $facebook->api_client->fql_query($fql);
// Extract the user ID's returned in the FQL request into a new array.
$friends = array();
if (is_array($_friends) && count($_friends)) {
    foreach ($_friends as $friend) {
        $friends[] = $friend['uid'];
    }
}
unset($_friends);
$ad = new AddictDatabase();
$filmfriends = array();
foreach ($friends as $friend) {
    $user = $ad->getUser($friend);
    if ($user) {
        $filmfriends[] = $user;
    }
}
unset($friends);
//Create the pageData object
$pageData = (object) array();
// Save Information
$pageData->css = $cssurl;
$pageData->appurl = $appurl;
$pageData->tabs = 2;
$pageData->userid = $user;
示例#5
0
*/
// Error Handling
$users = array_keys($_GET['user']);
if (count($users) < 2) {
    die("Too few arguments");
}
$str = "";
foreach ($users as $key => $value) {
}
$str .= "{$key},";
try {
    $facebook->api_client->users_getInfo($str, "name");
} catch (Exception $ex) {
    die("invalid user id");
}
$ad = new AddictDatabase();
// Update the userfilms
$movies = $ad->getRankedMovies();
$unseenids = array();
foreach ($users as $user) {
    $unseenids = array_merge($ad->getUserMovies($user), $unseenids);
}
$unseen = array();
$unseenids = array_unique($unseenids);
foreach ($movies as $key => $value) {
    if (!in_array($key, $unseenids)) {
        $unseen[] = $value;
    }
}
//Create the pageData object
$pageData = (object) array();
示例#6
0
<?php

// Get the configuration variables
require_once 'addict_database.php';
require_once 'config.php';
$ad = new AddictDatabase();
$user_id = $_POST['userid'];
$on_movies = $_POST['film'];
$checked_movies = array();
$list = $_POST['list'];
$previous_movies = $ad->getUserMovies($user_id);
if ($list == "imdb") {
    $list_films = array_keys($ad->getIMDBMovies());
} else {
    $list_films = array_keys($ad->getAFIMovies());
}
foreach ($on_movies as $key => $value) {
    $checked_movies[] = (int) $key;
}
foreach ($checked_movies as $movie_id) {
    if (!in_array($movie_id, $previous_movies)) {
        $ad->addUserMovie($user_id, $movie_id);
    }
}
foreach ($previous_movies as $movie_id) {
    if (!is_null($checked_movies) && !in_array($movie_id, $checked_movies) && in_array($movie_id, $list_films)) {
        $ad->deleteUserMovie($user_id, $movie_id);
    }
}
$ad->updateUserMovieCount($user_id);
echo '<fb:redirect url="http://apps.facebook.com/' . $appurl . '?msg=1" />';