We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3766
    • 4 Posts
    Hi,
    I’m new to ModX and I’m trying to show in the "security" > "web users" manager page the total number of registered web users.
    Do you have any idea how to do that?

    I’ using Evo 1.0.4

    thanks a lot,
    Pietro
      • 10449
      • 956 Posts
      Hi Pietro, and welcome to MODx smiley

      All it takes is really just inserting a few lines of PHP in manager/actions/web_user_management.static.php
      after line 110

      something like:

      $table = $modx->getFullTableName('web_users');
      $countQuery = "SELECT COUNT(id) AS c FROM $table WHERE 1 LIMIT 0,1";
      $result = mysql_query($countQuery) or die( mysql_error() );
      if(mysql_num_rows($result) > 0) {
      	while ($row = mysql_fetch_array($result)) {
      		extract($row);
      		echo "There are currently $c web-users.";
      	}
      }
      


      Maybe there’s a more elegant way to do the same (without hardcoding / hacking it), but I wouldn’t know.
        • 3766
        • 4 Posts
        Thanks, ganeshXL!
        it just works