Reputation: 162
so I have this little box on my site that displays links about the user when logged in. I just added a feature where it gets how many unread messages the user has and displays it next to messages "Messages (1)". It just messed up the formatting completely and I tried to fix it but it isn't cooperating. I have been fighting it for over an hour, any help would be greatly appreciated.
To see what I am talking about, go to the link and the box is in the top right corner. I am trying to get the links to be inline. So it should read:
My Account Messages (0) Logout
right now, the logout is in a weird position and I can't seem to resolve it.
URL: http://www.clanrippgaming.net/
Thanks a bunch
Here is the php code:
echo "<div class='logged_in'>";
echo "<div class='welcome'>".$user->data['username'] ;"</div>";
echo "<div class='account'><a href=\"forums/ucp.php\">My Account</a></div>";
echo "<div class='account'><a href=\"forums/ucp.php?i=pm&folder=inbox\">Messages (".$user->data['user_new_privmsg'].')';"</a></div>";
echo "<div class='account'><a href=\"logout.php\">Logout</a></div>";
echo "</div>";
And the CSS for it:
.logged_in {
background-image:url(images/bg_login2.png);
border:3px solid#000000;
outline:1px solid#BDBDBD;
width:304px;
height:55px;
margin-left:-2px;
padding-top:5px;
}
.logged_out {
margin-right: 22px;
position: relative;
}
.logged_out_txt {
margin-top:-20px;
}
.welcome {
color:#B40404;
font-size:22px;
font-family:"Rockwell";
padding-left:15px;
float:left;
font-weight:bold;
}
.account {
font-weight:normal;
list-style:none;
float:right;
position:center;
padding:0px;
margin-top:-5px;
font-size:16px;
text-decoration:underline;
margin-right:15px;
display: inline;
}
.account a:hover {
color:#D8D8D8
}
Upvotes: 0
Views: 34
Reputation: 168
echo '<div class="account"><a href="forums/ucp.php?i=pm&folder=inbox">Messages ('.$user->data["user_new_privmsg"].')</a></div>';
I think that should do the trick.
My tip: be consistent, choose what you want to use: double quote for attributes? Okay, then stick with that, don't go switching that over mid-code.
Upvotes: 2