Boas-vindas ao Power Pixel

Junte-se a comunidade! Crie o seu próprio conteúdo, e faça amizades.EntrarCriar uma conta

Avatar no LastPost

5 participantes

Phill Lima Phill Lima  • Seg 3 Mar 2014 - 8:42

Avatar no LastPost Empty Avatar no LastPost Seg 3 Mar 2014 - 8:42

Qual é minha questão:
Olá a todos, vi muitos tópicos mais infelizmente não conseguir resultado com os códigos postado nas dúvidas existentes...

Alguém pode me ajudar?

Endereço do meu fórum:
[Tens de ter uma conta e sessão iniciada para poderes visualizar este link]

Versão:
PunBB

[K]oke [K]oke  • Seg 3 Mar 2014 - 9:19

Avatar no LastPost Empty Re: Avatar no LastPost Seg 3 Mar 2014 - 9:19

Olá,

Qual o código que utilizas atualmente?

Até mais.

Phill Lima Phill Lima  • Seg 3 Mar 2014 - 9:27

Avatar no LastPost Empty Re: Avatar no LastPost Seg 3 Mar 2014 - 9:27

Davisnatsu, eu tentei 3 códigos de 3 tópicos diferentes aqui no fórum, agora estou sem nenhum... qual você aconselha eu colocar para gente testar?

Darknes Darknes  • Seg 3 Mar 2014 - 12:49

Avatar no LastPost Empty Re: Avatar no LastPost Seg 3 Mar 2014 - 12:49

Crie um JS com o seguinte código:

Código:
jQuery(document).ready(function(){if(!window.localStorage)return;var default_avatar='http://2img.net/i/fa/invision/pp-blank-thumb.png';var caching_time=24*60*60*1000;var caching_error=60*1000;var set_avatar=function(id){$('.mini_ava.member'+id).html('<img src="'+get_avatar(id)+'" />')};var get_avatar=function(id){if(localStorage.getItem('t_ava'+id)<+new Date-caching_time||(localStorage.getItem('d_ava'+id)==default_avatar&&localStorage.getItem('t_ava'+id)<+new Date-caching_error)){localStorage.setItem('d_ava'+id,default_avatar);$.get('/u'+id,function(d){localStorage.setItem('t_ava'+id,+new Date);localStorage.setItem('d_ava'+id,$('#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',d).first().attr('src')||default_avatar);set_avatar(id)})}return localStorage.getItem('d_ava'+id)};var to_replace={};$('dd.lastpost strong a.gensmall, .ipbtable tr td:last-child span strong a.gensmall, .table td.tcr strong a.gensmall, .forumline .row3.over strong a.gensmall').each(function(){to_replace[$(this).attr('href').substr(2)]=1;$(this).closest('td,dd').prepend('<div class="mini_ava member'+$(this).attr('href').substr(2)+'"></div>')});for(i in to_replace){set_avatar(i)}});

E em seguida adicione ao teu CSS:

Código:
.mini_ava img {
-moz-box-shadow: 0 2px 2px rgba(0,0,0,0.1);
-webkit-box-shadow: 0 2px 2px rgba(0,0,0,0.1);
background: #fff;
border: 1px solid #D5D5D5;
box-shadow: 0 2px 2px rgba(0,0,0,0.1);
height: 36px;
margin: 0 5px;
padding: 1px;
width: 36px;
}

Resulta?

Até mais! Wink

Phill Lima Phill Lima  • Seg 3 Mar 2014 - 12:55

Avatar no LastPost Empty Re: Avatar no LastPost Seg 3 Mar 2014 - 12:55

Não mudou nada Darknes, nada mesmo...

Darknes Darknes  • Seg 3 Mar 2014 - 13:03

Avatar no LastPost Empty Re: Avatar no LastPost Seg 3 Mar 2014 - 13:03

Poderia me fornecer teu index_box?

Até mais! Wink

Phill Lima Phill Lima  • Seg 3 Mar 2014 - 13:05

Avatar no LastPost Empty Re: Avatar no LastPost Seg 3 Mar 2014 - 13:05

Ta aqui:

Código:
<div class="pun-crumbs">
   <p class="crumbs"><a href="{U_INDEX}">{L_INDEX}</a><strong>{NAV_CAT_DESC}</strong></p>
</div>
<div class="main">
<!-- BEGIN catrow -->
   <!-- BEGIN tablehead -->
      <div class="main-head">
         <div class="page-title">{catrow.tablehead.L_FORUM}</div>
      </div>
      <div class="main-content">
         <table cellspacing="0" class="table">
            <tbody class="statused">
   <!-- END tablehead -->

   <!-- BEGIN forumrow -->
               <tr>
                                                <td class="tc_icon">
                     <span class="status">
                        <img title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" src="{catrow.forumrow.FORUM_FOLDER_IMG}" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" />
                     </span>
                                                </td>
                  <td class="tc_forum" style="padding-right: {catrow.forumrow.INC_LEVEL_RIGHT};">
                                                        <h{catrow.forumrow.LEVEL} class="hierarchy"><a href="{catrow.forumrow.U_VIEWFORUM}" class="forumtitle">{catrow.forumrow.FORUM_NAME}</a></h{catrow.forumrow.LEVEL}>
                     <br />
                     {catrow.forumrow.FORUM_DESC}
                     <!-- BEGIN switch_moderators_links -->
                     <br />
                     {catrow.forumrow.switch_moderators_links.L_MODERATOR}{catrow.forumrow.switch_moderators_links.MODERATORS}
                     <!-- END switch_moderators_links -->
                     {catrow.forumrow.L_LINKS}{catrow.forumrow.LINKS}
                     <strong>{forumrow.L_SUBFORUM_STR}</strong> {forumrow.SUBFORUMS}
                  </td>
                                          <td class="tc3"><strong>{catrow.forumrow.TOPICS}</strong> tópicos<br /><strong>{catrow.forumrow.POSTS}</strong> respostas</td>
                  <td class="tcr">
                     <span>
                     <!-- BEGIN switch_topic_title -->
                     <a href="{catrow.forumrow.U_LATEST_TOPIC}" title="{catrow.forumrow.LATEST_TOPIC_TITLE}">{catrow.forumrow.LATEST_TOPIC_NAME}</a><br />
                     <!-- END switch_topic_title -->
                     {catrow.forumrow.USER_LAST_POST}
                     </span>
                  </td>
               </tr>
   <!-- END forumrow -->

   <!-- BEGIN tablefoot -->
            </tbody>
         </table>
      </div>
   <!-- END tablefoot -->
<!-- END catrow -->
</div>

<!-- BEGIN switch_on_index -->
<div class="main-box clearfix">
   <ul>
      <li><a href="{U_TODAY_ACTIVE}">{L_TODAY_ACTIVE}</a></li>
      <li><a href="{U_TODAY_POSTERS}">{L_TODAY_POSTERS}</a></li>
      <li><a href="{U_OVERALL_POSTERS}">{L_OVERALL_POSTERS}</a></li>
   </ul>
   <!-- BEGIN switch_delete_cookies -->
   <p class="right">
      <a href="{switch_on_index.switch_delete_cookies.U_DELETE_COOKIES}">{switch_on_index.switch_delete_cookies.L_DELETE_COOKIES}</a>
   </p>
   <!-- END switch_delete_cookies -->
</div>
<!-- END switch_on_index -->

vlw

Darknes Darknes  • Seg 3 Mar 2014 - 13:08

Avatar no LastPost Empty Re: Avatar no LastPost Seg 3 Mar 2014 - 13:08

Substitua por esse:

Código:
<div class="pun-crumbs">
 <p class="crumbs"><a href="{U_INDEX}">{L_INDEX}</a><strong>{NAV_CAT_DESC}</strong></p>
</div>
<div class="main">
<!-- BEGIN catrow -->
 <!-- BEGIN tablehead -->
 <div class="main-head">
 <div class="page-title">{catrow.tablehead.L_FORUM}</div>
 </div>
 <div class="main-content">
 <table cellspacing="0" class="table">
 <tbody class="statused">
 <!-- END tablehead -->

 <!-- BEGIN forumrow -->
 <tr>
                                                <td class="tc_icon">
 <span class="status">
 <img title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" src="{catrow.forumrow.FORUM_FOLDER_IMG}" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" />
 </span>
                                                </td>
 <td class="tc_forum" style="padding-right: {catrow.forumrow.INC_LEVEL_RIGHT};">
                                                        <h{catrow.forumrow.LEVEL} class="hierarchy"><a href="{catrow.forumrow.U_VIEWFORUM}" class="forumtitle">{catrow.forumrow.FORUM_NAME}</a></h{catrow.forumrow.LEVEL}>
 <br />
 {catrow.forumrow.FORUM_DESC}
 <!-- BEGIN switch_moderators_links -->
 <br />
 {catrow.forumrow.switch_moderators_links.L_MODERATOR}{catrow.forumrow.switch_moderators_links.MODERATORS}
 <!-- END switch_moderators_links -->
 {catrow.forumrow.L_LINKS}{catrow.forumrow.LINKS}
 <strong>{forumrow.L_SUBFORUM_STR}</strong> {forumrow.SUBFORUMS}
 </td>
                                                                    <td class="tc2"><span class="stats_number">{catrow.forumrow.TOPICS}<img src="http://i74.servimg.com/u/f74/18/12/37/46/stats_10.png" alt="" /></span><span class="stats_text">tópicos</span></td>
                 <td class="tc3"><span class="stats_number">{catrow.forumrow.POSTS}<img src="http://i74.servimg.com/u/f74/18/12/37/46/stats_10.png" alt="" /></span><span class="stats_text">respostas</span></td>
       <td class="tcr">
 <span>
 <!-- BEGIN switch_topic_title -->
 <a href="{catrow.forumrow.U_LATEST_TOPIC}" title="{catrow.forumrow.LATEST_TOPIC_TITLE}">{catrow.forumrow.LATEST_TOPIC_NAME}</a><br />
 <!-- END switch_topic_title -->
 {catrow.forumrow.USER_LAST_POST}
 </span>
 </td>
 </tr>
 <!-- END forumrow -->

 <!-- BEGIN tablefoot -->
 </tbody>
 </table>
 </div>
 <!-- END tablefoot -->
<!-- END catrow -->
</div>

<!-- BEGIN switch_on_index -->
<div class="main-box clearfix">
 <ul>
 <li><a href="{U_TODAY_ACTIVE}">{L_TODAY_ACTIVE}</a></li>
 <li><a href="{U_TODAY_POSTERS}">{L_TODAY_POSTERS}</a></li>
 <li><a href="{U_OVERALL_POSTERS}">{L_OVERALL_POSTERS}</a></li>
 </ul>
 <!-- BEGIN switch_delete_cookies -->
 <p class="right">
 <a href="{switch_on_index.switch_delete_cookies.U_DELETE_COOKIES}">{switch_on_index.switch_delete_cookies.L_DELETE_COOKIES}</a>
 </p>
 <!-- END switch_delete_cookies -->
</div>
<!-- END switch_on_index -->
<style>
  .stats_number {
font-size: 16px;
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
display: block;
text-align: center;
color: #BBB;
position: relative;
overflow: hidden;
}
.stats_number img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 15px;
}
.stats_text {
font-size: 10px;
text-transform: uppercase;
font-family: Arial, Helvetica, sans-serif;
display: block;
text-align: center;
color: #DDD;
}
</style>

Resulta?

Até mais! Wink

Phill Lima Phill Lima  • Seg 3 Mar 2014 - 13:23

Phill Lima Phill Lima  • Seg 3 Mar 2014 - 22:22

Avatar no LastPost Empty Re: Avatar no LastPost Seg 3 Mar 2014 - 22:22

UP

B4N3 B4N3  • Seg 3 Mar 2014 - 23:37

Avatar no LastPost Empty Re: Avatar no LastPost Seg 3 Mar 2014 - 23:37

Javascrip/ em todas as paginas:
Código:
jQuery(document).on('ready', function() {
jQuery('td.tcr').prepend('<div class="avat-miembro"><div>');
jQuery('td.tcr .avat-miembro').each(function () {
var profileUserURL = jQuery(this).parent().children('span').children('strong').children('a').attr('href');
jQuery(this).html('<a href="' + profileUserURL + '" class="avat-miembro-enlace"><img src="http://2img.net/i/fa/invision/pp-blank-thumb.png" alt="No Avatar" /></a>');
jQuery(this).children('a').load(profileUserURL + ' .module:eq(0) img:eq(0)')
});
});

no CSS
Código:
/*avatar no indice*/
.avat-miembro {
float: left;
}
.avat-miembro img {
width: 40px;
height: 40px;
padding: 1px;
margin: 0 5px;
border-radius: 10px
}
/*fim avatar no indice*/

resulta?

Phill Lima Phill Lima  • Seg 3 Mar 2014 - 23:54

Avatar no LastPost Empty Re: Avatar no LastPost Seg 3 Mar 2014 - 23:54

Nada... estou usando o index_box que o Darknes postou por último ai...

olha como está: [Tens de ter uma conta e sessão iniciada para poderes visualizar este link]

Ficou foi com [Tens de ter uma conta e sessão iniciada para poderes visualizar esta imagem]

B4N3 B4N3  • Seg 3 Mar 2014 - 23:58

Avatar no LastPost Empty Re: Avatar no LastPost Seg 3 Mar 2014 - 23:58

para o codigo resultar retire as modificações que outros lhe passaram e teste somente com esse codigo que eu informei.
pois acabei de testar em forum teste e é o mesmo que eu utilizo no meu forum!

Phill Lima Phill Lima  • Ter 4 Mar 2014 - 0:09

Avatar no LastPost Empty Re: Avatar no LastPost Ter 4 Mar 2014 - 0:09

Nada B4n3, pode verificar lá =/

B4N3 B4N3  • Ter 4 Mar 2014 - 0:42

Phill Lima Phill Lima  • Ter 4 Mar 2014 - 0:48

Avatar no LastPost Empty Re: Avatar no LastPost Ter 4 Mar 2014 - 0:48

Mais Bane, não ta...
olha como apareceu no meu:

[Tens de ter uma conta e sessão iniciada para poderes visualizar esta imagem]

Phill Lima Phill Lima  • Qua 5 Mar 2014 - 9:47

Avatar no LastPost Empty Re: Avatar no LastPost Qua 5 Mar 2014 - 9:47

UP

DeeW. DeeW.  • Qua 5 Mar 2014 - 10:17

Avatar no LastPost Empty Re: Avatar no LastPost Qua 5 Mar 2014 - 10:17

Tente esse JS:

Com investimento no índice.
Código:
jQuery(document).ready(function(){if(!window.localStorage)return;var default_avatar='http://2img.net/i/fa/invision/pp-blank-thumb.png';var caching_time=24*60*60*1000;var caching_error=60*1000;var set_avatar=function(id){$('.mini_ava.member'+id).html('<img src="'+get_avatar(id)+'" />')};var get_avatar=function(id){if(localStorage.getItem('t_ava'+id)<+new Date-caching_time||(localStorage.getItem('d_ava'+id)==default_avatar&&localStorage.getItem('t_ava'+id)<+new Date-caching_error)){localStorage.setItem('d_ava'+id,default_avatar);$.get('/u'+id,function(d){localStorage.setItem('t_ava'+id,+new Date);localStorage.setItem('d_ava'+id,$('#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',d).first().attr('src')||default_avatar);set_avatar(id)})}return localStorage.getItem('d_ava'+id)};var to_replace={};$('dd.lastpost strong a.gensmall, .ipbtable tr td:last-child span strong a.gensmall, .table td.tcr strong a.gensmall, .forumline .row3.over strong a.gensmall').each(function(){to_replace[$(this).attr('href').substr(2)]=1;$(this).closest('td,dd').prepend('<div class="mini_ava member'+$(this).attr('href').substr(2)+'"></div>')});for(i in to_replace){set_avatar(i)}});

Funcionou Certinho nos meus testes.

Phill Lima Phill Lima  • Qua 5 Mar 2014 - 10:27

Avatar no LastPost Empty Re: Avatar no LastPost Qua 5 Mar 2014 - 10:27

Showwwwwwwwwwwwwww... nem css eu coloquei...

Só fiz ativar também em sub-forum e nos tópicos...

Vlw David


Tópico Resolvido!

[K]oke [K]oke  • Qua 5 Mar 2014 - 11:09

Avatar no LastPost Empty Re: Avatar no LastPost Qua 5 Mar 2014 - 11:09

[sucesso=Tópico Resolvido; e Bloqueado][/sucesso]Movido para: Arquivo - Pedido de código

Conteúdo patrocinado  • 

Avatar no LastPost Empty Re: Avatar no LastPost

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