Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Syntax and field names for editing theme files
Avatar
chrisguld
USA
Member
Free Members
sp_UserOfflineSmall Offline
Feb 19, 2012 - 3:43 pm

I'm trying to customize what members see when they look at another member's profile.  We are a business group and I want to use this for members to see each others phone numbers, for example.

I am using the Theme editor and I found the spProfileShow.php which currently displays the First Name and Last Name, website and bio.  I copied the syntax from another line and changed the field name

....

sp_ProfileShowBusinessPhone('', __sp('Business Phone'));

 

Not only does it not show the business phone, but it stops the display of anything past that line.  Where do I find the filed names, or whatever I have wrong above.

thanks!

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Feb 19, 2012 - 3:54 pm

not really sure what you are trying to to...

sp_ProfileShowBusinessPhone() would be a php function call... did you provide that function to do the display when called? if not, would explain why its stops - you cause an error trying to call a function that does not exist.

I would suggest you take a look at the custom profile fields plugin for sp...  It will let you add new profile fields for users to fill in...  so you could add a business phone field, a home phone field, etc...  and then display it on the profile if you want...

Avatar
chrisguld
USA
Member
Free Members
sp_UserOfflineSmall Offline
Feb 19, 2012 - 4:06 pm

hmm - well, I am using the custom profile fields plugin, but I guess I don't understand it.  I've already imported metadata for all my users that includes business phone, is there any way I can use that?

Avatar
chrisguld
USA
Member
Free Members
sp_UserOfflineSmall Offline
Feb 19, 2012 - 4:15 pm

As mentioned, I am using the Custom Profile Fields plugin but I have two problems.

1. the custom fields show up in the user's own 'Edit Profile' but when I enter a mobile phone, it doesn't stick.  I've entered it multiple times now but, after I update and refresh - it disappears.

2. How do I get the custom fields to display where other users can see them?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Feb 19, 2012 - 5:15 pm

yes, sorry but its two step process... setting up the custom profile field in the admin only makes it show up on the edit profile form...  then you have to make it show up where you want it in your theme...

so now I understand what you were trying to do in the first post... and frankly, not that far off...

however, we couldnt possibly know what you would add so there is a generic routine to call for the custom profile fields and you just pass an argument telling us which one...

please see this post on the 'how to':

https://simple-press.com/suppo.....-1/#p97699

come on back if that's not clear...

Avatar
chrisguld
USA
Member
Free Members
sp_UserOfflineSmall Offline
Feb 19, 2012 - 7:38 pm

Thanks ... I'm starting to understand

BUT - I would prefer to use the data I already have in the user's metadata.  Any way to fill the custom profile fields with existing metadata?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Feb 19, 2012 - 8:25 pm

that would be very tricky... but maybe possible...  but before going too far, would suggest making sure you have a db backup...

what ever you create in forum - profile - custom profile fields for the slug (its auto generated from the name) will appear in the wp usermeta table... so for example if you created a custom profile field called 'phone number' the slug would be phonenumber... and you would see an entry in the usermeta for each user (when they saved) called phonenumber...

so if you create such a custom profile field and name it appropriately, it 'should' use your existing data...  but have never actually tried this, but in theory should work...  but thats the reason I say to have a db backup in case something heads south...

so if you already have a usermeta entry from another plugin or something, just name your sp custom profile field appropriately...  you can always see what the generated slug is on the sp custom profile admin panel...

make sense?

Avatar
chrisguld
USA
Member
Free Members
sp_UserOfflineSmall Offline
Feb 19, 2012 - 9:32 pm

Ok, thanks again for all the instruction 🙂  and all the upgrades!  I just upgraded to build 7960

I used a plugin 'Import users from CSV' which created many metadata fields. I expected it to work just as you said - if the name was the same, the data would show.  For example, I imported first_name and last_name and user_url and user_email and they show up appropriately in the user info.  I know that is in the wp_users table and not the wp_usermeta, but I also imported a field called description - I see it in the metadata SQL table and it is showing up nicely as 'bio' in the user's displayed info?? How does description become bio?

One of the meta fields has a simple name of Join Date.  In the SQL table (using phpMyAdmin) I can see the meta_key is JoinDate.  So I added a custom profile field as Join Date - I checked and see that the slug comes out to joindate.  Yet, when I edit a member's profile, the Join Date field is blank.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Feb 19, 2012 - 11:16 pm

well as to bio vs description, I have to blame wp there... that really is simply the field on your user profile in the wp admin...  they called the meta name description, but on the profile, they call it biographical info...  so we just carried that forward to be consistent...

first_name, last_name, user_url and user_email are also wp standard usermeta info...  the sp stuff just uses the wp stuff... they are not distinct and no reason to have a duplicate...

are you really sure you have a meta_key of 'Join Date' in your usermeta db??  I dont think the space is allowed...  please dont confuse name and slug (or meta_key)...  the slug is a db safe manipulation of the plain text name...  so for this join date, please look in the db at the usermeta table and see what the meta_key is for it...  you want to match the slug on custom profile fields to the meta_key... for example if its join_date, that is doable...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17362
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625