summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjartan Mannes <kjartan@2.no-reply.drupal.org>2002-05-29 17:19:20 +0000
committerKjartan Mannes <kjartan@2.no-reply.drupal.org>2002-05-29 17:19:20 +0000
commit0b596a8ec426beb4df9f82bd74c82a1d8d5c8b18 (patch)
tree4efd08908d0f05a178b004a3b6df8b1acb649e2a
parentc9feee50ced97667042d858a7b87c7a32e3739ef (diff)
downloadbrdo-0b596a8ec426beb4df9f82bd74c82a1d8d5c8b18.tar.gz
brdo-0b596a8ec426beb4df9f82bd74c82a1d8d5c8b18.tar.bz2
- modified the user blocks to use the same layout and trim long usernames to
keep the blocks from ruining theme layouts.
-rw-r--r--modules/user.module7
-rw-r--r--modules/user/user.module7
2 files changed, 6 insertions, 8 deletions
diff --git a/modules/user.module b/modules/user.module
index 5242a5b50..c656d8449 100644
--- a/modules/user.module
+++ b/modules/user.module
@@ -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) > 10 ? substr($account->name, 0, 10) . '...' : $account->name), array("mod" => "user", "op" => "view", "id" => $account->uid)).'</li>';
+ $output .= lm((strlen($account->name) > 15 ? substr($account->name, 0, 15) . '...' : $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;
}
diff --git a/modules/user/user.module b/modules/user/user.module
index 5242a5b50..c656d8449 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -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) > 10 ? substr($account->name, 0, 10) . '...' : $account->name), array("mod" => "user", "op" => "view", "id" => $account->uid)).'</li>';
+ $output .= lm((strlen($account->name) > 15 ? substr($account->name, 0, 15) . '...' : $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;
}