The image verification code you entered is incorrect.

Drupal: Display a block of random members with picture and basic info

<?php
$fields = array();
$result2 = db_query('SELECT name, title, type, visibility, weight FROM {profile_fields} WHERE name IN ("profile_full_name", "profile_country") ORDER BY weight');
while ($record = db_fetch_object($result2)) { $fields[] = $record; }
$count = 2;
$Block_h = $count * 85;
$result = db_query_range(db_rewrite_sql("SELECT * FROM {users} u Where CHAR_LENGTH(picture) > 0 ORDER BY RAND()"), 0, $count);
while ($user_info = db_fetch_object($result)) {
$user_info = user_load(array('uid' => $user_info->uid));
$profile = _profile_update_user_fields($fields, $user_info);
// $output .= theme('profile_block', $user_info, $profile, true);
// $output .= theme('profile_listing', $user_info, $profile);
$output .= "<div class=\"profile\" style=\"height: 85px\">\n";
$output .= theme('user_picture', $user_info);
$output .= ' <div class="name">'. theme('username', $user_info) ."</div>\n";
foreach ($profile as $field) {
if ($field->value) {
$output .= " <div class=\"field\">$field->value</div>\n";
}
}
$output .= "</div>\n";
}
print("$output");
?>



Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
More information about formatting options Captcha Image: you will need to recognize the text in it.
Please type in the letters/numbers that are shown in the image above.