Sidebar Login Script
-
Hi,
I have written the following script to display various things and to allow people to login via the sidebar of a project, once logged in it should display various links depending on the user level. The script is not working as it is not detecting names, or the logged in users level. Please can someone assist? Script below:
<li class="spec"> <?php global $user_ID; get_currentuserinfo(); if ('' == $user_ID) { //no user logged in ?> <form name="loginform" id="loginform" action="http://localhost/Other/wsbeorchids/wp-login.php" method="post"> <div> <label>Username</label> <input type="text" name="log" id="user_login" class="input" value="admin" size="20" tabindex="10" /> </div> <div> <label>Password</label> <input type="password" name="pwd" id="user_pass" class="input" value="" size="20" tabindex="20" /> </div> <div class="forgetmenot"> <input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90" /> <label>Remember Me</label> </div> <div> <input type="submit" name="wp-submit" class="submit" value="Log In" tabindex="100" /> <input type="hidden" name="redirect_to" value="http://localhost/Other/wsbeorchids/" /> <input type="hidden" name="testcookie" value="1" /> </div> </form> <ul> <li><a href="http://localhost/Other/wsbeorchids/wp-login.php?action=lostpassword">Forgotten Password?</a></li> <?php wp_register(); ?> </ul> <?php } else { // user logged in echo "<ul>"; if ($current_user->user_level == '10') { ?> <li><a href="<?php bloginfo('url');?>/wp-admin/post-new.php">New Post</a></li> <li><a href="<?php bloginfo('url');?>/wp-admin/edit-pages.php">Edit Pages</a></li> <li><a href="<?php bloginfo('url');?>/wp-admin/edit-comments.php">Comment Moderation</a></li> <li><a href="<?php bloginfo('url');?>/wp-admin/users.php">User Moderation</a></li> <li><a href="<?php bloginfo('url');?>/wp-admin/options-general.php">Options Panel</a></li> <?php } else { ?> <li>Welcome, <?php echo $current_user->user_firstname . ' ' . $current_user->user_lastname; ?></li> <li><a href="<?php bloginfo('url'); ?>/wp-admin/profile.php">Edit Profile</a></li> <li><a href="<?php bloginfo('url'); ?>/wp-admin/tools.php">Install Gears</a></li> <?php } ?> <li><a href="<?php echo wp_logout_url( get_bloginfo('url') ); ?>" title="Logout">Logout</a></li> </ul> <?php } ?> </li>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Sidebar Login Script’ is closed to new replies.