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.
I installed it and now plugins page is showing empty. Didn't even activate this plugin, just copy/paste files and now this.

[Image: dvYA8JG.png]
(2019-01-06, 07:16 AM)VinceOrlando Wrote: [ -> ]
(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);
            }
        }
    }
Is the plugin publicly available? If so, do you have a download link for the plugin so I can try it and try to find the problem?
(2019-01-06, 09:47 AM)Omar G. Wrote: [ -> ]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"
  }
}
You might be right - it looks like the avatar is created before passing to the formatter: https://github.com/MyBBStuff/MyAlerts/bl...s.php#L629

Easiest would probably be to just pass the alert data by reference to the method. I'll try and remember to push an update to allow that.
(2019-01-06, 03:11 PM)forumtester123 Wrote: [ -> ]I installed it and now plugins page is showing empty. Didn't even activate this plugin, just copy/paste files and now this.

[Image: dvYA8JG.png]

Are you sure that you've followed the instructions in the first post and uploaded files like "ClassLoader.php" and PluginLibrary? Those are the usual errors that people make.
(2019-01-06, 04:53 PM)Euan T Wrote: [ -> ]
(2019-01-06, 07:16 AM)VinceOrlando Wrote: [ -> ]
(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: [ -> ]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.
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.

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);
            }
        }
    }
Is the plugin publicly available? If so, do you have a download link for the plugin so I can try it and try to find the problem?
(2019-01-06, 09:47 AM)Omar G. Wrote: [ -> ]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"
  }
}
You might be right - it looks like the avatar is created before passing to the formatter: https://github.com/MyBBStuff/MyAlerts/bl...s.php#L629

Easiest would probably be to just pass the alert data by reference to the method. I'll try and remember to push an update to allow that.
(2019-01-06, 03:11 PM)forumtester123 Wrote: [ -> ]I installed it and now plugins page is showing empty. Didn't even activate this plugin, just copy/paste files and now this.

[Image: dvYA8JG.png]

Are you sure that you've followed the instructions in the first post and uploaded files like "ClassLoader.php" and PluginLibrary? Those are the usual errors that people make.

Here is the plugin github: https://github.com/momobenji/MyProfile
(2019-01-06, 04:53 PM)Euan T Wrote: [ -> ]
(2019-01-06, 03:11 PM)forumtester123 Wrote: [ -> ]I installed it and now plugins page is showing empty. Didn't even activate this plugin, just copy/paste files and now this.

[Image: dvYA8JG.png]

Are you sure that you've followed the instructions in the first post and uploaded files like "ClassLoader.php" and PluginLibrary? Those are the usual errors that people make.

Yes I uploaded all files. But there was an SQL file too containing two tables which I didn't create so I am not sure if it is due to this. Here are screenshots:

[Image: xLwAPKv.png]

[Image: WrbnPyJ.png]

[Image: rU0VaB5.png]

[Image: f6bVBMx.png]

[Image: ItyFYqr.png]

[Image: clO7mZc.png]

[Image: CnmJnvv.png]

[Image: ajlaUzH.png]

[Image: r1Jt6yu.png]

[Image: lwr8dvt.png]

[Image: HmVX4n7.png]
Quote:... there was an SQL file too containing two tables which I didn't create
manual work for database is NOT required to install & use MyAlerts.
would you like to PM me temporary access to forum admin panel & files (FTP) to check
Yeah, you don't need to do anything with the SQL - it's only for reference to developers.

Access to your hosting control panel would definitely help to track down the error that is happening.

@VinceOrlando Thanks, I will have to install and test the plugin with MyAlerts tomorrow after work.
(2019-01-07, 08:31 PM)Euan T Wrote: [ -> ]Yeah, you don't need to do anything with the SQL - it's only for reference to developers.

Access to your hosting control panel would definitely help to track down the error that is happening.

@VinceOrlando Thanks, I will have to install and test the plugin with MyAlerts tomorrow after work.

Alright thanks. Subscribing to the thread for updates on what happens then.
(2019-01-07, 02:46 PM).m. Wrote: [ -> ]
Quote:... there was an SQL file too containing two tables which I didn't create
manual work for database is NOT required to install & use MyAlerts.
would you like to PM me temporary access to forum admin panel & files (FTP) to check

PM sent please check.
just checking in to see if you were able to look at the issue between the connection of those plugins Smile
I haven't yet I'm afraid, I'll try and get to it ASAP - hopefully tomorrow.