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.

Profile field move... again.

View previous topic View next topic Go down

Solved Profile field move... again.

Post by Mimůza on March 29th 2016, 12:12 am

Hello,
It's me again. I'm having some troubles. @Ange Tuteur gave me a great code, not so long ago, which was working fine when I tested it, but now that I would like to use it officially, it is not working.†Of course...

Here is the topic where my problem got solved:†http://help.forumotion.com/t146437-1-profile-field-move?highlight=move

And this is what happens now, when I would like to assign an award to someone's profile.† TT
(The bunny is the award and it stays at the other profile field's places.)





(Reminder, I wanted it up next to the username in the gray row.)





The code I'm using now:
Code:
$(function() {
 †var fieldName = 'Awards', // profile field name
 † †
 † † †a = $('.user-info'), // target elements
 † † †b,
 † † †i = 0,
 † † †j = a.length,
 † † †regex = new RegExp('<span class="label">.*?' + fieldName + '.*?: </span>.*?<br>', 'i');
 
 †for (; i < j; i++) {
 † †if (regex.test(a[i].innerHTML)) {
 † † †// create new element
 † † †b = document.createElement('SPAN');
 † † †b.className = 'posthead-field';
 † † †b.innerHTML = a[i].innerHTML.replace(new RegExp('.*?(<span class="label">.*?' + fieldName + '.*?: </span>.*?)<br>.*'), '$1');
 † †
 † † †a[i].innerHTML = a[i].innerHTML.replace(regex, ''); // remove field from the profile field list
 
 † † †$(a[i]).closest('.post').prev().find('.username').append(b); // add new element to the posthead
 † †}
 †}
});

The profile field:



What did I do wrong again?†Doh
Thanks for all the replies!


Last edited by Mimůza on March 29th 2016, 12:40 am; edited 1 time in total

Mimůza
Forumember

Female Posts : 541
Reputation : 241
Language : :)
Location : @Graphic Balloon

http://www.graphicballoon.com/

Back to top Go down

Solved Re: Profile field move... again.

Post by Genesis on March 29th 2016, 12:16 am

For clarification, you want to move the award profile field to the grey area?

Genesis
Forum Reviewer
Forum Reviewer

Male Posts : 2331
Reputation : 322
Language : English
Location : Forumountain

http://forumpromocean.com

Back to top Go down

Solved Re: Profile field move... again.

Post by Mimůza on March 29th 2016, 12:18 am

Yes. Very Happy

Mimůza
Forumember

Female Posts : 541
Reputation : 241
Language : :)
Location : @Graphic Balloon

http://www.graphicballoon.com/

Back to top Go down

Solved Re: Profile field move... again.

Post by Genesis on March 29th 2016, 12:23 am

Could it possibly because you are not showing the title of the profile field?

Genesis
Forum Reviewer
Forum Reviewer

Male Posts : 2331
Reputation : 322
Language : English
Location : Forumountain

http://forumpromocean.com

Back to top Go down

Solved Re: Profile field move... again.

Post by Ange Tuteur on March 29th 2016, 12:27 am

@Forumedic wrote:Could it possibly because you are not showing the title of the profile field?
^^ This. Try changing the "display type" of the profile field to "text"

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Profile field move... again.

Post by Mimůza on March 29th 2016, 12:40 am

Ooooh!


I should have thought of that! Thank you very much!!††††

Mimůza
Forumember

Female Posts : 541
Reputation : 241
Language : :)
Location : @Graphic Balloon

http://www.graphicballoon.com/

Back to top Go down

Solved Re: Profile field move... again.

Post by SLGray on March 29th 2016, 12:45 am

Topic solved and archived


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


SLGray
Administrator
Administrator

Male Posts : 35661
Reputation : 2375
Language : English
Location : United States

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