예제 #1
0
파일: dialogs.php 프로젝트: kimblemj/server
 public static function updateDialog($pack)
 {
     $pack->auth->game_id = dbconnection::queryObject("SELECT * FROM dialogs WHERE dialog_id = '{$pack->dialog_id}'")->game_id;
     $pack->auth->permission = "read_write";
     if (!editors::authenticateGameEditor($pack->auth)) {
         return new return_package(6, NULL, "Failed Authentication");
     }
     dbconnection::query("UPDATE dialogs SET " . (isset($pack->name) ? "name                   = '" . addslashes($pack->name) . "', " : "") . (isset($pack->description) ? "description            = '" . addslashes($pack->description) . "', " : "") . (isset($pack->icon_media_id) ? "icon_media_id          = '" . addslashes($pack->icon_media_id) . "', " : "") . (isset($pack->intro_dialog_script_id) ? "intro_dialog_script_id = '" . addslashes($pack->intro_dialog_script_id) . "', " : "") . (isset($pack->back_button_enabled) ? "back_button_enabled    = '" . addslashes($pack->back_button_enabled) . "', " : "") . "last_active = CURRENT_TIMESTAMP " . "WHERE dialog_id = '{$pack->dialog_id}'");
     games::bumpGameVersion($pack);
     return dialogs::getDialog($pack);
 }