We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
  • Pages:
  • 1
[ C ] Reorder & Relocate Profile Field
Topic Started: Aug 1 2015, 05:39 PM (402 Views)
Tyler Dream
Member Avatar
Member
[ *  *  *  * ]
ZB
URL in profile field
Is it possible to relocate these profile fields to the first box like in this picture:

Posted Image

and then reorder them to this order?

Wizard Name:
Wizard School:
Wizard Level:
Joined:
Posts:

and is it possible to make it to show it next to the profile field instead of under it? and also remove the italic?
Offline Profile Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

Admin CP >> Board Template >> Below the Board
Code:
 
<script type="text/javascript">
var fieldsOrder = ['Wizard Name', 'Wizard School', 'Wizard Level', 'Joined', 'Posts'];

for (var i = 0; i < fieldsOrder.length; i++) {
$('td.c_user').each(function() {
var $this = $(this);
$this.find('dl.user_profile:not([id])').hide().children().appendTo($this.find('dl.user_info:first'));
$this.find('dl.user_info dt:contains(' + fieldsOrder[i] + ')').next().andSelf().appendTo($this.find('dl.user_info'));
});
}
</script>
Just edit the fieldsOrder variable so that the items are in the order that you want the profile fields to be.
Edited by DaPizzaMan, Aug 4 2015, 09:14 PM.
Offline Profile Goto Top
 
Tyler Dream
Member Avatar
Member
[ *  *  *  * ]
Doesn't work. http://thewizardlycommons.com/topic/7426383/1/#new
Offline Profile Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

Try the edited code in my previous post.
Offline Profile Goto Top
 
Tyler Dream
Member Avatar
Member
[ *  *  *  * ]
Nope
Offline Profile Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

Sorry about that. Try it now (the same post).
Offline Profile Goto Top
 
Tyler Dream
Member Avatar
Member
[ *  *  *  * ]
Still nothing. It kind of edited mines but not other members
Offline Profile Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

I accidentally removed something from the code. I edited the code above again.
Offline Profile Goto Top
 
Tyler Dream
Member Avatar
Member
[ *  *  *  * ]
Works better but for me the mood is there and for another member there's the group http://thewizardlycommons.com/topic/7426432/1/#new
It works, just the group and mood are in the way now.
Edited by Tyler Dream, Aug 4 2015, 11:29 PM.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Try this instead:
Code:
 
<script type="text/javascript">
$('dl.user_profile dt').each(function() {
if ($(this).text().indexOf('Wizard Name') !== -1 || $(this).text().indexOf('Wizard School') !== -1 || $(this).text().indexOf('Wizard Level') !== -1) {
$(this).prependTo($(this).parents('td.c_user').find('dl.user_info'));
}

$(this).parents('td.c_user').find('dl.user_info dt:contains(Posts)').next('dd').andSelf().prependTo($(this).parents('td.c_user').find('dl.user_info')).end().parents('td.c_user').find('dl.user_info dt:contains(Joined)').next('dd').andSelf().prependTo($(this).parents('td.c_user').find('dl.user_info')).end().parents('td.c_user').find('dl.user_info dt:contains(Wizard Level)').next('dd').andSelf().prependTo($(this).parents('td.c_user').find('dl.user_info')).end().parents('td.c_user').find('dl.user_info dt:contains(Wizard School)').next('dd').andSelf().prependTo($(this).parents('td.c_user').find('dl.user_info')).end().parents('td.c_user').find('dl.user_info dt:contains(Wizard Name)').next('dd').andSelf().prependTo($(this).parents('td.c_user').find('dl.user_info'));
});
</script>
It's a larger code, but it's less to loop through.
Offline Profile Goto Top
 
Tyler Dream
Member Avatar
Member
[ *  *  *  * ]
Nope http://thewizardlycommons.com/topic/7416364/1/#new
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Can you remove the code real quick so I can test the code in my browsers web console?
Offline Profile Goto Top
 
Tyler Dream
Member Avatar
Member
[ *  *  *  * ]
Just did
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Code:
 
<script type="text/javascript">
function moveField(fName) {
$('td.c_user').each(function() {
$(this).find('dl.user_profile dt:contains(' + fName + ')').next('dd').andSelf().prependTo($(this).find('dl.user_info'));
$(this).find('dl.user_info dt:contains(Posts)').next('dd').andSelf().insertBefore($(this).find('dl.user_info dd.spacer'));
});
}

moveField('Wizard Level');
moveField('Wizard School');
moveField('Wizard Name');
</script>
Try that instead.
Code:
 
.user_info dt:nth-of-type(3), .user_info dd:nth-of-type(3), .user_info dt:nth-of-type(2), .user_info dd:nth-of-type(2) {
display:none;
}
Change that to this:
Code:
 
dl.user_info dt:nth-of-type(4), dl.user_info dd:nth-of-type(4), dl.user_info dt:nth-of-type(5), dl.user_info dd:nth-of-type(5) {
display:none;
}
Offline Profile Goto Top
 
Tyler Dream
Member Avatar
Member
[ *  *  *  * ]
It works now but it added something new called Points? http://thewizardlycommons.com/topic/7426401/1/#new
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · Closed Requests · Next Topic »
Locked Topic
  • Pages:
  • 1