Best Style

Você não está conectado. Conecte-se ou registre-se

Widget - Staff Online

Ver o tópico anterior Ver o tópico seguinte Ir para baixo  Mensagem [Página 1 de 1]

1Widget - Staff Online Empty Widget - Staff Online 02.01.16 17:44

PaladinoS

PaladinoS
Membro
Estou usando este código no Wiget, mas só aparece No Staff Online, mesmo eu estando online !
Código:
<script type="text/javascript">
myStaff = ['/u1'];
staff_cache_time = 4*60*1000; // mm*ss*ms;
</script>
<div id="theStaff">
</div>
<div id="theContent" style="display:none">
</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).text() === myStaff[i] }).appendTo('#theStaff').wrap('<div class="myStaff">');
    if (!jQuery('#theStaff .myStaff').length) jQuery('#theStaff').html('No staff online');
    if (window.localStorage) {
      localStorage.staffOn = jQuery('#theStaff').html();
      localStorage.staffEx = +new Date;
    }
  })
}
</script>

2Widget - Staff Online Empty Re: Widget - Staff Online 02.01.16 18:19

Sliw

Sliw
Administrador
Tente esse codigo no widget:
Código:
<script type="text/javascript">
  myStaff = ['/u1'];
  staff_cache_time = 4*60*1000; // mm*ss*ms;
  </script>   
<div id="theStaff">
              
</div>
         
<div id="theContent" style="display:none">
              
</div><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') === myStaff[i] }).appendTo('#theStaff').wrap('<div class="myStaff">');
      if (!jQuery('#theStaff .myStaff').length) jQuery('#theStaff').html('Não há membros da staff online.');
      jQuery('.myStaff a').each(function() {
        var href = jQuery(this).attr('href');
          if (window.localStorage) {
            localStorage.staffOn = jQuery('#theStaff').html();
            localStorage.staffEx = +new Date;
          }
        });
      });
    });
  }
  </script>   

Lembrando que é o /u1 que é da staff, ou seja, você deve estar conectado na conta /u1 pra que possa aparecer.

https://beststyle.forumeiros.com

3Widget - Staff Online Empty Re: Widget - Staff Online 02.01.16 18:30

PaladinoS

PaladinoS
Membro
Agora ficou branco... O widget

4Widget - Staff Online Empty Re: Widget - Staff Online 02.01.16 18:37

Sliw

Sliw
Administrador
Bom, achei aqui o erro que fiz :/
Altere pra este codigo:
Código:
<script type="text/javascript">
  myStaff = ['/u1'];
  staff_cache_time = 4*60*1000; // mm*ss*ms;
  </script>
<div id="theStaff">
</div>
 
<div id="theContent" style="display:none">
</div><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') === 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>

https://beststyle.forumeiros.com

5Widget - Staff Online Empty Re: Widget - Staff Online 02.01.16 18:40

PaladinoS

PaladinoS
Membro
Sliw, perfeito, mas tem um problema. Quando aparece a imagem ela vai enorme cara, tem como deixar menor ? Tipo como essa daqui quando faz o login http://prntscr.com/9lc9sl

6Widget - Staff Online Empty Re: Widget - Staff Online 02.01.16 18:44

Sliw

Sliw
Administrador
Adicione esse codigo css na sua folha de estilo:

Código:
.monAva img {
  height: 40px;
  width: 40px;
  margin-right: 5px;
  background: none repeat scroll 0 0 #FFF;
  border: 1px solid #d5d1c8;
  box-shadow: 0 2px 2px rgba(0,0,0,0.1);
  padding: 1px;
}
.monAva img:hover {
  border: 1px solid black;
}
.myStaff a {
  display:inline-block;
  vertical-align:top;
  margin-top:.75em;
}

Resolvido?

https://beststyle.forumeiros.com

7Widget - Staff Online Empty Re: Widget - Staff Online 02.01.16 18:46

PaladinoS

PaladinoS
Membro
A imagem sumiu ... Ja que sumiu tem como deixar sem a imagem mesmo ?

8Widget - Staff Online Empty Re: Widget - Staff Online 02.01.16 19:21

Sliw

Sliw
Administrador
deixe o CSS passado e altere o widget pra este:
Código:
<script type="text/javascript">
  myStaff = ['/u1' , '/u6'];
  staff_cache_time = 4*60*1000; // mm*ss*ms;
  </script>   
<div id="theStaff">
                
</div>
         
<div style="display:none" id="theContent">
                
</div><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') === myStaff[i] }).appendTo('#theStaff').wrap('<div class="myStaff">');
      if (!jQuery('#theStaff .myStaff').length) jQuery('#theStaff').html('Não há membros da 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>   

https://beststyle.forumeiros.com

9Widget - Staff Online Empty Re: Widget - Staff Online 02.01.16 19:26

PaladinoS

PaladinoS
Membro
A imagem ainda continua, quero tira-la

10Widget - Staff Online Empty Re: Widget - Staff Online 02.01.16 22:19

Sliw

Sliw
Administrador
aaaaah perdão, eu não tinha lido :/
pensei que pela ultima vez, você tinha tido que estava bugado (ao invez de você querer que retire).

adicione esse codigo CSS em sua folha de estilo:
Código:
.monAva img {display:none;}

e deixe o widget esse widget:
Código:
<script type="text/javascript">
  myStaff = ['/u1'];
  staff_cache_time = 4*60*1000; // mm*ss*ms;
  </script>
<div id="theStaff">
</div>
 
<div id="theContent" style="display:none">
</div><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') === 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>

https://beststyle.forumeiros.com

11Widget - Staff Online Empty Re: Widget - Staff Online 02.01.16 22:22

PaladinoS

PaladinoS
Membro
Perfeito !!

12Widget - Staff Online Empty Re: Widget - Staff Online 02.01.16 22:26

Sliw

Sliw
Administrador
Topico Finalizado e Bloqueado
Topico Movido para Arquivados

https://beststyle.forumeiros.com

Conteúdo patrocinado


Ver o tópico anterior Ver o tópico seguinte Ir para o topo  Mensagem [Página 1 de 1]

Permissões neste sub-fórum
Não podes responder a tópicos