R
ragtek
Guest
It would be much easier to include own vars in the noticeTokens if we would have an event listener with an reference to the noticeTokens or if a method would return the array.
that's the part i mean:
XenForo_ViewRenderer_HtmlPublic
that's the part i mean:
XenForo_ViewRenderer_HtmlPublic
PHP:
$noticeTokens = array(
'{name}' => $user['username'] !== '' ? $user['username'] : new XenForo_Phrase('guest'),
'{user_id}' => $user['user_id'],
);
foreach (XenForo_Application::get('notices') AS $noticeId => $notice)
{
if (!in_array($noticeId, $dismissedNotices)
&& XenForo_Helper_Criteria::userMatchesCriteria($notice['user_criteria'], true, $user)
&& XenForo_Helper_Criteria::pageMatchesCriteria($notice['page_criteria'], true, $template->getParams(), $containerData))
{
$notices[$noticeId] = array(
'title' => $notice['title'],
'message' => str_replace(array_keys($noticeTokens), $noticeTokens, $notice['message']),
'wrap' => $notice['wrap'],
'dismissible' => ($notice['dismissible'] && XenForo_Visitor::getUserId())
);
}
}
Upvote
0