tabular display : not very good , better methods to display results !
i agree tabular results display is very good , but then i hate it when the user_relationships modules displays even the users in a tabular form , .. there is a better way you could display the users, ... and if the user pictures are enabled , then even the pictures could be displayed , ... it looks so much better than the tabula display , ... here is part of a module i wrote which uses this type of display , :
$output .= "<table align='center'><tr><td width = 15%>".roles_display_get_picture($display_user)."</td>";
$output .= "<td width= 60% >".theme('username',$display_user)."<br>";
$output .= "</td></tr></table>";
$output .= "<td width= 60% >".theme('username',$display_user)."<br>";
$output .= "</td></tr></table>";
where roles_display_get_picture is just another modification of theme_user_picture(), ... the function is as follows :
function roles_display_get_picture($account) {
if (variable_get('user_pictures', 0)) {
if ($account->picture && file_exists($account->picture)) {
$picture = file_create_url($account->picture);
}
else if (variable_get('user_picture_default', '')) {
$picture = variable_get('user_picture_default', '');
}
if (isset($picture)) {
$alt = t("@user's picture", array('@user' => $account->name ? $account->name : variable_get('anonymous', t('Anonymous'))));
$picture = theme('image', $picture, $alt, $alt, '', FALSE);
if (!empty($account->uid) && user_access('access user profiles')) {
$picture = l($picture, "user/$account->uid", array('title' => t('View user profile.')), NULL, NULL, FALSE, TRUE);
}
return "<div align='left'>".$picture."</div>";
}
}
}
if (variable_get('user_pictures', 0)) {
if ($account->picture && file_exists($account->picture)) {
$picture = file_create_url($account->picture);
}
else if (variable_get('user_picture_default', '')) {
$picture = variable_get('user_picture_default', '');
}
if (isset($picture)) {
$alt = t("@user's picture", array('@user' => $account->name ? $account->name : variable_get('anonymous', t('Anonymous'))));
$picture = theme('image', $picture, $alt, $alt, '', FALSE);
if (!empty($account->uid) && user_access('access user profiles')) {
$picture = l($picture, "user/$account->uid", array('title' => t('View user profile.')), NULL, NULL, FALSE, TRUE);
}
return "<div align='left'>".$picture."</div>";
}
}
}
, now the need for use of tables in the markup is that the picture be displayed beside the text details , ...... try it out !!
