How to make comment link

pande

Joined: 2005-05-08
Posts: 56
Posted: Sun, 2005-11-06 22:00

In addition to my previous post, I have found out that it is not photo.tpl I have to edit to put an Add Comment-link between first/previous and next/last, but Navigator.tpl in \modules\core\templates\blocks\local.

I now have something likë:

<div class="first-and-previous">
{strip}
{if isset($navigator.first)}
<a href="{g->url params=$navigator.first.urlParams}" class="first">
{if isset($navigator.first.thumbnail)}
{g->image item=$navigator.first.item image=$navigator.first.thumbnail
maxSize="40" class="first"}
{/if}
{$prefix}{g->text text="first"}
</a>
{/if}
{if isset($navigator.back) &&
(!isset($navigator.first) || $navigator.back.urlParams != $navigator.first.urlParams)}
<a href="{g->url params=$navigator.back.urlParams}" class="previous">
{if isset($navigator.back.thumbnail)}
{g->image item=$navigator.back.item image=$navigator.back.thumbnail
maxSize="40" class="previous"}
{/if}
{$prefix}{g->text text="previous"}
</a>
{/if}
{/strip}
<center>Add Comment</center>
</div>

But HOW o HOW, do I make a working link of that piece of text? I can't find the specific code to add a comment in a file and don't know what code I have to use, since the code is of course different for every photo. So how and where can I find the comment.AddComment code or link that will include the variable, just like the Add Comment link that can be found on top of sidebar.tpl?

Thanks!

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2005-11-07 17:00

<a href="{g->url arg1="view=comment.AddComment" arg2="itemId=`$item.id`"}">{g->text text="Add Comment"}</a>
replace $item.id with $child.id if needed.

 
pande

Joined: 2005-05-08
Posts: 56
Posted: Mon, 2005-11-07 18:37

Thx mindless, but not working! I've tried both $item.id and $child.id and in both cases I get the following url:

http://gallery.url.nl/main.php?g2_view=comment.AddComment&g2_itemId=

Seems to me the variable photo id isn't found...

Any suggestions?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2005-11-07 19:19

maybe $theme.item.id

 
pande

Joined: 2005-05-08
Posts: 56
Posted: Mon, 2005-11-07 19:36

Yup! Worked! Spanks a lot :)
Only he doesn't add the return url &g2_return= but I suppose that won't be a problem!

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2005-11-08 04:47

arg3="return=true"
i think it will then replace "true" with the right url.

 
eiNfach-heNNiNg

Joined: 2006-04-23
Posts: 30
Posted: Thu, 2006-04-27 16:05

Sorry for posting in this old thread, but can anyone let me know the totally codeline to add into navigator.tpl??
My line
<a href="{g->url arg1="view=comment.AddComment" arg2="itemId=`$item.id`"}">{g->text text="Add Comment"}</a>
doesn't work.
Would be very nice to get the totally code because I dont understand, where I have to add "$theme.item.id".

Thx for coming answers very much!

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2006-04-27 21:36

as it says a couple posts up, $theme.item.id

 
scotchsean

Joined: 2006-07-05
Posts: 4
Posted: Thu, 2006-07-06 06:13

I used <a href="{g->url arg1="view=comment.AddComment" arg2="itemId=`$theme.item.id`" arg3="return=true"}">{g->text text="Add Comment"}</a>
to get add comment to work.. all was good cept for returning to the page with the photo.
I have the latest version of Gallery 2.1
Maybe return=true doesn't work with this version?

Thanks

 
mihatt

Joined: 2006-10-02
Posts: 7
Posted: Sat, 2006-12-09 09:08

How to check if user has permision to add a comment? If he doesnt have right access I dont wont him to see the link ...

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2006-12-09 16:34

something like {if $theme.permissions.comment_add} i can add comments {/if}

 
mihatt

Joined: 2006-10-02
Posts: 7
Posted: Sat, 2006-12-09 19:45

Works great - Thanks!