显示选项卡index.php代码以前可以工作,但现在不行了。我该如何修复?
我已将此代码用于数十个显示选项卡,但现在它们已停止工作。我找到了针对 https 页面的修复,但该修复在 http 页面上不起作用。请参阅下面的代码,任何具体的帮助都会很棒。
<?php
require 'facebook.php';
$app_id = "APP_ID";
$app_secret = "APP_SECRET";
$facebook = new Facebook(array(
'appId' => $app_id,
'secret' => $app_secret,
'cookie' => true
));
$signed_request = $facebook->getSignedRequest();
$page_id = $signed_request["page"]["id"];
$page_admin = $signed_request["page"]["admin"];
$like_status = $signed_request["page"]["liked"];
$country = $signed_request["user"]["country"];
$locale = $signed_request["user"]["locale"];
// If a fan is on your page
if ($like_status) {
$a = file_get_contents("yourlikepage.html");
echo ($a);
} else {
// If a non-fan is on your page
$a = file_get_contents("yournolikepage.html");
echo ($a);
}
?>
我绝不是一个编码员。请在您的回复中具体说明实际的代码修复,否则您的答案可能会超出我有限的大脑,尽管它会很棒。
谢谢!
I've used this code for dozens of reveal tabs and now they've stopped working. I've found a fix for the https pages, but that fix doesn't work on http pages. Please see the code below and any specific help would be great.
<?php
require 'facebook.php';
$app_id = "APP_ID";
$app_secret = "APP_SECRET";
$facebook = new Facebook(array(
'appId' => $app_id,
'secret' => $app_secret,
'cookie' => true
));
$signed_request = $facebook->getSignedRequest();
$page_id = $signed_request["page"]["id"];
$page_admin = $signed_request["page"]["admin"];
$like_status = $signed_request["page"]["liked"];
$country = $signed_request["user"]["country"];
$locale = $signed_request["user"]["locale"];
// If a fan is on your page
if ($like_status) {
$a = file_get_contents("yourlikepage.html");
echo ($a);
} else {
// If a non-fan is on your page
$a = file_get_contents("yournolikepage.html");
echo ($a);
}
?>
I am by no means a coder. Please be specific in your response with actual code fixes as otherwise it's likely your answer, as awesome as it'll be, will soar over my limited brain.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
作为一个有限的大脑,我只是想仔细检查一下您是否确实输入了您的应用程序 ID 和应用程序密钥。我希望这看起来不是一个愚蠢的问题——你会感到惊讶的!
As one limited brain to another, I just wanted to double check that you are actually entering in your App ID and App Secret. I hope this doesn't seem like a stupid question - you'd be surprised!