Example #1
0
 public static function updateQuest($pack)
 {
     $pack->auth->game_id = dbconnection::queryObject("SELECT * FROM quests WHERE quest_id = '{$pack->quest_id}'")->game_id;
     $pack->auth->permission = "read_write";
     if (!editors::authenticateGameEditor($pack->auth)) {
         return new return_package(6, NULL, "Failed Authentication");
     }
     dbconnection::query("UPDATE quests SET " . (isset($pack->name) ? "name                                 = '" . addslashes($pack->name) . "', " : "") . (isset($pack->description) ? "description                          = '" . addslashes($pack->description) . "', " : "") . (isset($pack->active_icon_media_id) ? "active_icon_media_id                 = '" . addslashes($pack->active_icon_media_id) . "', " : "") . (isset($pack->active_media_id) ? "active_media_id                      = '" . addslashes($pack->active_media_id) . "', " : "") . (isset($pack->active_description) ? "active_description                   = '" . addslashes($pack->active_description) . "', " : "") . (isset($pack->active_notification_type) ? "active_notification_type             = '" . addslashes($pack->active_notification_type) . "', " : "") . (isset($pack->active_function) ? "active_function                      = '" . addslashes($pack->active_function) . "', " : "") . (isset($pack->active_requirement_root_package_id) ? "active_requirement_root_package_id   = '" . addslashes($pack->active_requirement_root_package_id) . "', " : "") . (isset($pack->active_event_package_id) ? "active_event_package_id              = '" . addslashes($pack->active_event_package_id) . "', " : "") . (isset($pack->complete_icon_media_id) ? "complete_icon_media_id               = '" . addslashes($pack->complete_icon_media_id) . "', " : "") . (isset($pack->complete_media_id) ? "complete_media_id                    = '" . addslashes($pack->complete_media_id) . "', " : "") . (isset($pack->complete_description) ? "complete_description                 = '" . addslashes($pack->complete_description) . "', " : "") . (isset($pack->complete_notification_type) ? "complete_notification_type           = '" . addslashes($pack->complete_notification_type) . "', " : "") . (isset($pack->complete_function) ? "complete_function                    = '" . addslashes($pack->complete_function) . "', " : "") . (isset($pack->complete_requirement_root_package_id) ? "complete_requirement_root_package_id = '" . addslashes($pack->complete_requirement_root_package_id) . "', " : "") . (isset($pack->complete_event_package_id) ? "complete_event_package_id            = '" . addslashes($pack->complete_event_package_id) . "', " : "") . (isset($pack->sort_index) ? "sort_index                           = '" . addslashes($pack->sort_index) . "', " : "") . "last_active = CURRENT_TIMESTAMP " . "WHERE quest_id = '{$pack->quest_id}'");
     games::bumpGameVersion($pack);
     return quests::getQuest($pack);
 }