[support] extracting author's UID from URL for use in a block

Neil: esl-lounge.com neil at esl-lounge.com
Thu Jun 26 11:28:31 UTC 2008


Thanks Fred. That did the trick.

Neil


----- Original Message ----- 
From: "Fred Jones" <fredthejonester at gmail.com>
To: <support at drupal.org>
Sent: Wednesday, June 25, 2008 10:20 AM
Subject: Re: [support] extracting author's UID from URL for use in a block


>> I thought I could use args to extract the UID from the URL but when I 
>> print
>> out all arguments in the block as a test, I get only "node" and "389" so
>> it's not seeing the PathAuto URL but the system URL.
>
> Correct.
>
> To get the uid use node_load to load the node details. If you use
> print_r() to examine the results, you will see that uid is one of the
> entries in the returned array. So something like:
>
> $node = node_load(arg(1));
> $uid = $node['uid'];
>
> HTH
> -- 
> [ Drupal support list | http://lists.drupal.org/ ]
> 



More information about the support mailing list