Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2012-05-09 14:08:42

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,388
Website GitHub Mastodon Twitter

Re: migrating

Maybe I should clarify the difference between my old server up and the new one. In the old server the forum was residing inside the main domain. After Joyend’s advice, now the forum is working like an independent domain. The includes I was using in the previous setup were cross-domain (fetching content from our sites) except the forum as I mentioned earlier and everything was working wonderfully.

<?php echo file_get_contents('http://mysite.tld/?rah_external_output=bar'); ?> works fine for the txp sites but for the forum, it is not parsed.

Can anyone point me to the right direction on how I can display this txp content?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#17 2012-05-09 22:55:57

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: migrating

Try using Curl

I had a similar problem a few years ago with get_file_contents and include, both of which had been turned off or something on the server and the admins told me to use Curl…. I did, and it worked.

Not sure on the technicalities though

Offline

#18 2012-05-10 05:47:44

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,388
Website GitHub Mastodon Twitter

Re: migrating

Thanks tye

I tried

<?php
	$curl = curl_init();
	curl_setopt ($curl, CURLOPT_URL, 'http://mysite.tld/?rah_external_output=bar');
	curl_setopt ($curl, CURLOPT_RETURNTRANSFER, 1);
	echo curl_exec ($curl);
	curl_close ($curl);
?>

and

<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://mysite.tld/?rah_external_output=bar');
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$file = curl_exec($ch);
$http = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $file !== false && $http == '200' ? $file : 'Error appeared. Sad face.';
?>

neither of which returned any results.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#19 2012-05-10 06:33:12

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,388
Website GitHub Mastodon Twitter

Re: migrating

[SOLVED]… I had an include in my rah page which I forgot to change.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#20 2012-05-10 07:23:47

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: migrating

:) Phew… thought I was going to have to pretend I knew what I was doing then

Offline

#21 2012-05-10 08:02:00

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,388
Website GitHub Mastodon Twitter

Re: migrating

tye wrote:

:) Phew… thought I was going to have to pretend I knew what I was doing then

lol. No worries, your suggestion pushed me to think more laterally anyway and assisted in solving the issue.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB