Hello.
Can you please give me a hint: How to display UserPoints at "All member" page?
I edit file "html\com_community\layouts\people.browse.php"
and try to use code:
<?php echo $user->getKarmaPoint(); ?>
or this code:
<?php echo $user->userpoints; ?>
but with no succes. Does it mean I need to add something else?
Thanks.
HI, Dmitry.
Thank you for contacting us.
Try:
<?php echo $this->user->getKarmaPoint(); ?>
HI, Dmitry.
Did you defined $user at the beginning of the file?
$cuser = CFactory::getUser();
Hi. No, I didn't defined $user at the beginning of the file. :)
Seems it should looks like that?
<?php
defined('_JEXEC') or die();
if (!isset($pageTitle)) {
$task = JFactory::getApplication()->input->getCmd('task');
$pageTitle = JText::_($task === 'display' ? 'COM_COMMUNITY_ADVANCESEARCH_SEARCH_RESULTS' : 'COM_COMMUNITY_ALL_MEMBERS');
$cuser = CFactory::getUser();// crimson: add to display userpoints
}
?>
Privet Dmitry.
Try this:
$mypoints = $row->user->getKarmaPoint();
echo $mypoints;
Thanks you very much - it helps :)
As result:
Need to paste this code to the begining of file (after "if (!isset($pageTitle)) {"):
$cuser = CFactory::getUser();
Need to paste this code to place where need Userpoints to display:
<?php $mypoints = $row->user->getKarmaPoint(); echo $mypoints; ?>