Hi Andy,
I used your script to display the user that is logged in a block
but some how is displays other user.
When I go to the http://drupla/user link it shows the correct user but the scripts that added as a block shows a different user:
<?php global $user;
<?php if ($user->uid): ?>
Welcome <b><?php print $user->name; ?></b>
<?php else: ?>
Martin Hooper wrote:I just added the following code into a suitable place in my page.tpl.php:
> Is there a module that will display the logged in user?
>
<?php if ($user->uid): ?>
Welcome <?php print $user->name; ?>
(<a href="<?php print base_path() ?>logout/" >Log out</a>)
<?php else: ?>
<a href="<?php print base_path() ?>user/" >Log in /<?php endif; ?>
register</a>
This prints 'Welcome <user name>' plus a log in /out link.
If that's any help?
andy