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

Subdomain issue with flags and vote
#1

Hi,
I set up commentics and have got it to work mostly. I am intending to have the comments on pages that are on seperate subdomains of the main site with the scripts directory on the main site.

The $path_to_comments_folder
is set to "../../climatesite/comments/";

and the subdomain I am testing on is http://www.afghanistan.climatetemp.info/

This seems to work fine apart from the flag and vote feature which are not working.

On a page on the main site these are working fine as you can see:
http://www.climatetemp.info/test.php

I can't get my head around why these arn't working as most everything else is working fine. The capcha also doesn't work properly on the subdomain but I can live without that. Well I could probably do without the flaging and ratings but it would be nice to get them to work so please let me know if you have any ideas how to get them to work.

Thank you very much for the great resource.

Martin
Reply
#2

Hi,

After reading a similar problem on Stack Overflow it seems that you can't load remote domain content with ajax due to browser security restrictions and the browser is treating your subdomain as a separate website.

There are a couple of solutions on that page which involve adding a small piece of JavaScript.

On your subdomain page, try adding this somewhere above the Commentics script:
Code:
<script type="text/javascript">
document.domain = "climatetemp.info";
</script>

That "should" hopefully fix the flag and voting features, but probably not the captcha.

Have you completed the interview?
Reply
#3

Hi,

If you add the following just before the Commentics integration code:

PHP Code:
<?php
@error_reporting(-1); //show every possible error
@ini_set('display_errors', 1); //display errors
@ini_set("log_errors" , 0); //don't log errors
?>

.. it should display an error message.

I think the error will be related to the require statement not being able to find the yoursite.com/comments/includes/commentics.php file.

To fix it, you will need to edit the $cmtx_path so that it can find commentics.php.

That might be as simple as removing the "../" so that you have this:
PHP Code:
<?php 
$cmtx_path
= "comments/";

Or you may need to specify the full server path, which might look something like this:
PHP Code:
<?php 
$cmtx_path
= "/public_html/comments/";

I'm not an expert on subdomains so that's the best advice I can give.

Note that on a subdomain, the Like/Dislike and Flag features won't work.
See this page for more information:
http://www.commentics.org/forum/showthread.php?tid=390

Have you completed the interview?
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by FaradaysPC
03-Aug-2022, 07:08 PM
Last Post by finzer
30-Apr-2015, 09:12 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)