<?php
include_once '../php/facebook.php';
include_once 'lib.php';
include_once 'config.php';
$facebook = new Facebook($api_key, $secret);
$facebook->require_frame();
$user = $facebook->require_login();
if (isset($_POST['to'])) {
$prints_id = (int)$_POST['to'];
$prints = do_step($user, $prints_id);
} else {
if (isset($_GET['to'])) {
$prints_id = (int)$_GET['to'];
} else {
$prints_id = $user;
}
$prints = get_prints($prints_id);
}
?>
<form method="post" >
<div style="padding: 10px;">
<h2>Hi <fb:name firstnameonly="true" uid="<?=$user?>" useyou="false"/>!</h2>
</div>
<?php
$friends = $facebook->api_client->friends_get();
$rand_keys = array_rand($friends, 2);
$random_friend = $friends[$rand_keys[0]];
$answers = array('YES.','NO.','MAYBE LATER...','DEFINITELY!','NOT REALLY.','TRY ANOTHER QUESTION.','OKAY THEN.','NEVER!','I\'M UNSURE OF THE ANSWER.','IT WOULD BE A SHAME NOT TO.','I WOULD ADVISE AGAINST IT.');
$answerstotal = count($answers) - 1;
$answer = rand(0,$answerstotal);
echo $answers[$answer];
echo "
<fb

rofile-pic uid=\"$random_friend\" useyou=\"false\" /></p>";
?>
<input type="submit" class="inputsubmit" value="SI">
<input type="submit" class="inputsubmit" value="NO">
</form>