MyBB Community Forums

Full Version: MyAlerts v2.0.4
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
After getting the plugin to finally work, I was excited. However, it seems there's another problem I can't solve. I wanted to remove the Alert button from the top of the page and make it a custom button that works with my current theme. At the moment, it's messing with my theme.

Here's a screenshot on what I am speaking about;

[Image: 7fb0b62f1a713bbc70f4ffb56ce0bec5.png]

Any idea on how to remove that and make it a button, like the others there?
Can you please help with a issue related to myalert plugin?

Whenever i install myalert plugin my website giving following error:
This page isn’t working domain.com is currently unable to handle this request.

And website working without any error when i uninstall my alert plugin.

Using latest version of myalert plugin.

Can you please help?
Have you checked your server error log file?
When this is coupled with the myprofile plugin, myalerts seems to throw a 500 error trying to give an alert for profile comments. they were telling us to post here about it?
(2019-01-02, 05:58 AM)IllusionTM98 Wrote: [ -> ]After getting the plugin to finally work, I was excited. However, it seems there's another problem I can't solve. I wanted to remove the Alert button from the top of the page and make it a custom button that works with my current theme. At the moment, it's messing with my theme.

Here's a screenshot on what I am speaking about;

[Image: 7fb0b62f1a713bbc70f4ffb56ce0bec5.png]

Any idea on how to remove that and make it a button, like the others there?
You can edit the "myalerts_headericon" template in ACP > Templates & Style > Templates (on the left) > *YOUR THEME* > MyAlerts Templates. You can edit the template to use the same structure and styling as other header links to achieve a similar look.
(2019-01-02, 06:09 PM)yaa hee Wrote: [ -> ]Can you please help with a issue related to myalert plugin?

Whenever i install myalert plugin my website giving following error:
This page isn’t working domain.com is currently unable to handle this request.

And website working without any error when i uninstall my alert plugin.

Using latest version of myalert plugin.

Can you please help?
Can you please check your server error logs? These are usually available in cPanel or any other web hosting control panel that your host provides. This way we can track down what the actual problem is.
(2019-01-02, 07:06 PM)VinceOrlando Wrote: [ -> ]When this is coupled with the myprofile plugin, myalerts seems to throw a 500 error trying to give an alert for profile comments. they were telling us to post here about it?

As above, could you please check your server error logs and post any errors here so that I can work out what the problem is?
(2019-01-02, 08:05 PM)Euan T Wrote: [ -> ]Can you please check your server error logs? These are usually available in cPanel or any other web hosting control panel that your host provides. This way we can track down what the actual problem is.

 There is no errors in error log
(2019-01-02, 08:05 PM)Euan T Wrote: [ -> ]
(2019-01-02, 05:58 AM)IllusionTM98 Wrote: [ -> ]After getting the plugin to finally work, I was excited. However, it seems there's another problem I can't solve. I wanted to remove the Alert button from the top of the page and make it a custom button that works with my current theme. At the moment, it's messing with my theme.

Here's a screenshot on what I am speaking about;

[Image: 7fb0b62f1a713bbc70f4ffb56ce0bec5.png]

Any idea on how to remove that and make it a button, like the others there?
You can edit the "myalerts_headericon" template in ACP > Templates & Style > Templates (on the left) > *YOUR THEME* > MyAlerts Templates. You can edit the template to use the same structure and styling as other header links to achieve a similar look.
(2019-01-02, 06:09 PM)yaa hee Wrote: [ -> ]Can you please help with a issue related to myalert plugin?

Whenever i install myalert plugin my website giving following error:
This page isn’t working domain.com is currently unable to handle this request.

And website working without any error when i uninstall my alert plugin.

Using latest version of myalert plugin.

Can you please help?
Can you please check your server error logs? These are usually available in cPanel or any other web hosting control panel that your host provides. This way we can track down what the actual problem is.
(2019-01-02, 07:06 PM)VinceOrlando Wrote: [ -> ]When this is coupled with the myprofile plugin, myalerts seems to throw a 500 error trying to give an alert for profile comments. they were telling us to post here about it?

As above, could you please check your server error logs and post any errors here so that I can work out what the problem is?

It gives no error, but when i check dev console, it throws this error: https://playersquared.com/forums/xmlhttp...mments-add can not load 500 error. This is only when i have MyAlerts enabled as the notification type.
(2019-01-03, 01:40 AM)yaa hee Wrote: [ -> ]
(2019-01-02, 08:05 PM)Euan T Wrote: [ -> ]Can you please check your server error logs? These are usually available in cPanel or any other web hosting control panel that your host provides. This way we can track down what the actual problem is.

 There is no errors in error log
If you are getting a blank page, then that indicates an internal error and there should be an error log. You could try enabling MyBB's error logging in the ACP under Configuration > Server and Optimization Options > Error Logging Medium = Log errors and Error Logging Location = ./error.log.

This will create a file in the root of your MyBB install called "error.log". If you then install MyAlerts and try to browse your site, you should see some errors appear there.

Also make sure you have PluginLibrary and the "ClassLoader.php" file as explained in the first post of this thread.

(2019-01-03, 02:54 AM)VinceOrlando Wrote: [ -> ]
(2019-01-02, 08:05 PM)Euan T Wrote: [ -> ]
(2019-01-02, 05:58 AM)IllusionTM98 Wrote: [ -> ]After getting the plugin to finally work, I was excited. However, it seems there's another problem I can't solve. I wanted to remove the Alert button from the top of the page and make it a custom button that works with my current theme. At the moment, it's messing with my theme.

Here's a screenshot on what I am speaking about;

[Image: 7fb0b62f1a713bbc70f4ffb56ce0bec5.png]

Any idea on how to remove that and make it a button, like the others there?
You can edit the "myalerts_headericon" template in ACP > Templates & Style > Templates (on the left) > *YOUR THEME* > MyAlerts Templates. You can edit the template to use the same structure and styling as other header links to achieve a similar look.
(2019-01-02, 06:09 PM)yaa hee Wrote: [ -> ]Can you please help with a issue related to myalert plugin?

Whenever i install myalert plugin my website giving following error:
This page isn’t working domain.com is currently unable to handle this request.

And website working without any error when i uninstall my alert plugin.

Using latest version of myalert plugin.

Can you please help?
Can you please check your server error logs? These are usually available in cPanel or any other web hosting control panel that your host provides. This way we can track down what the actual problem is.
(2019-01-02, 07:06 PM)VinceOrlando Wrote: [ -> ]When this is coupled with the myprofile plugin, myalerts seems to throw a 500 error trying to give an alert for profile comments. they were telling us to post here about it?

As above, could you please check your server error logs and post any errors here so that I can work out what the problem is?

It gives no error, but when i check dev console, it throws this error: https://playersquared.com/forums/xmlhttp...mments-add can not load 500 error. This is only when i have MyAlerts enabled as the notification type.

Hi, that URL isn't related to MyAlerts and seems to be related to some comments plugin or something that isn't part of MyAlerts.
(2019-01-05, 09:47 PM)Euan T Wrote: [ -> ]
(2019-01-03, 01:40 AM)yaa hee Wrote: [ -> ]
(2019-01-02, 08:05 PM)Euan T Wrote: [ -> ]Can you please check your server error logs? These are usually available in cPanel or any other web hosting control panel that your host provides. This way we can track down what the actual problem is.

 There is no errors in error log
If you are getting a blank page, then that indicates an internal error and there should be an error log. You could try enabling MyBB's error logging in the ACP under Configuration > Server and Optimization Options > Error Logging Medium = Log errors and Error Logging Location = ./error.log.

This will create a file in the root of your MyBB install called "error.log". If you then install MyAlerts and try to browse your site, you should see some errors appear there.

Also make sure you have PluginLibrary and the "ClassLoader.php" file as explained in the first post of this thread.

(2019-01-03, 02:54 AM)VinceOrlando Wrote: [ -> ]
(2019-01-02, 08:05 PM)Euan T Wrote: [ -> ]
(2019-01-02, 05:58 AM)IllusionTM98 Wrote: [ -> ]After getting the plugin to finally work, I was excited. However, it seems there's another problem I can't solve. I wanted to remove the Alert button from the top of the page and make it a custom button that works with my current theme. At the moment, it's messing with my theme.

Here's a screenshot on what I am speaking about;

[Image: 7fb0b62f1a713bbc70f4ffb56ce0bec5.png]

Any idea on how to remove that and make it a button, like the others there?
You can edit the "myalerts_headericon" template in ACP > Templates & Style > Templates (on the left) > *YOUR THEME* > MyAlerts Templates. You can edit the template to use the same structure and styling as other header links to achieve a similar look.
(2019-01-02, 06:09 PM)yaa hee Wrote: [ -> ]Can you please help with a issue related to myalert plugin?

Whenever i install myalert plugin my website giving following error:
This page isn’t working domain.com is currently unable to handle this request.

And website working without any error when i uninstall my alert plugin.

Using latest version of myalert plugin.

Can you please help?
Can you please check your server error logs? These are usually available in cPanel or any other web hosting control panel that your host provides. This way we can track down what the actual problem is.
(2019-01-02, 07:06 PM)VinceOrlando Wrote: [ -> ]When this is coupled with the myprofile plugin, myalerts seems to throw a 500 error trying to give an alert for profile comments. they were telling us to post here about it?

As above, could you please check your server error logs and post any errors here so that I can work out what the problem is?

It gives no error, but when i check dev console, it throws this error: https://playersquared.com/forums/xmlhttp...mments-add can not load 500 error. This is only when i have MyAlerts enabled as the notification type.

Hi, that URL isn't related to MyAlerts and seems to be related to some comments plugin or something that isn't part of MyAlerts.

I think its his custom myalerts formatter. the plugin dev isnt active anymore, so not sure if this plugs into myalerts correctly.

/* A custom MyAlerts Formatter for MyProfile Comments */
if (class_exists("MybbStuff_MyAlerts_Formatter_AbstractFormatter")) {

    class MyProfileCommentsMyAlertsFormatter extends MybbStuff_MyAlerts_Formatter_AbstractFormatter {

        /**
         * Format an alert into it's output string to be used in both the main alerts listing page and the popup.
         *
         * @param MybbStuff_MyAlerts_Entity_Alert $alert The alert to format.
         * @return string The formatted alert string.
         */
        public function formatAlert(MybbStuff_MyAlerts_Entity_Alert $alert, array $outputAlert) {
            global $lang;
            $from_user = get_user($alert->getFromUserId());
            $this->buildShowLink($alert);
            return $lang->sprintf($lang->myprofile_alert, format_name(htmlspecialchars_uni($from_user["username"]), $from_user["usergroup"], $from_user["displaygroup"]));
        }

        /**
         * Init function called before running formatAlert(). Used to load language files and initialize other required resources.
         *
         * @return void
         */
        public function init() {
            MyProfileUtils::lang_load_myprofile();
        }

        public function buildShowLink(MybbStuff_MyAlerts_Entity_Alert $alert) {
            $alertContent = $alert->getExtraDetails();
            return MyProfileComments::get_instance()->build_comment_link($alertContent["cid"]);
        }

        /**
         * Let's not get lost in between things, this will return the alert type code
         */
        public static function alert_type_code() {
            return "myprofilecomments";
        }

    }

}
and

        /* let's integrate with MyAlerts 2.0 if it's not already the case */
        if (MyProfileUtils::myalerts_exists()) {
            if (MyProfileComments::myalerts_can_integrate()) {
                $alertTypeManager = MybbStuff_MyAlerts_AlertTypeManager::createInstance($db, $cache);
                $alertType = new MybbStuff_MyAlerts_Entity_AlertType();
                $alertType->setCode(MyProfileCommentsMyAlertsFormatter::alert_type_code());
                $alertType->setEnabled(true);
                $alertTypeManager->add($alertType);
            }
        }
    }
Hi, currently inside the formatAlert() method we can get the user avatar information, but apparently it is not possible to change it (the avatar itself is probably formatted before). It would be nice to be able to modify this information.

$outputAlert

array(1) {
  [0]=>
  array(7) {
    ["avatar"]=>
    array(2) {
      ["image"]=>
      string(47) "http://localhost/mybb/images/default_avatar.png"
      ["width_height"]=>
      string(22) "width="64" height="64""
    }
    ["id"]=>
    int(1)
    ["username"]=>
    string(6) "Sama34"
    ["from_user"]=>
    string(67) "Sama34"
    ["from_user_raw_profilelink"]=>
    string(35) "member.php?action=profile&uid=1"
    ["from_user_profilelink"]=>
    string(139) "Sama34"
    ["alert_status"]=>
    string(12) " alert--read"
  }
}