Esempio n. 1
0
 public static function updateItem($pack)
 {
     $pack->auth->game_id = dbconnection::queryObject("SELECT * FROM items WHERE item_id = '{$pack->item_id}'")->game_id;
     $pack->auth->permission = "read_write";
     if (!editors::authenticateGameEditor($pack->auth)) {
         return new return_package(6, NULL, "Failed Authentication");
     }
     dbconnection::query("UPDATE items 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->media_id) ? "media_id             = '" . addslashes($pack->media_id) . "', " : "") . (isset($pack->droppable) ? "droppable            = '" . addslashes($pack->droppable) . "', " : "") . (isset($pack->destroyable) ? "destroyable          = '" . addslashes($pack->destroyable) . "', " : "") . (isset($pack->max_qty_in_inventory) ? "max_qty_in_inventory = '" . addslashes($pack->max_qty_in_inventory) . "', " : "") . (isset($pack->weight) ? "weight               = '" . addslashes($pack->weight) . "', " : "") . (isset($pack->url) ? "url                  = '" . addslashes($pack->url) . "', " : "") . (isset($pack->type) ? "type                 = '" . addslashes($pack->type) . "', " : "") . (isset($pack->delta_notification) ? "delta_notification   = '" . addslashes($pack->delta_notification) . "', " : "") . "last_active = CURRENT_TIMESTAMP " . "WHERE item_id = '{$pack->item_id}'");
     games::bumpGameVersion($pack);
     return items::getItem($pack);
 }