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 June 22nd 2013, 12: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
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 June 22nd 2013, 4: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
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 June 22nd 2013, 1: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
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 June 22nd 2013, 4:32 pm

Can i have code for phpBB2

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 June 25th 2013, 12:09 am

bump

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 June 25th 2013, 7:04 am

Yeah.. I want that too! :/

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 June 25th 2013, 7:15 am

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 June 25th 2013, 7:33 am

But it's not working!! Sad

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 June 25th 2013, 7:38 am

@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 June 25th 2013, 7:44 am

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
Hyperactive

Male Posts : 2566
Reputation : 344
Language : Romanian, English
Location : Romania | Feel free to tag me into your topic if you have a problem

http://help.forumotion.com/

Back to top Go down

Re: Avatars in Index [PhPBB3]

Post by Scorpi94 on June 25th 2013, 9:29 am

Thanks candy_fear! It's working for me Smile

Good Luck, Akeno1! Hello

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 June 25th 2013, 9:39 am

Work for all only phpBB3 version Smile

levy
Hyperactive

Male Posts : 2566
Reputation : 344
Language : Romanian, English
Location : Romania | Feel free to tag me into your topic if you have a problem

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