Closed (fixed)
Project:
Views (for Drupal 7)
Version:
5.x-1.6
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
18 Apr 2009 at 18:06 UTC
Updated:
12 Mar 2010 at 22:01 UTC
I have my views set up so that its filters all the nodes by the authors name in the argument
the url is set up as /content/author/$arg
Now I would like to provide information about the author in the header. If I can figure out how to print $arg then I should have no problem with the rest.
Ive tried
<?php print $arg ?>
and
<php print $views->arg ?>
as well as a few other things. Can someone help me out please?
Comments
Comment #1
TheOldGuy223 commentedok I figured it out using
Now the last thing I need to do is print the authors picture
Since Im in a view and not a node the usual
wont work
Any ideas how I can pass the value of $arg and return the path of the authors picture?
Comment #2
dawehnercan you print out was $x is?
is this the username or the uid?
Comment #3
TheOldGuy223 commented$x is the username
Comment #4
dawehner<?php
$x = arg(2);
$account = user_load('name' => $x);
$picture = $account->picture;
Comment #5
TheOldGuy223 commentedwhen I use that code I get a
Parse error: syntax error, unexpected T_DOUBLE_ARROW in /home/--------/--------/includes/common.inc(1355) : eval()'d code on line 54
Comment #6
junedkazi commentedI think the $account statement is wrong
It should be
$account = user_load(array('name' => $x));
Hope this helps.
Thanks
Juned Kazi
Comment #7
dawehneroh sry
Comment #8
TheOldGuy223 commentedThat did the trick thank you very much.
Some stuff I just wanted to add for anyone that might need this feature in the future is to also add
as the source for your picture and it will show up looking great!
Comment #9
esmerel commentedThis looks like it got answered.