Skip to content

Commit

Permalink
Update displaying based on locations
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Friedman <[email protected]>
  • Loading branch information
iMattPro committed Jun 25, 2024
1 parent 05194bb commit a4fe5bc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions event/listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,13 @@ public function display_board_announcements()

foreach ($board_announcements_data as $data)
{
// Do not continue if announcements are only displayed on the board index, and the user is not currently viewing the board index
if ($data['announcement_indexonly'] && $this->user->page['page_name'] !== "index.$this->php_ext")
$locations = json_decode($data['announcement_locations'], true);

// Do not continue if announcement has locations specified, and user isn't at that location
if (!empty($locations) && (
($this->user->page['page_name'] === "index.$this->php_ext" && !in_array(0, $locations))
|| !in_array($this->request->variable('f', 0), $locations))
)
{
continue;
}
Expand Down

0 comments on commit a4fe5bc

Please sign in to comment.