public function ReadForumReplies($topic, $start = 0, $count = 10) { $this->UpdateTopicWatch($topic); $result = $this->CoreSQL("SELECT t1.*, t2.Name AS AuthorName, \nt2.CharID AS AuthorCharID, t2.Signature AS Signature, t2.Title AS \nAuthorTitle, t2.CorporationTicker AS AuthorCorpTicker, \nt2.PortalRoles AS AuthorPortalRoles, t3.Name as \nEditedByName FROM forum_replies AS t1 INNER JOIN users AS t2 ON t1.AuthorID = t2.id LEFT JOIN users AS t3 ON t1.EditedBy = t3.id WHERE t1.TopicID = " . $topic . " AND t1.IsDeleted = FALSE ORDER BY t1.DateCreated ASC LIMIT " . $start . "," . $count); if (mysql_num_rows($result) == 0) { return array(); } $replies = array(); while ($row = mysql_fetch_assoc($result)) { $reply = new Reply(); $reply->ID = $row["id"]; $reply->TopicID = $row["TopicID"]; $reply->AuthorID = $row["AuthorID"]; $reply->AuthorName = $this->SQLUnEscape($row["AuthorName"]); $reply->AuthorCharID = $row["AuthorCharID"]; $reply->AuthorSignature = $this->SQLUnEscape($row["Signature"]); $reply->AuthorTitle = $this->SQLUnEscape($row["AuthorTitle"]); $reply->AuthorCorpTicker = $this->SQLUnEscape($row["AuthorCorpTicker"]); $reply->IsHonorary = BigNumber::Compare(BigNumber::BitwiseAnd($row["AuthorPortalRoles"], User::MDYN_HonoraryMember), "0") != 0; if ($reply->IsHonorary && $reply->AuthorTitle == "") { $reply->AuthorTitle = "Honorary Member"; } $reply->Text = $this->SQLUnEscape($row["Text"]); $reply->DateCreated = $row["DateCreated"]; $reply->DateEdited = $row["DateEdited"]; $reply->EditedByID = $row["EditedBy"]; $reply->EditedByName = $this->SQLUnEscape($row["EditedByName"]); $reply->DateDeleted = $row["DateDeleted"]; $reply->IsDeleted = $row["IsDeleted"]; $reply->ShowSignature = $row["ShowSignature"]; $reply->ShowEdited = $row["ShowEdited"]; $replies[] = $reply; } mysql_free_result($result); return $replies; }
public function HasPortalRole($role) { if (empty($role)) { return true; } return BigNumber::Compare(BigNumber::BitwiseAnd($this->PortalRoles, $role), "0") != 0; }