By Manish Arora on Sunday, 06 April 2014
Posted in General Issues
Replies 7
Likes 0
Views 581
Votes 0
In need to get list of discussion categories with post count
like: category A(56), category B(22),category C(21)...

how can get user points and number of badges earned so that i can echo it somewhere in my template.
Hello Manish,

You should take a look at EasyDiscuss categories module as the categories module is already doing something similar like this As for retrieving the points, see the theme file /components/com_easydiscuss/themes/simplistic/profile.php
·
Sunday, 06 April 2014 16:10
·
0 Likes
·
0 Votes
·
0 Comments
·
i have checked profile.php there is $profile->getPoints() but i am unable to echo it outside easydiscuss what file's should i include?
·
Monday, 07 April 2014 01:18
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Manish Arora,

Sorry for late reply to this,
May i know how would you display the user point in your template page?
If I'm not wrong, we have the Leaderboard module of Easydiscuss to display the user point.
If you're not referring on this module feature, can you elaborate more on your requirement here? Perhaps some screenshot. Please advise.
·
Monday, 07 April 2014 13:55
·
0 Likes
·
0 Votes
·
0 Comments
·
see the attachment
·
Monday, 07 April 2014 17:28
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Manish Arora,

You can apply this following code :

require_once DISCUSS_HELPERS . '/helper.php';

// Get current logged in user
$my = JFactory::getUser();

$user = DiscussHelper::getTable('Profile');
$user->load($my->id);

echo $user->getPoints();
echo $user->getTotalBadges();

Hope this help.
·
Monday, 07 April 2014 20:24
·
0 Likes
·
0 Votes
·
0 Comments
·
thanks that worked perfectly
additionally i need to show user rank in discussion view / question and answer view , Just below the profile picture
·
Saturday, 12 April 2014 01:54
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Manish,

Kindly please understand that our support does not cover customizations. We only provide you some sample codes that you could use as an example. You need to take a look at the methods available in /administrator/components/com_easydiscuss/tables/profile.php
·
Saturday, 12 April 2014 02:24
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post