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

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
#7

Does using the
Code:
$_SERVER['REQUEST_URI'];
apply if I am using the iFrame method?
Reply
#8

Technically yes you could still use $_SERVER['REQUEST_URI'] for the iFrame method like this:

Code:
<script>
var commentics_config = {
  'identifier': '<?php echo $_SERVER['REQUEST_URI']; ?>',
  'reference' : 'Page One'
};
</script>

But it might be better to use JavaScript like this:

Code:
<script>
var commentics_config = {
  'identifier': window.location.pathname,
  'reference' : 'Page One'
};
</script>

Have you completed the interview?
Reply
#9

What other options are there for 'Page One', or is that the only option.  What is the reference referring to?
Reply
#10

Good news and bad news...

The good news is that the comments are being posted, the bad news is that the same comment is being posted to all of the articles and it doesn't matter if I use the javascript method or the iFrame method. The same problem is still the problem...I can't figure out the identifier for the HTMLy flatbase blog system.
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: 2 Guest(s)