All pastes #30652 Raw Edit

Untitled

public text v1 · immutable
#30652 ·published 2005-11-23 18:31 UTC
rendered paste body
include 'embed.php';
GalleryEmbed::init(array('fullInit' => true));

// This is what it looks like in AddComment.inc:
//$itemId = GalleryUtilities::getRequestVariables('itemId');

//This is what I've done that I'm not sure will work ($picId is the g_id from Gallery for the picture I'm adding a comment to:
$itemId = $picId;

list ($ret, $comment) =
GalleryCoreApi::newFactoryInstance('GalleryEntity', 'GalleryComment');

$ret = $comment->create($itemId);

$comment->setCommenterId($old->userId);
$comment->setHost('');
$comment->setSubject('');
$comment->setComment($old->text);
$comment->setDate(time());

$ret = $comment->save();

GalleryEmbed::done();