By Jboo on
Hi,
I've created a new content type called "deals" which can be created by registered users. In my template I've added a link to node/add/deals which is fine for registered users. However, anoymous users are directed to a Access Denied page. How can I create a link for visitors to create an account or login if they haven't already, or for the node/add/deals link to appear if they are logged in?
Thanks for any help.
Comments
_
I started using LoginToboggan, and have never looked back :-)
http://drupal.org/project/logintoboggan
Pete.
conditional
global $user;
if ($user->uid) print("you are logged in");
else print("you are not logged in");
Anonymous user is always 0.
_
This would probably work -
Pete.
Great, thanks Pete. I've
Great, thanks Pete. I've managed to get what I needed with just this code, although the LoginToboggan module looks quite useful too.
Thanks again.
My new EasySnoozing, Nursing and BusinessEgghead websites on D7!
Pete, how can I make this
Pete, how can I make this into a function to call from the template.php?
_
You could try something like -
though you'd be better off using Drupal's Swiss Army switchblade of a link generator (see http://api.drupal.org/api/function/l/6)
If coding is like a box of chocolates, all I can say is that it's a shame most of the options are Coffee Cremes :-)
Pete.
Thanks Pete! ...that's a good
Thanks Pete!
...that's a good one! :-)