solskenn, try this:
PHP Code:
//This function determines what shows in the side bar of the template
$isloggedin = $GLOBALS['isloggedin'];
$loggedinname = $GLOBALS['loggedinname'];
if($isloggedin == "yes") {
$msgctr = "<a href='messages.php'>Messages</a>";
$stmt = $GLOBALS['adopts']->query("SELECT * FROM {$GLOBALS['prefix']}messages WHERE touser='{$loggedinname}' and status='unread'");
$row = $stmt->fetchAll();
if(count($row) > 0) {
$msgctr = "<a href='messages.php'>Messages <b>(".count($row).")</b></a>";
}
$getavatar = $GLOBALS['adopts']->query("SELECT * FROM {$GLOBALS['prefix']}users_profile WHERE username='{$loggedinname}'");
while($row = $getavatar->fetch(PDO::FETCH_ASSOC)) {
$avatar=$row['avatar'];
$sidebar = "<img src='{$row['avatar']}' border='0' width='100px' height='100px'><br>
You have {$GLOBALS['money']} {$GLOBALS['settings']['cost']}.<br />
<a href='donate.php'>Donate money to friends</a><br />
<ul>
<li><a href='logout.php'>Log Out</a></li>";
[Sorry, I know the question wasn't directed towards me. :P]