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 in last post

View previous topic View next topic Go down

Solved avatar in last post

Post by mist3r0us_b0y on November 27th 2013, 12:46 pm

avatar in last post showing in some categories only not in all why ?

any help ?

thanks

mist3r0us_b0y
Forumember

Male Posts : 747
Reputation : 19
Language : english

http://sh.st/nJRXG

Back to top Go down

Solved Re: avatar in last post

Post by Ange Tuteur on November 27th 2013, 12:55 pm

Hello mist3r0us_b0y,

Do the categories that are not showing the avatar have any topics which received replies?

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: avatar in last post

Post by mist3r0us_b0y on November 27th 2013, 1:04 pm

yup all categories got bunch of topics only the 1st category got avatar below to it none why so ?

mist3r0us_b0y
Forumember

Male Posts : 747
Reputation : 19
Language : english

http://sh.st/nJRXG

Back to top Go down

Solved Re: avatar in last post

Post by Ange Tuteur on November 27th 2013, 1:10 pm

Could you post the code you're using, or a link to your forum?

Thanks I love you

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: avatar in last post

Post by mist3r0us_b0y on November 27th 2013, 1:13 pm

Javascript:
Code:
Code:
$(document).ready(function () {
$('.statused .tcr').each(function(e) {
var l = this.getElementsByTagName('strong')[0].firstChild.href;
$(this).prepend('<span class="avatar-index" id="avatar-index'+e+'"></span>');
$('#avatar-index'+e).load(l+' .module .main-content.clearfix.center:eq(0) img:eq(0)');
});
});;

CSS:
Code:
Code:
.avatar-index { 
float: left; 
}
.avatar-index img { 
width: 35px; 
height: 35px; 
}

mist3r0us_b0y
Forumember

Male Posts : 747
Reputation : 19
Language : english

http://sh.st/nJRXG

Back to top Go down

Solved Re: avatar in last post

Post by Ange Tuteur on November 27th 2013, 1:18 pm

Its showing fine for me, do you have anything on your index which could be conflicting with it?

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: avatar in last post

Post by mist3r0us_b0y on November 27th 2013, 1:25 pm

www.gmail.com have a look please


Last edited by mist3r0us_b0y on November 27th 2013, 1:34 pm; edited 1 time in total

mist3r0us_b0y
Forumember

Male Posts : 747
Reputation : 19
Language : english

http://sh.st/nJRXG

Back to top Go down

Solved Re: avatar in last post

Post by Ange Tuteur on November 27th 2013, 1:30 pm

I don't see the avatars at all.

Have you tried this one instead?:

Script:
Code:
$(function(){
        if(!window.localStorage) return;
        // Avatar par défaut
        var default_avatar= 'http://illiweb.com/fa/invision/pp-blank-thumb.png';
        // Temps de cache, ici 24 h * 60 m * 60 s * 1000 ms donc un jour
        var caching_time= 24*60*60*1000;
        // Temps de cache d'une erreur, ici 60 s * 1000 ms donc une 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);
        };
        });
CSS:
Code:
.mini_ava{
float:left;
}
.mini_ava img{
width:40px;
height:40px;
margin-right:8px;
margin-left:8px;
}

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: avatar in last post

Post by mist3r0us_b0y on November 27th 2013, 1:33 pm

ok your code works perfect thumright 

thanks 

solved can lock the topic now

mist3r0us_b0y
Forumember

Male Posts : 747
Reputation : 19
Language : english

http://sh.st/nJRXG

Back to top Go down

Solved Re: avatar in last post

Post by Ange Tuteur on November 27th 2013, 1:36 pm

You're welcome I love you

If you need more room in last topic use this:
Code:
.pun table .tcr{
width:210px;
}
And if an old avatar is displayed simply clear your cache thumright

Topic Solved and Archived

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
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