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"> 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! |
|
Posts: 8601
<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.
Posts: 56
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?
Posts: 8601
maybe $theme.item.id
Posts: 56
Yup! Worked! Spanks a lot
Only he doesn't add the return url &g2_return= but I suppose that won't be a problem!
Posts: 8601
arg3="return=true"
i think it will then replace "true" with the right url.
Posts: 30
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!
Posts: 8601
as it says a couple posts up, $theme.item.id
Posts: 4
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
Posts: 7
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 ...
Posts: 8601
something like {if $theme.permissions.comment_add} i can add comments {/if}
Posts: 7
Works great - Thanks!