Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated

Display the gender field of users (not the current user !)

9 years 10 months ago
  • Laura's Avatar
    Topic Author
  • Laura
  • Offline
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 0
Licenses:

Hello :)

I try many ways to display the gender of the visited profile but none of these solutions work.

I try this :

// load jomsocial library 
require_once( JPATH_ROOT .'/components/com_community/libraries/core.php');
// create the owner object
$owner = CFactory::getUser($listing['User']['user_id']); ?>
<?php echo $owner->getInfo('FIELD_GENDER'); ?>

<?php echo $listing['Community']['Field']['FIELD_GENDER']['value']; ?>

Nothing happend. So I try this too :
<?php	$gender = $user->getInfo('FIELD_GENDER');
					echo $gender; ?>

This, send me the gender of the visiting user (the current user so). Same here :
$user =& CFactory::getUser();
echo $data = $user->getInfo('FIELD_ABOUTME');

Same result.
So I try this too :
require_once JPATH_SITE.DS.'components'.DS.'com_community'.DS.'libraries'.DS.'core.php';
$value =& CFactory::getUser($userid)->getInfo('FIELD_GENDER');

And this give me the gender of the current user... and not the gender of the user of the visited profile.

I don't know what to do but I hope you could help me.

Thanks,

9 years 10 months ago
  • Laura's Avatar
    Topic Author
  • Laura
  • Offline
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 0
Licenses:

Doesn't it exist an SQL query for getting this field ?

9 years 10 months ago
  • Paul's Avatar
  • Paul
  • Visitor
  • Thank you received: 0
Licenses:

Hi Laura,

This is the Pre-Sales section, For technical support you would need to post in the correct category, you will require an active licence to do that then our support staff can help you there

Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW