First you have to require the library:
// Require the library<br />require ("./includes/main.inc.php");
Then you have to use the authenticate user function:
$userob = new user;<br />$user = $userob -> authenticate();
Then you could do something like this:
isset($user['U_Username']) && $Username = $user['U_Username'];
and that would give you the user name
Note: The authenticate function will give you: U_Username,U_Password,U_SessionId, U_StyleSheet, U_Status, U_Privates, U_FrontPage, U_Number, U_Banned,U_LastOn, and U_OC_Userid plus it can accept input from you on a lot of other user data (just take a look at the showflat.php file for an example of what you can pull out of the database).