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.

adding the profile link ...

Go down

In progress adding the profile link ...

Post by Ahmed.K on May 21st 2014, 10:00 am

I try to add the profile link to the new Avatar system, this code doesn't work, why, any ideas?

$('.tcr').each(function() {
        var src = document.querySelectorAll('.tcr strong a');
        var a = $("<a/>").attr("href", src);
        $(".lastpost-avatar img").wrap(a);
});

Ahmed.K
Forumember

Posts : 349
Reputation : 4
Language : English

Back to top Go down

In progress Re: adding the profile link ...

Post by SLGray on May 21st 2014, 12:07 pm

Are you trying to make the avatars clickable to load the profiles?


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

avatar
SLGray
Administrator
Administrator

Male Posts : 41799
Reputation : 2875
Language : English
Location : United States

https://fmthemes.forumotion.com/

Back to top Go down

In progress Re: adding the profile link ...

Post by Apollo 2.0 on May 21st 2014, 12:14 pm

Try:
Code:
$('.tcr').each(function() {
        var src = document.querySelectorAll('strong a', this);
        $(".lastpost-avatar img", this).wrap('<a href="'+ src +'" />');
});
avatar
Apollo 2.0
Forumember

Male Posts : 54
Reputation : 6
Language : RO-10, EN-3, FR-1
Location : Romania

http://help.forumgratuit.ro/forum

Back to top Go down

In progress Re: adding the profile link ...

Post by Ahmed.K on May 21st 2014, 2:05 pm

@SLGray wrote:Are you trying to make the avatars clickable to load the profiles?
Yes.

InFeRn0 wrote:Try:
Code:
$('.tcr').each(function() {
        var src = document.querySelectorAll('strong a', this);
        $(".lastpost-avatar img", this).wrap('<a href="'+ src +'" />');
});

Doesn't work.

Ahmed.K
Forumember

Posts : 349
Reputation : 4
Language : English

Back to top Go down

In progress Re: adding the profile link ...

Post by Ahmed.K on May 22nd 2014, 8:07 pm

Still no ideas?

Ahmed.K
Forumember

Posts : 349
Reputation : 4
Language : English

Back to top Go down

In progress Re: adding the profile link ...

Post by Ange Tuteur on May 23rd 2014, 4:52 am

Hello Ahmed.K,

Here is a quick example I've written up :

Modules > Javascript codes management > create a new script

Title : your choice
Placement : in all the pages
Paste one of the codes below and submit :

For version PHPBB3 :
Code:
$(document).ready(function(){$('.row .lastpost').each(function(){$(this).find('.lastpost-avatar img').wrap('<a href="'+$(this).find('span strong a').attr('href')+'">')})});

For version PUNBB :
Code:
$(document).ready(function(){$('tr td.tcr').each(function(){$(this).find('.lastpost-avatar img').wrap('<a href="'+$(this).find('span strong a').attr('href')+'">')})});
avatar
Ange Tuteur
Forumaster

Male Posts : 13186
Reputation : 2893
Language : EN10, FR5
Location : Macungie, PA

http://fmdesign.forumotion.com

Back to top Go down

In progress Re: adding the profile link ...

Post by Ahmed.K on May 23rd 2014, 11:26 am

Hi Ange,

There is a technical problem...
I use this code for auto refresh the forum index:
Code:
<script>
jQuery(document).ready(function() {
var refreshId = setInterval(function()
{
jQuery('#forum_index').load('/ #forum_index');
}, 20000);
jQuery.ajaxSetup({ cache: false });
});
</script>

So, the avatar profile-link code works just one time, and then doest work.
Is there any solution to this problem?

Ahmed.K
Forumember

Posts : 349
Reputation : 4
Language : English

Back to top Go down

Back to top


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