This is how my block looks on my local test forum, ignore the 0 posts and 0 topics, its where I haven't posted anything new on the forum since the last visit

I wrote this in mind with it being on top of the middle column but the code is fairly easy to change if you want different formatting for other locations. From the Admin page, goto Portal -> Add Custom Blocks. Then fill out the first two details and copy and paste the below code into the third field.
<?php
if ($this->ipsclass->member['id'])
{
// for members
$welcometext ="<table cellpadding='0' cellspacing='0' border='0' width='100%' align='center'><tr><td align='left'>";
// avatar (1st column)
$welcomequery1 = $this->ipsclass->DB->query("SELECT * FROM ibf_member_extra WHERE id = " . $this->ipsclass->member['id']);
$avatar = $this->ipsclass->DB->fetch_row($welcomequery1);
$data['avatar'] = $this->ipsclass->get_avatar($avatar['avatar_location'], 1,$avatar['avatar_size'], $avatar['avatar_type']);
$welcometext .= $data['avatar'];
$welcometext .="</td>";
// Member text (2nd column)
$welcometext .="<td align='left'>";
$welcometext .= "Welcome back {$this->ipsclass->member['members_display_name']}<br>";
$welcomedate= $this->ipsclass->get_date($this->ipsclass->member['last_visit'], LONG);
$welcometext .= "You last visited {$welcomedate}<br>";
$welcomequery2 = $this->ipsclass->DB->query("SELECT COUNT(DISTINCT(t.tid)) as tcnt, COUNT(DISTINCT(p.pid)) as pcnt FROM ibf_posts p, ibf_topics t WHERE p.post_date < ".time()." AND p.post_date > ".$this->ipsclass->member['last_visit']." AND p.topic_id=t.tid");
$row = $this->ipsclass->DB->fetch_row($welcomequery2);
$data['topics_since'] = $row[tcnt];
$data['posts_since'] = $row[pcnt];
$welcometext .= "There has been {$data['topics_since']} posts in {$data['posts_since']} topics since your last visit!<br>";
$welcometext .= "<a href=\"{$this->ipsclass->base_url}act=Search&CODE=getnew\">{$this->ipsclass->lang['view_new_posts']}</a><br>";
$welcometext .="</td>";
// forum stats (3rd column)
$welcometext .="<td align='left'>";
$welcometext .="Forum stats:<br>";
if ( ! is_array( $this->ipsclass->cache['stats'] ) )
{
$this->ipsclass->cache['stats'] = array();
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'cache_store', 'where' => "cs_key='stats'" ) );
$this->ipsclass->DB->do_insert( 'cache_store', array( 'cs_array' => 1, 'cs_key' => 'stats', 'cs_value' =>addslashes(serialize($this->ipsclass->cache['stats'])) ) );
}
$stats = $this->ipsclass->cache['stats'];
if ($this->users_online > $stats['most_count'])
{
$stats['most_count'] = $this->users_online;
$stats['most_date'] = time();
$this->ipsclass->DB->do_update( 'cache_store',array( 'cs_array' => 1, 'cs_value' => addslashes(serialize($stats)) ),"cs_key='stats'");
}
$total_posts = $stats['total_replies'] + $stats['total_topics'];
$total_posts= $this->ipsclass->do_number_format($total_posts);
$welcometext .= "Members: {$stats['mem_count']}, Topics {$stats['total_topics']}<br>";
$welcometext .= "Replies: {$stats['total_replies']}, Total Posts: {$total_posts}<br>";
$welcometext .= "Our newest member: <a href=\"{$this->ipsclass->base_url}showuser={$stats['last_mem_id']}\">{$stats['last_mem_name']}</a><br>";
$welcomequery3 = $this->ipsclass->DB->query("SELECT `id`,`name`,`posts` FROM ibf_members WHERE 1 ORDER BY `posts` DESC LIMIT 1");
$row = $this->ipsclass->DB->fetch_row($welcomequery3);
$welcometext .= "Top poster: <a href=\"{$this->ipsclass->base_url}showuser={$row[id]}\">{$row[name]}</a> ({$row[posts]} posts)<br>";
$welcometext .="</td></tr></table>";
}
// for guests
else
{
// first column
$welcometext ="<table cellpadding='0' cellspacing='0' border='0' width='100%' align='center'><tr><td align='left'>";
$welcometext .="Welcome Guest!<br>";
$welcometext .= "<a href=\"{$this->ipsclass->base_url}act=Search&CODE=getactive\">View all of todays active posts.</a><br>";
$welcometext .="</td>";
// second column
$welcometext .="<td align='left'>";
$welcometext .="<form action=\"{$this->ipsclass->base_url}act=Login&CODE=01\" method=\"post\" name=\"LOGIN\" onsubmit=\"return ValidateForm()\">
<input type=\"hidden\" name=\"CookieDate\" value=\"1\" checked=\"checked\" />
<table width=\"50%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td>Username:</td>
<td><input type=\"text\" size=\"15\" maxlength='150' value=\"\" name=\"UserName\" class=\"forminput\" /></td>
</tr>
<tr>
<td>Password:</td>
<td><input type=\"password\" size=\"15\" name=\"PassWord\" class=\"forminput\" /></td>
</tr>
<tr>
<td><input class=\"button\" type=\"submit\" name=\"submit\" value=\"Login\" /></td>
</tr>
</table>
</form>";
$welcometext .="<a href=\"{$this->ipsclass->base_url}act=Reg&CODE=00\">Register</a>";
$welcometext .="</td></tr></table>";
}
echo "$welcometext";
?>While everything should work fine, I should point out I am not an expert coder so there are likely better ways of writing the code, feel free to post any changes here and I will add them to this post. If you have any problems or questions feel free to ask and I will try and answer them.














