Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
292
Merge Requests
292
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
0de88f50
Commit
0de88f50
authored
May 23, 2005
by
Dries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Patch
#23383
by Ber: added theme_user_list() function.
parent
7dcb9086
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
28 deletions
+34
-28
modules/user.module
modules/user.module
+17
-14
modules/user/user.module
modules/user/user.module
+17
-14
No files found.
modules/user.module
View file @
0de88f50
...
...
@@ -533,9 +533,8 @@ function user_block($op = 'list', $delta = 0, $edit = array()) {
if
(
user_access
(
'access content'
))
{
$result
=
db_query_range
(
'SELECT uid, name FROM {users} WHERE status != 0 ORDER BY uid DESC'
,
0
,
5
);
while
(
$account
=
db_fetch_object
(
$result
))
{
$items
[]
=
format_name
(
$account
)
;
$items
[]
=
$account
;
}
$output
=
theme
(
'user_list'
,
$items
);
$block
[
'subject'
]
=
t
(
'Who\'s new'
);
...
...
@@ -563,19 +562,14 @@ function user_block($op = 'list', $delta = 0, $edit = array()) {
// Display a list of currently online users.
$max_users
=
variable_get
(
'user_block_max_list_count'
,
10
);
if
(
$max_users
)
{
$items
=
array
();
$items
=
array
();
while
(
$max_users
--
&&
$account
=
db_fetch_object
(
$users
))
{
$items
[]
=
format_name
(
$account
)
;
}
while
(
$max_users
--
&&
$account
=
db_fetch_object
(
$users
))
{
$items
[]
=
$account
;
}
if
(
$items
)
{
if
(
db_fetch_object
(
$users
))
{
$items
[]
=
'...'
;
}
$output
.
=
theme
(
'item_list'
,
$items
,
t
(
'Online users:'
));
}
if
(
$items
)
{
$output
.
=
theme
(
'user_list'
,
$items
,
t
(
'Online users'
));
}
$block
[
'subject'
]
=
t
(
'Who\'s online'
);
...
...
@@ -618,7 +612,16 @@ function theme_user_profile($account, $fields) {
return
$output
;
}
function
theme_user_list
(
$items
,
$title
=
NULL
)
{
/**
* Make a list of users.
* @param $items an array with user objects. Should contain at least the name and uid
*
* @ingroup themeable
*/
function
theme_user_list
(
$users
,
$title
=
NULL
)
{
foreach
(
$users
as
$user
)
{
$items
[]
=
format_name
(
$user
);
}
return
theme
(
'item_list'
,
$items
,
$title
);
}
...
...
modules/user/user.module
View file @
0de88f50
...
...
@@ -533,9 +533,8 @@ function user_block($op = 'list', $delta = 0, $edit = array()) {
if
(
user_access
(
'access content'
))
{
$result
=
db_query_range
(
'SELECT uid, name FROM {users} WHERE status != 0 ORDER BY uid DESC'
,
0
,
5
);
while
(
$account
=
db_fetch_object
(
$result
))
{
$items
[]
=
format_name
(
$account
)
;
$items
[]
=
$account
;
}
$output
=
theme
(
'user_list'
,
$items
);
$block
[
'subject'
]
=
t
(
'Who\'s new'
);
...
...
@@ -563,19 +562,14 @@ function user_block($op = 'list', $delta = 0, $edit = array()) {
// Display a list of currently online users.
$max_users
=
variable_get
(
'user_block_max_list_count'
,
10
);
if
(
$max_users
)
{
$items
=
array
();
$items
=
array
();
while
(
$max_users
--
&&
$account
=
db_fetch_object
(
$users
))
{
$items
[]
=
format_name
(
$account
)
;
}
while
(
$max_users
--
&&
$account
=
db_fetch_object
(
$users
))
{
$items
[]
=
$account
;
}
if
(
$items
)
{
if
(
db_fetch_object
(
$users
))
{
$items
[]
=
'...'
;
}
$output
.
=
theme
(
'item_list'
,
$items
,
t
(
'Online users:'
));
}
if
(
$items
)
{
$output
.
=
theme
(
'user_list'
,
$items
,
t
(
'Online users'
));
}
$block
[
'subject'
]
=
t
(
'Who\'s online'
);
...
...
@@ -618,7 +612,16 @@ function theme_user_profile($account, $fields) {
return
$output
;
}
function
theme_user_list
(
$items
,
$title
=
NULL
)
{
/**
* Make a list of users.
* @param $items an array with user objects. Should contain at least the name and uid
*
* @ingroup themeable
*/
function
theme_user_list
(
$users
,
$title
=
NULL
)
{
foreach
(
$users
as
$user
)
{
$items
[]
=
format_name
(
$user
);
}
return
theme
(
'item_list'
,
$items
,
$title
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment