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 on the last topic

View previous topic View next topic Go down

Solved Avatars on the last topic

Post by Luffy on November 23rd 2013, 7:15 pm

Hello. I am using these codes for the avatars in the last topic and something is wrong because whenever i put the code in the forum it comes this message that i am trying to load a page too many times and it needs refresh all the times.. Can u tell me if it has something wrong in the code and whats the problem?

CSS:
Code:
.avatar-index { float: left; }
.avatar-index img { width: 40px; height: 40px; padding: 1px; border: 1px solid #DDD; margin: 0 5px; }

Javascript:
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)');
    });
});

these codes i use in forum versions:
phpbb2 & punbb

Thank you!

Luffy
Manager
Manager

Male Posts : 4260
Reputation : 424
Language : Greek, English
Location : Greece

http://helpgr.forumgreek.com/forum

Back to top Go down

Solved Re: Avatars on the last topic

Post by SLGray on November 23rd 2013, 8:17 pm

When you have too many requests on the same page, you will get that message. I believe there is no way to change the code to stop that message.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36751
Reputation : 2449
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Solved Re: Avatars on the last topic

Post by Luffy on November 23rd 2013, 8:39 pm

Look, i was using this code on my ex forum version which was phpbb2 and it was working fine.. But now i am trying to put it again and it shows this message in any page i go! This is my problem. Not only to the forum but anywhere i go it shows this message.. This is why i posted this message here...






Luffy
Manager
Manager

Male Posts : 4260
Reputation : 424
Language : Greek, English
Location : Greece

http://helpgr.forumgreek.com/forum

Back to top Go down

Solved Re: Avatars on the last topic

Post by SLGray on November 23rd 2013, 8:53 pm

So this happens if you are not even on a forum hosted by Forumotion?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36751
Reputation : 2449
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Solved Re: Avatars on the last topic

Post by Luffy on November 23rd 2013, 9:18 pm

Yes and this is why its weird..






Luffy
Manager
Manager

Male Posts : 4260
Reputation : 424
Language : Greek, English
Location : Greece

http://helpgr.forumgreek.com/forum

Back to top Go down

Solved Re: Avatars on the last topic

Post by SLGray on November 23rd 2013, 9:21 pm

Well then it is on your side, not Forumotion, if it is happening everywhere. Try clearing your browser's cache.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36751
Reputation : 2449
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Solved Re: Avatars on the last topic

Post by Luffy on November 23rd 2013, 9:28 pm

I did that but the weird of all is that whenever i put the code this happens.. if i remove the code it doesn't do it..






Luffy
Manager
Manager

Male Posts : 4260
Reputation : 424
Language : Greek, English
Location : Greece

http://helpgr.forumgreek.com/forum

Back to top Go down

Solved Re: Avatars on the last topic

Post by Dark Nexus on November 23rd 2013, 11:39 pm

If you're not using Forumotion you'd probably be better off asking on a site like Stack Overflow.

Dark Nexus
New Member

Male Posts : 1
Reputation : 0
Language : English

Back to top Go down

Solved Re: Avatars on the last topic

Post by Ange Tuteur on November 24th 2013, 3:11 am

In that code you're using the AJAX .load() function. It doesn't look like it caches the loaded data either.

Depending on how many forums you have that this icon is being applied to, you're sending many requests to load a users avatar each time you're on the index. If you keep going over your request limit, I highly suggest you remove that code.

On the French support there is a tuto which caches the data so it only has to load on your first visit.

Please try this tuto: Avatar of who posted last on the forum index

You don't have to use it, it is only a suggestion.

Ange Tuteur
Forumaster

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

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Avatars on the last topic

Post by Luffy on November 24th 2013, 4:03 am

At first, i am the founder of one forum and on the other one i am just an admin/helper. This is weird because when i had this on my ex-version (phpbb2) worked fine but now it doesn't. Is it possible, because the forum has a lot of categories to load these icons to show this message?

For the link you showed me this will work on both versions? Phpbb2 & Punbb?






Luffy
Manager
Manager

Male Posts : 4260
Reputation : 424
Language : Greek, English
Location : Greece

http://helpgr.forumgreek.com/forum

Back to top Go down

Solved Re: Avatars on the last topic

Post by Ange Tuteur on November 24th 2013, 4:27 am

Depending on how many "Last posts" are show on the index, if a lot, the amount of load functions would no doubt take a toll on your requests.

The link I provided works on all versions from what I tested.

Ange Tuteur
Forumaster

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

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Avatars on the last topic

Post by Luffy on November 24th 2013, 4:28 am

ok solved.. i will post one more and bedtime!!

Topic can close!






Luffy
Manager
Manager

Male Posts : 4260
Reputation : 424
Language : Greek, English
Location : Greece

http://helpgr.forumgreek.com/forum

Back to top Go down

Solved Re: Avatars on the last topic

Post by Ange Tuteur on November 24th 2013, 4:30 am

Topic Solved and Archived

Unarchived at authors request

Ange Tuteur
Forumaster

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

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Avatars on the last topic

Post by Luffy on November 24th 2013, 5:01 pm

Hello once again and thank you for opening this again.

The codes i provided at the first topic don't work on punbb. why is that?

i just realized that!! lol






Luffy
Manager
Manager

Male Posts : 4260
Reputation : 424
Language : Greek, English
Location : Greece

http://helpgr.forumgreek.com/forum

Back to top Go down

Solved Re: Avatars on the last topic

Post by Ange Tuteur on November 24th 2013, 5:18 pm

The selectors would need to be changed over to the ones used in punbb.

Here its is:
Code:
$(document).on('ready', function() {
        $('.statused td.tcr').prepend('<div class="avatar-index"><div>');
        $('.statused td.tcr .avatar-index').each(function () {
            var profileUser = $(this).parent().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 + '#profile-advanced-right .main-content.clearfix.center img:eq(0)');
        });
    });

Ange Tuteur
Forumaster

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

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Avatars on the last topic

Post by Luffy on November 24th 2013, 5:24 pm

Its appears that it shows it to the homepage but it doesnt show the image of the avatar...

forum: http://informationforum.forumgreek.com






Luffy
Manager
Manager

Male Posts : 4260
Reputation : 424
Language : Greek, English
Location : Greece

http://helpgr.forumgreek.com/forum

Back to top Go down

Solved Re: Avatars on the last topic

Post by Ange Tuteur on November 24th 2013, 5:28 pm

Your forum has a bit things different on it from default punbb, try this:
Code:
    $(document).on('ready', function() {
            $('.statused td.tcr').prepend('<div class="avatar-index"><div>');
            $('.statused td.tcr .avatar-index').each(function () {
                var profileUser = $(this).parent().children('span').children('center').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 + '#profile-advanced-right .main-content.clearfix.center img:eq(0)');
            });
        });

Ange Tuteur
Forumaster

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

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Avatars on the last topic

Post by Luffy on November 24th 2013, 5:31 pm

You are the best!!!!!! I wish you all the thanks i can get from the universe!!!

Thanks, thanks, thanks, thanks!!!!!! :wouhou::wouhou:


SOLVED!!!






Luffy
Manager
Manager

Male Posts : 4260
Reputation : 424
Language : Greek, English
Location : Greece

http://helpgr.forumgreek.com/forum

Back to top Go down

Solved Re: Avatars on the last topic

Post by Ange Tuteur on November 24th 2013, 5:33 pm

You're welcome ^^ I love you

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