Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By Xano on
I'm trying to find out how to check whether the current visitor is a logged in user or not. In any other file than node.tpl.php and comment.tpl.php I could easily use $user to check, but this object has got a whole other meaning in those two files. I wasn't able to find anything using Google, so I wondered if anyone here could enlighten me on this. Thanks in advance!
Comments
http://drupal.org/node/144735
http://drupal.org/node/144735
User = role GUEST rid =1
http://drupal.org/node/92218
~~
Linux, Drupal5 and Simple Machines Forum R great (got a "non-Russian Bridge yet (for me..))
http://veberu.hostfabrica.ru/index.php
DRUPAL ME BAD!!! & Feel free to contact me (4 faster repsonse) I am happy to look at your site (privately or com
The global part did the
The global part did the trick. Hadn't thought of that. Thanks!
UR welcome .. ~~ Linux,
UR welcome ..
~~
Linux, Drupal5 and Simple Machines Forum R great (got a "non-Russian Bridge yet (for me..))
http://veberu.hostfabrica.ru/index.php
DRUPAL ME BAD!!! & Feel free to contact me (4 faster repsonse) I am happy to look at your site (privately or com
how is it in core themes
Thank you. This is useful, but I have looked through some of the core themes to look how it is implemented in them, and I can't see any code like that above in any of the template/theme files... does anyone know how they do it in the core themes....?
Thanks,
It is very useful information.
ChanHan Hy
Cool...thanks!
Saved me a couple of hours of poking around in code. Thanks a ton!
You should use the variable
You should use the variable $logged_in.