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.

Avatars in Index [PhPBB3]

View previous topic View next topic Go down

Avatars in Index [PhPBB3]

Post by Akeno1 on Sat 22 Jun - 6:37

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/
avatar
Akeno1
Forumember

Male Posts : 55
Reputation : 1
Language : English

http://mistvalleyacademy.forumotion.com/

Back to top Go down

Re: Avatars in Index [PhPBB3]

Post by Raykim on Sat 22 Jun - 10:22

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;
}
avatar
Raykim
Forumember

Male Posts : 57
Reputation : 7
Language : Romanian, English, German, French, Italian, Hungarian
Location : Romania

http://help.forumgratuit.ro/

Back to top Go down

Re: Avatars in Index [PhPBB3]

Post by Akeno1 on Sat 22 Jun - 19:56

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
avatar
Akeno1
Forumember

Male Posts : 55
Reputation : 1
Language : English

http://mistvalleyacademy.forumotion.com/

Back to top Go down

Re: Avatars in Index [PhPBB3]

Post by saltarski on Sat 22 Jun - 22:32

Can i have code for phpBB2
avatar
saltarski
Forumember

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

Back to top Go down

Re: Avatars in Index [PhPBB3]

Post by Akeno1 on Tue 25 Jun - 6:09

bump
avatar
Akeno1
Forumember

Male Posts : 55
Reputation : 1
Language : English

http://mistvalleyacademy.forumotion.com/

Back to top Go down

Re: Avatars in Index [PhPBB3]

Post by Scorpi94 on Tue 25 Jun - 13:04

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

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

http://the-beatles.bulgarianforum.net

Back to top Go down

Re: Avatars in Index [PhPBB3]

Post by Guest on Tue 25 Jun - 13:15

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

Guest
Guest


Back to top Go down

Re: Avatars in Index [PhPBB3]

Post by Scorpi94 on Tue 25 Jun - 13:33

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

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

http://the-beatles.bulgarianforum.net

Back to top Go down

Re: Avatars in Index [PhPBB3]

Post by Guest on Tue 25 Jun - 13:38

@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

Guest
Guest


Back to top Go down

Re: Avatars in Index [PhPBB3]

Post by levy on Tue 25 Jun - 13:44

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 .
avatar
levy
Hyperactive

Male Posts : 2585
Reputation : 345
Language : Romanian, English
Location : criticize artwork, not people!

http://help.forumotion.com/

Back to top Go down

Re: Avatars in Index [PhPBB3]

Post by Scorpi94 on Tue 25 Jun - 15:29

Thanks candy_fear! It's working for me Smile

Good Luck, Akeno1! Hello
avatar
Scorpi94
Forumember

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

http://the-beatles.bulgarianforum.net

Back to top Go down

Re: Avatars in Index [PhPBB3]

Post by levy on Tue 25 Jun - 15:39

Work for all only phpBB3 version Smile
avatar
levy
Hyperactive

Male Posts : 2585
Reputation : 345
Language : Romanian, English
Location : criticize artwork, not people!

http://help.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