Hello, dear friends. I had the same problem and found that bug is hidden here in the file class.facebook.plugin.php inside of GetProfile function at this line:
$Contents = file_get_contents($Url);
The problem mostly is not in vanilla forum, but in PHP configuration. It should be built with OpenSSL support to transfer data via https protocol ($Url in this case points to https facebook site). But this function is deprecated and it's bit strange why developers use it instead of curl functions. Moreover there are a lot of curl calls in this file. Because of that on some configurations this bug exists, on others don't.
To make it work correctly, try to change this line to:
$Contents = $this->file_get_contents_curl($Url);
Of course, my dear friends, you have to add the function file_get_contents_curl inside of the file. Put the following code after the GetProfile function:
function file_get_contents_curl($url) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set curl to return the data instead of printing it to the browser.
curl_setopt($ch, CURLOPT_URL, $url);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
It should work now! I hope you'll enjoy vanilla forums.
If it doesn't work, please ensure that OpenSSL feature is enabled for cURL.
second part of the code you just can place after GetProfile function, after the closing curly bracket ("}"). Something like: function GetProfile {
// some code goes here, where you have to change the line
} // <-- closing curly bracket of GetProfile function
// second part of the code
function file_get_contents_curl($url) {
// bla-bla
}
Comments
$Contents = file_get_contents($Url);
The problem mostly is not in vanilla forum, but in PHP configuration. It should be built with OpenSSL support to transfer data via https protocol ($Url in this case points to https facebook site). But this function is deprecated and it's bit strange why developers use it instead of curl functions. Moreover there are a lot of curl calls in this file. Because of that on some configurations this bug exists, on others don't.
To make it work correctly, try to change this line to:
$Contents = $this->file_get_contents_curl($Url);
Of course, my dear friends, you have to add the function file_get_contents_curl inside of the file. Put the following code after the GetProfile function:
function file_get_contents_curl($url) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set curl to return the data instead of printing it to the browser. curl_setopt($ch, CURLOPT_URL, $url); $data = curl_exec($ch); curl_close($ch); return $data; }
It should work now! I hope you'll enjoy vanilla forums.
If it doesn't work, please ensure that OpenSSL feature is enabled for cURL.
I am trying your solution.
Where exactly did you place the second part of the code ?
Is it under: "$Contents = $this->file_get_contents_curl($Url);" ?
As you can see I am not a developer
Thanks
function GetProfile { // some code goes here, where you have to change the line } // <-- closing curly bracket of GetProfile function // second part of the code function file_get_contents_curl($url) { // bla-bla }
YOU ARE A LEGEND !!!!!!!! YOU ARE MY HERO !!!!!
I have been waiting for this solution for a while, Thank you so much !
P.S.: It will be great if in the next Update of Vanilla forum will include Alibaba's Code !
There was an error rendering this rich post.