This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Problem Getting Correct Identifier
#1

I am trying to integrate Commentics into a flat file based blog using .md as the extension of the blog title.  The posted blog has the following display:

https://domain/blogfolder/post/name-of-article

However, as noted above the article is posted to the content folder as name-of-article.md

I have been able to get the Commentics form to show up in the place I want it to (at the end of the article) and have been able to post a comment which is then displayed. The problem is that the same comment is displayed at the end of every article. I can't seem to figure out what identifier I should use.

The blog in question is HTMLy and while I really like the blog, their support is non existent.  Any assistance would be much appreciated.

My Blog Location
Reply
#2

You could use the URI like this:
PHP Code:
<?php 
$cmtx_identifier
= $_SERVER['REQUEST_URI'];

Have you completed the interview?
Reply
#3

Or extract only the last segment from the URI, e.g. 'computers-and-me'.

Have you completed the interview?
Reply
#4

(08-Aug-2022, 07:08 PM)Steven Wrote:  Or extract only the last segment from the URI, e.g. 'computers-and-me'.

How would I go about extracting only the last segment as trying your other suggestion did not work because the same comment is displayed at the end of each article.

Here is what I have and I am not positive the $cmtx_identifier is correct.

<?php
$cmtx_identifier = 'post/';
$cmtx_reference  = $_SERVER['REQUEST_URI'];
$cmtx_folder    = '/commentics/';
require($_SERVER['DOCUMENT_ROOT'] . $cmtx_folder . 'frontend/index.php');
?>
Reply
#5

You should put:
PHP Code:
<?php 
$cmtx_identifier
= $_SERVER['REQUEST_URI'];

Rather than:
PHP Code:
<?php 
$cmtx_identifier
= 'post/';

Have you completed the interview?
Reply
#6

Interesting...I posted a comment to each of the articles I have on the blog and they were displayed at the end of the article, but when I went back to the blog and clicked on the article, the comment was not there, for either article. Nothing else has changed so no idea what could cause this. BTW, the two comments have been inserted into the database so the problem seems to be that they are not being displayed.
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by afoster
21-Aug-2020, 06:47 PM
Last Post by daniel
20-Jan-2017, 06:32 PM
Last Post by pizzaboi
17-Nov-2016, 10:38 PM
Last Post by pizzaboi
17-Nov-2016, 08:12 PM
Last Post by finzer
30-Apr-2015, 09:12 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)