} 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(); $smarty->assign('ACTIONDONE', 'doc'); $smarty->assign('ACTIONPOINTS', $doc); } if (ereg("play", $action)) { $number = split("-", $action); $playResult = $tamagotchi->actionPlay($number[1]); $doc = $tamagotchi->actionDoctor(); $smarty->assign('ACTIONDONE', 'played'); $smarty->assign('ACTIONPOINTS', $playResult); } $tamagotchi->Calculate(); $info = $tamagotchi->getData(); $age = $tamagotchi->calculateAgeSize(); // calculate image $age_minutes_awake = $age[minutes] - $tamagotchi->getNightMinsLifetime(); $step = 1; if ($age_minutes_awake > 130) { $step = 2; } if ($age_minutes_awake > 900) { $step = 3;