By PRFB on
Sorry for what's probably a very basic question to anyone who knows anything about PHP....
I have a block that's only seen by logged-in users. Right now it includes some static links to frequently-used spots on the site. I'd like to add a link to the user's own tracker.
It would be a link like "user/[user#]/track"
The thing is, I don't know how to tell Drupal to replace "[user#]" with the right number for the logged-in user.... Could anyone tell me how?
Many thanks,
P
Comments
To do this "by hand" via
To do this "by hand" via PHP, you would first need to set the input format of the block content to "PHP code". Then, you put something like this (in Drupal 5 at least)
<?php global $user; print l('My Posts', 'user/' . $user->uid . '/track'); ?>where you'd want to print the link to the user's tracker.
Thank you!
Awesome. Worked perfectly. Thank you!