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.

Avatar doesnt change at last reply

View previous topic View next topic Go down

Solved Avatar doesnt change at last reply

Post by J0k3R^ on November 17th 2014, 11:08 am

Hi, i have changed my avatar but it doesnt update at last reply icon. Not even when i make new topics doesnt update.
Forum: PunBB (its not fmplanet.forumgreek.com!)




Codes using:

Code:
$(function(){
        
          if(!window.localStorage) return;
        
          // Avatar by default
            var default_avatar= 'http://illiweb.com/fa/invision/pp-blank-thumb.png';
        
          // Time of cache, here : 24hrs * 60m * 60s * 1000ms so one day
            var caching_time= 24*60*60*1000;
        
          // Time of cache in case of error, here : 60s * 1000ms so one minute
            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);
            };
        
      });

Code:
.mini_ava{
float:left;
}
.mini_ava img{
width:30px;
height:30px;
margin: 7px 7px;
  padding: 1px;
border: 1px solid #B1B1B1;
  border-radius:2px;
}

J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: Avatar doesnt change at last reply

Post by Ange Tuteur on November 17th 2014, 11:14 am

Hello J0k3R^,

With that script the avatars are cached for 24h, so you will either have to clear your cache or wait for it to expire.

Also, have you tried this ?
http://help.forumotion.com/t133214-new-option-show-avatars-in-the-column-last-posts

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Avatar doesnt change at last reply

Post by J0k3R^ on November 17th 2014, 11:18 am

i changed my forum url and it upgraded xD
solved

J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: Avatar doesnt change at last reply

Post by Ange Tuteur on November 17th 2014, 11:33 am

Topic archived

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


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