Closed (fixed)
Project:
Views Bookmark
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
26 Mar 2008 at 23:40 UTC
Updated:
2 May 2008 at 15:34 UTC
I have the view set up correctly, (following this tutorial http://drupal.org/node/215178) but I'm unable to get the user picture listed with user name. The tutorial doesn't include any advice on this. I tried hardcoding using the code below in my node-blog.tpl.php, but it doesn't seem to function properly.
$accounts = module_invoke('views_bookmark', 'get_node_bookmarks', $nid);
foreach ($accounts as $account_info) {
$account = user_load($accounts_info->uid);
print theme('user_picture', $account);
}
How can I adjust the view concept from http://drupal.org/node/215178 to make it display user pictures as well?
Thanks in advance,
Marius
Comments
Comment #1
glob commentedI'm trying to do the same thing
My users pictures are stored in their node profile, so I guess that would be a bit more tricky! :)
Comment #2
mooffie commentedThe 'views_bookmark_get_node_bookmarks' function, which you use, doesn't exactly return accounts. It returns some data which is keyed by the user IDs. So you should rewrite that section as:
I haven't actually tried to run this code, so expect typos.
Let's first see if Marius' new code works. If, and only if, it works, you could change it to something along of:
Sorry I can't give you two code that I actually tested and debugged. Let's leave that as an exercise for the reader.
Comment #3
mariusooms commentedHi mooffie, thanks for the quick reply. The code works great and I actually prefer to code it in like this rather than using views. Thanks again!
Comment #4
quicksketchComment #5
yeeloon commentedHi guys,
Where and what exactly should I implement this above code?
I don't use the node profile module, instead I use the standard User picture.. but somehow the dropdown in the Fields has no such field... Can someone point me what I need to do?
Thanks in advance!
Comment #6
quicksketchHi yeeloon, could you open a new issue? The solution posted here is sort of specific to nodeprofile. It's not clear what you're trying to accomplish. Please be more specific in the new post.