======== Comments ======== :Author: PyBlosxom Development Team :Version: $Id: comments.txt 1029 2007-06-07 02:33:12Z willhelm $ :Copyright: This document is distributed under the MIT license. .. contents:: This chapter briefly walks you through installing the comments, trackback, pingback, and CommentAPI plugins. Summary ======= PyBlosxom does not come with comments functionality built-in. Instead, comments are implemented as a plugin which people who are interested in in having comments can install and everyone else can ignore. You can get the latest stable version of the comments plugin from the `contributed plugins pack`_. Alternatively, you can get the latest version `from SVN`_, which is even more recent but may be broken. Caveat hacker! .. _contributed plugins pack: http://sourceforge.net/project/showfiles.php?group_id=67445&package_id=145140 .. _from SVN: http://pyblosxom.svn.sourceforge.net/viewvc/pyblosxom/trunk/contrib/plugins/comments/ The comments plugin also has a `README file`_ that has more information on installing comments, traceback, pingback, and the comment API. .. _README file: http://pyblosxom.svn.sourceforge.net/viewvc/*checkout*/pyblosxom/trunk/contrib/plugins/comments/README Installing the comments plugin ============================== Requirements: * A directory the web-server has writable permissions to. After making sure you have the requirements, do the following: 1. Copy ``contrib/plugins/comments/plugins/comments.py`` to your plugins directory. Then add ``"comments"`` to the ``load_plugins`` property in your ``config.py`` file. 2. Comments are stored in a directory tree which will parallel the data directory tree. The comments themselves are stored as XML files named ``entryname-datetime.suffix``. The comment system allows you to specify the directory where the comment directory tree will stored, and the suffix used for comment files. You need to make sure that this directory is writable by the pyblosxom CGI scripts. Set ``comment_dir`` to the directory (in your data directory) where you want the comments to be stored. The default value is a directory named ``comments`` in your data directory. Set ``comment_ext`` to the change comment file extension. The default file extension is ``cmt``. 3. Copy the flavour files from the contrib/plugins/comments/flavours directory. There are flavours for ``html`` and ``rss``. You should copy all the files to your data directory. The ``comment-story`` template is used to format a single entry that has comments. The ``comment`` template is used to format a single comment/trackback/pingback. The ``comment-form`` template provides the form used to enter new comments. 4. Edit the ``comment-story``, ``comment``, and ``comment-form`` templates. Variables that are available are: Available in the ``story`` and ``comment-story`` templates: ============= ======================================================== Template variables from comments.py available in story and comment-story ------------------------------------------------------------------------ variable name description ============= ======================================================== num_comments contains an integer count of the number of comments associated withthis entry ============= ======================================================== Available in the ``comment`` template: ============================ =============================================================== Template variables from comments.py ---------------------------------------------------------------------------------------------- variable name description ============================ =============================================================== cmt_title the title of the comment cmt_description the content of the comment or excerpt of the trackback/pingback cmt_link the pingback link referring to this entry cmt_author the author of the comment or trackback cmt_optionally_linked_author the author, wrapped in an <a href> tag to ``$cmt_link`` *if* it was provided cmt_pubDate the date and time of the comment/trackback/pingback cmt_source the source of the trackback ============================ =============================================================== Email notification ================== Enabling email notification --------------------------- The comment system can notify you via e-mail when new comments/trackbacks/pingbacks are posted. There are two ways to configure this feature. The first is to have email notifications sent through your MTA via SMTP and the second is to have email notifications sent through your MTA via a local command. If you want to enable this feature, add the following properties to your ``config.py`` file:: py['comment_smtp_server'] - your SMTP server OR py['comment_mta_cmd'] - alternatively, the path to your MTA AND THEN py['comment_smtp_from'] - the address sending the notification py['comment_smtp_to'] - the address receiving the notification For example, this sends email through your MTA via SMTP connecting to localhost:: py['comment_smtp_server'] = "localhost" py['comment_smtp_from'] = "joe@joe.com" py['comment_smtp_to'] = "joe@joe.com" This sends email through your MTA via the command ``/usr/bin/mail``:: py['comment_mta_cmd'] = "/usr/bin/mail" py['comment_smtp_from'] = "joe@joe.com" py['comment_smtp_to'] = "joe@joe.com" Problems you might have ----------------------- FIXME Writing comments plugin templates ================================= This "diagram" shows which templates are responsible for what for rendering a single entry::