Avatars in Index [PhPBB3]

Go down

Avatars in Index [PhPBB3] Empty Avatars in Index [PhPBB3]

Post by Akeno1 on June 22nd 2013, 5:37 am

How do I get Avatars to show in the index next to the latest post.
Example:
http://www.worldduelingacademy.com/

My forum:
http://terribadacademy.forumotion.com/
Akeno1
Akeno1
Forumember

Male Posts : 55
Reputation : 1
Language : English

http://mistvalleyacademy.forumotion.com/

Back to top Go down

Avatars in Index [PhPBB3] Empty Re: Avatars in Index [PhPBB3]

Post by Raykim on June 22nd 2013, 9:22 am

Hello,
Visit: Administration Panel => Modules => HTML & Javascrip => Javascript Codes Management => Create a new code javascript:

Title: Avatar index
Placment: In the home page
Javascript code:
Code:
$(document).on('ready',function(){$('.forumline tr .row3.over').prepend('<div class="avatar-index"><div>');$('.forumline tr .row3.over .avatar-index').each(function(){var profileUser=$(this).parent().children('span').children('span').children('strong').children('a').attr('href');$(this).html('<a href="'+profileUser+'" class="avatar-index-enlace"><img src="http/cdn1.iconfinder.com/data/icons/basicset/user_64.png" alt="No Avatar" /></a>');$(this).children('a').load(profileUser+' .forumline .row1.gensmall[align="center"]:eq(0) img:eq(0)')})});
Visit: Administration Panel => Display => Colors => CSS Stylesheet:

Code:
.avatar-index img {
border: 1px solid #DDD;
height: 50px;
margin: 0 5px;
padding: 1px;
width: 50px;
}
Raykim
Raykim
Forumember

Male Posts : 71
Reputation : 8
Language : Romanian, English, German, Italian
Location : Romania

http://help.forumgratuit.ro/

Back to top Go down

Avatars in Index [PhPBB3] Empty Re: Avatars in Index [PhPBB3]

Post by Akeno1 on June 22nd 2013, 6:56 pm

Kenan wrote:Hello,
Visit: Administration Panel => Modules => HTML & Javascrip => Javascript Codes Management => Create a new code javascript:

Title: Avatar index
Placment: In the home page
Javascript code:
Code:
$(document).on('ready',function(){$('.forumline tr .row3.over').prepend('<div class="avatar-index"><div>');$('.forumline tr .row3.over .avatar-index').each(function(){var profileUser=$(this).parent().children('span').children('span').children('strong').children('a').attr('href');$(this).html('<a href="'+profileUser+'" class="avatar-index-enlace"><img src="http/cdn1.iconfinder.com/data/icons/basicset/user_64.png" alt="No Avatar" /></a>');$(this).children('a').load(profileUser+' .forumline .row1.gensmall[align="center"]:eq(0) img:eq(0)')})});
Visit: Administration Panel => Display => Colors => CSS Stylesheet:

Code:
.avatar-index img {
border: 1px solid #DDD;
height: 50px;
margin: 0 5px;
padding: 1px;
width: 50px;
}
Not working
Akeno1
Akeno1
Forumember

Male Posts : 55
Reputation : 1
Language : English

http://mistvalleyacademy.forumotion.com/

Back to top Go down

Avatars in Index [PhPBB3] Empty Re: Avatars in Index [PhPBB3]

Post by saltarski on June 22nd 2013, 9:32 pm

Can i have code for phpBB2
saltarski
saltarski
Forumember

Male Posts : 126
Reputation : 3
Language : Polish / French / English

Back to top Go down

Avatars in Index [PhPBB3] Empty Re: Avatars in Index [PhPBB3]

Post by Akeno1 on June 25th 2013, 5:09 am

bump
Akeno1
Akeno1
Forumember

Male Posts : 55
Reputation : 1
Language : English

http://mistvalleyacademy.forumotion.com/

Back to top Go down

Avatars in Index [PhPBB3] Empty Re: Avatars in Index [PhPBB3]

Post by Scorpi94 on June 25th 2013, 12:04 pm

Yeah.. I want that too! :/
Scorpi94
Scorpi94
Forumember

Female Posts : 120
Reputation : 2
Language : Bulgarian, English
Location : Bulgaria

http://freddie-mercury.catsboard.com

Back to top Go down

Avatars in Index [PhPBB3] Empty Re: Avatars in Index [PhPBB3]

Post by Guest on June 25th 2013, 12:15 pm

Well kenan helped and thank you kenan for helping a fellow member
avatar
Guest
Guest


Back to top Go down

Avatars in Index [PhPBB3] Empty Re: Avatars in Index [PhPBB3]

Post by Scorpi94 on June 25th 2013, 12:33 pm

But it's not working!! Sad
Scorpi94
Scorpi94
Forumember

Female Posts : 120
Reputation : 2
Language : Bulgarian, English
Location : Bulgaria

http://freddie-mercury.catsboard.com

Back to top Go down

Avatars in Index [PhPBB3] Empty Re: Avatars in Index [PhPBB3]

Post by Guest on June 25th 2013, 12:38 pm

@Scorpi94 wrote:But it's not working!! Sad
1. Is it on the right lines given from kenan?
2. Are you using Phpbb3?
3.if those don't work just search.

Smile
avatar
Guest
Guest


Back to top Go down

Avatars in Index [PhPBB3] Empty Re: Avatars in Index [PhPBB3]

Post by levy on June 25th 2013, 12:44 pm

Administration Panel => Modules => HTML & Javascrip => Javascript Codes Management => Create a new code javascript: Only in index !

Code:
$(function(){
    
        if(!window.localStorage) return;
    
        // Avatar por defecto
        var default_avatar= 'http/illiweb.com/fa/invision/pp-blank-thumb.png';
    
        // Tiempo de cache, aqui 24 h * 60 m * 60 s * 1000 ms entonces un día
        var caching_time= 24*60*60*1000;
    
        // Tiempo de cache de un error, ici 60 s * 1000 ms entonces un minuto
        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);
        };
    
    });

That in your Administration Panel ~> Display ~> Colours ~> CSS

Code:
.mini_ava{
position: relative;
z-index: 9999!important;
margin-left: 99px;
}

.mini_ava img {
width: 34px;
height: 34px;
-webkit-border-radius: 100px;
border-radius: 100px;
position: absolute;
z-index: 9999!important;
margin-top: -3px;
}


I used and in my old forum with phpBB3 and work .
levy
levy
Hyperactive

Male Posts : 2590
Reputation : 346
Language : English, Romanian
Location : Grinding

https://help.forumotion.com/

Back to top Go down

Avatars in Index [PhPBB3] Empty Re: Avatars in Index [PhPBB3]

Post by Scorpi94 on June 25th 2013, 2:29 pm

Thanks candy_fear! It's working for me Smile

Good Luck, Akeno1! Hello
Scorpi94
Scorpi94
Forumember

Female Posts : 120
Reputation : 2
Language : Bulgarian, English
Location : Bulgaria

http://freddie-mercury.catsboard.com

Back to top Go down

Avatars in Index [PhPBB3] Empty Re: Avatars in Index [PhPBB3]

Post by levy on June 25th 2013, 2:39 pm

Work for all only phpBB3 version Smile
levy
levy
Hyperactive

Male Posts : 2590
Reputation : 346
Language : English, Romanian
Location : Grinding

https://help.forumotion.com/

Back to top Go down

Back to top


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