By mod_phx on
hi everyone,
how would i be able to tell if a person who is viewing a given page (or node) is logged in to drupal? basically i want a page to act differently depending on whether or not the user is logged in, like:
if user_logged_in {
// execute code for logged in users
}
else {
// execute code for non-authenticated users
}
i couldn't find anything in the drupal api to do this with. any tips?
Comments
Interested also
I am interested in this also
http://www.opensourcefriends.com - Ask the simple questions.
Not really an API things,
Not really an API things, but searching the handbooks, I came across http://drupal.org/node/64854.
The reason is works it that for non-authenticated users, the uid equals 0, which returns as false in the above example.
You can also use:
----------
My Drupal/Tech Thoughts
vbDrupal Articles at Skejo.com
in page content
Using PHP input format, you can use PHP tags mixed with normal markup like:
---
Work: BioRAFT
What about external integration?
This wont work on files outside of Drupal's core. What's the solution to replicate this on a file thats outside of Drupal but is being outputted via Drupal?
I got too lazy and wrote a module in a separate php page and used iframes to get it into Drupal. *shameful i know*
------------------------------
BioALIEN
Buy/Sell/Trade with other webmasters: WebMasterTrader.com
You can use this,<?phpif
You can use this,