Some questions

Discussion in 'Customization & add-ons' started by soothsayer, Oct 15, 2011.

  1. soothsayer

    soothsayer New Member

    Joined:
    Oct 15, 2011
    Messages:
    4
    Hi truly a great system you built. But I want to ask is there a possibility to create a menu as the "Country and State". Once you select a block from which the client is in the menu to remain only switch for the block. When we chose this block in the dropdown menu to show only 18-3-D-link, 18-9-D-link, 18-9-Sisco. And also is it possible for consumers discharged soon after for example 5 days to be marked in orange yellow 3 days, and past the red.
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    This will require customizations. There is no default field types that allow to create such menu.
  3. soothsayer

    soothsayer New Member

    Joined:
    Oct 15, 2011
    Messages:
    4
  4. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    This page display user records, and each user can have more then one product subscribed.
    So should it display maximum expiration date based on all user's payments? Also what payment systems do you use? Some payment plugins set expiration date to 2039-12-31 for recurring payments, so such info will be useless.
  5. soothsayer

    soothsayer New Member

    Joined:
    Oct 15, 2011
    Messages:
    4
    Manual payment from us! I want to use the system for me and people from my team. to reflect payments to clients
  6. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    ok. Edit /amember/plugins/db/mysql.inc.php and change this function:
    PHP:
        function get_users_list($pattern='%'$status=-1$start=0$limit=-1$aff_id=){
            
    $where $having "";
            if (
    $pattern)
                
    $where " AND u.login LIKE '" $this->escape($pattern) . "' ";
            if (
    strlen($status)){
                
    $status intval($status);
                if (
    $status >= && $status 3)
                    
    $where .= " AND status = $status ";
                else if(
    $status == 3){
                    
    $where .= " AND is_affiliate>0 ";
                }

            }
            if(
    $aff_id ){
                
    $where .= "AND u.aff_id = '$aff_id'";
            }
            
            
            
    $limit_exp $this->get_limit_exp($start$limit);
            
    $q $this->query($s "SELECT u.*,
                SUM(if(p.completed, 1, 0)) AS count_of_completed,
                SUM(if(p.completed, p.amount,0)) as summa_of_completed
                FROM 
    {$this->config['prefix']}members u LEFT JOIN {$this->config['prefix']}payments p ON (p.member_id=u.member_id)
                WHERE 1 
    $where
                GROUP BY u.member_id
                HAVING 1 
    $having
                ORDER BY u.login
                
    $limit_exp
            "
    );
            
    $rows = array();
            while (
    $r mysql_fetch_assoc($q)){
                if (
    $r['data'])
                    
    $r['data'] = $this->decode_data($r['data']);
                
    $rows[] = $r;
            }
            return 
    $rows;
        }

    to
    PHP:
        function get_users_list($pattern='%'$status=-1$start=0$limit=-1$aff_id=){
            
    $where $having "";
            if (
    $pattern)
                
    $where " AND u.login LIKE '" $this->escape($pattern) . "' ";
            if (
    strlen($status)){
                
    $status intval($status);
                if (
    $status >= && $status 3)
                    
    $where .= " AND status = $status ";
                else if(
    $status == 3){
                    
    $where .= " AND is_affiliate>0 ";
                }

            }
            if(
    $aff_id ){
                
    $where .= "AND u.aff_id = '$aff_id'";
            }
            
            
            
    $limit_exp $this->get_limit_exp($start$limit);
            
    $q $this->query($s "SELECT u.*,
                max(if(p.completed, p.expire_date, '')) AS expire_date,
                SUM(if(p.completed, 1, 0)) AS count_of_completed,
                SUM(if(p.completed, p.amount,0)) as summa_of_completed
                FROM 
    {$this->config['prefix']}members u LEFT JOIN {$this->config['prefix']}payments p ON (p.member_id=u.member_id)
                WHERE 1 
    $where
                GROUP BY u.member_id
                HAVING 1 
    $having
                ORDER BY u.login
                
    $limit_exp
            "
    );
            
    $rows = array();
            while (
    $r mysql_fetch_assoc($q)){
                if (
    $r['data'])
                    
    $r['data'] = $this->decode_data($r['data']);
                
    $rows[] = $r;
            }
            return 
    $rows;
        }
    Then in /amember/templates/admin/users.html you will be able to use this valiable within {foreach from=$ul item=u} cycle:
    {$u.expire_date}
  7. soothsayer

    soothsayer New Member

    Joined:
    Oct 15, 2011
    Messages:
    4
    Does anyone have any ideas how to do drop-down menus.Once you select a block from which the client is in the menu to remain only switch for the block. When we chose this block in the dropdown menu to show only 18-3-D-link, 18-9-D-link, 18-9-Sisco.

Share This Page