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

Display same comments on all pages
#1

Hello,
I have added commentics in my x-cart site.Problem is that whenever someone post a comment on products or in static page then same comments display in all pages.

Is it a flaws or any settings required to change..

What settings need to change?

Thanks,
Dwaipayan
Reply
#2

Hi Dwaipayan,

In the integration code, you need to make sure that the $cmtx_identifier variable ($cmtx_page_id in previous versions) has a different value for each page.

The way that you have it set up at the moment is on every page the $cmtx_identifier is the same.

<?php
$cmtx_identifier = '1'; //this should be a different value for each page
$cmtx_reference = 'Page One';
$cmtx_path = 'comments/';
define('IN_COMMENTICS', 'true'); //no need to edit this line
require $cmtx_path . 'includes/commentics.php'; //no need to edit this line
?>

Have you completed the interview?
Reply
#3

In which PHP file we need to change to display comments on that page only? Please let me know the PHP file where we can modify.
waiting for your early reply.
Thanks,
Dwaipayan
Reply
#4

It's impossible for me to say which file you added the integration code to, as only you know this.

It sounds like you may have used the X-Cart integration package? If so, you need to contact the author of that package because it seems like it's out-of-date or needs fixing.

Alternatively, if you want to try to fix it yourself, search your X-Cart files for "$cmtx_identifier" or "$cmtx_page_id" to find the file.

Have you completed the interview?
Reply
#5

[quote='Steven' pid='4343' dateline='1372593229']
Hi Dwaipayan,

In the integration code, you need to make sure that the $cmtx_identifier variable ($cmtx_page_id in previous versions) has a different value for each page.

The way that you have it set up at the moment is on every page the $cmtx_identifier is the same.

<?php
$cmtx_identifier = '1'; //this should be a different value for each page
$cmtx_reference = 'Page One';
$cmtx_path = 'comments/';
define('IN_COMMENTICS', 'true'); //no need to edit this line
require $cmtx_path . 'includes/commentics.php'; //no need to edit this line
?>


Why not get the page url :
Code:
[quote]<?php
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
  $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
  $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
?>

And then use the values to retrive the comments
Code:
<?php
$cmtx_identifier = curPageURL();
$cmtx_reference = curPageURL();
$cmtx_path = 'comments/';
define('IN_COMMENTICS', 'true'); //no need to edit this line
require $cmtx_path . 'includes/commentics.php'; //no need to edit this line
?>
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by Steven
29-Jul-2020, 08:34 AM
Last Post by MattyP
13-Apr-2020, 08:33 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)