} // Таймеры $task_end = "Aug,25,2011,13:25:00"; $help_end = "Aug,25,2011,13:25:00"; // "M,d,Y,H:i:s" $bonus_help_end = "Aug,25,2011,13:25:00"; // Чат $chat = $gamechat_model->get_chat($game_id, $command_id); $chat_id = $chat['chat_id']; if ($chat_id != false) { $messages = $gamechat_model->get_messages($chat_id, 0); foreach ($messages as &$message) { $message['time'] = date('H:i', $message['time']); } } else { $provider_id = $gameprovider_model->get_privider_id_by_game_id($game_id); $chat_id = $gamechat_model->add_chat($game_id, $command_id, $provider_id); } // Активные юзеры $active_users = $command_model->get_active_users($command_id, $game_id); //$gameStart = date("M,d,Y,h:m:i", $gameInfo['game_sdate'] + 60*60*24*62); $question_model->can_complete_game($game_id, $command_id); // Порции с вопросами $current_portions = $question_model->get_current_portions($game_id, $command_id); $next_portion = $question_model->get_next_portion($game_id, $command_id); // Если порций больше нет, то завершаем игру if (count($current_portions) == 0 && count($next_portion) == 0) { $game_model->complete_game($game_id, $command_id); } foreach ($current_portions as &$portion) { $portion['usedhelps'] = $question_model->get_used_helps($portion['question_id'], $command_id);