Ejemplo n.º 1
0
    echo '<fb:iframe src="http://YOURURL/bigfatpig/?start=1" frameborder=0 width=760 height=600></fb:iframe>';
    exit;
}
// get facebook user id, initialize action
$_GET[pet] = $user;
$path = split("/", $_SERVER['HTTP_REFERER']);
$path[4] = split("\\?", $path[5]);
$action = $path[4][0];
/* get friends which use 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);
*/
/***************** start the app ********************************************************************************/
$tamagotchi = new Tamagotchi($_GET[pet]);
if ($action == "restart") {
    $tamagotchi->restart($_GET[pet]);
}
$smarty->assign('PETID', $_GET[pet]);
$smarty->display('header.tpl');
if ($tamagotchi->error == "noaccount") {
    $smarty->display('noaccount.tpl');
    exit;
}
$tamagotchi->Calculate();
if ($action == "shower") {
    $showered = $tamagotchi->actionShower();
    $smarty->assign('ACTIONDONE', 'showered');
    $smarty->assign('ACTIONPOINTS', $showered);
    $facebook->api_client->notifications_send($_GET[pet], 'Taken a shower. Yeah.', 'user_to_user');
}
if ($action == "feed") {