Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+10 votes
in Plugins by
edited by

Version 1.4.2

  • RTL fixes.
  • Added - Amount of points received per vote.
  • Moved language files into a folder.
  • Added 2 more languages. Spanish and Portuguese translation.


Download official - GitHub / on-site-notifications

My branch - GitHub / my-repository
Live Demo - Plugin Live Demo

Buy me a beer - PayPal.me

4 Answers

+3 votes
Best answer

This branch is now merged to the official master


edited by
Hi, gold-developer
Recently I have installed (On Site Notifications - Version 1.4.2) It seems to be good and better than the old one, but there is one problem that appears, whenever user opens the notifications page. The error message in the cPanel error log is as follows:

 PHP Deprecated:  explode(): Passing null to parameter #2 ($string) of type string is deprecated in /home1/xxxxxx/public_html/xxx/qa-include/qa-base.php on line 1575

* My website is currently working with Version 1.8.7
and PHP 8.1
edited by
Thanks @SaadH . I've pushed a new update to the official plugin repository with compatibility for PHP version 8.1.
0 votes

Its work fine now in desktop with RTL, but in the mobile there still error.

The notification box appears partially:

fix in your css files
How and which line?
Ok i fixed the problem, i modified the "osn-styles.min.css" file in line 3, i changed the value "width:460px" to "width:300px".
Now it works fine.
Thanks, will add that to the next commit.
+1 vote

I'm going to leave another answer, because I can't post images in comments. 

The notification box is positioned strangely on my snowflat-based theme, and is not next to the profile picture:


It also will not close when I click the close button. This is strange because I never modified any code relating to the notification box in my theme. Is there a quick fix for this that I can add to my CSS?

Maybe you've moved some things around in the User Navigation function? Idk, But send me a link in a private message and I will take a look. Also include the version of Q2A you're using. Master or Dev.
After a bit more digging I discovered that OSN plugin is making some changes specifically for SnowFlat theme, in order for the bell to appear next to the User Avatar at the TopBar.

So if you're using a Modded version of Snowflat theme, with a new different name, for example 'SnowflatCustom', these SnowFlat targeted changes won't take effect.

To fix this you'll need to add your SnowflatCustom to the targeted changes as well.
Got to - On Site Notifications > q2apro-onsitenotifications-layer.php > line 122

Change that line from this:
    if(qa_opt('site_theme')=='SnowFlat'') {
to this:
    if(qa_opt('site_theme')=='SnowFlat' || qa_opt('site_theme')=='SnowflatCustom') {

Most of Modern themes already use that style of User Navigation dropdown (https://i.ibb.co/9VMxz7z/z317.jpg), so I could push a better solution to output the bell to the official repository. But with that fix, older themes may appear displaced. So I need to think thoroughly of a more general solution, or use that same logic of line 122 but instead of targeting SnowFlat, target all the old themes available... Will see.
Oh cool, thanks for your help! I'm really glad to have my notification bell back lol.

Sounds tricky, good luck on the general fix... If I were a dev, I would try to help with a lot of these types of things, but alas I'm still learning.
I've pushed a general fix for On Site Notifications
but you'll also need to make a small tweak on your SnowFlat qa-theme.php file
0 votes
Hello, it does not work to open the notification in a new tab.
edited by
Nice catch! Can't recall why I removed that.