Closed (cannot reproduce)
Project:
ImageCache Actions
Version:
6.x-2.0
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
2 Jan 2011 at 00:58 UTC
Updated:
12 Jun 2012 at 17:50 UTC
I am attempting to have a user's name appear on the bottom of the user's profile picture. Can anyone let me know what the php code is for that? I have checked the "Evaluate text as PHP code" box, and tried a few different values but have had no success as of yet. Note, my server currently is suffering from "Low Quality / Poor Performance GD Image Filtering" so perhaps this is part of the problem, but I was hoping to find out what the correct php code should be to print out the user's name on the image.
Thanks
Comments
Comment #1
dman commentedReturn $node->name;
?
Comment #2
allandk commentedReturn $node->name;
or
Return $user->name;
not working :-(
Comment #3
dman commentedAssuming that the image in question was actually owned by - attached to - a node, and that a user owned the node, that should be working.
How are you attaching your images and assigning ownership?
Can you try putting
into the code area and seeing what values are available?
Comment #4
allandk commentedthe images are cck file field in a node called user images
Comment #5
allandk commented$user = db_fetch_object(db_query('SELECT name FROM {users} WHERE uid = %d', $node->uid));
return $user->name;
i dont understand why this is not working ???
Comment #6
dman commentedI would expect that code to work - yes.
Were you able to confirm that the $node was being loaded correctly in the first place? The algorithm that goes from filepath->file->filefield->node can be unreliable due to occasional changes in the CCK DB schema.
Comment #7
fietserwinThe 6.x-2.x is not supported anymore and we are closing all issues for it. Please feel free to reopen against the 7.x-1.x branch if the error still appears there.