本文整理汇总了PHP中dbconnection::queryInsert方法的典型用法代码示例。如果您正苦于以下问题:PHP dbconnection::queryInsert方法的具体用法?PHP dbconnection::queryInsert怎么用?PHP dbconnection::queryInsert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dbconnection
的用法示例。
在下文中一共展示了dbconnection::queryInsert方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createGame
public static function createGame($pack)
{
$pack->auth->permission = "read_write";
if (!users::authenticateUser($pack->auth)) {
return new return_package(6, NULL, "Failed Authentication");
}
if (isset($pack->siftr_url) && $pack->siftr_url == '') {
// For creation, a siftr_url of undefined, null, or empty string are all the same.
// They all become NULL in the db.
$pack->siftr_url = null;
}
$url_result = games::isValidSiftrURL($pack);
if ($url_result->returnCode != 0) {
return $url_result;
}
$pack->game_id = dbconnection::queryInsert("INSERT INTO games (" . (isset($pack->name) ? "name," : "") . (isset($pack->description) ? "description," : "") . (isset($pack->icon_media_id) ? "icon_media_id," : "") . (isset($pack->media_id) ? "media_id," : "") . (isset($pack->map_type) ? "map_type," : "") . (isset($pack->map_focus) ? "map_focus," : "") . (isset($pack->map_latitude) ? "map_latitude," : "") . (isset($pack->map_longitude) ? "map_longitude," : "") . (isset($pack->map_zoom_level) ? "map_zoom_level," : "") . (isset($pack->map_show_player) ? "map_show_player," : "") . (isset($pack->map_show_players) ? "map_show_players," : "") . (isset($pack->map_offsite_mode) ? "map_offsite_mode," : "") . (isset($pack->notebook_allow_comments) ? "notebook_allow_comments," : "") . (isset($pack->notebook_allow_likes) ? "notebook_allow_likes," : "") . (isset($pack->notebook_trigger_scene_id) ? "notebook_trigger_scene_id," : "") . (isset($pack->notebook_trigger_requirement_root_package_id) ? "notebook_trigger_requirement_root_package_id," : "") . (isset($pack->notebook_trigger_title) ? "notebook_trigger_title," : "") . (isset($pack->notebook_trigger_icon_media_id) ? "notebook_trigger_icon_media_id," : "") . (isset($pack->notebook_trigger_distance) ? "notebook_trigger_distance," : "") . (isset($pack->notebook_trigger_infinite_distance) ? "notebook_trigger_infinite_distance," : "") . (isset($pack->notebook_trigger_wiggle) ? "notebook_trigger_wiggle," : "") . (isset($pack->notebook_trigger_show_title) ? "notebook_trigger_show_title," : "") . (isset($pack->notebook_trigger_hidden) ? "notebook_trigger_hidden," : "") . (isset($pack->notebook_trigger_on_enter) ? "notebook_trigger_on_enter," : "") . (isset($pack->inventory_weight_cap) ? "inventory_weight_cap," : "") . (isset($pack->is_siftr) ? "is_siftr," : "") . (isset($pack->siftr_url) ? "siftr_url," : "") . (isset($pack->published) ? "published," : "") . (isset($pack->type) ? "type," : "") . (isset($pack->intro_scene_id) ? "intro_scene_id," : "") . (isset($pack->latitude) ? "latitude," : "") . (isset($pack->longitude) ? "longitude," : "") . (isset($pack->network_level) ? "network_level," : "") . (isset($pack->allow_download) ? "allow_download," : "") . (isset($pack->preload_media) ? "preload_media," : "") . (isset($pack->moderated) ? "moderated," : "") . (isset($pack->version) ? "version," : "") . (isset($pack->colors_id) ? "colors_id," : "") . "created" . ") VALUES (" . (isset($pack->name) ? "'" . addslashes($pack->name) . "'," : "") . (isset($pack->description) ? "'" . addslashes($pack->description) . "'," : "") . (isset($pack->icon_media_id) ? "'" . addslashes($pack->icon_media_id) . "'," : "") . (isset($pack->media_id) ? "'" . addslashes($pack->media_id) . "'," : "") . (isset($pack->map_type) ? "'" . addslashes($pack->map_type) . "'," : "") . (isset($pack->map_focus) ? "'" . addslashes($pack->map_focus) . "'," : "") . (isset($pack->map_latitude) ? "'" . addslashes($pack->map_latitude) . "'," : "") . (isset($pack->map_longitude) ? "'" . addslashes($pack->map_longitude) . "'," : "") . (isset($pack->map_zoom_level) ? "'" . addslashes($pack->map_zoom_level) . "'," : "") . (isset($pack->map_show_player) ? "'" . addslashes($pack->map_show_player) . "'," : "") . (isset($pack->map_show_players) ? "'" . addslashes($pack->map_show_players) . "'," : "") . (isset($pack->map_offsite_mode) ? "'" . addslashes($pack->map_offsite_mode) . "'," : "") . (isset($pack->notebook_allow_comments) ? "'" . addslashes($pack->notebook_allow_comments) . "'," : "") . (isset($pack->notebook_allow_likes) ? "'" . addslashes($pack->notebook_allow_likes) . "'," : "") . (isset($pack->notebook_trigger_scene_id) ? "'" . addslashes($pack->notebook_trigger_scene_id) . "'," : "") . (isset($pack->notebook_trigger_requirement_root_package_id) ? "'" . addslashes($pack->notebook_trigger_requirement_root_package_id) . "'," : "") . (isset($pack->notebook_trigger_title) ? "'" . addslashes($pack->notebook_trigger_title) . "'," : "") . (isset($pack->notebook_trigger_icon_media_id) ? "'" . addslashes($pack->notebook_trigger_icon_media_id) . "'," : "") . (isset($pack->notebook_trigger_distance) ? "'" . addslashes($pack->notebook_trigger_distance) . "'," : "") . (isset($pack->notebook_trigger_infinite_distance) ? "'" . addslashes($pack->notebook_trigger_infinite_distance) . "'," : "") . (isset($pack->notebook_trigger_wiggle) ? "'" . addslashes($pack->notebook_trigger_wiggle) . "'," : "") . (isset($pack->notebook_trigger_show_title) ? "'" . addslashes($pack->notebook_trigger_show_title) . "'," : "") . (isset($pack->notebook_trigger_hidden) ? "'" . addslashes($pack->notebook_trigger_hidden) . "'," : "") . (isset($pack->notebook_trigger_on_enter) ? "'" . addslashes($pack->notebook_trigger_on_enter) . "'," : "") . (isset($pack->inventory_weight_cap) ? "'" . addslashes($pack->inventory_weight_cap) . "'," : "") . (isset($pack->is_siftr) ? "'" . addslashes($pack->is_siftr) . "'," : "") . (isset($pack->siftr_url) ? "'" . addslashes($pack->siftr_url) . "'," : "") . (isset($pack->published) ? "'" . addslashes($pack->published) . "'," : "") . (isset($pack->type) ? "'" . addslashes($pack->type) . "'," : "") . (isset($pack->intro_scene_id) ? "'" . addslashes($pack->intro_scene_id) . "'," : "") . (isset($pack->latitude) ? "'" . addslashes($pack->latitude) . "'," : "") . (isset($pack->longitude) ? "'" . addslashes($pack->longitude) . "'," : "") . (isset($pack->network_level) ? "'" . addslashes($pack->network_level) . "'," : "") . (isset($pack->allow_download) ? "'" . addslashes($pack->allow_download) . "'," : "") . (isset($pack->preload_media) ? "'" . addslashes($pack->preload_media) . "'," : "") . (isset($pack->moderated) ? "'" . addslashes($pack->moderated) . "'," : "") . (isset($pack->version) ? "'" . addslashes($pack->version) . "'," : "") . (isset($pack->colors_id) ? "'" . addslashes($pack->colors_id) . "'," : "") . "CURRENT_TIMESTAMP" . ")");
dbconnection::queryInsert("INSERT INTO user_games (game_id, user_id, created) VALUES ('{$pack->game_id}','{$pack->auth->user_id}',CURRENT_TIMESTAMP)");
// game_id, type, name, icon, sort, created
dbconnection::query("INSERT INTO tabs (game_id, type, name, icon_media_id, sort_index, created) VALUES ('{$pack->game_id}', 'QUESTS', '', '0', '1', CURRENT_TIMESTAMP)");
dbconnection::query("INSERT INTO tabs (game_id, type, name, icon_media_id, sort_index, created) VALUES ('{$pack->game_id}', 'MAP', '', '0', '2', CURRENT_TIMESTAMP)");
dbconnection::query("INSERT INTO tabs (game_id, type, name, icon_media_id, sort_index, created) VALUES ('{$pack->game_id}', 'INVENTORY', '', '0', '3', CURRENT_TIMESTAMP)");
dbconnection::query("INSERT INTO tabs (game_id, type, name, icon_media_id, sort_index, created) VALUES ('{$pack->game_id}', 'SCANNER', '', '0', '4', CURRENT_TIMESTAMP)");
dbconnection::query("INSERT INTO tabs (game_id, type, name, icon_media_id, sort_index, created) VALUES ('{$pack->game_id}', 'DECODER', '', '0', '5', CURRENT_TIMESTAMP)");
dbconnection::query("INSERT INTO tabs (game_id, type, name, icon_media_id, sort_index, created) VALUES ('{$pack->game_id}', 'PLAYER', '', '0', '6', CURRENT_TIMESTAMP)");
dbconnection::query("INSERT INTO tabs (game_id, type, name, icon_media_id, sort_index, created) VALUES ('{$pack->game_id}', 'NOTEBOOK', '', '0', '7', CURRENT_TIMESTAMP)");
mkdir(Config::v2_gamedata_folder . "/{$pack->game_id}", 0777);
$pack->name = "Starting Scene";
$pack->description = "";
scenes::createScene($pack);
return games::getGame($pack);
}
示例2: createWebHook
public static function createWebHook($pack)
{
$pack->auth->game_id = $pack->game_id;
$pack->auth->permission = "read_write";
if (!editors::authenticateGameEditor($pack->auth)) {
return new return_package(6, NULL, "Failed Authentication");
}
$pack->web_hook_id = dbconnection::queryInsert("INSERT INTO web_hooks (" . "game_id," . (isset($pack->name) ? "name," : "") . (isset($pack->url) ? "url," : "") . (isset($pack->incoming) ? "incoming," : "") . (isset($pack->requirement_root_package_id) ? "requirement_root_package_id," : "") . "created" . ") VALUES (" . "'" . addslashes($pack->game_id) . "'," . (isset($pack->name) ? "'" . addslashes($pack->name) . "'," : "") . (isset($pack->url) ? "'" . addslashes($pack->url) . "'," : "") . (isset($pack->incoming) ? "'" . addslashes($pack->incoming) . "'," : "") . (isset($pack->requirement_root_package_id) ? "'" . addslashes($pack->requirement_root_package_id) . "'," : "") . "CURRENT_TIMESTAMP" . ")");
games::bumpGameVersion($pack);
return web_hooks::getWebHook($pack);
}
示例3: createOverlay
public static function createOverlay($pack)
{
$pack->auth->game_id = $pack->game_id;
$pack->auth->permission = "read_write";
if (!editors::authenticateGameEditor($pack->auth)) {
return new return_package(6, NULL, "Failed Authentication");
}
$pack->overlay_id = dbconnection::queryInsert("INSERT INTO overlays (" . "game_id," . (isset($pack->name) ? "name," : "") . (isset($pack->description) ? "description," : "") . (isset($pack->media_id) ? "media_id," : "") . (isset($pack->top_left_latitude) ? "top_left_latitude," : "") . (isset($pack->top_left_longitude) ? "top_left_longitude," : "") . (isset($pack->top_right_latitude) ? "top_right_latitude," : "") . (isset($pack->top_right_longitude) ? "top_right_longitude," : "") . (isset($pack->bottom_left_latitude) ? "bottom_left_latitude," : "") . (isset($pack->bottom_left_longitude) ? "bottom_left_longitude," : "") . (isset($pack->requirement_root_package_id) ? "requirement_root_package_id," : "") . "created" . ") VALUES (" . "'" . addslashes($pack->game_id) . "'," . (isset($pack->name) ? "'" . addslashes($pack->name) . "'," : "") . (isset($pack->description) ? "'" . addslashes($pack->description) . "'," : "") . (isset($pack->media_id) ? "'" . addslashes($pack->media_id) . "'," : "") . (isset($pack->top_left_latitude) ? "'" . addslashes($pack->top_left_latitude) . "'," : "") . (isset($pack->top_left_longitude) ? "'" . addslashes($pack->top_left_longitude) . "'," : "") . (isset($pack->top_right_latitude) ? "'" . addslashes($pack->top_right_latitude) . "'," : "") . (isset($pack->top_right_longitude) ? "'" . addslashes($pack->top_right_longitude) . "'," : "") . (isset($pack->bottom_left_latitude) ? "'" . addslashes($pack->bottom_left_latitude) . "'," : "") . (isset($pack->bottom_left_longitude) ? "'" . addslashes($pack->bottom_left_longitude) . "'," : "") . (isset($pack->requirement_root_package_id) ? "'" . addslashes($pack->requirement_root_package_id) . "'," : "") . "CURRENT_TIMESTAMP" . ")");
games::bumpGameVersion($pack);
return overlays::getOverlay($pack);
}
示例4: createTrigger
public static function createTrigger($pack)
{
$pack->auth->game_id = $pack->game_id;
$pack->auth->permission = "read_write";
if (!editors::authenticateGameEditor($pack->auth)) {
return new return_package(6, NULL, "Failed Authentication");
}
$pack->trigger_id = dbconnection::queryInsert("INSERT INTO triggers (" . "game_id," . (isset($pack->instance_id) ? "instance_id," : "") . (isset($pack->scene_id) ? "scene_id," : "") . (isset($pack->requirement_root_package_id) ? "requirement_root_package_id," : "") . (isset($pack->type) ? "type," : "") . (isset($pack->name) ? "name," : "") . (isset($pack->title) ? "title," : "") . (isset($pack->icon_media_id) ? "icon_media_id," : "") . (isset($pack->latitude) ? "latitude," : "") . (isset($pack->longitude) ? "longitude," : "") . (isset($pack->distance) ? "distance," : "") . (isset($pack->infinite_distance) ? "infinite_distance," : "") . (isset($pack->wiggle) ? "wiggle," : "") . (isset($pack->show_title) ? "show_title," : "") . (isset($pack->hidden) ? "hidden," : "") . (isset($pack->trigger_on_enter) ? "trigger_on_enter," : "") . (isset($pack->qr_code) ? "qr_code," : "") . (isset($pack->seconds) ? "seconds," : "") . "created" . ") VALUES (" . "'" . $pack->game_id . "'," . (isset($pack->instance_id) ? "'" . addslashes($pack->instance_id) . "'," : "") . (isset($pack->scene_id) ? "'" . addslashes($pack->scene_id) . "'," : "") . (isset($pack->requirement_root_package_id) ? "'" . addslashes($pack->requirement_root_package_id) . "'," : "") . (isset($pack->type) ? "'" . addslashes($pack->type) . "'," : "") . (isset($pack->name) ? "'" . addslashes($pack->name) . "'," : "") . (isset($pack->title) ? "'" . addslashes($pack->title) . "'," : "") . (isset($pack->icon_media_id) ? "'" . addslashes($pack->icon_media_id) . "'," : "") . (isset($pack->latitude) ? "'" . addslashes($pack->latitude) . "'," : "") . (isset($pack->longitude) ? "'" . addslashes($pack->longitude) . "'," : "") . (isset($pack->distance) ? "'" . addslashes($pack->distance) . "'," : "") . (isset($pack->infinite_distance) ? "'" . addslashes($pack->infinite_distance) . "'," : "") . (isset($pack->wiggle) ? "'" . addslashes($pack->wiggle) . "'," : "") . (isset($pack->show_title) ? "'" . addslashes($pack->show_title) . "'," : "") . (isset($pack->hidden) ? "'" . addslashes($pack->hidden) . "'," : "") . (isset($pack->trigger_on_enter) ? "'" . addslashes($pack->trigger_on_enter) . "'," : "") . (isset($pack->qr_code) ? "'" . addslashes($pack->qr_code) . "'," : "") . (isset($pack->seconds) ? "'" . addslashes($pack->seconds) . "'," : "") . "CURRENT_TIMESTAMP" . ")");
games::bumpGameVersion($pack);
return triggers::getTrigger($pack);
}
示例5: createItem
public static function createItem($pack)
{
$pack->auth->game_id = $pack->game_id;
$pack->auth->permission = "read_write";
if (!editors::authenticateGameEditor($pack->auth)) {
return new return_package(6, NULL, "Failed Authentication");
}
$pack->item_id = dbconnection::queryInsert("INSERT INTO items (" . "game_id," . (isset($pack->name) ? "name," : "") . (isset($pack->description) ? "description," : "") . (isset($pack->icon_media_id) ? "icon_media_id," : "") . (isset($pack->media_id) ? "media_id," : "") . (isset($pack->droppable) ? "droppable," : "") . (isset($pack->destroyable) ? "destroyable," : "") . (isset($pack->max_qty_in_inventory) ? "max_qty_in_inventory," : "") . (isset($pack->weight) ? "weight," : "") . (isset($pack->url) ? "url," : "") . (isset($pack->type) ? "type," : "") . (isset($pack->delta_notification) ? "delta_notification," : "") . "created" . ") VALUES (" . "'" . addslashes($pack->game_id) . "'," . (isset($pack->name) ? "'" . addslashes($pack->name) . "'," : "") . (isset($pack->description) ? "'" . addslashes($pack->description) . "'," : "") . (isset($pack->icon_media_id) ? "'" . addslashes($pack->icon_media_id) . "'," : "") . (isset($pack->media_id) ? "'" . addslashes($pack->media_id) . "'," : "") . (isset($pack->droppable) ? "'" . addslashes($pack->droppable) . "'," : "") . (isset($pack->destroyable) ? "'" . addslashes($pack->destroyable) . "'," : "") . (isset($pack->max_qty_in_inventory) ? "'" . addslashes($pack->max_qty_in_inventory) . "'," : "") . (isset($pack->weight) ? "'" . addslashes($pack->weight) . "'," : "") . (isset($pack->url) ? "'" . addslashes($pack->url) . "'," : "") . (isset($pack->type) ? "'" . addslashes($pack->type) . "'," : "") . (isset($pack->delta_notification) ? "'" . addslashes($pack->delta_notification) . "'," : "") . "CURRENT_TIMESTAMP" . ")");
games::bumpGameVersion($pack);
return items::getItem($pack);
}
示例6: createTab
public static function createTab($pack)
{
$pack->auth->game_id = $pack->game_id;
$pack->auth->permission = "read_write";
if (!editors::authenticateGameEditor($pack->auth)) {
return new return_package(6, NULL, "Failed Authentication");
}
$pack->tab_id = dbconnection::queryInsert("INSERT INTO tabs (" . "game_id," . (isset($pack->type) ? "type," : "") . (isset($pack->name) ? "name," : "") . (isset($pack->icon_media_id) ? "icon_media_id," : "") . (isset($pack->content_id) ? "content_id," : "") . (isset($pack->info) ? "info," : "") . (isset($pack->requirement_root_package_id) ? "requirement_root_package_id," : "") . (isset($pack->sort_index) ? "sort_index," : "") . "created" . ") VALUES (" . "'" . addslashes($pack->game_id) . "'," . (isset($pack->type) ? "'" . addslashes($pack->type) . "'," : "") . (isset($pack->name) ? "'" . addslashes($pack->name) . "'," : "") . (isset($pack->icon_media_id) ? "'" . addslashes($pack->icon_media_id) . "'," : "") . (isset($pack->content_id) ? "'" . addslashes($pack->content_id) . "'," : "") . (isset($pack->info) ? "'" . addslashes($pack->info) . "'," : "") . (isset($pack->requirement_root_package_id) ? "'" . addslashes($pack->requirement_root_package_id) . "'," : "") . (isset($pack->sort_index) ? "'" . addslashes($pack->sort_index) . "'," : "") . "CURRENT_TIMESTAMP" . ")");
games::bumpGameVersion($pack);
return tabs::getTab($pack);
}
示例7: createQuest
public static function createQuest($pack)
{
$pack->auth->game_id = $pack->game_id;
$pack->auth->permission = "read_write";
if (!editors::authenticateGameEditor($pack->auth)) {
return new return_package(6, NULL, "Failed Authentication");
}
$pack->quest_id = dbconnection::queryInsert("INSERT INTO quests (" . "game_id," . (isset($pack->name) ? "name," : "") . (isset($pack->description) ? "description," : "") . (isset($pack->active_icon_media_id) ? "active_icon_media_id," : "") . (isset($pack->active_media_id) ? "active_media_id," : "") . (isset($pack->active_description) ? "active_description," : "") . (isset($pack->active_notification_type) ? "active_notification_type," : "") . (isset($pack->active_function) ? "active_function," : "") . (isset($pack->active_requirement_root_package_id) ? "active_requirement_root_package_id," : "") . (isset($pack->active_event_package_id) ? "active_event_package_id," : "") . (isset($pack->complete_icon_media_id) ? "complete_icon_media_id," : "") . (isset($pack->complete_media_id) ? "complete_media_id," : "") . (isset($pack->complete_description) ? "complete_description," : "") . (isset($pack->complete_notification_type) ? "complete_notification_type," : "") . (isset($pack->complete_function) ? "complete_function," : "") . (isset($pack->complete_requirement_root_package_id) ? "complete_requirement_root_package_id," : "") . (isset($pack->complete_event_package_id) ? "complete_event_package_id," : "") . (isset($pack->sort_index) ? "sort_index," : "") . "created" . ") VALUES (" . "'" . addslashes($pack->game_id) . "'," . (isset($pack->name) ? "'" . addslashes($pack->name) . "'," : "") . (isset($pack->description) ? "'" . addslashes($pack->description) . "'," : "") . (isset($pack->active_icon_media_id) ? "'" . addslashes($pack->active_icon_media_id) . "'," : "") . (isset($pack->active_media_id) ? "'" . addslashes($pack->active_media_id) . "'," : "") . (isset($pack->active_description) ? "'" . addslashes($pack->active_description) . "'," : "") . (isset($pack->active_notification_type) ? "'" . addslashes($pack->active_notification_type) . "'," : "") . (isset($pack->active_function) ? "'" . addslashes($pack->active_function) . "'," : "") . (isset($pack->active_requirement_root_package_id) ? "'" . addslashes($pack->active_requirement_root_package_id) . "'," : "") . (isset($pack->active_event_package_id) ? "'" . addslashes($pack->active_event_package_id) . "'," : "") . (isset($pack->complete_icon_media_id) ? "'" . addslashes($pack->complete_icon_media_id) . "'," : "") . (isset($pack->complete_media_id) ? "'" . addslashes($pack->complete_media_id) . "'," : "") . (isset($pack->complete_description) ? "'" . addslashes($pack->complete_description) . "'," : "") . (isset($pack->complete_notification_type) ? "'" . addslashes($pack->complete_notification_type) . "'," : "") . (isset($pack->complete_function) ? "'" . addslashes($pack->complete_function) . "'," : "") . (isset($pack->complete_requirement_root_package_id) ? "'" . addslashes($pack->complete_requirement_root_package_id) . "'," : "") . (isset($pack->complete_event_package_id) ? "'" . addslashes($pack->complete_event_package_id) . "'," : "") . (isset($pack->sort_index) ? "'" . addslashes($pack->sort_index) . "'," : "") . "CURRENT_TIMESTAMP" . ")");
games::bumpGameVersion($pack);
return quests::getQuest($pack);
}
示例8: createInstance
public static function createInstance($pack)
{
$pack->auth->game_id = $pack->game_id;
$pack->auth->permission = "read_write";
if (!editors::authenticateGameEditor($pack->auth)) {
return new return_package(6, NULL, "Failed Authentication");
}
$pack->instance_id = dbconnection::queryInsert("INSERT INTO instances (" . "game_id," . (isset($pack->object_type) ? "object_type," : "") . (isset($pack->object_id) ? "object_id," : "") . (isset($pack->qty) ? "qty," : "") . (isset($pack->infinite_qty) ? "infinite_qty," : "") . (isset($pack->factory_id) ? "factory_id," : "") . (isset($pack->owner_type) ? "owner_type," : "") . (isset($pack->owner_id) ? "owner_id," : "") . "created" . ") VALUES (" . "'" . $pack->game_id . "'," . (isset($pack->object_type) ? "'" . addslashes($pack->object_type) . "'," : "") . (isset($pack->object_id) ? "'" . addslashes($pack->object_id) . "'," : "") . (isset($pack->qty) ? "'" . addslashes($pack->qty) . "'," : "") . (isset($pack->infinite_qty) ? "'" . addslashes($pack->infinite_qty) . "'," : "") . (isset($pack->factory_id) ? "'" . addslashes($pack->factory_id) . "'," : "") . (isset($pack->owner_type) ? "'" . addslashes($pack->owner_type) . "'," : "") . (isset($pack->owner_id) ? "'" . addslashes($pack->owner_id) . "'," : "") . "CURRENT_TIMESTAMP" . ")");
games::bumpGameVersion($pack);
return instances::getInstance($pack);
}
示例9: createGroup
public static function createGroup($pack)
{
$pack->auth->game_id = $pack->game_id;
$pack->auth->permission = "read_write";
if (!editors::authenticateGameEditor($pack->auth)) {
return new return_package(6, NULL, "Failed Authentication");
}
$pack->group_id = dbconnection::queryInsert("INSERT INTO groups (" . "game_id," . (isset($pack->name) ? "name," : "") . (isset($pack->description) ? "description," : "") . "created" . ") VALUES (" . "'" . addslashes($pack->game_id) . "'," . (isset($pack->name) ? "'" . addslashes($pack->name) . "'," : "") . (isset($pack->description) ? "'" . addslashes($pack->description) . "'," : "") . "CURRENT_TIMESTAMP" . ")");
games::bumpGameVersion($pack);
return groups::getGroup($pack);
}
示例10: createObjectTag
public static function createObjectTag($pack)
{
$pack->auth->game_id = $pack->game_id;
$pack->auth->permission = "read_write";
if (!editors::authenticateGameEditor($pack->auth)) {
return new return_package(6, NULL, "Failed Authentication");
}
$pack->object_tag_id = dbconnection::queryInsert("INSERT INTO object_tags (" . "game_id," . (isset($pack->object_type) ? "object_type," : "") . (isset($pack->object_id) ? "object_id," : "") . (isset($pack->tag_id) ? "tag_id," : "") . "created" . ") VALUES (" . "'" . addslashes($pack->game_id) . "'," . (isset($pack->object_type) ? "'" . addslashes($pack->object_type) . "'," : "") . (isset($pack->object_id) ? "'" . addslashes($pack->object_id) . "'," : "") . (isset($pack->tag_id) ? "'" . addslashes($pack->tag_id) . "'," : "") . "CURRENT_TIMESTAMP" . ")");
games::bumpGameVersion($pack);
return tags::getObjectTag($pack);
}
示例11: createWebPage
public static function createWebPage($pack)
{
$pack->auth->game_id = $pack->game_id;
$pack->auth->permission = "read_write";
if (!editors::authenticateGameEditor($pack->auth)) {
return new return_package(6, NULL, "Failed Authentication");
}
$pack->web_page_id = dbconnection::queryInsert("INSERT INTO web_pages (" . "game_id," . (isset($pack->name) ? "name," : "") . (isset($pack->url) ? "url," : "") . (isset($pack->icon_media_id) ? "icon_media_id," : "") . (isset($pack->back_button_enabled) ? "back_button_enabled," : "") . "created" . ") VALUES (" . "'" . addslashes($pack->game_id) . "'," . (isset($pack->name) ? "'" . addslashes($pack->name) . "'," : "") . (isset($pack->url) ? "'" . addslashes($pack->url) . "'," : "") . (isset($pack->icon_media_id) ? "'" . addslashes($pack->icon_media_id) . "'," : "") . (isset($pack->back_button_enabled) ? "'" . addslashes($pack->back_button_enabled) . "'," : "") . "CURRENT_TIMESTAMP" . ")");
games::bumpGameVersion($pack);
return web_pages::getWebPage($pack);
}
示例12: createNoteComment
public static function createNoteComment($pack)
{
$pack->auth->permission = "read_write";
if (!users::authenticateUser($pack->auth)) {
return new return_package(6, NULL, "Failed Authentication");
}
$pack->note_comment_id = dbconnection::queryInsert("INSERT INTO note_comments (" . "game_id," . "note_id," . "user_id," . (isset($pack->name) ? "name," : "") . (isset($pack->description) ? "description," : "") . "created" . ") VALUES (" . "'" . $pack->game_id . "'," . "'" . $pack->note_id . "'," . "'" . $pack->auth->user_id . "'," . (isset($pack->name) ? "'" . addslashes($pack->name) . "'," : "") . (isset($pack->description) ? "'" . addslashes($pack->description) . "'," : "") . "CURRENT_TIMESTAMP" . ")");
client::logPlayerCreatedComment($pack);
games::bumpGameVersion($pack);
return note_comments::getNoteComment($pack);
}
示例13: createFactory
public static function createFactory($pack)
{
$pack->auth->game_id = $pack->game_id;
$pack->auth->permission = "read_write";
if (!editors::authenticateGameEditor($pack->auth)) {
return new return_package(6, NULL, "Failed Authentication");
}
$pack->factory_id = dbconnection::queryInsert("INSERT INTO factories (" . "game_id," . (isset($pack->name) ? "name," : "") . (isset($pack->description) ? "description," : "") . (isset($pack->object_type) ? "object_type," : "") . (isset($pack->object_id) ? "object_id," : "") . (isset($pack->seconds_per_production) ? "seconds_per_production," : "") . (isset($pack->production_probability) ? "production_probability," : "") . (isset($pack->max_production) ? "max_production," : "") . (isset($pack->produce_expiration_time) ? "produce_expiration_time," : "") . (isset($pack->produce_expire_on_view) ? "produce_expire_on_view," : "") . (isset($pack->production_bound_type) ? "production_bound_type," : "") . (isset($pack->location_bound_type) ? "location_bound_type," : "") . (isset($pack->min_production_distance) ? "min_production_distance," : "") . (isset($pack->max_production_distance) ? "max_production_distance," : "") . (isset($pack->requirement_root_package_id) ? "requirement_root_package_id," : "") . (isset($pack->trigger_latitude) ? "trigger_latitude," : "") . (isset($pack->trigger_longitude) ? "trigger_longitude," : "") . (isset($pack->trigger_distance) ? "trigger_distance," : "") . (isset($pack->trigger_infinite_distance) ? "trigger_infinite_distance," : "") . (isset($pack->trigger_on_enter) ? "trigger_on_enter," : "") . (isset($pack->trigger_hidden) ? "trigger_hidden," : "") . (isset($pack->trigger_wiggle) ? "trigger_wiggle," : "") . (isset($pack->trigger_title) ? "trigger_title," : "") . (isset($pack->trigger_icon_media_id) ? "trigger_icon_media_id," : "") . (isset($pack->trigger_show_title) ? "trigger_show_title," : "") . (isset($pack->trigger_requirement_root_package_id) ? "trigger_requirement_root_package_id," : "") . "created" . ") VALUES (" . "'" . addslashes($pack->game_id) . "'," . (isset($pack->name) ? "'" . addslashes($pack->name) . "'," : "") . (isset($pack->description) ? "'" . addslashes($pack->description) . "'," : "") . (isset($pack->object_type) ? "'" . addslashes($pack->object_type) . "'," : "") . (isset($pack->object_id) ? "'" . addslashes($pack->object_id) . "'," : "") . (isset($pack->seconds_per_production) ? "'" . addslashes($pack->seconds_per_production) . "'," : "") . (isset($pack->production_probability) ? "'" . addslashes($pack->production_probability) . "'," : "") . (isset($pack->max_production) ? "'" . addslashes($pack->max_production) . "'," : "") . (isset($pack->produce_expiration_time) ? "'" . addslashes($pack->produce_expiration_time) . "'," : "") . (isset($pack->produce_expire_on_view) ? "'" . addslashes($pack->produce_expire_on_view) . "'," : "") . (isset($pack->production_bound_type) ? "'" . addslashes($pack->production_bound_type) . "'," : "") . (isset($pack->location_bound_type) ? "'" . addslashes($pack->location_bound_type) . "'," : "") . (isset($pack->min_production_distance) ? "'" . addslashes($pack->min_production_distance) . "'," : "") . (isset($pack->max_production_distance) ? "'" . addslashes($pack->max_production_distance) . "'," : "") . (isset($pack->requirement_root_package_id) ? "'" . addslashes($pack->requirement_root_package_id) . "'," : "") . (isset($pack->trigger_latitude) ? "'" . addslashes($pack->trigger_latitude) . "'," : "") . (isset($pack->trigger_longitude) ? "'" . addslashes($pack->trigger_longitude) . "'," : "") . (isset($pack->trigger_distance) ? "'" . addslashes($pack->trigger_distance) . "'," : "") . (isset($pack->trigger_infinite_distance) ? "'" . addslashes($pack->trigger_infinite_distance) . "'," : "") . (isset($pack->trigger_on_enter) ? "'" . addslashes($pack->trigger_on_enter) . "'," : "") . (isset($pack->trigger_hidden) ? "'" . addslashes($pack->trigger_hidden) . "'," : "") . (isset($pack->trigger_wiggle) ? "'" . addslashes($pack->trigger_wiggle) . "'," : "") . (isset($pack->trigger_title) ? "'" . addslashes($pack->trigger_title) . "'," : "") . (isset($pack->trigger_icon_media_id) ? "'" . addslashes($pack->trigger_icon_media_id) . "'," : "") . (isset($pack->trigger_show_title) ? "'" . addslashes($pack->trigger_show_title) . "'," : "") . (isset($pack->trigger_requirement_root_package_id) ? "'" . addslashes($pack->trigger_requirement_root_package_id) . "'," : "") . "CURRENT_TIMESTAMP" . ")");
games::bumpGameVersion($pack);
return factories::getFactory($pack);
}
示例14: createPlaque
public static function createPlaque($pack)
{
$pack->auth->game_id = $pack->game_id;
$pack->auth->permission = "read_write";
if (!editors::authenticateGameEditor($pack->auth)) {
return new return_package(6, NULL, "Failed Authentication");
}
$pack->plaque_id = dbconnection::queryInsert("INSERT INTO plaques (" . "game_id," . (isset($pack->name) ? "name," : "") . (isset($pack->description) ? "description," : "") . (isset($pack->icon_media_id) ? "icon_media_id," : "") . (isset($pack->media_id) ? "media_id," : "") . (isset($pack->event_package_id) ? "event_package_id," : "") . (isset($pack->back_button_enabled) ? "back_button_enabled," : "") . (isset($pack->continue_function) ? "continue_function," : "") . "created" . ") VALUES (" . "'" . addslashes($pack->game_id) . "'," . (isset($pack->name) ? "'" . addslashes($pack->name) . "'," : "") . (isset($pack->description) ? "'" . addslashes($pack->description) . "'," : "") . (isset($pack->icon_media_id) ? "'" . addslashes($pack->icon_media_id) . "'," : "") . (isset($pack->media_id) ? "'" . addslashes($pack->media_id) . "'," : "") . (isset($pack->event_package_id) ? "'" . addslashes($pack->event_package_id) . "'," : "") . (isset($pack->back_button_enabled) ? "'" . addslashes($pack->back_button_enabled) . "'," : "") . (isset($pack->continue_function) ? "'" . addslashes($pack->continue_function) . "'," : "") . "CURRENT_TIMESTAMP" . ")");
games::bumpGameVersion($pack);
return plaques::getPlaque($pack);
}
示例15: addEditorToGame
public static function addEditorToGame($pack)
{
$pack->auth->game_id = $pack->game_id;
$pack->auth->permission = "read_write";
if (!editors::authenticateGameEditor($pack->auth)) {
return new return_package(6, NULL, "Failed Authentication");
}
//note $pack->user_id is DIFFERENT than $pack->auth->user_id
dbconnection::queryInsert("INSERT INTO user_games (game_id, user_id, created) VALUES ('{$pack->game_id}','{$pack->user_id}',CURRENT_TIMESTAMP)");
games::bumpGameVersion($pack);
return new return_package(0);
}