September 17th, 2013
JomSocial User Data in Articles
Include any Jom Social user field in artciles. Usage: jsuserfield FIELD_NAME UserID
If UserID is left out, will try to retrieve user data for current user.
jsuserfield fieldname userid
Where fieldname is a JomSocial/JomSocial custom field name.
FIELD_COUNTRY, FIELD_MOBILE, etc, or one of predefined names.
AVATAR, NAME, or AGE is calculated from FIELD_BIRTHDATE
Currently AVATAR outputs just the path to image, not a whole tag. It could do the whole image tag. Then I guess you would use CSS if you wanted to change sizes in different places or such. (maybe that’s a setting to add – Default Avatar Width, Default Avatar Height.
Even set it up so that the userid is optional (useless for this particular case of course) so you could do something like:
Hello jsuserfield NAME
And, assuming the user was logged in, it would display the current user’s name.