Updated 5/3/12: Refined member profile options (custom sorting and placement, hiding, etc)

What does it do?
You can hide, sort, or move modules between the left and right columns of all member profile pages. This script disables the user's ability to move modules around on their own, because you will have complete control on where they show up! This script is the answer to the features requested by several people.

Notes:
   *  This script has three lists. The first is a list of modules to hide, the second is a list of modules for the left column, and the third is a list of modules for the right column.
   *  You can move any module to the left column or the right column. It might look weird to put something like Photos into the left column, but it does work! Just move the module you want (the whole line) to the appropriate list.
   *  The options for each column will be listed IN ORDER. If you put Photos at the top of the list of modules for the right column, it will show at the top of the page in that column.
   *  You cannot have multiple modules in multiple lists. You should only have each module in only one list. You cannot place Photos in the "hide" list as well as the "right" list.
   *  The value in green is the text which will show up by default for the headline of the "Text Box." If you don't want to use this feature, remove this whole line and it will be ignored. Just note that it won't work with multilingual sites.
   *  This goes in your Custom Code box. Not in Developer Mode or CSS areas.
   *  It is wise to place this script at the bottom of all your custom code (outside of all other script tags, as well), just in case you have other things modifying the modules on this page.

<script>(function($){if(window.location.href.indexOf('/profile/')>0){
// REFINED MEMBER PROFILE OPTIONS v1.5 by erikwoods.com
// USAGE GUIDE: http://bit.ly/refinedprofileoptions

// FORCED HEADLINE FOR TEXT BOX
var forceHeadlineForTextBox = 'About Me';

// MODULES TO HIDE
var modulesToHide = new Array(
    '.module_feed', // RSS
    '.xg_module_comment_wall', // Comment Wall
'');

// MODULES (IN ORDER) FOR LEFT COLUMN
var modulesLeftCol = new Array(
    '.module_members', // Friends
    '.module_groups', // Groups
    '.module_forum', // Discussions
    '.module_gift', // Gifts
'');

// MODULES (IN ORDER) FOR RIGHT COLUMN
var modulesRightCol = new Array(
    '.xg_module_activity', // Latest Activity
    '.module_about_user', // Profile Information/Questions
    '.module_text', // Text Box
    '.module_blog', // Blog
    '.module_photo', // Photos
    '.module_video', // Videos
'');

// DO NOT EDIT BELOW THIS LINE
var moduleSelector = $('#xg_layout_column_1 div, #xg_layout_column_2 div');if (typeof forceHeadlineForTextBox !== 'undefined') {if ($('#xg_layout_column_2 .module_text h2').length) {$('#xg_layout_column_2 .module_text h2').html(forceHeadlineForTextBox);}else {$('#xg_layout_column_2 .module_text').prepend('<div class="xg_module_head"><h2>'+forceHeadlineForTextBox+'</h2></div>');$('#xg_layout_column_2 .module_text .xg_module_body').removeClass('nopad');} }$.each(modulesToHide,function(i){$(moduleSelector).filter(modulesToHide[i]).remove();});$.each(modulesLeftCol,function(i){$(moduleSelector).filter(modulesLeftCol[i]).appendTo('#xg_layout_column_1');});$.each(modulesRightCol,function(i){$(moduleSelector).filter(modulesRightCol[i]).appendTo('#xg_layout_column_2');});if($('.draggable, .movable, .sortable').length){$('*').removeClass('draggable, movable, sortable');$('.xg_handle').remove();}
}})(jQuery);</script>

Enjoy, and please let me know if you have any issues or additional features you'd like to see added.

Views: 1913

Reply to This

Replies to This Discussion

Dr. Trocar,

The Developer Mode and the Custom Code box are two different things. To get to the Custom Code box you must go into your Dashboard, scroll down to the Tools section. The Custom Code link is in that section, I think the 5th link down. 

Developer Mode is a powerful tool, but I do not use it because it takes away your members ability to customize their profile pages. 

I would agree with this. Members should have complete control of their pages. Seems like a good way to drive people off. j/s

Thank you VERY much for this.  I have not tried it yet, but I've been hoping for a long time for this solution. 

Most of all, I'd like to change the position of the "Text box" to go to the top of the page (instead of having the activity there.)  Is there a possible solution for that as well?

Elizabeth,
The code has been updated to include sorting options (at your request), in addition to options for moving any module to either the left or right column.

Let me know how this works for you.

I don't see anything missing, but I will check and let you know if I find anything. 

Below is some custom code that forces the profile questions module to the top of all member profile pages. It may or may not be useful to you if you try to take this further and force several modules at the top in a particular order. 

<script type="text/javascript">
if (x$(".xg_widget_profiles_profile_show").length > 0){
x$('.module_about_user').appendTo(x$('#xg_layout_column_2 .xg_headline'));
}
</script>

If the network option is set to allow members to move profile modules, then they could override this "profile questions module at the top" code. 

I cut and pasted code and left everything set how you have it but seen no changes to order, forced headers etc...

I have isolated this code as the problem NOT YOURS but is conflicting somehow..

<script type="text/javascript">x$(".xg_widget_photo_photo_newWithUploader .bulkupload a,.xg_widget_video_video_newWithUploader .bulkupload a, .xg_widget_photo_photo_new .xg_1col .simpleupload a, .xg_widget_video_video_new .xg_1col .simpleupload a").text('Click to View');var addByPhoneText = x$("a#xg_profiles_settings_email_show").text();

if (typeof addByPhoneText != 'undefined') {

addByPhoneText = addByPhoneText.replace(location.hostname.replace("www.", ""), ning.CurrentApp.id+'.ning.com');

x$("a#xg_profiles_settings_email_show").text(addByPhoneText);

x$("a#xg_profiles_settings_email_show").attr('href', 'mailto:'+addByPhoneText);

}

see anything in there that would block your script.?

Thanks..

Ascot,

EDIT: I see that you don't have the other code in there right now because of the conflicts, eh? Well... the reason why it might not work is because it uses classes to specify which column to go in to and stuff..... you might want to put my script at the bottom of all other scripts. That way, any other scripts that modify any modules will be changed before they are moved or removed. Does this help?

Does this Help? you knew the answer before you posted.......

YES SIR.. lol

thanks

Fantastic. Hope it works well for you. PM me if you see any issues or have any suggestions.

I had to jump in and say, impressive stuff! =)

Thank you very much, Jen.

RSS

What's Up With Ning 3.0?

Click here to share your thoughts on what features we should develop next! - Survey will close Friday, 4/25

Projects that the Ning 3.0 Team is currently working on: 

Articles - a new way of organizing longer content pieces. Released 4/16.

Activity Feed Updates - options for more content in the activity feed.

Forum Notifications - ability for members to opt into receiving notifications of new discussions in forums. Released 4/9. 

APIs - The ability to create new members and content programatically.

For more information on what's next, visit the Product Roadmap

Latest Activity

Lorenzo M. Oliver replied to Crystal Coleman's discussion 'The Return of Network Creator Blogs on Creators 3.0'
"I just do it, in spanish. Thanks! "
1 hour ago
Lorenzo M. Oliver replied to ComunidadFCB.com's discussion 'No me deja dar de baja mi comunidad (Cancelarla)' in the group Ning Networks en español
"Lamento que cierres esa estupenda red... "
2 hours ago
Lorenzo M. Oliver replied to Lorenzo M. Oliver's discussion '[NING 3.0 EMIGRACIÓN] PROCESO' in the group Ning Networks en español
"Ni idea... "
2 hours ago

NC for Hire
SweetPotato replied to SweetPotato's discussion 'Ning 3.0 Tip: Insert Videos and Music Players on Profile Pages'
"My pleasure Elena. SP"
2 hours ago

NC for Hire
SweetPotato replied to soaringeagle's discussion 'fb style tagging and notification'
"+1 Buddypress has this in Twitter form, I.e you @memtiom someone by username. Fire-Tech you might…"
2 hours ago
Thiago Santos de Moraes replied to Scott Bishop's discussion 'Better Captcha'
"I liked! Simple and innovative."
2 hours ago
TJ @ jQueryHelp replied to Alexander's discussion 'Goodbye for now.'
"Hi Alex, I wish you all the best with your new network.  Maybe we'll see you again in the…"
3 hours ago
Dustin Craig replied to Enrrico Torres's discussion 'Want to remove powered by from footer'
"Is there a way to change the copyright info without changing the network name. Our network is built…"
7 hours ago

© 2014   Created by Ning.

Badges  |  Report an Issue  |  Terms of Service