hmmm something I posted is missing ... sorry ...must have been the spam filter ...anyway here it is again:
==================================
I tested this completely on Zenphoto and it works GREAT .as soon as I added it to the API for the plugin it returns user. any ideas as to why?
==================================
$id = "someid";
$row = query_single_row('SELECT '.prefix("images").'.id, '.prefix("images").'.filename, '.prefix("albums").'.folder FROM
'.prefix("images").' LEFT JOIN '.prefix("albums").' ON '.prefix("images").'.albumId = '.prefix("albums").'.id
WHERE
'.prefix("images").'.id='.$id, true);
$albumobject = new Album(new Gallery(),$row['folder']);
$imageobject = newImage($albumobject, $row['filename']);
$username = 'Joh Doe';
$commentText = 'HELLO Blaster World';
$postcomment = $imageobject->addComment($username, 'fake-email.com', '', $commentText, '','' , '', '', '', '');
echo 'postcomment '. $postcomment;