subuser

Discussion in 'Customization & add-ons' started by csongor_simsay, Jan 10, 2014.

  1. csongor_simsay

    csongor_simsay New Member

    Joined:
    Dec 10, 2013
    Messages:
    26
    Hello,
    we have just recently bought the subuser plugin.
    We have difficulties with the followings:
    1. clicking on the subuser TAB it loads a different style sheet not our custom css from the THEME folder. Clicking on the other tabs the member page looks again as we designed it.
    2. when adding a subuser we need to run a custom.php and sending it the user _id.
    The site.php doesn't run it somehow.

    Could you give us directions where to start?
  2. csongor_simsay

    csongor_simsay New Member

    Joined:
    Dec 10, 2013
    Messages:
    26
    Hello,

    Is there a way to get the list of the subusers of a specific user? something like this:

    $resellerUserId = 'anyone';
    for(i=1; i<=$subusersNumber; i++){
    echo $subUserEmail.$i;
    }

    Cheers
  3. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
    Hello,

    1. Please contact us in helpdesk (https://www.amember.com/support) we will troubleshoot it.
    2. I need more details. How do you call custom.php? What is code you have in it?
    3.
    Code:
    foreach(Am_Di::getInstance()->userTable->findBySubusersParentId('parent user id') as $user) {
        echo $user->email;
    }
    
  4. csongor_simsay

    csongor_simsay New Member

    Joined:
    Dec 10, 2013
    Messages:
    26
    Hello,

    That's perfect, thanks!
    I copy the script here, others also may find it useful.

    <?php

    require_once '/home/yourname/public_html/amember/bootstrap.php';
    $adminUser = 299;//example
    $subUserCount = 0;
    foreach(Am_Di::getInstance()->userTable->findBySubusersParentId($adminUser) as $user) {
    $subUserCount++;
    echo ' user:'.$user->email;
    }
    echo ' subUserCount: '.$subUserCount;
    ?>

Share This Page