Thread: Avatar in menu
View Single Post
  #6  
Old 03-31-2012, 01:12 PM
solskenn's Avatar
solskenn solskenn is offline
Member
 
Join Date: Mar 2012
Location: Ankh-Morpork
Posts: 73
Gender: Female
Credits: 6,109
solskenn is on a distinguished road
Default

I'm still having problems getting this to work. No matter where/how I put the code in it still says something like "error on line..." and when I check that line it was a code that worked before.

This is practically the default code, with minor edits for my site. Can you help?




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>";
		}
		$sidebar = "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>";
Reply With Quote