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 ...

View previous topic View next topic Go down

In progress adding the profile link ...

Post by Ahmed.K on Wed 21 May - 11:00

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 Wed 21 May - 13:07

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 : 40875
Reputation : 2775
Language : English
Location : United States

https://fmthemes.forumotion.com/

Back to top Go down

In progress Re: adding the profile link ...

Post by SSYT on Wed 21 May - 13:14

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

Male Posts : 48
Reputation : 3
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 Wed 21 May - 15:05

@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 Thu 22 May - 21:07

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 Fri 23 May - 5:52

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 : 13176
Reputation : 2881
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 Fri 23 May - 12:26

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

View previous topic View next topic Back to top


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