As for not having them be logged in, then I'd say you're missing some session variables that are set during the vB login process. I'm sure if you look hard enough in the vB code, you can find the login processing page, and you can see what session variables are set during login.
As for showing information after they log in, you'd have to check for some cookie information, specifically:
Last Visited :: bblastvisit
Last Activity :: bblastactivity
User ID :: bbuserid
From there you can do something like:
<?php
$userID = intval($_COOKIE['bbuserid']);
$last_visited = $_COOKIE['bblastvisit'];
$last_activity = $_COOKIE['bblastactivity'];
// Change this to be the prefix for all of your tables
$table_prefix = 'vB__';
$query = "SELECT `username` FROM `{$table_prefix}user` WHERE `userid`={$userID}";
$result = mysql_query($query);
if(!$result || mysql_num_rows($result) < 1)
echo 'User data unavailable';
else
{
$row = mysql_fetch_assoc($result);
echo 'Welcome <strong>' . $row['username'] . '</strong>!<br />
Last Login: ' . date('n d, Y g:i a', $last_login) . '<br />';
// read count
$query = "SELECT COUNT(*) AS `count` FROM `{$table_prefix}pm` WHERE `userid`={$userID} AND `messageread` > 0";
$result = mysql_query($query);
if(!$result || mysql_num_rows($result) < 1)
$read = 0;
else
{
$row = mysql_fetch_assoc($result);
$read = $row['count'];
}
// Unread count
$query = "SELECT COUNT(*) AS `count` FROM `{$table_prefix}pm` WHERE `userid`={$userID} AND `messageread`=0";
$result = mysql_query($query);
if(!$result || mysql_num_rows($result) < 1)
$unread = 0;
else
{
$row = mysql_fetch_assoc($result);
$unread = $row['count'];
}
$total = $unread + $read;
echo 'Private Messages: ' . $unread . ' unread of ' . $total . ' messages';
}
Not guaranteed to work, but should help you get on your way to what you want to do. The $table_prefix variable is just a placeholder. You'd have to look at your database to see what the prefix is for your forum, and change that variable at the top of the code I provided.
Hope that helps.