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.
Did you download the code from a tag or the branch as linked in the first post? https://github.com/MyBBStuff/MyAlerts/ar...master.zip

I tried it out on a fresh install of MyBB locally on PHP 7.3 and there weren’t any problems. Please list which other plugins you have installed.

Does an error.log file exist at all and if so paste the contents here. If not try creating an empty file with that name then visit the plugin page again to see if the error gets saved to the log.
Hello,

Yes I did download it from the first post. I have created the error log file but even though I have reproduced the issue several times it remained empty :/

Installed & Activated Plugins:
  • Multiple Usergroup Images on Postbit/Profile (1.2)
  • Shows Avatar on Threadlist and Forumlist (3.0)
  • DVZ Mentions (1.0.5)
  • Emerald Extended (1.0)
  • OUGC Custom Reputation (1.8.22)
  • Report to Thread (1.5)
  • Spoiler MyCode (1.8)
Not installed Plugins:
  • PluginLibrary (13)
Would You kindly please tell me as to which version of MyBB did You install ? I am reluctnat but I may resolve to flatten the current forum (as it is still not in live version) and install it from scratch.

Edit: Made a test forum and there everything worked fine so yeah, I am starting a new with this one. My theory is that I had installed some kind of plugin dependant on MyAlerts before m Alerts and/or PluginLibrary and this may have broken something in the SQL etc.
Quote:... installed some kind of plugin dependant on MyAlerts before ...
most probably that was the cause.
(2020-06-26, 10:24 AM).m. Wrote: [ -> ]
Quote:... installed some kind of plugin dependant on MyAlerts before ...
most probably that was the cause.



Well an important lesson for future though Big Grin and if anyone will come across similar issue now he will know the answer ^^ Anyway thank You all Guys for quick replies and support Smile
So i have a theme that I am using and I have custom header text which is as follows

<!-- start: myalerts_headericon -->
<li class="alerts ">
    <a href="alerts.php" class="myalerts" onclick="MyBB.popupWindow('/alerts.php?modal=1&amp;', { fadeDuration: 250, zIndex: (typeof modal_zindex !== 'undefined' ? modal_zindex : 9999) }); return false;">
        <i class="fas fa-bell"></i>&nbsp; <span class="messages-icon head-messages">N/A</span>
</a>
</li>
<!-- end: myalerts_headericon -->



I am trying to get myalerts to show a number of alerts. The button when clicked will display the alerts like it should but it shows N/A which is i guess where i dont know how to find the code for a number to display of alerts. ANy suggestions?

I also added a screenshot of the code in the header

Actually i did figure it out.

<!-- start: myalerts_headericon -->
<li class="alerts ">
<a href="alerts.php" class="myalerts" onclick="MyBB.popupWindow('/alerts.php?modal=1&amp;', { fadeDuration: 250, zIndex: (typeof modal_zindex !== 'undefined' ? modal_zindex : 9999) }); return false;">
<i class="fas fa-bell"></i>&nbsp; <span class="messages-icon head-messages">({$mybb->user['unreadAlerts']})</span>
</a>
</li>
<!-- end: myalerts_headericon -->


Using ({$mybb->user['unreadAlerts']}) it displays the number of alerts! Took me all day to find that
(2020-04-02, 09:12 PM)Euan T Wrote: [ -> ]
(2020-04-02, 01:40 PM)skrilaxrev Wrote: [ -> ]
(2020-03-07, 04:31 PM)Euan T Wrote: [ -> ]That's a very odd issue, I'll try and replicate it. Do yo know which alert is being created? Is it the subscribed thread alert or the thread author alert or the quote alert?

Hi, thank you for your response!

I am pretty sure it's for the subscribed threads alert.
Thanks, I'll look into it this weekend and try get it fixed.

Thanks to a clue of the German MYBB community, i fixed the "subscribed alert for drafts"-bug.

It is nearly the same bug as here, just not for quote alert, but for subscribed threads:
https://github.com/lairdshaw/MyAlerts/co...5eb86aa5ca

It is pretty simple to solve, so please insert it in the next update and other people do this for the solution:

Find this:

$plugins->add_hook('datahandler_post_insert_post', 'myalertsrow_subscribed');
function myalertsrow_subscribed(&$dataHandler)
{
	global $mybb, $db, $post;

    if (!isset($mybb->user['uid']) || $mybb->user['uid'] < 1) {
        return;
    }

And change to this:

$plugins->add_hook('datahandler_post_insert_post', 'myalertsrow_subscribed');
function myalertsrow_subscribed(&$dataHandler)
{
	global $mybb, $db, $post;

    if (!isset($mybb->user['uid']) || $mybb->user['uid'] < 1 || $post['savedraft']) {
        return;
    }
I suspected as much, but have been too low on energy/motivation to actually implement and test this solution. Thanks for taking the initiative.
Using a fresh install of MyBB, only plugin installed is MyAlerts just today.

Using both the default theme and the simplicity theme by Rooloo which is a 1.8.22 theme the MyAlerts popup modal does not work at all, clicking it does nothing.

All other pop-up modals work so this issue is related to MyAlerts.

Was something changed?? because it worked a few weeks or so ago when I fiddled with it on another installation.
^ does forumURL/alerts.php work ? can we have your forum url & a test user account to check ..
(2020-06-30, 06:10 AM).m. Wrote: [ -> ]^ does forumURL/alerts.php work ? can we have your forum url & a test user account to check ..
Yes alerts.php works, 
I can pm a test account yes, I have cloudflare setup so I will need to put dev mode on as well.

The problem was due to https

When I installed MyBB for some reason it did not put https:// on the board url even though I put https:// during installation if i'm remembering correctly.

Anyways after setting the board url to https in configuration >> site details Alerts modal now works fine.