How can the name of the auth user uploading an image be "printed" on the image?
If it's an image that has been attached to a node using CCK-filefield-imagefield for example like $node object, $file_data object

What code can be entered like $author OR return $author; OR something in the "Evaluate text as PHP code" field?

Comments

dman’s picture

$node->name gives you the owner of the node that contains the image.

kaakuu’s picture

Thanks, a huge thanks for the snippet, Dman,

It works well. I do get intermittently an error message, for example sometimes on visiting /user, sometimes on visiting /node/*, not consistently and goes away on refresh. Can it cause any major problem or is it just okay to do error reporting 0 ?

The error message is like user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'N u.fid = f.fid WHERE f.filepath = 'sites/default/files/sample.jpg' LIM' at line 1 query: SELECT nid, f.fid FROM upload AS u INNER JOIN files AS f N u.fid = f.fid WHERE f.filepath = 'sites/default/files/sample.jpg' LIMIT 1 in ..www\test3\sites\all\modules\imagecache_actions\utility.inc on line 275.

dman’s picture

looks like a typo in my code there... I'll review

dman’s picture

... yeah, that was fixed in -dev a while back. #491038: MySQL query
The current dev branch has a replacement for that.
Note this also includes a small change to the way positions are calculated, YMMV.

kaakuu’s picture

Thanks. So what I understand that replacing that utility.inc with this one will be sufficient.
Point me if I am wrong. The utility is great as in a multiuser environment like blogging or otheres each individual can "water"mark his image automatically with his name. Kudos for creating this module.

dman’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.