XF 1.5 Click Alerts -> NOT Mark All As Read

king8084

Well-known member
I'm trying to determine a way to prevent all alerts being marked read upon clicking the Alerts dropdown in the top nav. Rather, I'd like to have them marked as read as they're individually clicked on.

Was hoping to do this without the need for a mod (or to find an available pre-existing mod). Looking into accounts_alert & accounts_alert_popup to play with how $alerts.new, $alerts.unread behave.
 
I believe Xon's add-on here would do what you're looking for: https://xenforo.com/community/resources/alert-improvements-by-xon.4578/
appreciate the help, but i've been tinkering with that add-on as well, but it doesn't appear that it fully accomplishes the above. Xon's add-on will prevent alerts from being marked read upon accessing the /accounts/alerts page, however, the alerts still get marked as read upon clicking the nav dropdown. I've pinged Xon in his mod thread as well...I'm guessing that if it were easy to do, then it would have been baked into his add-on. Will wait and see on that front.

Any other options/suggestions?
 
src/XF/Pub/Controller/Account ->
public function actionAlertsPopup() ->
$alertRepo->markUserAlertsRead($visitor);

Comment that line out and then use Xon's addon.
 
src/XF/Pub/Controller/Account ->
public function actionAlertsPopup() ->
$alertRepo->markUserAlertsRead($visitor);

Comment that line out and then use Xon's addon.
you're my hero.

FYI to others, the above path & code is xf 2.0. for me (xf 1.5), it was Library/XenForo/ControllerPublic/Account.php. then comment out $alertModel->markAllAlertsReadForUser($visitor['user_id']);
 
Back
Top Bottom