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

commentics and subdomain problem
#1

Hi everybody,

First, Thanks for this comment system. it's very nice.

My problem is, i have install commentics on my web site.

www.mysite.com/example.php and it's work perfectly.

i have a lot of subdomain like: dallas.mysite.com

the problem is the script doesn't work at this url (dallas.mysite.com/example.php) but it's work with the url www.mysite.com/dallas/example.php

if i call the page by my subdomain name, it doesn't work. the page stop loading after the lorem ipsum <br/>.

How can i resolve that ??

i put the code like the instruction:

<?php
$cmtx_page_id = "56";
$cmtx_reference = "Page 56";
$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
?>

thanks for your help.
Reply
#2

Is there a solution aviable now? Habe the exact same problem. The Script works fine (domain.com) but not on any subdomain (m.domain.com). Still get a error "Access Denied." when i include commentics on my mobile subdomain:

Quote:require '/www/htdocs/path/to/commentics/includes/commentics.php';

Any ideas?

The Files are on the same phisical server.
Reply
#3

I think the issue that the original poster had was that their "require" wasn't pointing to where the commentics.php file was. It was likely resulting in a fatal error but their server probably wasn't displaying the error.

With yours it seems like it's requiring the file successfully, because it's showing the "Access Denied" message which is from the commentics.php file. However it looks like the PHP variable $cmtx_path isn't set which is why it's showing that message. Maybe you removed that variable from the integration code?

Have you completed the interview?
Reply
#4

You where right Smile

This works fine:

PHP Code:
$cmtx_path ''/www/htdocs/path/to/commentics/';
require $cmtx_path.'
includes/commentics.php'; //don't edit this line 

Thanks
Reply
#5

Ok Back again Big Grin

Found the subdomain-issue today again. the commentics.php is includet fine. The boxes are already there. But without css an javascript. the sourcecode showed me the issues. all pathes are wrong. the files are not existant on my subdomain so the script cant find them under

Quote:http://m.domain.de/sites/comments/javasc....cookie.js

Quote:http://m.domain.de/sites/comments/css/default.css

....

so i need to change the urls to

Quote:http://www.domain.de/sites/comments/css/default.css

...

is there a function? do i have to copy them? whats the best solution?
Reply
#6

In /upload/includes/functions/page.php, try replacing this (two instances, lines 778 and 793):

PHP Code:
strtolower($_SERVER['HTTP_HOST']) 

With this:

PHP Code:
domain.de 

Have you completed the interview?
Reply
#7

Hey Steven, thats exactly what i have looked for. works finde for me. the last problem is about the submit button. now i will be redirected to the main-domain because of the cmtx_commentics_url() and cmtx_current_page() function. especially in the case when the script generates an error - the user on the subdomain can't read the errors because he will directly to the main domain.

can i use an iframe instead?
Reply
#8

Sorry I thought I had already replied to this. If you undo what I suggested and then edit the links to the JavaScript and CSS files in /upload/includes/template/head.php to point to your main domain then I think it should fix it. I'm going to test the use of subdomains more thoroughly for the next version.

Have you completed the interview?
Reply
#9

Hey Steven, no problem Wink

i solved the problem in a other way. added some code to the /comments/include/template/form.php

PHP Code:
<?php
if ((strtolower($_SERVER['HTTP_HOST'])) == 'www.domain.de') {
?>
<form name="commentics" id="commentics" class="cmtx_form" action="<?php echo cmtx_url_encode(cmtx_url_decode('http://www.domain.de'.$_SERVER['REQUEST_URI'])).CMTX_ANCHOR_FORM?>" method="post">
<?php } else { ?>
<form name="commentics" id="commentics" class="cmtx_form" action="<?php echo cmtx_url_encode(cmtx_url_decode('http://m.domain.de'.$_SERVER['REQUEST_URI'])).CMTX_ANCHOR_FORM?>" method="post">
<?php ?>

That works fine too.

I will test your solution too, thx   Smile
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by kbadmin
28-May-2019, 07:16 PM
Last Post by daniel
20-Jan-2017, 06:32 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)