Difference between revisions of "Altering JomSocial Members Count"

(Hacking the code to show all members on the site)
 
Line 9: Line 9:
  
 
==Hacking the code to show all members on the site==
 
==Hacking the code to show all members on the site==
 +
If you still however want to show all users that have ever registered on your entire Joomla site modification is quite simple<br/>
 +
Just open this file '''JOOMLA/administrator/components/com_community/views/community/view.html.php''' and on (or around) line 41 find this code<br/>
 +
<syntaxhighlight lang="php">
 +
$this->set('userCount',$user->getMembersCount('jomsocial'));
 +
</syntaxhighlight>
 +
<br/>
 +
The important bit here is '''jomsocial''' parameter. Change it to '''all''' so that it becomes
 +
<syntaxhighlight lang="php">
 +
$this->set('userCount',$user->getMembersCount('all'));
 +
</syntaxhighlight>
 +
<br/>
 +
Now you will have all members counted even if they never opened JomSocial at your site
  
 
==See Also==
 
==See Also==

Latest revision as of 07:10, 20 February 2014

Since JomSocial 3.1

With JomSocial 3.1 onwards, the dashboard counters are implemented in JomSocial Backend Panel. These counters hold various statistical data about your community and are available to all admins in main control panel view.

Dashboardcounters.png

Is members counter wrong?

No! By design members counter will only show those users that have at least one (1) JomSocial User Point
User points are assigned on every individual action available in JomSocial and it is the easy way to recognise how many users actually used your community.

Hacking the code to show all members on the site

If you still however want to show all users that have ever registered on your entire Joomla site modification is quite simple
Just open this file JOOMLA/administrator/components/com_community/views/community/view.html.php and on (or around) line 41 find this code

$this->set('userCount',$user->getMembersCount('jomsocial'));


The important bit here is jomsocial parameter. Change it to all so that it becomes

$this->set('userCount',$user->getMembersCount('all'));


Now you will have all members counted even if they never opened JomSocial at your site

See Also