summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-08-12 22:03:31 +0000
committerDries Buytaert <dries@buytaert.net>2004-08-12 22:03:31 +0000
commitd4a8bd587707a7c0d99b27c16164b2cb22e8c905 (patch)
treeca8b4598e451f81932f1c2d1f710e5a903c62629 /modules
parentcea07ecac664f7d9853d9111e355aa9bead4bf7f (diff)
downloadbrdo-d4a8bd587707a7c0d99b27c16164b2cb22e8c905.tar.gz
brdo-d4a8bd587707a7c0d99b27c16164b2cb22e8c905.tar.bz2
- Modified patch #9924 by njivi: added a basic member list to the profile module. (If this deprecates the memberlist module, it ought to be deprecated.)
I removed the permission njivi introduced and made the page title match the link title.
Diffstat (limited to 'modules')
-rw-r--r--modules/profile.module26
-rw-r--r--modules/profile/profile.module26
2 files changed, 46 insertions, 6 deletions
diff --git a/modules/profile.module b/modules/profile.module
index 07dd06720..1ad8288c7 100644
--- a/modules/profile.module
+++ b/modules/profile.module
@@ -27,7 +27,7 @@ function profile_menu() {
global $user;
$items = array();
- $items[] = array('path' => 'profile', 'title' => t('browse'),
+ $items[] = array('path' => 'profile', 'title' => t('user list'),
'callback' => 'profile_browse',
'access' => TRUE,
'type' => MENU_SUGGESTED_ITEM);
@@ -61,7 +61,7 @@ function profile_browse() {
$field = db_fetch_object(db_query("SELECT DISTINCT(fid), type, title, page FROM {profile_fields} WHERE name = '%s'", $name));
- if ($field->fid) {
+ if ($name && $field->fid) {
// Compile a list of fields to show
$fields = array();
$result = db_query('SELECT name, title, type FROM {profile_fields} WHERE fid != %d AND visibility = %d', $field->fid, PROFILE_PUBLIC_LISTINGS);
@@ -101,9 +101,29 @@ function profile_browse() {
print theme('page', $output, $title);
}
- else {
+ else if ($name && !$field->id) {
drupal_not_found();
}
+ else {
+ // Compile a list of fields to show
+ $fields = array();
+ $result = db_query('SELECT name, title, type FROM {profile_fields} WHERE visibility = %d', PROFILE_PUBLIC_LISTINGS);
+ while ($record = db_fetch_object($result)) {
+ $fields[] = $record;
+ }
+
+ // Extract the affected users:
+ $result = pager_query("SELECT uid FROM {users} WHERE uid > 0 ORDER BY changed DESC", 20, 0, NULL);
+
+ $output = '<div id="profile">';
+ while ($account = db_fetch_object($result)) {
+ $output .= theme('profile_profile', user_load(array('uid' => $account->uid)), $fields);
+ }
+ $output .= '</div>';
+ $output .= theme('pager', NULL, 20);
+
+ print theme('page', $output, t('user list'));
+ }
}
function profile_load_profile(&$user) {
diff --git a/modules/profile/profile.module b/modules/profile/profile.module
index 07dd06720..1ad8288c7 100644
--- a/modules/profile/profile.module
+++ b/modules/profile/profile.module
@@ -27,7 +27,7 @@ function profile_menu() {
global $user;
$items = array();
- $items[] = array('path' => 'profile', 'title' => t('browse'),
+ $items[] = array('path' => 'profile', 'title' => t('user list'),
'callback' => 'profile_browse',
'access' => TRUE,
'type' => MENU_SUGGESTED_ITEM);
@@ -61,7 +61,7 @@ function profile_browse() {
$field = db_fetch_object(db_query("SELECT DISTINCT(fid), type, title, page FROM {profile_fields} WHERE name = '%s'", $name));
- if ($field->fid) {
+ if ($name && $field->fid) {
// Compile a list of fields to show
$fields = array();
$result = db_query('SELECT name, title, type FROM {profile_fields} WHERE fid != %d AND visibility = %d', $field->fid, PROFILE_PUBLIC_LISTINGS);
@@ -101,9 +101,29 @@ function profile_browse() {
print theme('page', $output, $title);
}
- else {
+ else if ($name && !$field->id) {
drupal_not_found();
}
+ else {
+ // Compile a list of fields to show
+ $fields = array();
+ $result = db_query('SELECT name, title, type FROM {profile_fields} WHERE visibility = %d', PROFILE_PUBLIC_LISTINGS);
+ while ($record = db_fetch_object($result)) {
+ $fields[] = $record;
+ }
+
+ // Extract the affected users:
+ $result = pager_query("SELECT uid FROM {users} WHERE uid > 0 ORDER BY changed DESC", 20, 0, NULL);
+
+ $output = '<div id="profile">';
+ while ($account = db_fetch_object($result)) {
+ $output .= theme('profile_profile', user_load(array('uid' => $account->uid)), $fields);
+ }
+ $output .= '</div>';
+ $output .= theme('pager', NULL, 20);
+
+ print theme('page', $output, t('user list'));
+ }
}
function profile_load_profile(&$user) {