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.
Tags:
Permalink Reply by Pam Suggs on June 15, 2012 at 1:32am "McAfee wants "verification file in the root Web directory of your site, using the exact file name listed above." Can anyone help?"
Permalink Reply by Chloe Prince on September 18, 2012 at 6:44pm +1
This has to be nominated among one of the BEST tips on NC!! WOW !! Works perfect.
There are tips that make life a little better, a little brighter... and then there are those ones that bust down the doors, and changes the game! This is one of those MUST haves!!! THANK YOU!
PS: NING - Can you please make this a BASIC feature for NC's to be able to set the default profile and "LOCK IN" the modules so users can't change the locations from where the NC wants them?
Also, for those of us that HIDE module headers - by doing so, removes the "EDIT" button on the module's header to be able to change the AMOUNT of Comments and Latest Activity posts to display in the module on a users profile. Once I hide the header, users can't change the default amount. I don't like those headers - they take up too much room and make my page look like a fenced in ghetto! Can we please move that Edit feature of the module header and put them somewhere else for those of use that like to hide them?
Permalink Reply by Erik Woods on February 7, 2013 at 11:23am I am glad that it helped. Thanks for letting me know - I appreciate it. :)
Permalink Reply by Vera Hendriks on February 6, 2013 at 8:32am Thanks a million for your sharing the code! Added it to all the networks we currently run!
Permalink Reply by Erik Woods on February 7, 2013 at 11:22am I am glad that it helped. Thanks for letting me know - I appreciate it. :)
Permalink Reply by Andrew Claridge on February 11, 2013 at 2:36pm Hi Erik,
Great tip thank you so much and it worked wonderfully for me in Safari on mac but for some reason won't work in Internet explorer 8 or 9 on Windows 7. Do you have any tips that might help in getting this to work that I could add to custom code. The site is www.bureauofmagic.com I'm no expert and flying solo, would appreciate any tips you could give.
Cheers
Permalink Reply by Erik Woods on February 14, 2013 at 9:53pm Andrew,
I looked at the code on your site and it looks like you have some of my code commented out. You have to be sure to keep the line breaks where I have them in the code shown above, or else you may accidentally comment out the main part that makes it function properly. I would be surprised if my script is working in ANY browser, as it is right now.
Permalink Reply by Andrew Claridge on February 16, 2013 at 3:25pm Hi Erik,
Thanks so much for your reply, I'll give it a go.
Cheers
Permalink Reply by Chloe Prince on February 16, 2013 at 4:09pm I have found one flaw in this code - but even so, its still my favorit code of all time on NING creators.
The flaw is: If your users have been allowed to customize their profiles, for example, they have moved their GIFT module to the left hand column, NING resizes these icons to fit the left column. However, if you use this code, and force the gift module to be in the middle right column, NING still thinks these icons are in the left, and the size of the icons and padding of the module is incorrect. This can be an issue, for some.
My website has 6000 users. I used this code to wrangle in their profiles to look uniform. It works awesome. However, every so often I get a user that complains about the spacing or sizing of their ICONS for their friends list, gifts, etc, and the way I fix it is, to temporarily disable the code, allow the user to go in and set the modules to be where I am forcing them to be, and then re-enable the code and then everything looks correct for that profile.
This is not a problem for new networks with no users yet, or very little users, or networks that didn't let their users customize their profiles before.
Still, a great job and I'll say it again - A BIG THANK to Erik!
Permalink Reply by Erik Woods on February 16, 2013 at 8:24pm Chloe,
Thanks so much for your detailed report! If I get a chance, I will look into a solution for your problem.
The thing with writing custom code for a platform like Ning is... things can change. Quickly. I wrote this bit of code almost a whole year ago, and there's a very big chance that Ning has changed something which I have no control over but use for my script. For instance: if Ning decides to change one of the class names used for one of the modules on the profile page, the script won't work for that module.
There is also a strong possibility that I simply never ran into your situation because I had not realized that such a thing could happen as you have described.
There is also a chance that you have CSS applying styles to certain areas or something based on class names which, when we move things around with my script, lose their styles or something.
Nevertheless, if I get the time, I will investigate a fix. It doesn't sound like it's too crazy.
Permalink Reply by Alessandro Sporleder on February 26, 2013 at 6:08pm The same happens to MY GROUPS module in the profile pages, it is resized from a column to another. It would be perfect for my network if I could set the MY GROUPS module of all profile pages resized to the biggest column.
Still a great tip and I applied it to my network Thanks Erik for sharing it.
Riccardo Rossini replied to Riccardo Rossini's discussion 'problem in redirecting NING 3.0'
Mandy P. replied to Mandy P.'s discussion 'Remove unwanted space-Header'
Aaron replied to Aaron's discussion 'Ning Spring Cleaning Begins This Week'


Fire-Tech replied to Jen's discussion 'Jen's Running List - Updated 4/6/2013' in the group The Sandbox
Kos replied to Kos's discussion '3.0 My Thoughts From A Non-Coder (edited 5/20/13)' in the group The Sandbox© 2013 Created by Ning.
