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

2 sites integration
#11

There is one distinct drawback to using an iframe from another host, besides the extra CSS editing I had to do: the cookie to prefill the name and email fields isn't working. Maybe I can tweak the iframe permissions or something.
Reply
#12

On the site with the inline form, I see a Commentics-Form cookie being sent in the format name|email|||0|0. No such cookie appears in the iframe. There is only a commentics-iframe-session cookie with an alphanumeric random identifier in it.
Reply
#13

Okay, at this point I've probably taken this too far, but I got it working across domains by adding conditional CORS headers in .htaccess for the clientside part, and using a small proxy wrapper page to replace the serverside require with a curl call. The one thing that doesn't work is image captcha -- all http results are success and the console and log are free of errors, but it never accepts the input as a match. ReCaptcha works. You do see the proxy url instead of the real one in Mange > Pages.

---- Here are the .htaccess lines that I put in site A's commentics folder:

SetEnvIf Origin "http(s)?://(www\.)?(siteb.com)$" SiteB=$0
Header add Access-Control-Allow-Origin %{SiteB}e env=SiteB
Header add Access-Control-Allow-Headers x-requested-with env=SiteB

---- Here's the core of the proxy page:

$serverLocation = $_SERVER['DOCUMENT_ROOT'] . '/commentics/';
session_start();
header('Content-Type: text/html; charset=utf-8');
if ($_GET['title'] && $_GET['pageid'] && $_GET['whodat'] == 'secret') { // better-than-nothing security
$cmtx_identifier = 'siteB/' . $_GET['pageid'];
$cmtx_reference = $_GET['title'];
require($serverLocation . 'frontend/index.php');
}
Reply
#14

......my clever proxy hack has subtle issues. Recaptcha is balky, the Edit and Delete icons fail to appear, and there's a multi-second delay that occurs far too often. Back to the iframe.

Hey, in both versions, new comments appear at the top even if the sort order is Oldest.
Reply
#15

Never mind abuot the cookie -- separate issue since resolved.
Reply
#16

To sum this up, my experience is there are several ways where trying to get an install to support two domains almost works, but none where it works quite well enough to be a good alternative to using two installations. If I had free time, I'd be tempted to dig into the source and actually submit fixes. But I doubt I will.

My two-install situation is working properly now (though it has yet to develop any audience, in part because both sites apparently got de-indexed by gloogle last year without notice just for being a bit outdated -- e.g. no canonical header -- and have only recently been visible again). I will be paying for the Plus install... once.
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by nsuomine
20-Jan-2023, 08:32 AM
Last Post by Steven
23-Jan-2019, 02:07 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)