Xen Notices [Deleted]

You're extending your controller via xfcp but you're not using the right classname for the parent class;)
PHP:
public static function extendAccountController($class, array &$extend)
{
if ($class == 'XenForo_ControllerPublic_Account')
{
$extend[] = 'GritterNotifications_ControllerPublic_Account';
}
}

PHP:
class GritterNotifications_ControllerPublic_Account extends XenForo_ControllerPublic_Account

should be
PHP:
class GritterNotifications_ControllerPublic_Account extends XFCP_GritterNotifications_ControllerPublic_Account
 
I have just tried to insert a youtube video in a notification. Looks cool :cool:.
However the notification containter cannot expand to full wide. Possible it can expand if content is wider?
 
I have just tried to insert a youtube video in a notification. Looks cool :cool:.
However the notification containter cannot expand to full wide. Possible it can expand if content is wider?

Can't you just define a width? And extend the width in the extra.css this is what I have done for the fixed image notifications I'm sure it can be applied to the container.
 
another suggestion:

IMO it's better to use
PHP:
if ($templateName == 'PAGE_CONTAINER' && $template instanceof XenForo_Template_Admin) {
instead of
PHP:
public static function templatePostRender($templateName, &$content, array &$containerData, XenForo_Template_Abstract $template)
{
 
if ($templateName == 'PAGE_CONTAINER')
{
// <body data-controller=" only appears in the admin version of PAGE_CONTAINER.
// Without the following check, editing a notification that contains {name} causes
// a replacement. This ensures this replacement only happens outside of the Admin CP.
if (!preg_match('/<body data-controller="/', $content))
{
because:

  • performance => you don't need to run preg_match with the whole output code (because all admin templates will be an instance of XenForo_Template_Admin it's fine to check only for this)
  • you can't be sure, that the search string ( <body data-controller= ) is available.
what if a "ugly addon":Dis searching for <body and replacing it with <body class="foo" ?
Then your search string won't be found;)






EDIT: lol, i've miread the code, i thought it's FOR THE ACP area
change admin with template and then it should work but i think already you know what i mean^^
 
I have just tried to insert a youtube video in a notification. Looks cool :cool:.
However the notification containter cannot expand to full wide. Possible it can expand if content is wider?
If you configure the width of your YouTube video in the embed settings appropriately, you can actually get away with the default notification width:

YouTubeNotification.webp

Here's the YouTube settings - so aim for a width of about 275px:

YouTubeWidth.webp
 
another suggestion:
EDIT: lol, i've miread the code, i thought it's FOR THE ACP area
sorry

It's ok, I got what you were saying.

I've gone with:

PHP:
public static function templatePostRender($templateName, &$content, array &$containerData, XenForo_Template_Abstract $template)
{
 
if ($templateName == 'PAGE_CONTAINER' && $template instanceof XenForo_Template_Public)

I worry about the quality of the rest of my code now :(
 
If you configure the width of your YouTube video in the embed settings appropriately, you can actually get away with the default notification width:

Cool, thanks. Notifications can be used to a lot of different things. Advertising, tips & tricks, have you seen... pop ups, videos, sponsor blocks etc.
 
Purchased, Installed, +1 (actually +1000)...Here is what is would ideally have/want/need....notifications based on visiting certain pages (actually, what I really want is if someone visits my profile, then they get a notification).

Is this possible, if so, how do I do it?!?!?!?
 
Purchased, Installed, +1 (actually +1000)...Here is what is would ideally have/want/need....notifications based on visiting certain pages (actually, what I really want is if someone visits my profile, then they get a notification).

Is this possible, if so, how do I do it?!?!?!?
This - I'm sorry to say - isn't possible.

The criteria capabilities are the same as Notices, and this isn't one of the possible ways to target a Notice so by proxy you also can't with Notifications.

You can target the XenForo_ControllerPublic_Member :: Member action, but this will show the notification on every member profile, not specific ones.
 
Yorick updated Notifications - powered by Gritter with a new update entry:

Bugs squashed, new colour picker (default XenForo), audible notifications and Admin CP preview

1.3 Fixes:
  • Temporary dismissal now only functions if the close button is pressed.
  • Fixed clash with other add-ons (specifically Conversation Essentials and User Essentials by Syndol)

1.3 New Features:

Video demonstration of new features:
To view this content we will need your consent to set third party cookies.
For more detailed information, see our cookies page.
  • Updated the admin colour picker to use the default XenForo picker.
  • Colour picker now lets you configure transparency on a per notification basis....

Read the rest of this update entry...
 
Back
Top Bottom