drupal 5 user id variable? Not $user->id like in drupal 6. Help is appreciated!

Events happening in the community are now at Drupal community events on www.drupal.org.
jnicola's picture

Hey everyone,

I'm doing some custom theme-ing. I've found it extremely useful to be able to place "edit this image" above images in image galleries for content administrators. In drupal 6 I've been placing the code in node.tpl.php and and saying is user != 0 then display the edit div. Since only content admins are users, it's a safe methodology.

Anyways, I can't seem to find the variable in drupal 5. $uid is constantly set at 1 for some god awful reason, and $user->uid doesn't work either!

Thanks everyone,
Jesse

Comments

global $user;?

dnotes's picture

$user->uid is what I use all the time, though you have to include the line "global $user;" first.

Portland (Oregon)

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: