Changeset 1065 in ExiteCMS for branches/PLi-Fusion/members.php


Ignore:
Timestamp:
11/05/07 22:23:47 (5 years ago)
Author:
hverton
Message:

Merged trunk revision 1056:1064 into the PLi-Fusion branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PLi-Fusion/members.php

    r834 r1065  
    3838if (iMEMBER) { 
    3939    // create the where clause 
     40    $filter = "user_status = 0";    // only show activated accounts 
    4041    if ($sortby == "all") { 
    41         if ($country == "") { 
    42             $orderby = ""; 
    43         } else { 
    44             $orderby = " user_cc_code = '".$country."'"; 
     42        if ($country != "") { 
     43            $filter .= " AND user_cc_code = '".$country."'"; 
    4544        } 
    4645    } else { 
    4746        if ($country == "") { 
    48             $orderby = " user_name LIKE '".stripinput($sortby)."%' OR user_name LIKE '".strtolower(stripinput($sortby))."%'"; 
     47            $filter .= " AND user_name LIKE '".stripinput($sortby)."%' OR user_name LIKE '".strtolower(stripinput($sortby))."%'"; 
    4948        } else { 
    50             $orderby = " user_cc_code = '".$country."' AND (user_name LIKE '".stripinput($sortby)."%' OR user_name LIKE '".strtolower(stripinput($sortby))."%')"; 
     49            $filter .= " AND user_cc_code = '".$country."' AND (user_name LIKE '".stripinput($sortby)."%' OR user_name LIKE '".strtolower(stripinput($sortby))."%')"; 
    5150        } 
    5251    } 
     
    5453    $variables['members'] = array(); 
    5554    if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0; 
    56     $result = dbquery("SELECT * FROM ".$db_prefix."users".($orderby==""?"":" WHERE").$orderby." ORDER BY user_level DESC, user_name LIMIT ".$rowstart.", ".ITEMS_PER_PAGE); 
     55    $result = dbquery("SELECT * FROM ".$db_prefix."users ".($filter==""?"":("WHERE ".$filter))." ORDER BY user_level DESC, user_name LIMIT ".$rowstart.", ".ITEMS_PER_PAGE); 
    5756    $rows = dbrows($result); 
    5857    $variables['members'] = array(); 
     
    9392    if (count($variables['search'])%2) $variables['search'][] = ""; 
    9493    $variables['sortby'] = $sortby; 
    95     $variables['rows'] = dbcount("(*)", "users", $orderby); 
     94    $variables['rows'] = dbcount("(*)", "users", $filter); 
    9695    $variables['rowstart'] = $rowstart; 
    9796    $variables['items_per_page'] = ITEMS_PER_PAGE; 
Note: See TracChangeset for help on using the changeset viewer.