Caixa de mensagem privada não aparece

3 participantes

Ver o tópico anterior Ver o tópico seguinte Ir para baixo

Tópico resolvido Caixa de mensagem privada não aparece

Mensagem por iScroll 25.03.17 14:50

Detalhes da questão


Endereço do fórum: http://www.brasilplayultimate.com.br
Versão do fórum: PunBB

Descrição


Olá pessoal, estava querendo esse JS :

https://i.imgur.com/MNF32Ux.png

Mas infelizmente não acontece nada no meu fórum, simplesmente vai para caixa padrão.
Código:

Código:
/***
* Código: Inbox List Elegante
* Data de criação: 08/09/2014
* Atualização: 16/08/2015
* Autor: Daemon
* Versão: 1.3
* Inspirado: IPS4 - IPB
* Acesse: http://bestskins.net
***/
$(document).ready(function() {
 
// Defina aqui abaixo a quantidade de mensagens que irão ser exibidas
var jQtd = 5;

// Todo CSS
$('head').append(
'<style type="text/css">' +
'  #bs_full_inbox {' +
'  font-size: 13px;' +
'  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;' +
'  line-height: 18px;' +
'  margin-top: 15px;' +
'  display: none;' +
'  width: 450px;' +
'  background: #fff;' +
'  box-shadow: 0px 15px 110px rgba(0,0,0,0.2);' +
'  border-radius: 3px;' +
'  z-index: 200;' +
'  position: absolute;' +
'  }' +
'  #bs_full_inbox a {' +
'  color: #255b79;' +
'  text-decoration: none;' +
'  }' +
'  #bs_full_inbox a:hover {' +
'  color: #cd3816;' +
'  }' +
'  #bs_full_inbox:before {' +
'  border-style: solid;' +
'  border-width: 15px;' +
'  border-color: transparent transparent #fff;' +
'  bottom: 100%;' +
'  pointer-events: none;' +
'  left: 15px;' +
'  content: "";' +
'  display: block;' +
'  height: 0;' +
'  position: absolute;' +
'  width: 0;' +
'  z-index: 3;' +
'  }' +
'  .bs_inbox_header {' +
'  background: #fff url(http://i.imgur.com/sl0Efuz.png) repeat-x 0 0;' +
'  border-bottom: 1px solid #e0e0e0;' +
'  box-shadow: 0px 1px 6px rgba(0,0,0,0.07);' +
'  border-radius: 3px 3px 0px 0px;' +
'  padding: 10px;' +
'  line-height: 24px;' +
'  }' +
'  .bs_inbox_header .compose {' +
'  font-size: 12px;' +
'  line-height: 28px;' +
'  padding: 0 15px;' +
'  float: right;' +
'  background: #262e33;' +
'  color: #ffffff !important;' +
'  font-weight: 500;' +
'  text-align: center;' +
'  text-decoration: none;' +
'  text-shadow: none;' +
'  white-space: nowrap;' +
'  display: inline-block;' +
'  vertical-align: middle;' +
'  border-radius: 3px;' +
'  border: 1px solid rgba(0,0,0,0.1);' +
'  -webkit-transition: 0.1s all linear;' +
'  -moz-transition: 0.1s all linear;' +
'  -ms-transition: 0.1s all linear;' +
'  -o-transition: 0.1s all linear;' +
'  transition: 0.1s all linear;' +
'  -webkit-user-select: none;' +
'  -moz-user-select: none;' +
'  -ms-user-select: none;' +
'  -o-user-select: none;' +
'  user-select: none;' +
'  -webkit-font-smoothing: antialiased;' +
'  }' +
'  .bs_inbox_header .compose:hover {' +
'  background-image: url(http://i.imgur.com/eaB5FHK.png);' +
'  background-repeat: repeat;' +
'  }' +
'  .bs_inbox_sectionHead {' +
'  font-size: 18px;' +
'  color: #333333;' +
'  line-height: 24px;' +
'  font-weight: 400;' +
'  display: inline-block;' +
'  margin: 0;' +
'  }' +
'  .bs_inbox_inner {' +
'  width: 100%;' +
'  display: table;' +
'  table-layout: auto;' +
'  position: relative;' +
'  border-collapse: separate;' +
'  border-spacing: 0;' +
'  list-style: none;' +
'  padding: 0;' +
'  margin: 0;' +
'  }' +
'  .bs_inbox_li {' +
'  width: 100%;' +
'  position: relative;' +
'  padding: 5px 3px;' +
'  border-width: 0 0 1px 0;' +
'  border-style: solid;' +
'  border-color: #f5f5f5;' +
'  box-sizing: border-box;' +
'  }' +
'  .bs_inbox_li:last-child {border-bottom: 0;}' +
'  .bs_inbox_li strong {font-weight: normal !important;}' +
'  .bs_inbox_item, .bs_user_p {' +
'  display: table-cell;' +
'  padding: 8px 10px;' +
'  }' +
'  .bs_inbox_item {color: #9c9c9c;}' +
'  .bs_inbox_item .topictitle {display: inherit;}' +
'  .bs_inbox_footer {' +
'  background: #fff url(http://i.imgur.com/sl0Efuz.png) repeat-x 0 0;' +
'  text-align: center;' +
'  padding: 10px;' +
'  line-height: 24px;' +
'  border-top: 1px solid #e0e0e0;' +
'  box-shadow: 0px -1px 6px rgba(0,0,0,0.07);' +
'  border-radius: 0px 0px 3px 3px;' +
'  }' +
'  .bs_inbox_photo {' +
'  background: #fff;' +
'  border: 1px solid #fff;' +
'  box-shadow: 0px 0px 0px 1px #e2e2e2;' +
'  padding: 0.5px;' +
'  vertical-align: middle;' +
'  line-height: 1px;' +
'  position: relative;' +
'  border-radius: 150px;' +
'  width: 34px;' +
'  height: 34px;' +
'  }' +
'</style>'
);

// Adicionando elemento ao corpo do fórum
$('body').append('<div id="bs_full_inbox"></div>');
var jInner = '<div class="bs_inbox_header">' +
            '  <a href="/privmsg?mode=post" class="compose" target="_self">Nova Mensagem</a>' +
            '  <h4 class="bs_inbox_sectionHead">Caixa de entrada</h4>' +
            '</div>' +
            '<ol class="bs_inbox_inner">' +
            '  <img src="http://i.imgur.com/DYwSiJf.gif" style="margin: 5px auto;display: block;" />' +
            '</ol>' +
            '<div class="bs_inbox_footer">' +
            '  <a href="/privmsg?folder=inbox">Ir Para Mensagens</a>' +
            '</div>';
var jInbox = $('#bs_full_inbox');
jInbox.append(jInner);

$('a.mainmenu[href="/privmsg?folder=inbox"]').click(function(d) {
  d.preventDefault();

  // Verificando se o elemento é visível
  if(jInbox.css('display') != 'none') {
    jInbox.fadeOut('450');
  } else {
    jInbox.css({
          'left': $(this).offset().left,
          'top': $(this).offset().top + $(this).outerHeight()
    }).show();
   
    // Carregar conteúdo
    if(!$('.bs_inbox_photo').length) {
        $('.bs_inbox_inner').load('/privmsg?folder=inbox&change_version=punbb .tdtopics:lt(' + jQtd + ')', function() {
            $(this).html(
              $(this).html()
              .replace(/\<\/td\>/g, '</span></div></li>')
              .replace(/\<td class="tcl tdtopics"\>/g, '<li class="bs_inbox_li clearfix"><div class="bs_user_p left"><img class="bs_inbox_photo" alt="photo" src="http://i.imgur.com/n4qY3fc.png" /></div><div class="bs_inbox_item">')
            ).find('span.status').remove();
            $(this).find('a').each(function() {
                var jHref = $(this).attr('href');
                jHref = jHref.split(/(&change|\?change)/g)[0];
                $(this).attr('href', jHref);
            });
            $('.bs_inbox_li').each(function() {
              var jUser = $(this).find('a[href^="/u"]').attr('href');
              var jImg = $(this).find('.bs_inbox_photo');
              var jUserImage = sessionStorage.getItem(jUser);
              if(jUserImage) {
                jImg.attr('src', jUserImage);
              } else {
                $.get(jUser + '?change_version=punbb', function(data) {
                  var jFindImage = $('#profile-advanced-right .main-content img:first', data).attr('src');
                  jImg.attr('src', jFindImage);
                  sessionStorage.setItem(jUser, jFindImage);
                });
              }
            });
        });
    }
  }
});
});
iScroll

iScroll
Super Membro

Membro desde : 08/03/2015
Mensagens : 1701
Pontos : 2311

http://ultimatelife.forumeiros.com

Ir para o topo Ir para baixo

Tópico resolvido Re: Caixa de mensagem privada não aparece

Mensagem por Kyo Panda 27.03.17 13:23

Troque por esse:

Código:
/***
* Código: Inbox List Elegante
* Data de criação: 08/09/2014
* Atualização: 16/08/2015
* Autor: Daemon
* Versão: 1.3
* Inspirado: IPS4 - IPB
* Acesse: http://bestskins.net
***/
$(document).ready(function() {
 
// Defina aqui abaixo a quantidade de mensagens que irão ser exibidas
var jQtd = 5;

// Todo CSS
$('head').append(
'<style type="text/css">' +
'  #bs_full_inbox {' +
'  font-size: 13px;' +
'  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;' +
'  line-height: 18px;' +
'  margin-top: 15px;' +
'  display: none;' +
'  width: 450px;' +
'  background: #fff;' +
'  box-shadow: 0px 15px 110px rgba(0,0,0,0.2);' +
'  border-radius: 3px;' +
'  z-index: 200;' +
'  position: absolute;' +
'  }' +
'  #bs_full_inbox a {' +
'  color: #255b79;' +
'  text-decoration: none;' +
'  }' +
'  #bs_full_inbox a:hover {' +
'  color: #cd3816;' +
'  }' +
'  #bs_full_inbox:before {' +
'  border-style: solid;' +
'  border-width: 15px;' +
'  border-color: transparent transparent #fff;' +
'  bottom: 100%;' +
'  pointer-events: none;' +
'  right: 5px;' +
'  content: "";' +
'  display: block;' +
'  height: 0;' +
'  position: absolute;' +
'  width: 0;' +
'  z-index: 3;' +
'  }' +
'  .bs_inbox_header {' +
'  background: #fff url(http://i.imgur.com/sl0Efuz.png) repeat-x 0 0;' +
'  border-bottom: 1px solid #e0e0e0;' +
'  box-shadow: 0px 1px 6px rgba(0,0,0,0.07);' +
'  border-radius: 3px 3px 0px 0px;' +
'  padding: 10px;' +
'  line-height: 24px;' +
'  }' +
'  .bs_inbox_header .compose {' +
'  font-size: 12px;' +
'  line-height: 28px;' +
'  padding: 0 15px;' +
'  float: right;' +
'  background: #262e33;' +
'  color: #ffffff !important;' +
'  font-weight: 500;' +
'  text-align: center;' +
'  text-decoration: none;' +
'  text-shadow: none;' +
'  white-space: nowrap;' +
'  display: inline-block;' +
'  vertical-align: middle;' +
'  border-radius: 3px;' +
'  border: 1px solid rgba(0,0,0,0.1);' +
'  -webkit-transition: 0.1s all linear;' +
'  -moz-transition: 0.1s all linear;' +
'  -ms-transition: 0.1s all linear;' +
'  -o-transition: 0.1s all linear;' +
'  transition: 0.1s all linear;' +
'  -webkit-user-select: none;' +
'  -moz-user-select: none;' +
'  -ms-user-select: none;' +
'  -o-user-select: none;' +
'  user-select: none;' +
'  -webkit-font-smoothing: antialiased;' +
'  }' +
'  .bs_inbox_header .compose:hover {' +
'  background-image: url(http://i.imgur.com/eaB5FHK.png);' +
'  background-repeat: repeat;' +
'  }' +
'  .bs_inbox_sectionHead {' +
'  font-size: 18px;' +
'  color: #333333;' +
'  line-height: 24px;' +
'  font-weight: 400;' +
'  display: inline-block;' +
'  margin: 0;' +
'  }' +
'  .bs_inbox_inner {' +
'  width: 100%;' +
'  display: table;' +
'  table-layout: auto;' +
'  position: relative;' +
'  border-collapse: separate;' +
'  border-spacing: 0;' +
'  list-style: none;' +
'  padding: 0;' +
'  margin: 0;' +
'  }' +
'  .bs_inbox_li {' +
'  width: 100%;' +
'  position: relative;' +
'  padding: 5px 3px;' +
'  border-width: 0 0 1px 0;' +
'  border-style: solid;' +
'  border-color: #f5f5f5;' +
'  box-sizing: border-box;' +
'  }' +
'  .bs_inbox_li:last-child {border-bottom: 0;}' +
'  .bs_inbox_li strong {font-weight: normal !important;}' +
'  .bs_inbox_item, .bs_user_p {' +
'  display: table-cell;' +
'  padding: 8px 10px;' +
'  }' +
'  .bs_inbox_item {color: #9c9c9c;}' +
'  .bs_inbox_item .topictitle {display: inherit;}' +
'  .bs_inbox_footer {' +
'  background: #fff url(http://i.imgur.com/sl0Efuz.png) repeat-x 0 0;' +
'  text-align: center;' +
'  padding: 10px;' +
'  line-height: 24px;' +
'  border-top: 1px solid #e0e0e0;' +
'  box-shadow: 0px -1px 6px rgba(0,0,0,0.07);' +
'  border-radius: 0px 0px 3px 3px;' +
'  }' +
'  .bs_inbox_photo {' +
'  background: #fff;' +
'  border: 1px solid #fff;' +
'  box-shadow: 0px 0px 0px 1px #e2e2e2;' +
'  padding: 0.5px;' +
'  vertical-align: middle;' +
'  line-height: 1px;' +
'  position: relative;' +
'  border-radius: 150px;' +
'  width: 34px;' +
'  height: 34px;' +
'  }' +
'</style>'
);

// Adicionando elemento ao corpo do fórum
$('body').append('<div id="bs_full_inbox"></div>');
var jInner = '<div class="bs_inbox_header">' +
            '  <a href="/privmsg?mode=post" class="compose" target="_self">Nova Mensagem</a>' +
            '  <h4 class="bs_inbox_sectionHead">Caixa de entrada</h4>' +
            '</div>' +
            '<ol class="bs_inbox_inner">' +
            '  <img src="http://i.imgur.com/DYwSiJf.gif" style="margin: 5px auto;display: block;" />' +
            '</ol>' +
            '<div class="bs_inbox_footer">' +
            '  <a href="/privmsg?folder=inbox">Ir Para Mensagens</a>' +
            '</div>';
var jInbox = $('#bs_full_inbox');
jInbox.append(jInner);

$('#inbox_link').click(function(d) {
  d.preventDefault();

  // Verificando se o elemento é visível
  if(jInbox.css('display') != 'none') {
    jInbox.fadeOut('450');
  } else {
    jInbox.css({
          'right': $(window).width() - ($(this).offset().left + $(this).outerWidth()),
          'top': $(this).offset().top + $(this).outerHeight()
    }).show();
   
    // Carregar conteúdo
    if(!$('.bs_inbox_photo').length) {
        $('.bs_inbox_inner').load('/privmsg?folder=inbox&change_version=punbb .tdtopics:lt(' + jQtd + ')', function() {
            $(this).html(
              $(this).html()
              .replace(/\<\/td\>/g, '</span></div></li>')
              .replace(/\<td class="tcl tdtopics"\>/g, '<li class="bs_inbox_li clearfix"><div class="bs_user_p left"><img class="bs_inbox_photo" alt="photo" src="http://i.imgur.com/n4qY3fc.png" /></div><div class="bs_inbox_item">')
            ).find('span.status').remove();
            $(this).find('a').each(function() {
                var jHref = $(this).attr('href');
                jHref = jHref.split(/(&change|\?change)/g)[0];
                $(this).attr('href', jHref);
            });
            $('.bs_inbox_li').each(function() {
              var jUser = $(this).find('a[href^="/u"]').attr('href');
              var jImg = $(this).find('.bs_inbox_photo');
              var jUserImage = sessionStorage.getItem(jUser);
              if(jUserImage) {
                jImg.attr('src', jUserImage);
              } else {
                $.get(jUser + '?change_version=punbb', function(data) {
                  var jFindImage = $('#profile-advanced-right .main-content img:first', data).attr('src');
                  jImg.attr('src', jFindImage);
                  sessionStorage.setItem(jUser, jFindImage);
                });
              }
            });
        });
    }
  }
});
});
Kyo Panda

Kyo Panda
Hiper Membro

Membro desde : 08/01/2012
Mensagens : 4641
Pontos : 5939

https://ajuda.forumeiros.com

Ir para o topo Ir para baixo

Tópico resolvido Re: Caixa de mensagem privada não aparece

Mensagem por iScroll 27.03.17 15:28

Resultou, mas agora fica em um carregamento infinito...

Veja: https://i.imgur.com/CvVha1p.png

Editado:

Funciona, mas não sei porque na primeira vez não funcionou e depois demorou um pouco para carregar, acho que foi pelo fato do navegador se "adaptar" ao script...
Bom, teria como melhora-lo nessa parte?

Agradecido.


Última edição por iScroll em 27.03.17 15:48, editado 1 vez(es)
iScroll

iScroll
Super Membro

Membro desde : 08/03/2015
Mensagens : 1701
Pontos : 2311

http://ultimatelife.forumeiros.com

Ir para o topo Ir para baixo

Tópico resolvido Re: Caixa de mensagem privada não aparece

Mensagem por Kyo Panda 27.03.17 15:33

Tente fechar as abas do seu navegador e reabri-las:

Caixa de mensagem privada não aparece A5Uomnh

Aqui está normal.
Kyo Panda

Kyo Panda
Hiper Membro

Membro desde : 08/01/2012
Mensagens : 4641
Pontos : 5939

https://ajuda.forumeiros.com

Ir para o topo Ir para baixo

Tópico resolvido Re: Caixa de mensagem privada não aparece

Mensagem por iScroll 27.03.17 15:49

Teria como deixar o Js mais rápido? Se não, não há problemas, agradecido desde já, pode dar como resolvido caso não for possível.
iScroll

iScroll
Super Membro

Membro desde : 08/03/2015
Mensagens : 1701
Pontos : 2311

http://ultimatelife.forumeiros.com

Ir para o topo Ir para baixo

Membro Entusiasta

Tópico resolvido Re: Caixa de mensagem privada não aparece

Mensagem por Luiz 27.03.17 17:21

Não tem como deixar um código mais rápido da forma como o senhor pede.
O único jeito seria refazê-lo em JavaScript puro (sem nenhum tipo de jQuery), o que daria um enorme trabalho, e que além disso, necessitaria a permissão do autor do código, e que não deixaria 100% mais veloz.

O grande problema é a velocidade da internet dos usuários, que pode atrapalhar um pouco (visto que há ajax no código, para pegar as Mp's).
Como conclusão, temos o fato de que o script está perfeitamente funcional.

Até mais. Feliz
Luiz

Luiz
Membro Entusiasta
Membro Entusiasta

Membro desde : 23/04/2016
Mensagens : 6645
Pontos : 7451

https://luizfelipe.dev

Ir para o topo Ir para baixo

Tópico resolvido Re: Caixa de mensagem privada não aparece

Mensagem por iScroll 27.03.17 23:32

Certo, agradecido, pode dar como tópico fechado.
iScroll

iScroll
Super Membro

Membro desde : 08/03/2015
Mensagens : 1701
Pontos : 2311

http://ultimatelife.forumeiros.com

Ir para o topo Ir para baixo

Membro Entusiasta

Tópico resolvido Re: Caixa de mensagem privada não aparece

Mensagem por Luiz 27.03.17 23:40

Caixa de mensagem privada não aparece Symbol10 Questão marcada como Resolvida ou o Autor solicitou que ela fosse arquivada.

Tópico marcado como Resolvido e movido para "Questões resolvidas".
Luiz

Luiz
Membro Entusiasta
Membro Entusiasta

Membro desde : 23/04/2016
Mensagens : 6645
Pontos : 7451

https://luizfelipe.dev

Ir para o topo Ir para baixo

Ver o tópico anterior Ver o tópico seguinte Ir para o topo

- Tópicos semelhantes

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