I would like to display how many subusers a person has left to create. Is there some PHP code i can add to my view that would display this number when they are logged in?

Thanks!

Comments

mlalu’s picture

This seems to give me what I was looking for. I'm pretty new at PHP and I dug most of this out of the module code. If anyone has any improvement suggestions I would be glad to hear them. Thanks!

<?php
  global $user;
  $clu = user_load(array('uid' => $user->uid)); 
      $limit_count = subuser_get_subuser_limit($user->uid);
      $current_subuser_count = count(subuser_get_subusers($user->uid));  
     $remaining_subuser_count= $limit_count - $current_subuser_count;
?>

<p>You have <strong><?php print $remaining_subuser_count; ?></strong> subuser accounts available out of your <strong><?php print $limit_count ?></strong> subuser limit.<br />&nbsp;</p>
sokrplare’s picture

Status: Active » Closed (fixed)

Cleaning up the issue queue - looks like you solved it yourself - nice!