Exemplo n.º 1
0
 $tmp = array_slice($tmp, $from, $C->PAGING_NUM_USERS, TRUE);
 $D->if_follow_user = array();
 if ($this->user->id && count($tmp) > 0) {
     $db2->query('SELECT whom FROM users_followed WHERE whom IN(' . implode(',', $tmp) . ') AND who="' . $this->user->id . '"');
     while ($o = $db2->fetch_object()) {
         if (isset($D->if_follow_user[$o->whom])) {
             continue;
         }
         $D->if_follow_user[$o->whom] = 1;
     }
 }
 if (count($tmp) > 0) {
     $r = $db2->query('SELECT * FROM users WHERE id IN(' . implode(',', $tmp) . ')');
     $tmp = array();
     while ($o = $db2->fetch_object($r)) {
         $tmp[] = generate_user_info_obj($o, TRUE);
     }
 }
 $D->users_html = '';
 ob_start();
 foreach ($tmp as $usr) {
     $D->u = $usr;
     $this->load_template('single_user.php');
 }
 $D->paging_url = $C->SITE_URL . $g->groupname . '/tab:members/filter:' . $D->filter . '/pg:';
 if ($D->num_pages > 1) {
     $this->load_template('paging_users.php');
 }
 $D->users_html = ob_get_contents();
 ob_end_clean();
 unset($tmp, $sdf, $D->u);
Exemplo n.º 2
0
    $db2->query('SELECT ' . implode(',', $required_fields) . ' FROM users u, users_followed uf WHERE uf.who=u.id AND whom="' . $this->user->id . '" ORDER BY u.id DESC LIMIT ' . $from . ', ' . $C->PAGING_NUM_USERS);
    while ($o = $db2->fetch_object()) {
        $selected_users[] = generate_user_info_obj($o);
        $user_ids[] = $o->id;
    }
} elseif ($D->tab == 'admins') {
    $D->num_results = $db2->fetch_field('SELECT COUNT(*) AS u FROM users WHERE is_network_admin="1"');
    $D->num_pages = ceil($D->num_results / $C->PAGING_NUM_USERS);
    $D->pg = $this->param('pg') ? intval($this->param('pg')) : 1;
    $D->pg = min($D->pg, $D->num_pages);
    $D->pg = max($D->pg, 1);
    $from = ($D->pg - 1) * $C->PAGING_NUM_USERS;
    $required_fields[] = 'id';
    $db2->query('SELECT ' . implode(',', $required_fields) . ' FROM users WHERE active=1 AND is_network_admin=1 ORDER BY id DESC LIMIT ' . $from . ', ' . $C->PAGING_NUM_USERS);
    while ($o = $db2->fetch_object()) {
        $selected_users[] = generate_user_info_obj($o);
        $user_ids[] = $o->id;
    }
}
$D->if_follow_user = array();
if ($this->user->id && count($user_ids) > 0) {
    $db2->query('SELECT whom FROM users_followed WHERE whom IN(' . implode(',', $user_ids) . ') AND who="' . $this->user->id . '"');
    while ($o = $db2->fetch_object()) {
        if (isset($D->if_follow_user[$o->whom])) {
            continue;
        }
        $D->if_follow_user[$o->whom] = 1;
    }
}
if (0 == $D->num_results) {
    $arr = array('#SITE_TITLE#' => htmlspecialchars($C->OUTSIDE_SITE_TITLE));