/* 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") { $eaten = $tamagotchi->actionFeed(); $smarty->assign('ACTIONDONE', 'eaten'); $smarty->assign('ACTIONPOINTS', $eaten); $tokens = array('variable1' => 'value1'); $facebook->api_client->feed_publishUserAction('59887462220', $tokens); } if ($action == "doc") { $doc = $tamagotchi->actionDoctor();