All pastes #746848 Raw Edit

Jemand

public php v1 · immutable
·published 2007-10-23 15:14 UTC
rendered paste body
function phptemplate_user_list($users, $title = NULL) {  $header = array(    theme('table_select_header_cell'),    array('data' => t('Username'), 'field' => 'u.name'),    array('data' => t('Mail'), 'field' => 'u.access')  );  // wir holen uns die Nutzer selbst aus der DB und verwenden nicht $users  $sql = 'SELECT DISTINCT u.uid, u.name, u.status, u.created, u.access FROM {users} u LEFT JOIN {users_roles} ur ON u.uid = ur.uid WHERE u.uid != 0';  $sql .= tablesort_sql($header);  $result = pager_query($sql, 50, 0, NULL, array());  $users = array();  while ($user = db_fetch_object($result)) {    $users[] = array(array('data' => $user->name), array('data' => $user->mail));  }  return theme('table', $header, $users, array('summary' => t('List of users.')));}