<?php
if($session->logged_in){
echo "Welcome <b>$session->username</b>, you are logged in."
."[<a href=\\"user.php?user=$session->username\\">My Account</a>] "
."[<a href=\\"useredit.php\\">Edit Account</a>] ";
if($session->isAdmin()){
echo "[<a href=\\"admin/admin.php\\">AdminCP</a>] ";
}
echo "[<a href=\\"process.php\\">Logout</a>]";
}
else{
?>
Hi,
I couldn’t decide on the most appropriate forum out of this this, HTML/XHTML, CSS and PHP but hopefully this is okay.
I’m normally great with styling but as I am quite new to PHP I have had some issues when mixing the two.
For me this displays as:
"Welcome karoshio, you are logged in.[My Account] [Edit Account] [AdminCP] [Logout] "
I want the “Welcome karoshio, you are logged in.” on the left and the rest on the right.
Any help is highly appreciated.
PS: I don’t know why the code is showing twice above, it may just be me.
karoshio:
I couldn’t decide on the most appropriate forum out of this this, HTML/XHTML, CSS and PHP but hopefully this is okay.
I’m normally great with styling but as I am quite new to PHP I have had some issues when mixing the two.
For me this displays as:
"Welcome karoshio, you are logged in.[My Account] [Edit Account] [AdminCP] [Logout] "
I want the “Welcome karoshio, you are logged in.” on the left and the rest on the right.
The easiest way would just be to float the rest of the list. Something along the lines of:
<ul id="account"><li><a href="myaccount.php">My Account</a></li>
<li><a href="edit.php">Edit Account</a></li>
<li><a href="admin.php">AdminCP</a></li>
<li><a href="logout.php">Logout</a></li></ul>
<p>Welcome karoshio, you are logged in.</p>
and for the CSS:
ul#account {float:right; margin:0;}
ul#account li {display:inline; margin:0 1em;}
You can then play around with the styling to get it looking how you want it.
PS: I don’t know why the code is showing twice above, it may just be me.
No, it isn’t just you. We don’t know either (yet), it appears to be a bug in the vBulletin 4 package that affects [noparse]
and
[/noparse] tags, but the dev team are looking into it and trying to find a fix. In the meantime, you can use [noparse]
...
[/noparse] to mark up code blocks, because those are working fine.
Thanks for the reply and explanation on the code tags. Would you be able to add your answer actually in with the PHP? I kept getting things wrong earlier when I was trying to get things to display correctly inside/around PHP.
the php tags work also: [noparse]
...
[/noparse]
Sorry, I don’t know enough about PHP to do that, all I can do is give you the end result you need the PHP to generate.