本文整理汇总了PHP中Module::queryObject方法的典型用法代码示例。如果您正苦于以下问题:PHP Module::queryObject方法的具体用法?PHP Module::queryObject怎么用?PHP Module::queryObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Module
的用法示例。
在下文中一共展示了Module::queryObject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getQuest
public function getQuest($gameId, $questId)
{
$quest = Module::queryObject("SELECT * FROM quests WHERE game_id = {$gameId} AND quest_id = {$questId} LIMIT 1");
if (!$quest) {
return new returnData(2, NULL, "invalid quest id");
}
return new returnData(0, $quest);
}
示例2: getMediaObject
public function getMediaObject($gameId, $mediaId)
{
//apparently, "is_numeric(NAN)" returns 'true'. NAN literally means "Not A Number". Think about that one for a sec.
if (!$mediaId || !is_numeric($mediaId) || $mediaId == NAN || !($media = Module::queryObject("SELECT * FROM media WHERE media_id = {$mediaId} LIMIT 1"))) {
$media = new stdClass();
$media->game_id = 0;
$media->media_id = $mediaId;
$media->name = "Default NPC";
$media->file_path = "0/npc.png";
return new returnData(0, Media::parseRawMedia($media));
}
return new returnData(0, Media::parseRawMedia($media));
}
示例3: migrateDB
public static function migrateDB()
{
$migrations = array();
if ($migrationsDir = opendir(Config::migrationsDir)) {
while ($migration = readdir($migrationsDir)) {
if (preg_match('/^[0..9]+\\.sql$/', $migration)) {
$migrations[intval(substr($migration, 0, -4))] = $migration;
}
}
}
$migrated = array();
if (Module::queryObject("SHOW TABLES LIKE 'aris_migrations'")) {
$knownVersions = Module::queryArray("SELECT * FROM aris_migrations");
foreach ($knownVersions as $version) {
if (!$migrated[intval($version->version_major)]) {
$migrated[intval($version->version_major)] = array();
}
$migrated[intval($version->version_major)][intval($version->version_minor)] = $version->timestamp;
}
} else {
//The one migration/construction to be done outside the .sql files
Module::query("CREATE TABLE aris_migrations ( version_major int(32) unsigned NOT NULL, version_minor int(32) unsigned NOT NULL, timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (version_major,version_minor))");
}
foreach ($migrations as $major => $file) {
if ($migrated[$major + 1]) {
continue;
}
$file_handle = fopen(Config::migrationsDir . "/" . $file, "r");
$minor = 0;
while (!feof($file_handle)) {
//Funny way to continue to read from the file until it either ends, or reaches a semicolon
$query = "";
while (!feof($file_handle) && strpos($query .= fgets($file_handle), ';') === FALSE) {
}
if (!$migrated[$major][$minor]) {
mysql_query($query);
if (mysql_error()) {
$error = "Error upgrading database to version " . $major . "." . $minor . ". Error was:\n" . mysql_error() . "\n in query:\n" . $query;
Module::serverErrorLog($error);
echo $error;
return $error;
}
Module::query("INSERT INTO aris_migrations (version_major, version_minor) VALUES ('" . $major . "','" . $minor . "')");
}
$minor++;
}
fclose($file_handle);
}
return 0;
}
示例4: getToken
public function getToken($username, $password, $permission)
{
$username = addslashes($username);
$password = addslashes($password);
$permission = addslashes($permission);
$e = Module::queryObject("SELECT editor_id, " . $permission . "_token FROM editors WHERE name = '" . $username . "' AND password = MD5('" . $password . "') LIMIT 1");
if ($e) {
if ($e->{$permission . "_token"} == "") {
$e->{$permission . "_token"} = Utils::rand_string(64);
Module::query("UPDATE editors SET " . $permission . "_token = '" . $e->{$permission . "_token"} . "' WHERE editor_id = " . $e->editor_id);
}
return new returnData(0, $e);
} else {
return new returnData(4, NULL, "Bad Username or Password");
}
}
示例5: topPlayersWithMostLikedNotes
public function topPlayersWithMostLikedNotes($gameId, $startFlag = "0000-00-00 00:00:00", $endFlag = "9999-99-99 12:59:59")
{
$notes = Module::queryArray("SELECT note_id, owner_id FROM notes WHERE game_id = '{$gameId}' AND created > '{$startFlag}' AND created < '{$endFlag}'");
$playerLikes = array();
for ($i = 0; $i < count($notes); $i++) {
if (!$playerLikes[$notes[$i]->owner_id]) {
$playerLikes[$notes[$i]->owner_id] = 0;
}
if (Module::queryObject("SELECT player_id FROM note_likes WHERE note_id = '{$notes[$i]->note_id}' LIMIT 1")) {
$playerLikes[$notes[$i]->owner_id]++;
}
}
$playerLikeObjects = array();
foreach ($playerLikes as $pidkey => $countval) {
$plo = new stdClass();
$plo->player_id = $pidkey;
$plo->liked_notes = $countval;
$plo->display_name = Module::queryObject("SELECT display_name FROM players WHERE player_id = '{$pidkey}'")->display_name;
$playerLikeObjects[] = $plo;
}
return $playerLikeObjects;
}
示例6: deleteTagFromGame
public function deleteTagFromGame($gameId, $tagId, $editorId, $editorToken)
{
if (!Module::authenticateGameEditor($gameId, $editorId, $editorToken, "read_write")) {
return new returnData(6, NULL, "Failed Authentication");
}
$tag = Module::queryObject("SELECT * FROM game_tags WHERE tag_id = '{$tagId}'");
if ($tag->player_created == 1) {
Module::query("DELETE FROM game_tags WHERE tag_id = '{$tagId}'");
Module::query("DELETE FROM note_tags WHERE tag_id = '{$tagId}'");
} else {
$notesTagged = Module::queryObject("SELECT note_id FROM note_tags WHERE tag_id = '{$tagId}'");
if ($notesTagged) {
Module::query("UPDATE game_tags SET player_created = 1 WHERE tag_id = '{$tagId}'");
} else {
Module::query("DELETE FROM game_tags WHERE tag_id = '{$tagId}'");
Module::query("DELETE FROM note_tags WHERE tag_id = '{$tagId}'");
}
}
return new returnData(0);
}
示例7: getRequirement
public function getRequirement($gameId, $requirementId)
{
//Old tables
$requirement = Module::queryObject("SELECT * FROM requirements WHERE game_id = {$gameId} AND requirement_id = {$requirementId} LIMIT 1");
return new returnData(0, $requirement);
/*
//New tables
//assume by requirement, they mean "requirement atom"
$rAtom = Requirements::getRequirementAtom($requirementId);
$returnObj = new stdClass();
$returnObj->data = new stdClass();
$returnObj->data->requirement_id = $rAtom->requirement_atom_id;
$returnObj->data->game_id = $rAtom->game_id;
$returnObj->data->requirement = $rAtom->requirement;
$bool = Module::queryArray("SELECT * FROM requirement_atoms WHERE requirement_and_package_id = '{$rAtom->requirement_and_package_id}'");
$returnObj->data->boolean_operator = count($bool) > 1 ? "AND" : "OR";
$returnObj->data->not_operator = $rAtom->bool_operator ? "DO" : "NOT";
$returnObj->data->group_operator = "SELF";
$returnObj->data->requirement_detail_1 = $rAtom->content_id;
$returnObj->data->requirement_detail_2 = $rAtom->qty;
$returnObj->data->requirement_detail_3 = $rAtom->latitude;
$returnObj->data->requirement_detail_4 = $rAtom->longitude;
$packId = Module::queryObject("SELECT * FROM requirement_and_packages WHERE requirement_and_package_id = '{$rAtom->requirement_and_package_id}'")->requirement_root_package_id;
if( $content = Module::queryObject("SELECT * FROM locations WHERE requirement_package_id = '{$packId}'")) { $returnObj->data->content_type = 'Location'; $returnObj->data->content_id = $content->location_id; }
else if($content = Module::queryObject("SELECT * FROM nodes WHERE requirement_package_id = '{$packId}'")) { $returnObj->data->content_type = 'Node'; $returnObj->data->content_id = $content->node_id; }
else if($content = Module::queryObject("SELECT * FROM quests WHERE display_requirement_package_id = '{$packId}'")) { $returnObj->data->content_type = 'QuestDisplay'; $returnObj->data->content_id = $content->quest_id; }
else if($content = Module::queryObject("SELECT * FROM quests WHERE complete_requirement_package_id = '{$packId}'")) { $returnObj->data->content_type = 'QuestComplete'; $returnObj->data->content_id = $content->quest_id; }
$returnObj->returnCode = 0;
$returnObj->returnCodeDescription = null;
return $returnObj;
*/
}
示例8: giveItemToWorld
protected function giveItemToWorld($gameId, $itemId, $floatLat, $floatLong, $intQty = 1)
{
$clumpingRangeInMeters = 10;
$query = "SELECT *,((ACOS(SIN({$floatLat} * PI() / 180) * SIN(latitude * PI() / 180) + \n COS({$floatLat} * PI() / 180) * COS(latitude * PI() / 180) * \n COS(({$floatLong} - longitude) * PI() / 180)) * 180 / PI()) * 60 * 1.1515) * 1609.344\n AS `distance`, location_id \n FROM locations \n WHERE type = 'item' AND type_id = '{$itemId}' AND game_id = '{$gameId}'\n HAVING distance<= {$clumpingRangeInMeters}\n ORDER BY distance ASC";
$result = Module::query($query);
if ($closestLocationWithinClumpingRange = @mysql_fetch_object($result)) {
Module::query("UPDATE locations SET item_qty = item_qty + {$intQty} WHERE location_id = {$closestLocationWithinClumpingRange->location_id} AND game_id = '{$gameId}'");
} else {
$item = Module::queryObject("SELECT * FROM items WHERE item_id = '{$itemId}'");
Module::query("INSERT INTO locations (game_id, name, type, type_id, icon_media_id, latitude, longitude, error, item_qty) VALUES ('{$gameId}', '{$item->name}','Item','{$itemId}', '{$item->icon_media_id}', '{$floatLat}','{$floatLong}', '100','{$intQty}')");
QRCodes::createQRCode($gameId, "Location", mysql_insert_id(), '');
}
}
示例9: addTagToNote
function addTagToNote($noteId, $gameId, $tag)
{
$id = Module::queryObject("SELECT tag_id FROM game_tags WHERE game_id = '{$gameId}' AND tag = '{$tag}' LIMIT 1");
if (!$id->tag_id) {
$allow = Module::queryObject("SELECT allow_player_tags FROM games WHERE game_id = '{$gameId}'");
if ($allow->allow_player_tags != 1) {
return new returnData(1, NULL, "Player Generated Tags Not Allowed In This Game");
}
Module::query("INSERT INTO game_tags (tag, game_id, player_created) VALUES ('{$tag}', '{$gameId}', 1)");
$id->tag_id = mysql_insert_id();
}
if (!Module::queryObject("SELECT * FROM note_tags WHERE note_id = '{$noteId}' AND tag_id = '{$id->tag_id}'")) {
Module::query("INSERT INTO note_tags (note_id, tag_id) VALUES ('{$noteId}', '{$id->tag_id}')");
}
return new returnData(0, $id->tag_id);
}
示例10: duplicateGame
public function duplicateGame($gameId, $editorId, $editorToken)
{
if (!Module::authenticateEditor($editorId, $editorToken, "read_write")) {
return new returnData(6, NULL, "Failed Authentication");
}
Module::serverErrorLog("Duplicating Game Id:" . $gameId);
$game = Module::queryObject("SELECT * FROM games WHERE game_id = {$gameId} LIMIT 1");
if (!$game) {
return new returnData(2, NULL, "invalid game id");
}
$compatibleName = false;
$appendNo = 1;
while (!$compatibleName) {
$query = "SELECT * FROM games WHERE name = '" . addslashes($game->name) . "_copy" . $appendNo . "'";
$result = Module::query($query);
if (mysql_fetch_object($result)) {
$appendNo++;
} else {
$compatibleName = true;
}
}
$game->name = $game->name . "_copy" . $appendNo;
$newGameId = Games::createGame($game->name, $game->description, $game->icon_media_id, $game->media_id, $game->ready_for_public, $game->is_locational, $game->on_launch_node_id, $game->game_complete_node_id, $game->allow_share_note_to_map, $game->allow_share_note_to_book, $game->allow_player_tags, $game->allow_player_comments, $game->allow_note_likes, $game->pc_media_id, $game->use_player_pic, $game->map_type, $game->show_player_location, $game->full_quick_travel, $game->inventory_weight_cap, $game->allow_trading, $editorId, $editorToken)->data;
//Remove the tabs created by createGame
Module::query("DELETE FROM game_tab_data WHERE game_id = {$newGameId}");
$result = Module::query("SELECT * FROM game_tab_data WHERE game_id = {$gameId}");
while ($result && ($row = mysql_fetch_object($result))) {
Module::query("INSERT INTO game_tab_data (game_id, tab, tab_index, tab_detail_1) VALUES ('{$newGameId}', '{$row->tab}', '{$row->tab_index}', '{$row->tab_detail_1}')");
}
$query = "SELECT * FROM requirements WHERE game_id = {$gameId}";
$result = Module::query($query);
while ($result && ($row = mysql_fetch_object($result))) {
$query = "INSERT INTO requirements (game_id, content_type, content_id, requirement, not_operator, boolean_operator, requirement_detail_1, requirement_detail_2, requirement_detail_3, requirement_detail_4) VALUES ('{$newGameId}', '{$row->content_type}', '{$row->content_id}', '{$row->requirement}', '{$row->not_operator}', '{$row->boolean_operator}', '{$row->requirement_detail_1}', '{$row->requirement_detail_2}', '{$row->requirement_detail_3}', '{$row->requirement_detail_4}')";
Module::query($query);
}
$query = "SELECT * FROM quests WHERE game_id = {$gameId}";
$result = Module::query($query);
while ($result && ($row = mysql_fetch_object($result))) {
$query = "INSERT INTO quests (game_id, name, description, text_when_complete, sort_index, exit_to_tab, active_media_id, complete_media_id, active_icon_media_id, complete_icon_media_id) VALUES ('{$newGameId}', '" . addSlashes($row->name) . "', '" . addSlashes($row->description) . "', '" . addSlashes($row->text_when_complete) . "', '{$row->sort_index}', '{$row->exit_to_tab}', '{$row->active_media_id}', '{$row->complete_media_id}', '{$row->active_icon_media_id}', '{$row->complete_icon_media_id}')";
Module::query($query);
$newId = mysql_insert_id();
$query = "UPDATE requirements SET requirement_detail_1 = {$newId} WHERE game_id = '{$newGameId}' AND requirement = 'PLAYER_HAS_COMPLETED_QUEST' AND requirement_detail_1 = '{$row->quest_id}'";
Module::query($query);
$query = "UPDATE requirements SET content_id = {$newId} WHERE game_id = '{$newGameId}' AND (content_type = 'QuestDisplay' OR content_type = 'QuestComplete') AND content_id = '{$row->quest_id}'";
Module::query($query);
}
$newFolderIds = array();
$query = "SELECT * FROM folders WHERE game_id = {$gameId}";
$result = Module::query($query);
while ($result && ($row = mysql_fetch_object($result))) {
$query = "INSERT INTO folders (game_id, name, parent_id, previous_id, is_open) VALUES ('{$newGameId}', '" . addSlashes($row->name) . "', '{$row->parent_id}', '{$row->previous_id}', '{$row->is_open}')";
Module::query($query);
$newFolderIds[$row->folder_id] = mysql_insert_id();
}
$query = "SELECT * FROM folders WHERE game_id = {$newGameId}";
$result = Module::query($query);
while ($result && ($row = mysql_fetch_object($result))) {
if ($row->folder_id != 0) {
$query = "UPDATE folders SET parent_id = {$newFolderIds[$row->parent_id]} WHERE game_id = '{$newGameId}' AND folder_id = {$row->folder_id}";
Module::query($query);
}
}
$query = "SELECT * FROM folder_contents WHERE game_id = {$gameId}";
$result = Module::query($query);
while ($result && ($row = mysql_fetch_object($result))) {
$query = "INSERT INTO folder_contents (game_id, folder_id, content_type, content_id, previous_id) VALUES ('{$newGameId}', '{$newFolderIds[$row->folder_id]}', '{$row->content_type}', '{$row->content_id}', '{$row->previous_id}')";
Module::query($query);
if ($row->folder_id != 0) {
$query = "UPDATE folder_contents SET folder_id = {$newFolderIds[$row->folder_id]} WHERE game_id = '{$newGameId}' AND object_content_id = {$row->object_content_id}";
Module::query($query);
}
}
$query = "SELECT * FROM qrcodes WHERE game_id = {$gameId}";
$result = Module::query($query);
while ($result && ($row = mysql_fetch_object($result))) {
$query = "INSERT INTO qrcodes (game_id, link_type, link_id, code, match_media_id) VALUES ('{$newGameId}', '{$row->link_type}', '{$row->link_id}', '{$row->code}', '{$row->match_media_id}')";
Module::query($query);
}
$query = "SELECT * FROM overlays WHERE game_id = {$gameId}";
$result = Module::query($query);
while ($result && ($row = mysql_fetch_object($result))) {
$query = "INSERT INTO overlays (game_id, sort_order, alpha, num_tiles, game_overlay_id) VALUES ('{$newGameId}', '{$row->sort_order}', '{$row->alpha}', '{$row->num_tiles}', '{$row->game_overlay_id}')";
Module::query($query);
$newId = mysql_insert_id();
$query = "SELECT * FROM overlay_tiles WHERE overlay_id = '{$row->overlay_id}'";
$result = Module::query($query);
while ($result && ($row = mysql_fetch_object($result))) {
$query = "INSERT INTO overlay_tiles (overlay_id, media_id, zoom, x, x_max, y, y_max) VALUES ('{$newId}', '{$row->media_id}', '{$row->zoom}', '{$row->x}', '{$row->x_max}', '{$row->y}', '{$row->y_max}')";
Module::query($query);
}
}
$query = "SELECT * FROM fountains WHERE game_id = {$gameId}";
$result = Module::query($query);
while ($result && ($row = mysql_fetch_object($result))) {
$query = "INSERT INTO fountains (game_id, type, location_id, spawn_probability, spawn_rate, max_amount, last_spawned, active) VALUES ('{$newGameId}', '{$row->type}', '{$row->location_id}', '{$row->spawn_probability}', '{$row->spawn_rate}', '{$row->max_amount}', '{$row->last_spawned}', '{$row->active}')";
Module::query($query);
}
$query = "SELECT * FROM spawnables WHERE game_id = {$gameId}";
$result = Module::query($query);
while ($result && ($row = mysql_fetch_object($result))) {
//.........这里部分代码省略.........
示例11: fireOffWebHook
protected function fireOffWebHook($playerId, $gameId, $webHookId)
{
Module::appendLog($playerId, $gameId, "SEND_WEBHOOK", $webHookId);
$webHook = Module::queryObject("SELECT * FROM web_hooks WHERE web_hook_id = '{$webHookId}' LIMIT 1");
$name = str_replace(" ", "", $webHook->name);
$name = str_replace("{playerId}", $playerId, $name);
$url = $webHook->url . "?hook=" . $name . "&wid=" . $webHook->web_hook_id . "&gameid=" . $gameId . "&playerid=" . $playerId;
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_exec($ch);
curl_close($ch);
}
示例12: getPlayerLogs
//.........这里部分代码省略.........
}
if (!$iknowwhatimdoing && floor(abs(strtotime($reqEndDate) - strtotime($reqStartDate)) / (60 * 60 * 24 * 31)) > 0) {
return new returnData(1, NULL, "Please don't ask for more than a month of data at a time!");
}
if (!is_numeric($reqGetExpired)) {
$reqGetExpired = 0;
} else {
if (intval($reqGetExpired) > 0) {
$reqGetExpired = 1;
}
}
if (!is_numeric($reqVerbose)) {
$reqVerbose = 0;
} else {
if (intval($reqVerbose) > 0) {
$reqVerbose = 1;
}
}
$playerLogs = array();
if ($filterMode == "group") {
$p = Module::queryArray("SELECT player_id, display_name, media_id, group_name from players WHERE group_name = '{$reqGroup}'");
for ($i = 0; $i < count($p); $i++) {
$log = new stdClass();
$log->player = $p[$i];
if ($log->player->display_name == "") {
$log->player->display_name = $log->player->user_name;
}
$log->player->pic_url = Media::getMediaObject("player", $p[$i]->media_id)->data->url;
$playerLogs[] = $log;
}
} else {
if ($filterMode == "players") {
for ($i = 0; $i < count($reqPlayers); $i++) {
$p = Module::queryObject("SELECT player_id, display_name, media_id, group_name from players WHERE player_id = '{$reqPlayers[$i]}'");
$log = new stdClass();
$log->player = $p;
if ($log->player->display_name == "") {
$log->player->display_name = $log->player->user_name;
}
$log->player->pic_url = Media::getMediaObject("player", $p->media_id)->data->url;
$playerLogs[] = $log;
}
} else {
if ($filterMode == "player") {
$p = Module::queryObject("SELECT player_id, display_name, media_id, group_name from players WHERE player_id = '{$reqPlayer}'");
$log = new stdClass();
$log->player = $p;
if ($log->player->display_name == "") {
$log->player->display_name = $log->player->user_name;
}
$log->player->pic_url = Media::getMediaObject("player", $p->media_id)->data->url;
$playerLogs[] = $log;
} else {
$r = Module::queryArray("SELECT player_id FROM player_log WHERE game_id = '{$reqGameId}' AND timestamp BETWEEN '{$reqStartDate}' AND '{$reqEndDate}' AND (deleted = 0 OR deleted = {$reqGetExpired}) GROUP BY player_id");
for ($i = 0; $i < count($r); $i++) {
$p = Module::queryObject("SELECT player_id, user_name, display_name, media_id, group_name from players WHERE player_id = '{$r[$i]->player_id}'");
if (!$p) {
continue;
}
$log = new stdClass();
$log->player = $p;
if ($log->player->display_name == "") {
$log->player->display_name = $log->player->user_name;
}
$log->player->pic_url = Media::getMediaObject("player", intval($p->media_id))->data->url;
$playerLogs[] = $log;
示例13: giveNoteToWorld
protected function giveNoteToWorld($gameId, $noteId, $floatLat, $floatLong)
{
$query = "SELECT * FROM locations WHERE type = 'PlayerNote' AND type_id = '{$noteId}' AND game_id = '{$gameId}'";
$result = Module::query($query);
if ($existingNote = @mysql_fetch_object($result)) {
//We have a match
$query = "UPDATE locations\n SET latitude = '{$floatLat}', longitude = '{$floatLong}'\n WHERE location_id = {$existingNote->location_id} AND game_id = '{$gameId}'";
Module::query($query);
$obj = Module::queryObject("SELECT title, owner_id FROM notes WHERE note_id = '{$noteId}'");
} else {
$error = 100;
//Use 100 meters
$query = "SELECT title, owner_id FROM notes WHERE note_id = '{$noteId}'";
$result = Module::query($query);
$obj = @mysql_fetch_object($result);
$title = $obj->title;
$query = "INSERT INTO locations (game_id, name, type, type_id, icon_media_id, latitude, longitude, error, item_qty, hidden, force_view, allow_quick_travel)\n VALUES ('{$gameId}', '{$title}','PlayerNote','{$noteId}', " . Module::kPLAYER_NOTE_DEFAULT_ICON . ", '{$floatLat}','{$floatLong}', '{$error}','1',0,0,0)";
Module::query($query);
$newId = mysql_insert_id();
}
Module::processGameEvent($obj->owner_id, $gameId, Module::kLOG_UPLOAD_MEDIA_ITEM, $noteId, $floatLat, $floatLong);
Module::processGameEvent($obj->owner_id, $gameId, Module::kLOG_DROP_NOTE, $noteId, $floatLat, $floatLong);
}
示例14: pruneNoteContentFromGame
public function pruneNoteContentFromGame($gameId, $surrogate, $editorId, $editorToken)
{
if (!Module::authenticateGameEditor($gameId, $editorId, $editorToken, "read_write")) {
return new returnData(6, NULL, "Failed Authentication");
}
$unused_content = array();
$noteContent = Module::queryArray("SELECT * FROM note_content WHERE game_id = '{$gameId}'");
for ($i = 0; $i < count($noteContent); $i++) {
if (!Module::queryObject("SELECT * FROM notes WHERE game_id = '{$gameId}' AND note_id = '{$noteContent[$i]->note_id}'")) {
$unused_content[] = $noteContent[$i]->content_id;
}
}
if ($surrogate) {
for ($i = 0; $i < count($unused_content); $i++) {
Module::query("UPDATE note_content SET game_id = '{$surrogate}' WHERE game_id = '{$gameId}' AND content_id = '{$unused_content[$i]}'");
}
} else {
for ($i = 0; $i < count($unused_content); $i++) {
Module::query("DELETE FROM note_content WHERE game_id = '{$gameId}' AND content_id = '{$unused_content[$i]}'");
}
}
return $unused_content;
}
示例15: getLocationById
public function getLocationById($locId)
{
$loc = Module::queryObject("SELECT * FROM locations WHERE location_id = '{$locId}'");
return new returnData(0, $loc);
}