Support Forum

custom profile fields

65 Answers

New Answer

MP Mr Papa
Mr Papa
Member

think we need to take a step back… it appears you are taking multiple examples and applying it to a single case…  showing up under a user is a different template file… the one you are editing is for profiles only…

so lets go one by one… where do you want the country to appear??  under a user avatar when viewing a topic (ie list of posts)?  if so, you need to edit the spTopicView.php template file in the theme…  so edit that file, and find this line:

                                    sp_UserAvatar(‘tagClass=spPostUserAvatar spCenter&context=user’, $spThisPostUser);

underneath it add:

sp_CustomProfileFieldsDisplay(‘Country’, $spThisPostUser->ID);

lets get this one working, then take them one by one…

remember, we strongly recommend you have your own custom theme or child theme vice editing our delivered themes to keep from losing changes on updates…

MP Mr Papa
Mr Papa
Member

and you were looking at a topic?  and the user had actually entered something for their country?  if nothing entered for the user, you wont see anything…

sp_CustomProfileFieldsDisplay('Country', $spThisPostUser->ID)

just tested and works fine for me…  see image

profile.png

be sure to copy the code if using mine so you get correct quotes…

JH JINCUI HAO
JINCUI HAO
Member

well its not working for me.

 

dont you think it would just so much easier to create a custom profile plugin, so people dont have to do child themes and coding which seems to cause huge problems setting up, and then even more after a upgrade ?

MP Mr Papa
Mr Papa
Member

This is already a custom profile plugin, so not sure what you mean…  and no way we could even remotely guess what kind of profile field you would want and where/problem-with-post-edit-buttonow you might want to display it… and certainly what everyone wants would be different…  adding a template function is the easiest most flexible way to do it…

if you can provide us admin access to your site, we can take a closer look and see what is going on… if that works for you, please pm the credentials…  it needs to be an sp admin…

and which user you have entered country data for…

MP Mr Papa
Mr Papa
Member

yes, had the site, but sent you pm this weekend that the password doesnt work with the account…

YS Yellow Swordfish
Yellow Swordfish
Member

You might want to PM me the site details as well in case I can take a look before @mr-papa has the opportunity to visit.

MP Mr Papa
Mr Papa
Member

hope to have a chance to look tonight after work…

MP Mr Papa
Mr Papa
Member

Okay, first thing you need to go do is bring your simple press plugins up to date…

you have 16 simple press plugins that are out of date…  you have several nags about the updates… some are quite old and may not even be compatible with the simple press version you are running…

if after updating, you still have the issue, we can come back and take another look…