function getFullNoteObject($noteId, $playerId = 0) { $query = "SELECT * FROM notes WHERE note_id = '{$noteId}'"; $result = Module::query($query); if (mysql_error()) { return new returnData(1, NULL, mysql_error()); } if ($note = mysql_fetch_object($result)) { $query = "SELECT user_name, display_name FROM players WHERE player_id = '{$note->owner_id}'"; $player = Module::query($query); $playerObj = mysql_fetch_object($player); $type = MODULE::kSHARE_FACEBOOK; $note->facebook_shares = Notes::getNoteShares($noteId, $type); $type = MODULE::kSHARE_TWITTER; $note->twitter_shares = Notes::getNoteShares($noteId, $type); $type = MODULE::kSHARE_PINTEREST; $note->pinterest_shares = Notes::getNoteShares($noteId, $type); $type = MODULE::kSHARE_EMAIL; $note->email_shares = Notes::getNoteShares($noteId, $type); $note->username = $playerObj->user_name; $note->displayname = $playerObj->display_name; $note->contents = Notes::getNoteContents($noteId, $note->game_id); $note->comments = Notes::getNoteComments($noteId, $playerId); $note->tags = Notes::getNoteTags($noteId, $note->game_id); $note->likes = Notes::getNoteLikes($noteId); $note->player_liked = $playerId == 0 ? 0 : Notes::playerLiked($playerId, $noteId); $note->player_flagged = $playerId == 0 ? 0 : Notes::playerFlagged($playerId, $noteId); $note->icon_media_id = 5; if ($note->dropped = Notes::noteDropped($noteId, $note->game_id)) { $location = Notes::getNoteLocation($noteId, $note->game_id); } else { $location = new stdClass(); $location->lat = $location->lon = 0; } $note->lat = $location->lat; $note->lon = $location->lon; return $note; } return; }
function getFullNoteObject($noteId, $playerId = 0) { $query = "SELECT * FROM notes WHERE note_id = '{$noteId}'"; $result = Module::query($query); if (mysql_error()) { return new returnData(1, NULL, mysql_error()); } if ($note = mysql_fetch_object($result)) { $query = "SELECT user_name FROM players WHERE player_id = '{$note->owner_id}'"; $player = Module::query($query); $playerObj = mysql_fetch_object($player); $note->username = $playerObj->user_name; $note->displayname = $playerObj->display_name; $note->contents = Notes::getNoteContents($noteId, $note->game_id); $note->comments = Notes::getNoteComments($noteId, $playerId); $note->tags = Notes::getNoteTags($noteId, $note->game_id); $note->likes = Notes::getNoteLikes($noteId); $note->player_liked = $playerId == 0 ? 0 : Notes::playerLiked($playerId, $noteId); $note->icon_media_id = 5; if ($note->dropped = Notes::noteDropped($noteId, $note->game_id)) { $location = Notes::getNoteLocation($noteId, $note->game_id); } else { $location = new stdClass(); $location->lat = $location->lon = 0; } $note->lat = $location->lat; $note->lon = $location->lon; return $note; } return; }