The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Problem in Staff Online Widget in the javascript

Page 1 of 3 1, 2, 3  Next

View previous topic View next topic Go down

Solved Problem in Staff Online Widget in the javascript

Post by Van-Helsing on May 9th 2015, 12:32 am

Hello,
I found an error in javascript of staff online widget can someone help me to solve it?


Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Problem in Staff Online Widget in the javascript

Post by JScript on May 9th 2015, 12:44 am

@Black-Shadow
And where's the code? fufufu

JS

JScript
Forumember

Male Posts : 741
Reputation : 167
Language : PT-BR, EN
Location : Brazil

http://jscript.forumeiros.com/

Back to top Go down

Solved Re: Problem in Staff Online Widget in the javascript

Post by Van-Helsing on May 9th 2015, 12:45 am

Sorry @JScript forgot the code here it is:

Code:

div id="Staff_Online">

</div>
<script type="text/javascript">
jQuery(document).ready(function () {
var widget = jQuery('#Staff_Online')[0];
staff_cache_time = 4*60*1000; // mm*ss*ms;

if (localStorage.staffOn && localStorage.staffEx > +new Date - staff_cache_time) {
jQuery(widget).html(localStorage.staffOn)
} else {
jQuery.get('/viewonline', function (data) {
var group = {

ffnd: jQuery('.table span[style="color:#990012"]', data).parents('td'),

adm: jQuery('.table span[style="color:#FF0000"]', data).parents('td'),

gmod: jQuery('.table span[style="color:#800080"]', data).parents('td'),

fmod: jQuery('.table span[style="color:#7057FA"]', data).parents('td'),

tsup: jQuery('.table span[style="color:#0020C2"]', data).parents('td'),
smod: jQuery('.table span[style="color:#008000"]', data).parents('td'),
}; jQuery(widget).append(group.ffnd).append(group.adm).append(group.gmod).append(group.fmod).append(group.tsup).append(group.smod);
jQuery('#Staff_Online a[href^="/u"]').each(function () {
var prof = jQuery(this).attr('href');
jQuery('<a href="' + prof + '" class="avatarimage"></a>').insertBefore(this);
jQuery('<div class="Info"></div>').insertAfter(this);
jQuery(this).prev().load(prof + ' #profile-advanced-right .main-content img:eq(0)');

jQuery(this).next().load(prof + ' #field_id5 dd div:eq(0)')
})
});
jQuery(window).on('load', function () {
localStorage.staffOn = document.getElementById(widget).innerHTML;
localStorage.staffEx = +new Date;
})
}
});
</script> <style>
#Staff_Online .avatarimage > img {
float: left;
margin-right: 4px!important;
width: 40px;
height: 40px;
border: 1px solid #0000CD;
border-radius: 4px;
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.1);
}
#Staff_Online .Info {
color: darkgray;
margin: 1px 45px;
padding: 10px 0px 10px;
width: 190px;
display: table-cell;
}
#Staff_Online {
height: auto;
}
#Staff_Online td {
display: block;
}
</style>

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Problem in Staff Online Widget in the javascript

Post by JScript on May 9th 2015, 12:54 am

@Black-Shadow
This code was full of mistakes, I do not know how he still worked something!

Try this:
Code:

<div id="Staff_Online"></div>

<script type="text/javascript">
   jQuery(document).ready(function() {
      var oWidget = jQuery('#Staff_Online');
      staff_cache_time = 4 * 60 * 1000; // mm*ss*ms;

      if (localStorage.staffOn && localStorage.staffEx > +new Date - staff_cache_time) {
         oWidget.html(localStorage.staffOn)
      } else {
         jQuery.get('/viewonline', function(data) {
            var group = {
               ffnd: jQuery('.table span[style="color:#990012"]', data).parents('td'),

               adm: jQuery('.table span[style="color:#FF0000"]', data).parents('td'),

               gmod: jQuery('.table span[style="color:#800080"]', data).parents('td'),

               fmod: jQuery('.table span[style="color:#7057FA"]', data).parents('td'),

               tsup: jQuery('.table span[style="color:#0020C2"]', data).parents('td'),
               smod: jQuery('.table span[style="color:#008000"]', data).parents('td'),
            };
            oWidget.append(group.ffnd).append(group.adm).append(group.gmod).append(group.fmod).append(group.tsup).append(group.smod);
            oWidget.find('a[href^="/u"]').each(function() {
               var prof = jQuery(this).attr('href');
               jQuery('<a href="' + prof + '" class="avatarimage"></a>').insertBefore(this);
               jQuery('<div class="Info"></div>').insertAfter(this);
               jQuery(this).prev().load(prof + ' #profile-advanced-right .main-content img:eq(0)');

               jQuery(this).next().load(prof + ' #field_id5 dd div:eq(0)')
            })
         });
         jQuery(window).on('load', function() {
            localStorage.staffOn = document.getElementById('Staff_Online').innerHTML;
            localStorage.staffEx = +new Date;
         })
      }
   });
</script>
<style>
   #Staff_Online .avatarimage > img {
      float: left;
      margin-right: 4px!important;
      width: 40px;
      height: 40px;
      border: 1px solid #0000CD;
      border-radius: 4px;
      box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.1);
   }
   
   #Staff_Online .Info {
      color: darkgray;
      margin: 1px 45px;
      padding: 10px 0px 10px;
      width: 190px;
      display: table-cell;
   }
   
   #Staff_Online {
      height: auto;
   }
   
   #Staff_Online td {
      display: block;
   }
</style>

Note: I only tested it on my head, so it might not work!

So long,

JS

JScript
Forumember

Male Posts : 741
Reputation : 167
Language : PT-BR, EN
Location : Brazil

http://jscript.forumeiros.com/

Back to top Go down

Solved Re: Problem in Staff Online Widget in the javascript

Post by Van-Helsing on May 9th 2015, 12:58 am

@JScript I change the staff online widget but it is not working correctly and the problem in chatbox remaining

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Problem in Staff Online Widget in the javascript

Post by JScript on May 9th 2015, 1:05 am

@Black-Shadow
The widget error disappeared, but I'm finding that I your forum chat code is working intermittently, I ask you to just leave it so I can check out what's triggering it ok?

JS

JScript
Forumember

Male Posts : 741
Reputation : 167
Language : PT-BR, EN
Location : Brazil

http://jscript.forumeiros.com/

Back to top Go down

Solved Re: Problem in Staff Online Widget in the javascript

Post by Van-Helsing on May 9th 2015, 1:11 am

Ok @JScript,
I am leaving the widget with your new code as it haven't errors now to locate where is the error in chatbox.

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Problem in Staff Online Widget in the javascript

Post by JScript on May 9th 2015, 1:26 am

@Black-Shadow
Your forum is in need of optimization, I found that you still use a JS to add the avatar in the column "Last posts"!
You no longer need this code, remove it ( linux-team.forumgreek.com/26750.js ) and follow the steps in the image below:


Note: Your forum has many codes with placement in all the pages, check for any that are no longer needed!

When you are finished, we can continue with the chat code,

JS

JScript
Forumember

Male Posts : 741
Reputation : 167
Language : PT-BR, EN
Location : Brazil

http://jscript.forumeiros.com/

Back to top Go down

Solved Re: Problem in Staff Online Widget in the javascript

Post by Van-Helsing on May 9th 2015, 1:29 am

@JScript I have remove the js about the avatar on last column of board index and now the avatar is not displaying. I followed the steps in your post.

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Problem in Staff Online Widget in the javascript

Post by JScript on May 9th 2015, 1:37 am

@Black-Shadow
The reason is that your template has been modified!
Read: http://help.forumotion.com/t133214-new-option-show-avatars-in-the-column-last-posts

Check the changes you will need to make in your templates.

JS

JScript
Forumember

Male Posts : 741
Reputation : 167
Language : PT-BR, EN
Location : Brazil

http://jscript.forumeiros.com/

Back to top Go down

Solved Re: Problem in Staff Online Widget in the javascript

Post by Van-Helsing on May 9th 2015, 1:53 am

@JScript ok i fixed the avatars but the widget is freezing and is not displaying the status update field.

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Problem in Staff Online Widget in the javascript

Post by Van-Helsing on May 10th 2015, 12:19 pm

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Problem in Staff Online Widget in the javascript

Post by Van-Helsing on May 12th 2015, 1:38 am

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Problem in Staff Online Widget in the javascript

Post by Van-Helsing on May 13th 2015, 8:56 pm

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Problem in Staff Online Widget in the javascript

Post by Van-Helsing on May 14th 2015, 11:07 pm

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Problem in Staff Online Widget in the javascript

Post by Van-Helsing on May 16th 2015, 12:21 am

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Problem in Staff Online Widget in the javascript

Post by Van-Helsing on May 17th 2015, 10:23 am

bump


Last edited by Black-Shadow on May 28th 2015, 10:38 pm; edited 1 time in total

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Problem in Staff Online Widget in the javascript

Post by Van-Helsing on May 18th 2015, 9:51 pm

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Problem in Staff Online Widget in the javascript

Post by Van-Helsing on May 19th 2015, 11:53 pm

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Problem in Staff Online Widget in the javascript

Post by Van-Helsing on May 21st 2015, 11:59 am

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Problem in Staff Online Widget in the javascript

Post by Van-Helsing on May 22nd 2015, 9:51 pm

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Problem in Staff Online Widget in the javascript

Post by Van-Helsing on May 24th 2015, 2:14 am

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Problem in Staff Online Widget in the javascript

Post by Van-Helsing on May 25th 2015, 2:08 pm

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Problem in Staff Online Widget in the javascript

Post by Van-Helsing on May 26th 2015, 3:18 pm

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Problem in Staff Online Widget in the javascript

Post by Van-Helsing on May 27th 2015, 6:56 pm

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Problem in Staff Online Widget in the javascript

Post by Van-Helsing on May 28th 2015, 10:38 pm

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Problem in Staff Online Widget in the javascript

Post by Van-Helsing on May 30th 2015, 12:58 am

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Problem in Staff Online Widget in the javascript

Post by Van-Helsing on May 31st 2015, 12:23 pm

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Problem in Staff Online Widget in the javascript

Post by Van-Helsing on June 1st 2015, 1:10 pm

Hello @JScript,
Today something is going wrong and staff online widget appearing crashed. I cleared my browser's cache and cookies and the problem is still remaining. I tested it in Mozilla Firefox, Google Chrome and Safari but the appearance seems crashed.

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Problem in Staff Online Widget in the javascript

Post by JScript on June 1st 2015, 2:45 pm

@Black-Shadow
Ok, I'll do some code changes or I will make another, just ask him to wait a bit.

JS

JScript
Forumember

Male Posts : 741
Reputation : 167
Language : PT-BR, EN
Location : Brazil

http://jscript.forumeiros.com/

Back to top Go down

Page 1 of 3 1, 2, 3  Next

View previous topic View next topic Back to top


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