Commentics Integration

Commentics is a free, advanced PHP comment script with many features. And can be one of the solutions for our blog comments platform instead of Disqus or Facebook comments.

Here's how to integrate it to our HTMLy blog:

PHP Integration

Edit post.html.php and paste the following code in the section where you want to display the comments:

<?php
$cmtx_identifier = strtok($_SERVER["REQUEST_URI"],'?');
$cmtx_reference  = $p->title;
$cmtx_folder     = '/comments/';
require($_SERVER['DOCUMENT_ROOT'] . $cmtx_folder . 'frontend/index.php');
?>

Create a file called all.php inside the folder below:

/comments/system/events/

And paste the following code:

<?php
/* Event for when a new comment is added */
if ($event == 'comment_added') {
    $c = str_replace('/', '#', rawurldecode($page_identifier));
    $cachefile = dirname(CMTX_DIR_ROOT) . '/cache/page/' . $c . '.cache';
    if (file_exists($cachefile)) {
        unlink($cachefile);
    }
}

For Commentics other integration, installation and configuration you can read it in their documentation.