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.

Staff online widget help.

3 posters

Go down

In progress Staff online widget help.

Post by Swagbito Sun 4 Jan - 3:46

So I added the staff online widget and it worked but...
http://rubbershinobi.forumotion.com/
It shows the whole staff list even offline. And it looks ugly.
Also,when I added the widget,I noticed that it cut out some of my topic images. How can I fix this?
Any help?
Swagbito
Swagbito
Forumember

Posts : 176
Reputation : 4
Language : English & Japanese

http://rubbershinobi.forumotion.com/

Back to top Go down

In progress Re: Staff online widget help.

Post by _Twisted_Mods_ Sun 4 Jan - 6:09

where did you get this widget? .. provide a link if u can
_Twisted_Mods_
_Twisted_Mods_
Helper
Helper

Male Posts : 2108
Reputation : 336
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

In progress Re: Staff online widget help.

Post by Swagbito Sun 4 Jan - 6:24

Swagbito
Swagbito
Forumember

Posts : 176
Reputation : 4
Language : English & Japanese

http://rubbershinobi.forumotion.com/

Back to top Go down

In progress Re: Staff online widget help.

Post by _Twisted_Mods_ Sun 4 Jan - 6:39

do you color your staff names?
_Twisted_Mods_
_Twisted_Mods_
Helper
Helper

Male Posts : 2108
Reputation : 336
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

In progress Re: Staff online widget help.

Post by Swagbito Sun 4 Jan - 6:39

No
Swagbito
Swagbito
Forumember

Posts : 176
Reputation : 4
Language : English & Japanese

http://rubbershinobi.forumotion.com/

Back to top Go down

In progress Re: Staff online widget help.

Post by _Twisted_Mods_ Sun 4 Jan - 6:50

well i can write you a better code but you have 2 choices either you can fill in all of your staffs user id's or you can color them and just fill in the colors
_Twisted_Mods_
_Twisted_Mods_
Helper
Helper

Male Posts : 2108
Reputation : 336
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

In progress Re: Staff online widget help.

Post by Swagbito Sun 4 Jan - 6:51

Writing me one is fine plz.
Swagbito
Swagbito
Forumember

Posts : 176
Reputation : 4
Language : English & Japanese

http://rubbershinobi.forumotion.com/

Back to top Go down

In progress Re: Staff online widget help.

Post by _Twisted_Mods_ Sun 4 Jan - 6:55

witch way do you want it by color or userid#
_Twisted_Mods_
_Twisted_Mods_
Helper
Helper

Male Posts : 2108
Reputation : 336
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

In progress Re: Staff online widget help.

Post by Swagbito Sun 4 Jan - 6:56

Userid#
Swagbito
Swagbito
Forumember

Posts : 176
Reputation : 4
Language : English & Japanese

http://rubbershinobi.forumotion.com/

Back to top Go down

In progress Re: Staff online widget help.

Post by _Twisted_Mods_ Sun 4 Jan - 9:39

see if this works for you

Code:

<style>
#staffwidget img{width:40px;border-radius:8px}
#staffwidget .stonh{border:1px solid white;padding: 2px;border-radius: 5px;width:97%;}
#staffwidget a{text-align:center;width:100%;}
#staffwidget #innerstname{width: 100% !important;display: inline-flex;font-size: 1.10em;font-weight: bold;}
</style>
<div id="staffwidget">
</div><script>
jQuery(function(){
fff = ['1','87294','3975','98818','12726','97664']; // id's of the staff
jQuery('body').append('<span id="staffget" style="display:inline;"></span>');
jQuery('#staffget').load('/viewonline .forumbg',function(){
jQuery('#staffget a[href^="/u"]').each(function(){
   var prof = jQuery(this).attr('href');

for(var i = 0; i < fff.length; i++){
if(prof == '/u'+fff[i]){
   jQuery('#staffwidget').append(' <div id="stonlin'+i+'" class="stonh"><span id="innerstname">'+jQuery(this).parent().html()+'</span><br><span id="innerstava"></span><br></div> ');
jQuery('#staffwidget #stonlin'+i+' #innerstava').load(prof + ' #profile-advanced-right .inner:eq(0) div:eq(1)');
}};});});});
</script>


fff = ['1','87294','3975','98818','12726','97664']; // id's of the staff

thats the list of user id#'s you can have as little ['1'] or as many ['1','2','3'] as you need

_Twisted_Mods_
_Twisted_Mods_
Helper
Helper

Male Posts : 2108
Reputation : 336
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

In progress Re: Staff online widget help.

Post by Swagbito Sun 4 Jan - 16:00

Didn`t work.
Swagbito
Swagbito
Forumember

Posts : 176
Reputation : 4
Language : English & Japanese

http://rubbershinobi.forumotion.com/

Back to top Go down

In progress Re: Staff online widget help.

Post by Swagbito Tue 6 Jan - 3:47

Bump.
Swagbito
Swagbito
Forumember

Posts : 176
Reputation : 4
Language : English & Japanese

http://rubbershinobi.forumotion.com/

Back to top Go down

In progress Re: Staff online widget help.

Post by Ange Tuteur Tue 6 Jan - 18:17

Hello @swagbito,

Try changing your widget to this :
Code:
 <script type="text/javascript">
    myStaff = ['1', '2'];
    staff_cache_time = 4*60*1000; // mm*ss*ms;
    </script>
<div id="theStaff">
</div>
 
<style type="text/css">
.monAva img {
  height:25px;
  width:25px;
}
.myStaff a {
  display:inline-block;
  vertical-align:top;
  margin-top:.75em;
}
</style>
<div style="display:none" id="theContent">
</div>
    <noscript><div style="color:red;font-size:9px">Functionality of this widget is not possible, as JavaScript is disabled or unsupported.</div></noscript>    <script type="text/javascript">
    if (localStorage.staffOn && localStorage.staffEx > +new Date - staff_cache_time) jQuery('#theStaff').html(localStorage.staffOn);
    else loadStaff();
    function loadStaff() {
      jQuery('#theContent').load('/viewonline #main-content a, a.gen', function() {
        for (i=0; i<myStaff.length; i++) jQuery('#theContent a').filter(function() { return jQuery(this).attr('href') === '/u' + myStaff[i] }).appendTo('#theStaff').wrap('<div class="myStaff">');
        if (!jQuery('#theStaff .myStaff').length) jQuery('#theStaff').html('No staff online');
        jQuery('.myStaff a').each(function() {
          var href = jQuery(this).attr('href');
          jQuery(this).before('<span class="monAva"></span>').prev().load(href + ' #profile-advanced-right .module:first div img:first,.forumline td.row1.gensmall:first > img, .frm-set.profile-view.left dd img,dl.left-box.details:first dd img, .row1 b .gen:first img, .real_avatar img', function() {
            if (window.localStorage) {
              localStorage.staffOn = jQuery('#theStaff').html();
              localStorage.staffEx = +new Date;
            }
          });
        });
      });
    }
    </script>

myStaff = ['1', '2']; Is the list of your staff
replace 1, 2 by the id of your staff, you can add more than two by separating multiple user IDs by a comma. To get their id go to their profile and look for /u# in the address bar, # being their ID.

staff_cache_time = 4*60*1000; Is the time the widget is cached
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13246
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Back to top

- Similar topics

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