I'm new to drupal and want to thank anyone who helps in advanced.

here's the problem...

I would like to add a page link to my nav bar that says "History" thats no problem, I'm using the private module and want each of my users (clients) to have their own history page, again no problem. Heres where it gets fun. I want to combine these two and make a link that depending on who's logged in determines what node it goes to, so when "Jane" logs in it takes her to node/9 and when "john" logs in the same link takes him to node/15 for example. Also if possible, if no one is logged in it might take them to login page or some other public page.

To sum up I want to make a menu item link to a deferent node depending on who's logged in. If anyone has an idea of how to do this they are a god to me.

Comments

kenljr’s picture

In case it helps someone I'm going to post my solution to this. I didn't get exactly what I wanted but I got close. I created a page that will be linked to from the nav bar with the following

This as you can see places the user id number in the url where @user is and redirects to the tracker page but can be modifed to go to any page specific to a user.

<?php
 global $user; $tracker.=t('index.php?q=user/@user/track', array('@user' => $user->uid));
?>

This next piece is just for search engines to tell them to never link directly to this page.

<?php
Header("HTTP/1.1 301 Moved Permanently"); Header("Location:$tracker");
?>

The final piece is to determine if the user is logged in or not and if not the takes them to the a login page. Once they are logged in it directs immediately to the requested page which it was told by the first piece of code. This code can be used on any page which you want to be user only access.

<?php
  global $user;
  if ($user->uid > 0) {
    $output = "<strong>".t("You do not have permission to view this page.")."</strong><br />";
    $output.= t("This page is only accessible to certain users.");
  } else {
    drupal_set_message(t("The page you requested is only accessible to certain users. Please log in so that we may determine your permissions."));
    unset($_REQUEST['destination']);
    drupal_goto("user/login",drupal_get_destination());
  }
  print $output;
?>

NOTE:This code must be put in the page in the order it is here or it will not work, excluding the code for search engines.