Example #1
0
 private function getNotesVisibleToPlayer($gameId, $playerId, $full = false, $page = 0, $psize = 20)
 {
     $noteIds = Module::queryArray("SELECT note_id FROM notes WHERE game_id = '{$gameId}' AND parent_note_id = 0 AND (owner_id = '{$playerId}' OR public_to_notebook = '1' OR public_to_map = '1') LIMIT " . $page * $psize . "," . $psize);
     $notes = array();
     for ($i = 0; $i < count($noteIds); $i++) {
         if ($full) {
             $notes[] = Notebook::getFullNoteObject($noteIds[$i]->note_id);
         } else {
             $notes[] = Notebook::getStubNoteObject($noteIds[$i]->note_id);
         }
     }
     return $notes;
 }