本文整理汇总了PHP中client::logPlayerCreatedNote方法的典型用法代码示例。如果您正苦于以下问题:PHP client::logPlayerCreatedNote方法的具体用法?PHP client::logPlayerCreatedNote怎么用?PHP client::logPlayerCreatedNote使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类client
的用法示例。
在下文中一共展示了client::logPlayerCreatedNote方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createNote
public static function createNote($pack)
{
$pack->auth->permission = "read_write";
if (!users::authenticateUser($pack->auth)) {
return new return_package(6, NULL, "Failed Authentication");
}
if ($pack->media) {
$pack->media->auth = $pack->auth;
$pack->media->game_id = $pack->game_id;
$pack->media_id = media::createMedia($pack->media)->data->media_id;
}
$game = games::getGame($pack);
$pack->note_id = dbconnection::queryInsert("INSERT INTO notes (" . "game_id," . "user_id," . (isset($pack->name) ? "name," : "") . (isset($pack->description) ? "description," : "") . (isset($pack->media_id) ? "media_id," : "") . "published," . "created" . ") VALUES (" . "'" . $pack->game_id . "'," . "'" . $pack->auth->user_id . "'," . (isset($pack->name) ? "'" . addslashes($pack->name) . "'," : "") . (isset($pack->description) ? "'" . addslashes($pack->description) . "'," : "") . (isset($pack->media_id) ? "'" . addslashes($pack->media_id) . "'," : "") . ($game->data->moderated ? "'PENDING'" : "'AUTO'") . "," . "CURRENT_TIMESTAMP" . ")");
if ($pack->trigger) {
$scene_id = dbconnection::queryObject("SELECT * FROM user_game_scenes WHERE user_id = '{$pack->auth->user_id}' AND game_id = '{$pack->game_id}'")->scene_id;
if (!$scene_id) {
$scene_id = $game->data->intro_scene_id;
}
$instance_id = dbconnection::queryInsert("INSERT INTO instances (game_id, object_id, object_type, created) VALUES ('{$pack->game_id}', '{$pack->note_id}', 'NOTE', CURRENT_TIMESTAMP)");
$trigger_id = dbconnection::queryInsert("INSERT INTO triggers (game_id, instance_id, scene_id, type, latitude, longitude, infinite_distance, created) VALUES ( '{$pack->game_id}', '{$instance_id}', '{$scene_id}', 'LOCATION', '{$pack->trigger->latitude}', '{$pack->trigger->longitude}', '1', CURRENT_TIMESTAMP);");
}
//allow for 'tag_id' in API, but really just use object_tags
if ($pack->tag_id) {
dbconnection::queryInsert("INSERT INTO object_tags (game_id, object_type, object_id, tag_id, created) VALUES ('{$pack->game_id}', 'NOTE', '{$pack->note_id}', '{$pack->tag_id}', CURRENT_TIMESTAMP)");
}
client::logPlayerCreatedNote($pack);
games::bumpGameVersion($pack);
return notes::getNote($pack);
}