Support Forum

Can the Member page be modded?

1 2 >
Thorsten B
Member
Aug 3, 2017 - 10:08 am

This one's a "would be nice to" but understand if it's not possible.

In an effort to enhance the forum for our students I was wondering if we can replace columns on the Member page, specifically "Registered" and "Last Visited":

Capture-1.PNGImage Enlarger

 

I'd like to have "Location" as well as a custom profile field I created included instead. Would that be possible?

Mr Papa
Simi Valley, CA
Member
Free Members
Aug 3, 2017 - 10:43 pm

the members page is controlled by page template like any other page view...  you can adjust the page as you like by editing the members page template in the sp theme  you are using... as always we suggest a child theme or a custom theme before editing it...

by adding display functions, or just simply grabbing wp/sp data and outputting, you can custom what is shown...

Thorsten B
Member
Aug 4, 2017 - 3:22 am

I've read the through the codex again, which is a great resource for WP programmers, but alas I am not a WP programmer (my forte is data science, R, Python etc.), I can't spend a lot of time trying to read myself into it all for a minor change.

I tried adding sp_ProfileShowLocation('', __sp('Location')); to spMembersView.php (custom theme), but it shows up blank. Same for adding sp_CustomProfileFieldsDisplay('Blog Category', $spProfileUser->ID);.

Mr Papa
Simi Valley, CA
Member
Free Members
Aug 4, 2017 - 9:20 am

well, you cant use a profile show type function because those are designed for profile view, so the $spProfileUser user object wont be set up...  the user object that will exist here is $spThisMember... 

and then get the data via $spThisMember->location I believe... I think that will exist for your first example...

and then the second, use spThisMember->ID...

Thorsten B
Member
Aug 4, 2017 - 1:19 pm

Got it, thank you so much. I have the custom profile field displaying now and properly formatted.

However, when I do echo $spThisMember->location; it comes up blank. Other options work fine, i.e. echo $spThisMember->lastvisit; displays the last visit date for each member. Attaching screenshots again:

Capture-2.PNGImage Enlarger

 

Capture2.PNGImage Enlarger

Mr Papa
Simi Valley, CA
Member
Free Members
Aug 4, 2017 - 8:16 pm

are you sure they have a location defined in their profile?

if so, its possible the user object for members view is not a full user object... but you can always fill it with the data... before using, try adding this:

$spProfileUser->location = get_user_meta($spProfileUser->ID, 'location', true);

then you should have it available...

Thorsten B
Member
Aug 5, 2017 - 3:57 am

Yes, several students and all the admins have location defined on their profile.

This worked now:

echo $spThisMember->location = get_user_meta($spThisMember->ID, 'location', true);

Thank you again for the help, much appreciated.

Mr Papa
Simi Valley, CA
Member
Free Members
Aug 5, 2017 - 9:46 am

you can optimize that a bit to be:

echo get_user_meta($spThisMember->ID, 'location', true);
Thorsten B
Member
Aug 5, 2017 - 9:52 am

Ah ok, thank you so much. Now we have a much more useful member page. Appreciated.

Mr Papa
Simi Valley, CA
Member
Free Members
Aug 5, 2017 - 9:57 am

glad to help...

1 2 >