The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Notification Widget not working

4 posters

Go down

In progress Notification Widget not working

Post by troyeccles June 13th 2016, 10:08 am

bellsareringing.forumotion.com
phpBB3

Hi,

I've grabbed this widget as I want notifications but not the toolbar: https://help.forumotion.com/t139188-notifications-without-displaying-toolbar#944510
Sadly, it's not working. It's displaying the header "Your Notifications" in the sidebar, but no notifications appear regardless of the page I'm viewing.

This is the widget:
Code:
 
<ul style="margin: 0px; overflow: auto; max-height: 225px; padding-left: 0px;" id="wnotify">
</ul><script type="text/javascript">
//<![CDATA[
/**************************************************************************
 * Module: JS_wNotify
 * Description: Notifications on Widget!
 * Author: Made and Optimizations by JScript - 2014/11/09
 * Version: First Release!
 ***************************************************************************/
jQuery(window).load(function() {
  var _pathName = location.pathname;
  if (_pathName == '/portal' || _pathName == '/forum' || _pathName == '/') {
      var NotifyExist = setInterval(function() {
        if (document.getElementById('notif_list') !== null) {
            clearInterval(NotifyExist);
            var iNewList = jQuery('#notif_list li').length,
              iOldList = 0;
 
            WidgetNotifications();
            iOldList = iNewList;
 
            setInterval(function() {
              iNewList = jQuery('#notif_list li').length;
              if (iNewList !== iOldList) {
                  WidgetNotifications();
                  iOldList = iNewList;
              }
            }, 10000);
        }
      }, 1000);
  }
});
 
function WidgetNotifications() {
  jQuery('#wnotify').html(jQuery('#notif_list').html());
 
    var oSearch = jQuery('#main-content .main-content td.tcr a.gensmall[href^="/u"]'), /* Location to look for avatars! In this case, looking in the categories. */
        oTarget = jQuery('#wnotify a[href^="/u"]'),
        ilen = oTarget.length;
 
    for (var index = 0; index < ilen; index++) {
        var oThis = jQuery(oTarget[index]),
            sHref = oThis.attr('href'),
            sTitle = oThis.text();
 
      if (sHref !== undefined) {
        oThis.closest('div').before('<a href="' + sHref + '" title="' + sTitle + '" class="lastpost-avatar"><img src="http://r26.imgfast.net/users/2617/31/90/74/avatars/1-40.png" alt="no_photo" class="avt-wid" /></a>');
        var oImg = oThis.closest('li').find('.avt-wid'),
        sSrc = sessionStorage.getItem(sHref); /* Relative fast... */
        if (sSrc) {
            oImg.attr('src', sSrc);
        } else {
            jQuery.get(sHref, function(data) { /* Slow and dangerous!!! */
              var image = jQuery('#profile-advanced-right img:first', data).attr('src');
              oImg.attr('src', image);
              sessionStorage.setItem(sHref, image);
            });
        }
      }
    }
};
//]]>
</script><style type="text/css">
<!--
#wnotify {
  list-style: outside none none;
}
#wnotify .ellipsis {
  min-height: 42px;
  overflow: auto;
  text-overflow: unset;
  white-space: normal;
  width: auto;
}
#wnotify .see_all {
  border: 1px solid #d2d2d2;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.07);
  margin-top: 5px;
  padding: 5px;
  text-align: center;
}
#wnotify .content > hr {
  display: none;
}
.lastpost-avatar {
  float: left;
  padding: 2px;
}
.lastpost-avatar img {
  background: none repeat scroll 0 0 #fff;
  border: 1px solid #d8d8d8;
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1);
  float: left;
  height: 28px;
  margin-right: 5px;
  padding: 2px;
  width: 28px;
}
-->
</style>

Any ideas why notifications don't appear?

Thanks.

Troy.
avatar
troyeccles
Forumember

Posts : 301
Reputation : 5
Language : English

Back to top Go down

In progress Re: Notification Widget not working

Post by Mohamed Nsr June 13th 2016, 10:12 am

hello

it works but you should Activate the toolbar :rose:
Mohamed Nsr
Mohamed Nsr
Forumember

Male Posts : 115
Reputation : 6
Language : Arabic & English
Location : ahlamontada

Back to top Go down

In progress Re: Notification Widget not working

Post by troyeccles June 13th 2016, 10:25 am

Hi Mohamed,

Thanks for your reply. According to the thread in the link above, the notification widget is to REPLACE the toolbar. I don't want it.
If I activate the toolbar, it shows.
avatar
troyeccles
Forumember

Posts : 301
Reputation : 5
Language : English

Back to top Go down

In progress Re: Notification Widget not working

Post by troyeccles June 13th 2016, 10:32 am

Update:

I see you're right. I activated the toolbar and there were the notifications. Well, one regarding a PM. It doesn't seem to show more than one notification.

So:
1. Is there a way of activating the toolbar but keeping it hidden?
2. Is there a way of showing, say, the last half a dozen notifications?
avatar
troyeccles
Forumember

Posts : 301
Reputation : 5
Language : English

Back to top Go down

In progress Re: Notification Widget not working

Post by SLGray June 13th 2016, 11:56 am

You can not hide the toolbar, because it contains copyright items. You can hide everything except for the Forumotion link. If you use credits, you can change the link. So you have to activate the toolbar or not.


Notification Widget not working Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51581
Reputation : 3526
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

In progress Re: Notification Widget not working

Post by troyeccles June 13th 2016, 1:57 pm

I can hide the toolbar by deactivating it. So.I'm not sure of these copyright issues.

Why, as per the link in the OP, would you have a notification widget AND a notification bar?

I think there's some confusion here
avatar
troyeccles
Forumember

Posts : 301
Reputation : 5
Language : English

Back to top Go down

In progress Re: Notification Widget not working

Post by SLGray June 13th 2016, 7:30 pm

JScript was not offering a code to hide the toolbar, but only to create a notification widget.  Also those JavaScripts were for punBB and phpBB 3.


Notification Widget not working Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51581
Reputation : 3526
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

In progress Re: Notification Widget not working

Post by troyeccles June 13th 2016, 11:21 pm

If you scroll down, he added bb3 code.

So there's no way of hiding the toolbar?
avatar
troyeccles
Forumember

Posts : 301
Reputation : 5
Language : English

Back to top Go down

In progress Re: Notification Widget not working

Post by Ape June 14th 2016, 6:16 pm

You can not hide your toolbar if its activated and it needs to be turned on for this system to work


Notification Widget not working Left1212Notification Widget not working Center11Notification Widget not working Right112
Notification Widget not working Ape_b110
Notification Widget not working Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19460
Reputation : 2012
Language : fluent in dork / mumbojumbo & English haha

http://chatworld.forumotion.co.uk/

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum