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.

1 profile field move

View previous topic View next topic Go down

Solved 1 profile field move

Post by Mimóza on March 17th 2016, 12:07 pm

Hello,
I'm having a question. Very Happy  Would it be possible to move a certain profile field away from its place?
I'd like everything to remain in the black part, except 1 new field that would go up to the gray line next to the user name. Can it be done? If so, could anyone help me, please? Very Happy




Link: http://www.graphicballoon.com/     punbb

Thank you! Very Happy


Last edited by Mimóza on March 17th 2016, 7:02 pm; edited 1 time in total

Mimóza
Forumember

Female Posts : 566
Reputation : 243
Language : •ᴗ•
Location : Hungary

http://dianagyms.deviantart.com/gallery/

Back to top Go down

Solved Re: 1 profile field move

Post by Ange Tuteur on March 17th 2016, 2:32 pm

Yes that should be possible. You'd have to use a bit of JavaScript to trim the profile field from the list and add it to a new node. Try adding the following script in the topics :
Code:
$(function() {
  var fieldName = 'Posts', // 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
    }
  }
});

At the top of the script is a variable entitled "fieldName" place the name of the field that you want placed on the posthead. FYI the new field that's created is given the class ".posthead-field" if you want to write any CSS rules for it.

If any problems let me know.

Ange Tuteur
Forumaster

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

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: 1 profile field move

Post by Mimóza on March 17th 2016, 7:01 pm

Omg, you can make everything real! *-* Thank you sooo much! ůů

Mimóza
Forumember

Female Posts : 566
Reputation : 243
Language : •ᴗ•
Location : Hungary

http://dianagyms.deviantart.com/gallery/

Back to top Go down

Solved Re: 1 profile field move

Post by SLGray on March 17th 2016, 7:36 pm

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 : 36691
Reputation : 2445
Language : English
Location : United States

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