by
Saskia » Mon Jul 28, 2014 10:51 pm
I was trying out some things to fix the delete/edit problem and then found out that with some minor modifications the comments tag works just fine with members. I didn't need an avatar though so I left that one out.
here's the modified code:
comment-form:
- Code: Select all
<cms:if k_is_commentable >
<div class="comment-form" >
<h3>Post a comment</h3>
<cms:member_check_login />
<cms:form method="post" class="k_form">
<cms:if k_success >
<cms:process_comment />
<cms:if k_process_comment_success>
<cms:send_mail from=k_email_from to='saskia@boardwax.eu' subject='Comment posted'>
The following comment has been posted at your site:
<cms:show k_success />
</cms:send_mail>
<div class="k_successmessage">
<p>
Thank you for the feed back! <br>
Your comment awaits moderation and will be published as soon as reviewed by the Admin.
</p>
</div>
<cms:else />
<div class="k_errormessage">
<p>
Could not post comment! <br>
The following error occured while processing your comment:<br>
<cms:show k_process_comment_error />
</p>
</div>
</cms:if>
<cms:else />
<cms:if k_error >
<div class="k_errormessage">
<h2>Fields incomplete!</h2>
<ul>
<cms:each k_error >
<li><cms:show item /></li>
</cms:each>
</ul>
</div>
</cms:if>
<cms:if k_member_logged_out >
<p class="comment-input">
<label for="author">Name *</label>
<cms:input type="text" name="k_author" size="22" tabindex="1" required="1"/>
</p>
<p class="comment-input">
<label for="email">Email * (will not be published)</label>
<cms:input type="text" name="k_email" size="22" tabindex="2" validator="email" required="1"/>
</p>
<cms:else />
<p>
Logged in as <b><cms:show k_member_title/></b>.
</p>
</cms:if>
<p class="comment-input">
<cms:input type="textarea" name="k_comment" style="width:93%" rows="10" cols="10" tabindex="4"
validator_msg="required=Please enter something as comment"
required="1" />
<br>
</p>
<cms:if k_member_logged_out >
<p class="comment-input">
<label for="captcha">Please enter this word in the textbox below</label><br>
<cms:input type="captcha" name="captcha" format='i-r-t' />
</p>
</cms:if>
<cms:input type="submit" value="Submit" name="submit"/>
</cms:if>
</cms:form>
</div>
</cms:if>
changed
k_user_title for k_member_id
k_logged_out for k_member_logged_out
and this is the comment-list
- Code: Select all
<cms:if k_is_page >
<cms:comments page_id=k_page_id limit='5' order='asc' paginate='1'>
<cms:if k_paginated_top >
<h3><cms:show k_total_records /> Comments</h3>
<ul id="commentlist">
</cms:if>
<li id="comment-<cms:show k_comment_id />">
<p>
<cite>
<span class="commenter">
<cms:if k_comment_author_website >
<a class="url" rel="external nofollow" href="<cms:show k_comment_author_website />"><cms:show k_comment_author /></a>
<cms:else/>
<cms:show k_comment_author />
</cms:if>
</span>
<br/>
<span class="meta"><a name="<cms:show k_comment_anchor />"><cms:date k_comment_date format='F j, Y'/> at <cms:date k_comment_date format='h:ia'/></a></span>
</cite>
</p>
<div class="comment_text">
<cms:show k_comment />
</div>
</li>
<cms:if k_paginated_bottom >
</ul>
</cms:if>
<cms:paginator />
</cms:comments>
</cms:if>
Still no solution for deleting or editing the comments But it is really nice to have your comments ordered by the page they where written on.
Small update:
to make sure a members name will be used as k_author add this:
- Code: Select all
<cms:if k_member_logged_out >
<p class="comment-input">
<label for="author">Name *</label>
<cms:input type="text" name="k_author" size="22" tabindex="1" required="1"/>
</p>
<p class="comment-input">
<label for="email">Email * (will not be published)</label>
<cms:input type="text" name="k_email" size="22" tabindex="2" validator="email" required="1"/>
</p>
<cms:else/>
<cms:input class="hidden" name='k_author' type='text' value="<cms:show k_member_title/>"/>
</cms:if>