Change both of the "$sidebar =" to "$links ="
Once you have done that, place your html div tags, or whatever you are using to style your site, right inside of the quotes.
You should now have something like this:
PHP:
if($mysidia->user->isloggedin == TRUE) {
$links = "<div class='ddmenu' style='top:-25px;'>";
}
else {
$links = "<div class='ddmenu' style='top:0px;'>
<b><u>Member Login:</u></b><br />
<form name='form1' method='post' action='login.php'>
<p>Username: <input name='username' type='text' id='username'></p>
<p>Password: <p><input name='password' type='password' id='password'></p>
<p><input type='submit' name='Submit' value='Log In'></p>
</form>Don't have an account?<br /><a href='register.php'>Register Free</a><br /><a href='forgotpass.php'>Forgot Password?</a><br />";
}
Note: your <div> tag will probably be different than mine. I have a menu that floats above my website so I have to style mine a little differently.
Okay, so now you have gotten that set up, let's place it in the LINKSBAR.
Find "private function getlinks()" in the same file.
Once there, you want add our login form above
PHP:
$links = "<div class='ddmenu'>\n<ul>";
After that, change
PHP:
$links = "<div class='ddmenu'>\n<ul>";
to
so the menu displays properly.
You should now have something similar to:
PHP:
private function getlinks(){
// This method gets the links for the top bar from the database
global $mysidia;
if($mysidia->user->isloggedin == TRUE) {
$links = "<div class='ddmenu' style='top:-25px;'>";
}
else {
$links = "<div class='ddmenu' style='top:0px;'>
<b><u>Member Login:</u></b><br />
<form name='form1' method='post' action='login.php'>
<p>Username: <input name='username' type='text' id='username'></p>
<p>Password: <p><input name='password' type='password' id='password'></p>
<p><input type='submit' name='Submit' value='Log In'></p>
</form>Don't have an account?<br /><a href='register.php'>Register Free</a><br /><a href='forgotpass.php'>Forgot Password?</a><br />";
}
$links .= "\n<ul>";
$stmt = $mysidia->db->select("links", array(), "linkparent < 1 ORDER BY id ASC");
while ($category = $stmt->fetchObject()) {
$links .= "\n<li><a class='hide' href='{$category->linkurl}'>{$category->linktext}</a>
\n<ul>";
$stmt2 = $mysidia->db->select("links", array(), "linkparent='{$category->id}' ORDER BY id ASC");
while($item = $stmt2->fetchObject()){
$links .= "<li><a href='{$item->linkurl}' title='{$item->linktext}'>{$item->linktext}</a></li>";
}
$links .= "</ul>
\n</li>";
}
$links .= "\n</ul>";
return $links;
}
After you got that, you can edit the login form layout to get it to how you want it, and then you are done with getting it above the menu!