Jump to content

navigation rights


Cessna1234

Recommended Posts

Hi all i have been trying to find how you are able to let pilots who are logged in verses pilots who are logged out while seeing certain options on the navigation bar. I know how you can set a tab so either logged in pilots can see for exaplme: {

// Show these if they haven't logged in yet

?>

<li><a href="<?php echo url('/registration'); ?>">Join</a></li>

<?php

?>

but say i want a tab to be view able to logged out people, but i don't want them to see some of the drop down options. Let me show you an explame: (this is the operations tab with drop down)

<!--2nd drop down menu -->

<div id="dropmenu2" class="dropmenudiv" style="width: 150px;">

<a href="http://www.bostonexpressva.org/index.php/pilots">Pilot Roster</a>

<a href="<?php echo url('/profile/edit'); ?>">Edit Profile</a>

<a href="<?php echo url('/pireps/mine'); ?>">Logbook</a>

<a href="<?php echo url('/profile/stats'); ?>">Statistics</a>

<a href="<?php echo url('/pireps/filepirep'); ?>">File Report</a>

<a href="<?php echo url('/'); ?>">Statistics</a>

<a href="<?php echo url('/'); ?>">Flight Log</a>

</div>

but i wan tall of this to be not view able to logged out pilots only logged in!

<a href="<?php echo url('/profile/edit'); ?>">Edit Profile</a>

<a href="<?php echo url('/pireps/mine'); ?>">Logbook</a>

<a href="<?php echo url('/profile/stats'); ?>">Statistics</a>

<a href="<?php echo url('/pireps/filepirep'); ?>">File Report</a>

<a href="<?php echo url('/'); ?>">Statistics</a>

<a href="<?php echo url('/'); ?>">Flight Log</a>

</div>

The only thing i want view able is the <a href="http://www.bostonexpressva.org/index.php/pilots">Pilot Roster</a>

Thanks,Skylar

Link to comment
Share on other sites

Just place this code on every page you don't want anyone (who is not logged in) to see.

<?php
if(Auth::LoggedIn() == false)
{
  echo 'You must be logged in to view this page!';
  return;
}
?>

Then all they will see on the page is your template and the text "'You must be logged in to view this page!". No other content will be visible.

Link to comment
Share on other sites

Just place this code on every page you don't want anyone (who is not logged in) to see.

<?php
if(Auth::LoggedIn() == false)
{
  echo 'You must be logged in to view this page!';
  return;
}
?>

Then all they will see on the page is your template and the text "'You must be logged in to view this page!". No other content will be visible.

So would this be correct:???

<?php

if(Auth::LoggedIn() == false)

{

echo 'You must be logged in to view this page!';

return;

<a href="<?php echo url('/profile/edit'); ?>">Edit Profile</a>

}

?>

Thanks,

Skylar

Link to comment
Share on other sites

To show you how it works, let's try it on your Pilots page. follow these steps:

1. Open your File Manager (cPanel or FTP program)

2. Go to: core/templates/pilots_list.tpl

3. Once you have it open, place this code at the very top:

<?php
if(Auth::LoggedIn() == false)
{
echo 'You must be logged in to view this page!';
return;
}
?>

4. Save the changes you made.

5. Log out of your website.

6. Go to your Pilots page by using the link www.yoursite.com/index.php/pilots (change www.yoursite.com to your website name)

7. Your Pilots page should say "You must be logged in to view this page!"

Now that you see how to do it, and how it works, repeat the process fro every page that you don't want non-members to see.

Link to comment
Share on other sites

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.

Loading...
×
×
  • Create New...