diff --git a/mod/network.php b/mod/network.php index 8cd2e27939..5ec97dbe99 100644 --- a/mod/network.php +++ b/mod/network.php @@ -439,7 +439,7 @@ function networkFlatView(App $a, $update = 0) if (!Config::get('theme', 'hide_eventlist')) { $o .= Profile::getBirthdays(); - $o .= Profile::getEvents(); + $o .= Profile::getEventsReminderHTML(); } } @@ -677,7 +677,7 @@ function networkThreadedView(App $a, $update, $parent) if (!$gid && !$cid && !$update && !Config::get('theme', 'hide_eventlist')) { $o .= Profile::getBirthdays(); - $o .= Profile::getEvents(); + $o .= Profile::getEventsReminderHTML(); } if ($datequery) { diff --git a/mod/profile.php b/mod/profile.php index 74ca06aad9..5e5988994c 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -352,7 +352,7 @@ function profile_content(App $a, $update = 0) if ($is_owner && !$update && !Config::get('theme', 'hide_eventlist')) { $o .= Profile::getBirthdays(); - $o .= Profile::getEvents(); + $o .= Profile::getEventsReminderHTML(); } diff --git a/src/Model/Profile.php b/src/Model/Profile.php index 81f9963099..e493d82d53 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -622,7 +622,7 @@ class Profile ]); } - public static function getEvents() + public static function getEventsReminderHTML() { $a = get_app(); $o = ''; @@ -642,12 +642,26 @@ class Profile $classtoday = ''; $s = dba::p( - "SELECT `event`.* FROM `event` - WHERE `event`.`uid` = ? AND `type` != 'birthday' AND `start` < ? AND `start` >= ? - ORDER BY `start` ASC ", + "SELECT * + FROM `event` + WHERE `event`.`uid` = ? + AND `event`.`type` != 'birthday' + AND `event`.`start` < ? + AND `event`.`start` >= ? + AND NOT EXISTS ( + SELECT `id` + FROM `item` + WHERE `item`.`uid` = `event`.`uid` + AND `item`.`parent-uri` = `event`.`uri` + AND `item`.`verb` = ? + AND `item`.`visible` + AND NOT `item`.`deleted` + ) + ORDER BY `event`.`start` ASC", local_user(), DateTimeFormat::utc('now + 7 days'), - DateTimeFormat::utc('now - 1 days') + DateTimeFormat::utc('now - 1 days'), + ACTIVITY_ATTENDNO ); $r = [];