UserGuide: Comments plugin

Difference between revisions from 2009/10/03 18:36 and 2009/08/24 20:02.
{include:subpage plugins}
Comments plugin provides support for page comments.

Plugin is integrated with BetterEditor and Captcha plugin, but it doesn't depend on them.

!Inserting into pages
* Globally - insert {plugin:COMMENTS} into your template on some suitable place
** If there's some page on which you don't want comments, place ^{NO_COMMENTS} into this page
* Locally - place ^{COMMENTS} into the desired page

!Customization
There's not much to configure - only the sorting order of comments (oldest/newest first), in ''plugins/wkp_Comments.php'' near the top.

!Template
Appearance of the comments can be arbitrarily changed using its template located in ''plugins/Comments/template.html''. 

Comments template is divided into two sections:
* Form - contains form with input fields etc., it is rendered only once
* Comments - is enclosed in ''{item}'' and ''{/item}'' and is rendered for each comment 


!!Form tags

* {COMMENTS}^{COMMENTS} - localized "comments"
* {FORM_NAME} - localized "name"
* {FORM_EMAIL} - localized "email"
* {FORM_CONTENT} - localized "content"
* {FORM_SUBMIT} - localized "submit"
* {NUMBER_OF_COMMENTS} - number of comments :)

Following are values of previously submitted comment which failed captcha text. Theys should be placed inside the ''value=""'' and textarea.

* {FORM_NAME_VALUE}
* {FORM_EMAIL_VALUE}
* {FORM_CONTENT_VALUE}


!!Comment tags
These can only be used inside the ''{item}{/item}''.

* {CONTENT} - contains actual comment content
* {NAME} - name of the author
* {EMAIL} - email of the author
* {NAME_TO_EMAIL} - returns name as a link to the email, if filled, or just plain name if not filled
* ^{IP} - IP of the author
* ^{DATE} - date of the comment, formatted using the $DATE_FORMAT set in the core LionWiki
* {NUMBER} - chronological number of the comment

!Deleting comments
Deleting comments is password protected - by [Admin|UserGuide: Admin plugin] password.

!RSS
By default, RSS file with recent comments is generated in ''var/comments-rss.xml''.

{tags:userguide, plugin}