Jump to content

Recommended Posts

Hello,

 

Iv finished my login/register function now! wooop! But i am wanting to remove the register/login menu from registered users now, how would I go about doing this? Thanks!

 

This is the menu code from the index page!

    <div class="navbar navbar-inverse navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="brand">EnderBase</a>
          <div class="nav-collapse collapse">
            <ul class="nav">
              <li class="active"><a>Home</a></li>
              <li><a href="http://enderbase.com/about.php">About</a></li>
              <li><a href="http://enderbase.com/contact.php">Contact</a></li>
              <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Register/Login <b class="caret"></b></a>
                <ul class="dropdown-menu">
                  <li><a href="http://enderbase.com/register.php">Register</a></li>
                  <li><a href="http://enderbase.com/login.php">Login</a></li>
                  <li class="divider"></li>
                  <li><a href="http://enderbase.com/activate.php">Account Activation</a></li>
                </ul>
              </li>
            </ul>
          </div><!--/.nav-collapse -->
        </div>
      </div>
	  </div>

 

 

When you're printing out the menu, you could throw in an if, just like jcbones suggested:

 

<ul class="nav">
    <li class="active"><a>Home</a></li>
    <li><a href="http://enderbase.com/about.php">About</a></li>
    <li><a href="http://enderbase.com/contact.php">Contact</a></li>
    <?php
	if(!logged_in()) {
	?>
    <li class="dropdown">
    <a href="#" class="dropdown-toggle" data-toggle="dropdown">Register/Login <b class="caret"></b></a>
    <ul class="dropdown-menu">
        <li><a href="http://enderbase.com/register.php">Register</a></li>
        <li><a href="http://enderbase.com/login.php">Login</a></li>
        <li class="divider"></li>
        <li><a href="http://enderbase.com/activate.php">Account Activation</a></li>
    </ul>
    </li>
    <?php
	}
	?>
</ul>

 

- W

When you're printing out the menu, you could throw in an if, just like jcbones suggested:

 

<ul class="nav">
    <li class="active"><a>Home</a></li>
    <li><a href="http://enderbase.com/about.php">About</a></li>
    <li><a href="http://enderbase.com/contact.php">Contact</a></li>
    <?php
	if(!logged_in()) {
	?>
    <li class="dropdown">
    <a href="#" class="dropdown-toggle" data-toggle="dropdown">Register/Login <b class="caret"></b></a>
    <ul class="dropdown-menu">
        <li><a href="http://enderbase.com/register.php">Register</a></li>
        <li><a href="http://enderbase.com/login.php">Login</a></li>
        <li class="divider"></li>
        <li><a href="http://enderbase.com/activate.php">Account Activation</a></li>
    </ul>
    </li>
    <?php
	}
	?>
</ul>

 

- W

Thanks Yomanny! :) and JCbones!

When you're printing out the menu, you could throw in an if, just like jcbones suggested:

 

<ul class="nav">
    <li class="active"><a>Home</a></li>
    <li><a href="http://enderbase.com/about.php">About</a></li>
    <li><a href="http://enderbase.com/contact.php">Contact</a></li>
    <?php
	if(!logged_in()) {
	?>
    <li class="dropdown">
    <a href="#" class="dropdown-toggle" data-toggle="dropdown">Register/Login <b class="caret"></b></a>
    <ul class="dropdown-menu">
        <li><a href="http://enderbase.com/register.php">Register</a></li>
        <li><a href="http://enderbase.com/login.php">Login</a></li>
        <li class="divider"></li>
        <li><a href="http://enderbase.com/activate.php">Account Activation</a></li>
    </ul>
    </li>
    <?php
	}
	?>
</ul>

 

- W

Could I do this for non registered users? to hide stuff if they are not logged in?

 

	if(!user_registerd) {
	?>
	<li class="dropdown">
    <a href="#" class="dropdown-toggle" data-toggle="dropdown">My Account<b class="caret"></b></a>
    <ul class="dropdown-menu">
	     <li><a href="http://enderbase.com/account.php">Manage Account</a></li>
        <li><a href="http://enderbase.com/register.php">My Submissions</a></li>
        <li><a href="http://enderbase.com/logout.php">Logout</a></li>
		<?php
		}
		?>
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.