Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Modules used
- Avatar upload (part of the core)
- Userpoints @ http://drupal.org/project/userpoints
<?php
global $user;
if ($user->uid == 0) { // uid == 0 means user is anonymous
return;
}
$name = $user->name;
if ($user->picture) {
$picture = $user->picture;
}
else {
$picture = 'misc/default_profile_image.jpg';
}
$my_account = l(t('My Account'), 'user/'.$user->uid);
$admin = l(t('Admin'), 'admin');
$create_content = l(t('Add Content'), 'node/add');
$logout = l(t('Logout'), 'logout');
?>
<div id="welcome-user-block">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" align="center" style="font-size: large;">Welcome back <i><?php print $name; ?></i>!</td>
</tr>
<tr>
<td rowspan="4"><div class="rtecenter"><img src="/<?php print $picture; ?>" alt="user picture" height="80" /></div></td>
<td><?php print $my_account; ?></td>
</tr>
<tr>
<td><?php print $admin; ?></td>
</tr>
<tr>
<td><?php print $create_content; ?></td>
</tr>
<tr>
<td><?php print $logout; ?></td>
</tr>
<tr>
<td colspan="2" align="center"><b><i>You now have <?php print userpoints_get_current_points($user->uid); ?> User Points.</b></i></td> // this <td> to </td> uses the userpoints module, rove the full from <tr> -> </tr> if you dont want to use userpoints
</tr>
</table>
</div>
Comments
D7
For D7 this has been turned into a module to better handle the code.
edit: Its code has been moved to a module for drupal 7 at user_details