Closed (fixed)
Project:
ImageCache Actions
Version:
6.x-1.6
Component:
Text Actions Module
Priority:
Minor
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
18 Dec 2009 at 13:44 UTC
Updated:
5 Feb 2010 at 19:30 UTC
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
Comment #1
dman commented$node->name gives you the owner of the node that contains the image.
Comment #2
kaakuu commentedThanks, 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.Comment #3
dman commentedlooks like a typo in my code there... I'll review
Comment #4
dman commented... 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.
Comment #5
kaakuu commentedThanks. 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.
Comment #6
dman commented