<?php get_header(); ?>
<div id="main">
<div id="content">
<div id="profile" class="narrowcolumn">
<?php
// This sets the $curauth variable
if(isset($_GET['author_name'])) :
$curauth get_userdatabylogin($_GET['author_name']);
else :
$curauth get_userdata(intval($author));
endif;
// Remove password / activation key
unset($curauth->user_pass);
unset(
$curauth->user_activation_key);
// Setup homepage link
$userlink "";
if (!empty(
$curauth->user_url)) {
    
// Prepare the HTML code for output
    
$userlink sprintf("<a href=\"%s\" title=\"Homepage of %s\" target=\"_blank\" rel=\"external\">%s</a>"strip_tags($curauth->user_url), $curauth->nicknamestr_replace("http://"""$curauth->user_url));
    
// Add click counter if Ozh's Click-Counter Plugin is installed
    
if (function_exists('wp_ozh_click_modifyhrefs')) {
        
$userlink wp_ozh_click_modifyhrefs($userlink);
    }
}

// Prepare user's description (bio?)
$description "<em>No description entered yet.</em>";
if (!empty(
$curauth->description)) {
    
// We want to strip-out HTML tags here
    
$description htmlentities(strip_tags($curauth->description), ENT_QUOTES);
}
?>
<h2 style="align: center">Profile of <?php printf('%s'$curauth->nickname); ?>

<h3>Personal data:</h3>
<ul>
<li>Real name:&nbsp;<?php printf("%s %s"$curauth->first_name$curauth->last_name); ?></li>
<li>Nickname:&nbsp;<?php printf('%s'$curauth->nickname); ?></li>
<li>Homepage:&nbsp;<?php echo $userlink?></li>
<li>Description:&nbsp;<?php echo $description?></li>
</ul>

<h3>Last posts of this user:</h3>
<!-- The Loop -->
<?php if ( have_posts() ) { ?>
<ul>
<?php while ( have_posts() ) { the_post(); ?>
<li><p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a>,<br />
<?php if(function_exists('wp_email')) { email_link(); } ?>&nbsp;|&nbsp;<?php if(function_exists('wp_print')) { print_link(); } ?>&nbsp;|&nbsp;Posted on&nbsp;<?php the_time('d M Y'); ?> in <?php the_category(' &amp;');?></p></li>
<?php ?>
</ul>
<?php } else { ?>
<p><?php _e('No posts by this author.'); ?></p>
<?php ?>
<!-- End Loop -->
</div>
</div>
<div id="sidebar">
<?php get_sidebar(); ?>
</div>
<?php get_footer(); ?>