$query['WHERE'] = "name != '' AND group_id = " . $req_group; } #show users (all) #show users (all) case 'users': $query['SELECT'] = 'COUNT(id) AS total_users'; $query['FROM'] = "{$dbprefix}users"; $query['ORDER BY'] = 'id ASC'; $result = $SQL->build($query); $nums_rows = 0; $n_fetch = $SQL->fetch($result); $nums_rows = $n_fetch['total_users']; //pagination $currentPage = isset($_GET['page']) ? intval($_GET['page']) : 1; $Pager = new pagination($perpage, $nums_rows, $currentPage); $start = $Pager->get_start_row(); $no_results = false; $arr = array(); if ($nums_rows > 0) { $query['SELECT'] = 'id, name, founder, group_id, last_visit'; $query['LIMIT'] = "{$start}, {$perpage}"; $result = $SQL->build($query); while ($row = $SQL->fetch($result)) { $userfile = $config['siteurl'] . ($config['mod_writer'] ? 'fileuser-' . $row['id'] . '.html' : 'ucp.php?go=fileuser&id=' . $row['id']); $arr[$row['id']] = array('id' => $row['id'], 'name' => $row['name'], 'userfile_link' => $userfile, 'delusrfile_link' => $row['founder'] && (int) $user->data['founder'] == 0 ? false : ADMIN_PATH . '?cp=' . basename(__FILE__, '.php') . '&deleteuserfile=' . $row['id'] . (isset($_GET['page']) ? '&page=' . intval($_GET['page']) : ''), 'delusr_link' => $user->data['id'] == $row['id'] || $row['founder'] && (int) $user->data['founder'] == 0 ? false : ADMIN_PATH . '?cp=' . basename(__FILE__, '.php') . '&del_user='******'id'] . (isset($_GET['page']) ? '&page=' . intval($_GET['page']) : ''), 'editusr_link' => $row['founder'] && (int) $user->data['founder'] == 0 ? false : ADMIN_PATH . '?cp=' . basename(__FILE__, '.php') . '&smt=edit_user&uid=' . $row['id'] . (isset($_GET['page']) ? '&page=' . intval($_GET['page']) : ''), 'founder' => (int) $row['founder'], 'last_visit' => empty($row['last_visit']) ? $lang['NOT_YET'] : kleeja_date($row['last_visit']), 'group' => get_group_name($row['group_id'])); } $SQL->free($result); } else { $no_results = true; } //pages
#if there is no username, then there is no user at all if (!$data_user['name']) { kleeja_error($lang['NOT_EXSIT_USER'], $lang['PLACE_NO_YOU']); } #this user closed his folder, and it's not the current user folder if (!$data_user['show_my_filecp'] && $user->id() != $user_id && !user_can('enter_acp')) { kleeja_info($lang['USERFILE_CLOSED'], $lang['CLOSED_FEATURE']); } $query = array('SELECT' => 'f.id, f.name, f.real_filename, f.folder, f.type, f.uploads, f.time, f.size', 'FROM' => "{$dbprefix}files f", 'WHERE' => 'f.user='******'ORDER BY' => 'f.id DESC'); #set variables $perpage = 16; $result_p = $SQL->build($query); $nums_rows = $SQL->num($result_p); $current_page = g('page', 'int', 1); $pagination = new pagination($perpage, $nums_rows, $current_page); $start = $pagination->get_start_row(); $your_fileuser_link = $config['siteurl'] . ($config['mod_writer'] ? 'fileuser-' . $user->data['id'] . '.html' : 'ucp.php?go=fileuser&id=' . $user->data['id']); $total_pages = $pagination->get_total_pages(); $pagination_link = $config['siteurl'] . ($config['mod_writer'] ? 'fileuser-' . $user_id . '-' : 'ucp.php?go=fileuser&id=' . $user_id); $linkgoto = $config['siteurl'] . ($config['mod_writer'] ? 'fileuser-' . $user_id . '-' . $current_page . '.html' : 'ucp.php?go=fileuser&id=' . $user_id . '&page=' . $current_page); $page_nums = $pagination->print_nums($pagination_link); $no_results = true; if ((int) $config['user_system'] != 1 && $user->data['id'] != $user_id) { $data_user['name'] = $user->usernamebyid($user_id); } $username = !$data_user['name'] ? false : $data_user['name']; #set page title $current_title = $lang['FILEUSER'] . ': ' . $username; #there is result ? show them if ($nums_rows) { $no_results = false;