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

Commentics works fine on my live server but not on my localserver
#1

Hello. Commentics works fine on my live server but how can i have commentics work also on my localserver?
In Manage - sites - add site how can i add my localserver
I tried like this:
Name: localhost
Domain: 127.0.0.1
URL: http://127.0.0.1/domain

But it didnt work. The commentics form does not appear
Reply
#2

Hello,

Before I get to the issue, you'll need to choose a different username because it could give the impression to others that you represent the project. Can you let me know what you'd like me to change it to?

The domain and the URL look okay to me. I have mine set to localhost and http://localhost but that's just how I view my local websites.

It's more likely that it's not showing for another reason. Try one of these FAQs, depending on your integration:

https://commentics.com/faq/php-integration/not-showing
https://commentics.com/faq/iframe-integr...ot-showing

Regards,

Steven

Have you completed the interview?
Reply
#3

Sorry for the username. I just typed in the first word that came to my mind. You can change it to: member476

It worked, i switched the code from this:

$cmtx_folder = '/comments/';

to this:

$cmtx_folder = ($_SERVER['HTTP_HOST'] == 'localhost') ? '/foldername/comments/' : '/comments/';

But when i write a comment the comment doesnt appear neither do the comments that i wrote on the live server (On the live server, they appear). The database is the exact same on the live server and the local. Both of them updated so they are exactly the same. The database works on local, it shows the other things that are on. Only the commentics comments dont appear.

Can you point me to the right direction for how to fix it? Thank you
Reply
#4

Thanks, that's sorted now.

I think it's normal that the comments from your live server don't appear locally because it's technically a different website and Commentics is multi-site so it's designed not to show comments from different websites where the pages have the same identifier.

You could try opening /comments/system/library/page.php and replacing this:

PHP Code:
<?php 
$query
= $this->db->query("SELECT * FROM `" . CMTX_DB_PREFIX . "pages` WHERE `identifier` = '" . $this->db->escape($identifier) . "' AND `site_id` = '" . (int) $site_id . "'");

With this:

PHP Code:
<?php 
$query
= $this->db->query("SELECT * FROM `" . CMTX_DB_PREFIX . "pages` WHERE `identifier` = '" . $this->db->escape($identifier) . "'");

As to the comments posted locally not appearing locally:
  • Do they appear in Manage -> Comments?
  • Is the identifier in your integration code the same as the identifier in Manage -> Pages?
  • Are the comments approved?
  • Try clearing the cache in Tools -> Clear Cache.
  • Could it be cached by your local webserver?
  • Try enabling error reporting and posting another comment.
    - https://commentics.com/faq/troubleshoot/errors

Have you completed the interview?
Reply
#5

Another thing out of interest. In the same file:

Just above this:
PHP Code:
<?php 
if ($domain) {

Add this:
PHP Code:
<?php 
var_dump
($domain);

See if that matches with the domain in your 'sites' database table.

Have you completed the interview?
Reply
#6

(10-Apr-2023, 06:03 PM)Steven Wrote:  Thanks, that's sorted now.

I think it's normal that the comments from your live server don't appear locally because it's technically a different website and Commentics is multi-site so it's designed not to show comments from different websites where the pages have the same identifier.

You could try opening /comments/system/library/page.php and replacing this:

PHP Code:
<?php 
$query
= $this->db->query("SELECT * FROM `" . CMTX_DB_PREFIX . "pages` WHERE `identifier` = '" . $this->db->escape($identifier) . "' AND `site_id` = '" . (int) $site_id . "'");

With this:

PHP Code:
<?php 
$query
= $this->db->query("SELECT * FROM `" . CMTX_DB_PREFIX . "pages` WHERE `identifier` = '" . $this->db->escape($identifier) . "'");

As to the comments posted locally not appearing locally:
Hi friend
It looks sense that local users won't see comments from the live server. The multi-site design of Commentics ensure that comments remain context meaningful while keeping clarity GB whatsapp Apkacross several pages that share identify.
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by RJCS
06-May-2019, 09:28 PM
Last Post by lastejas
29-Sep-2018, 02:03 PM
Last Post by hentes
06-Nov-2016, 01:36 PM
Last Post by Steven
25-Jul-2014, 07:17 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)