Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
251 views
in Q2A Core by
I noticed that qa-page-user.php displays the user profile fields with a foreach ($userfields as $userfield) Loop and then a qa_content array.

Is there a way to concatenate two user profile fields, so they are displayed together as opposed to on two different rows (e.g. Name - Location)?

Basically, i guess my question boils down to, is there a function that displays the value for a specific field? I thought maybe it was something like  qa_html(@$userprofile[$userfield['location']]); - would display the location. But that doesn't work. So how would I access the value of a specific profile field, outside of a loop on qa-page-user.php?

Also, why does the qa_content array always throw a table? Is there some sort of value to put in the qa_content array, so that it doesn't design a table with the data or are all arrays immediately designed as tables?

1 Answer

0 votes
by
If this helps anyone in the future, it took quite awhile, but after analyzing the qa-page-user.php file, apparently there is an array value called $userprofile, which is set early on in the file by the function  qa_db_user_profile_selectspec() (this function is actually found in qa-db-selects.php). You can then reference the array in the code to display various user profile fields. The code would go something like this (obviously, you would need to replace the [''] with the correct field name:

qa_html(@$userprofile['name']);

(Note this code could be used to display the user's name).

By getting all the different profile fields you can then output a custom version of the user page
...