After moving to HTMLy, I missed a local commenting system. My needings are basic: I just need a very simple one, possibly based on flat files, not relying on external commenting systems.
HTMLy only choices were Facebook and Diqus, none local. So I decided to write one for myself, ending in a slightly modified HTMLy 3.3.1 version.
Integrating the comments in existing template its quite simple. First add the PHP lines needed to show the comments box on your posts:
<?php if (local() && comments_config('comments.show.posts') === 'true'): ?>
<?php
displayCommentsSection($p->url, $p->file);
?>
<?php endif; ?>
then play with CSS to match your template. Actually the comment system supports:
- comments in blog posts, static pages and subpages, author profile (enable sections in comments.ini)
- reply to comment and threaded
- view new comment notification for admin comment approval (enable it in comments.ini)
- very simple anti-spam (honeyspot)
Below the sample file coments.ini:
; HTMLy Local Comments System Configuration
; To enable local comments, set comment.system = "local" in config/config.ini
; Require admin moderation before publishing comments
comments.moderation = "true"
; Enable honeypot anti-spam protection
comments.honeypot = "true"
; Enable email notifications
comments.notify = "true"
; Show comments section in posts
comments.show.posts = "true"
; Show comments section in static pages
comments.show.static = "false"
; Show comments section in authors pages
comments.show.author = "false"
; Admin email for comment notifications
comments.admin.email = "your@email.here"
; Email notification settings (using PHPMailer)
comments.mail.enabled = "true"
comments.mail.host = "mail.host.com"
comments.mail.port = "587"
comments.mail.username = "your_username"
comments.mail.password = "your_password*"
comments.mail.encryption = "tls"
comments.mail.from.email = "your@email.here"
comments.mail.from.name = "Your From Name"
It uses PHPMailer to send emails. In a future release there will be the possibility to subscribe to a thread - however, it has to be carefully evaluated, to avoid unwanted subriscriptions and spam.
The HTMLy modified version with comments integration can be found here:
Latest changes still have to be merged to main HTMLy GitHub repo at:
Comments
Leave a Comment