From 90d8331379c0ee66ecffda8478b32cad4d412829 Mon Sep 17 00:00:00 2001 From: Suki Date: Sun, 23 Mar 2014 13:28:12 -0600 Subject: [PATCH] Add support for guest accounts on BreezeQuery::loadMinimalData() Signed-off-by: Suki --- Sources/Breeze/BreezeLog.php | 2 +- Sources/Breeze/BreezeQuery.php | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Sources/Breeze/BreezeLog.php b/Sources/Breeze/BreezeLog.php index 3e2d0c76..8fa9fe8b 100644 --- a/Sources/Breeze/BreezeLog.php +++ b/Sources/Breeze/BreezeLog.php @@ -110,7 +110,7 @@ protected function logStatus($entry) $loadedUsers = $this->_query->loadMinimalData(array_unique(array($entry['content']['owner_id'], $entry['content']['poster_id'],))); //Posting on your own wall? - $own = $entry['content']['owner_id'] == $entry['content']['poster_id']; + $own = ($entry['content']['owner_id'] == $entry['content']['poster_id']); // Get the right text string $gender = !empty($loadedUsers[$entry['content']['poster_id']]['gender']) ? $loadedUsers[$entry['content']['poster_id']]['gender'] : '0'; diff --git a/Sources/Breeze/BreezeQuery.php b/Sources/Breeze/BreezeQuery.php index f358de1e..da199444 100644 --- a/Sources/Breeze/BreezeQuery.php +++ b/Sources/Breeze/BreezeQuery.php @@ -1472,6 +1472,19 @@ public function loadMinimalData($users) } } + // Any guest accounts? + foreach ($users as $u) + if (!isset($returnData[$u])) + $returnData[$u] = array( + 'username' => $txt['guest_title'], + 'name' => $txt['guest_title'], + 'id' => 0, + 'href' => '', + 'link' => $txt['guest_title'], + 'gender' => 0, + 'guest' => true, + ); + return $returnData; }