[support] PHP block snippet for account details
Bruce Whealton
brucewhealton at yahoo.com
Sun Mar 5 19:32:08 UTC 2006
Hi,
I created a block with the code that doesn't seem to be working but seems to give me the correct link anyway. I had a site of mine that was missing the link to my account. I could hard code in my own link and one for each user but that doesn't work, no one wants to see links to all the other users. So, I created a block that has a link that is of the form
drupalpath/user/ where drupalinstall is the full path to my drupal installation.
This gives the user page for whomever is logged in. When I'm logged in it goes to
user/1/
when I log in another user that I created it goes to the other users page, e.g.
user/2/
I was using the variable $userid which seems to get thrown away in my code or is this working? Is there a different variable I might want to use besides $userid
Here's the code, which I hope will be obvious about where the error might be.
<?php
$output = ''; // single quotes
$output .= '<a href=';
$output .= '"user/'; // single quote with double quotes inside.
$output .= $userid; // no quotes as I"m getting the $userid variable
$output .= '">Account/Profile details</a>';
return $output;
?>
If it just needs /user/ for the full path to any users account listing, then I don't need the php.
Thanks,
Bruce
++++++++++++++++++++++++++++++++++++++++++++++++++++
Bruce Whealton - Webmaster/Designer/publisher/Writer
http://trianglewebservices.com/
Word Salad Poetry Magazine - join us online at:
http://wordsalad.net/
Street Exposure - Street Newspaper
http://wordsalad.net/StreetExposure/
++++++++++++++++++++++++++++++++++++++++++++++++++++
---------------------------------
Yahoo! Mail
Use Photomail to share photos without annoying attachments.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20060305/18187094/attachment.htm
More information about the support
mailing list