first issue:
how can i put a button to post a new comment on the photo page, and not under the thumbnails? i tried
{g->url arg1="view=comment.AddComment" arg2="itemId=`$theme.item.id`"}
which works fine except it seems like a bad hack and when i post a comment it doesnt take me back to the previous page.
Second issue:
how can i show the thumbnail of the photo being commented on *on* the comment page. ive messed around with some of the itemid code but cant seem to get anything to work.
Posts: 32509
that's perfect, not a bad hack.
you can add arg3='return=1'
then it will take you back once you added the comment.
@photo:
you'll have to edit
modules/comment/templates/AddComment.tpl
please post a link to your howto on codex.gallery2.org -> how to, adding a thumbnail should be quite easy (see album.tpl how it gets the thumbnail to show. instead of $child.id, you'll have to use $theme.item.id
Posts: 62
I would really like to know how to add this myself. Looking at the code, doesn't really tell me where to add it. For a beginner like me, poking around seem rather difficult!
I will keep looking though, if I found a solution I will try add it. I'm hoping to have a pop up link that will help adding comment.
The perfect solution would be having that comment block simply underneath the photo like in G1. But I guess you can't ask for everything.
Posts: 62
Nevermind. I add that into photo.tpl and the code seem to work perfectly, it add a link underneath the picture where it can ask people to put comment.
I was thinking about putting the addcomment.tpl directly into photo.tpl since i -really- want to get the comment input text area into the same page of the photo.tpl, but I'm struggling to get it to work so far. If anyone is any expert in this please let me know.
Posts: 2
i'm also hacking a thumbnail in the AddComment.tpl but with not mutch succes
i've added the following code in the tpl, but i get a no thumbnail link
<a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$theme.item.id`"}">
{if isset($theme.item.thumbnail)}
{g->image item=$theme.item image=$theme.item.thumbnail}
{else}
{g->text text="no thumbnail"}
{/if}
</a>
in the AddComment.inc file i've added (in the class AddCommentView)
$itemId = $item->getId();
/* Find its thumbnail */
list ($ret, $thumbnailTable) = GalleryCoreApi::fetchThumbnailsByItemIds(array($itemId));
if ($ret->isError()) {
return array($ret->wrap(__FILE__, __LINE__), null);
}
if (empty($thumbnailTable)) {
$thumbnailData = null;
} else {
$thumbnail = $thumbnailTable[$itemId];
$thumbnailData = $thumbnail->getMemberData();
}
Posts: 2
i'm also hacking a thumbnail in the AddComment.tpl but with not mutch succes
i've added the following code in the tpl, but i get a no thumbnail link
<a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$theme.item.id`"}">
{if isset($theme.item.thumbnail)}
{g->image item=$theme.item image=$theme.item.thumbnail}
{else}
{g->text text="no thumbnail"}
{/if}
</a>
in the AddComment.inc file i've added (in the class AddCommentView)
$itemId = $item->getId();
/* Find its thumbnail */
list ($ret, $thumbnailTable) = GalleryCoreApi::fetchThumbnailsByItemIds(array($itemId));
if ($ret->isError()) {
return array($ret->wrap(__FILE__, __LINE__), null);
}
if (empty($thumbnailTable)) {
$thumbnailData = null;
} else {
$thumbnail = $thumbnailTable[$itemId];
$thumbnailData = $thumbnail->getMemberData();
}
Posts: 8
to show the thumbnail, you need to append the thumbnail data to $AddComment -
in the AddComment.inc file, keep the code you have (that fetches the thumbnail), and add this
also, don't forget to add the actual Item to $AddComment, as well (it's not in there by default).
the thumbnail in add comment is called with
{g->image item=$AddComment.item image=$AddComment.thumbnail [...width, height, blah blah blah]}