Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
0b596a8e
Commit
0b596a8e
authored
May 29, 2002
by
Kjartan Mannes
Browse files
- modified the user blocks to use the same layout and trim long usernames to
keep the blocks from ruining theme layouts.
parent
c9feee50
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/user.module
View file @
0b596a8e
...
...
@@ -501,11 +501,10 @@ function user_block() {
$result
=
db_query
(
"SELECT uid, name FROM users WHERE timestamp > unix_timestamp() -
$time
ORDER BY timestamp DESC LIMIT
$limit
"
);
if
(
db_num_rows
(
$result
))
{
$output
=
"
<ol>
"
;
$output
=
""
;
while
(
$account
=
db_fetch_object
(
$result
))
{
$output
.
=
'<li>'
.
lm
((
strlen
(
$account
->
name
)
>
1
0
?
substr
(
$account
->
name
,
0
,
1
0
)
.
'...'
:
$account
->
name
),
array
(
"mod"
=>
"user"
,
"op"
=>
"view"
,
"id"
=>
$account
->
uid
))
.
'</li>'
;
$output
.
=
lm
((
strlen
(
$account
->
name
)
>
1
5
?
substr
(
$account
->
name
,
0
,
1
5
)
.
'...'
:
$account
->
name
),
array
(
"mod"
=>
"user"
,
"op"
=>
"view"
,
"id"
=>
$account
->
uid
));
}
$output
.
=
"</ol>"
;
$block
[
2
][
"content"
]
=
$output
;
}
$block
[
2
][
"subject"
]
=
t
(
"Who's online"
);
...
...
@@ -520,7 +519,7 @@ function user_block() {
function
user_new_users
()
{
$result
=
db_query
(
"SELECT uid, name FROM users WHERE status != '0' ORDER BY uid DESC LIMIT 5"
);
while
(
$account
=
db_fetch_object
(
$result
))
{
$output
.
=
lm
(
$account
->
name
,
array
(
"mod"
=>
user
,
"op"
=>
"view"
,
"id"
=>
$account
->
uid
))
.
"<br />"
;
$output
.
=
lm
(
(
strlen
(
$account
->
name
)
>
15
?
substr
(
$account
->
name
,
0
,
15
)
.
'...'
:
$account
->
name
)
,
array
(
"mod"
=>
user
,
"op"
=>
"view"
,
"id"
=>
$account
->
uid
))
.
"<br />"
;
}
return
$output
;
}
...
...
modules/user/user.module
View file @
0b596a8e
...
...
@@ -501,11 +501,10 @@ function user_block() {
$result
=
db_query
(
"SELECT uid, name FROM users WHERE timestamp > unix_timestamp() -
$time
ORDER BY timestamp DESC LIMIT
$limit
"
);
if
(
db_num_rows
(
$result
))
{
$output
=
"
<ol>
"
;
$output
=
""
;
while
(
$account
=
db_fetch_object
(
$result
))
{
$output
.
=
'<li>'
.
lm
((
strlen
(
$account
->
name
)
>
1
0
?
substr
(
$account
->
name
,
0
,
1
0
)
.
'...'
:
$account
->
name
),
array
(
"mod"
=>
"user"
,
"op"
=>
"view"
,
"id"
=>
$account
->
uid
))
.
'</li>'
;
$output
.
=
lm
((
strlen
(
$account
->
name
)
>
1
5
?
substr
(
$account
->
name
,
0
,
1
5
)
.
'...'
:
$account
->
name
),
array
(
"mod"
=>
"user"
,
"op"
=>
"view"
,
"id"
=>
$account
->
uid
));
}
$output
.
=
"</ol>"
;
$block
[
2
][
"content"
]
=
$output
;
}
$block
[
2
][
"subject"
]
=
t
(
"Who's online"
);
...
...
@@ -520,7 +519,7 @@ function user_block() {
function
user_new_users
()
{
$result
=
db_query
(
"SELECT uid, name FROM users WHERE status != '0' ORDER BY uid DESC LIMIT 5"
);
while
(
$account
=
db_fetch_object
(
$result
))
{
$output
.
=
lm
(
$account
->
name
,
array
(
"mod"
=>
user
,
"op"
=>
"view"
,
"id"
=>
$account
->
uid
))
.
"<br />"
;
$output
.
=
lm
(
(
strlen
(
$account
->
name
)
>
15
?
substr
(
$account
->
name
,
0
,
15
)
.
'...'
:
$account
->
name
)
,
array
(
"mod"
=>
user
,
"op"
=>
"view"
,
"id"
=>
$account
->
uid
))
.
"<br />"
;
}
return
$output
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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