2 Comments issues

liaj

Joined: 2004-04-21
Posts: 112
Posted: Mon, 2005-12-19 06:33

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.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-12-26 07:30

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

 
id01

Joined: 2005-11-07
Posts: 62
Posted: Thu, 2005-12-29 03:50

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.

 
id01

Joined: 2005-11-07
Posts: 62
Posted: Thu, 2005-12-29 04:55

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.

 
Rubke

Joined: 2006-01-01
Posts: 2
Posted: Mon, 2006-01-02 18:49

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();
}

 
Rubke

Joined: 2006-01-01
Posts: 2
Posted: Tue, 2006-01-03 20:25

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();
}

 
tinroof

Joined: 2006-02-07
Posts: 8
Posted: Mon, 2006-02-27 23:00

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

Quote:
$AddComment['thumbnail'] = $thumbnailData;

also, don't forget to add the actual Item to $AddComment, as well (it's not in there by default).

Quote:
$AddComment['item'] = $item->getMemberData();

the thumbnail in add comment is called with
{g->image item=$AddComment.item image=$AddComment.thumbnail [...width, height, blah blah blah]}