我有一个 php 页面,它从 facebook 粉丝页面中提取事件。如果我打开隐身窗口(或退出 facebook)然后单击链接,则会打开一个空白页面。我的猜测是与访问令牌、FB 应用程序的权限和页面权限有关。任何见解将不胜感激。
ticket_uri 尝试打开这样的链接:http: //www.facebook.com/ajax/events/ticket.php ?event_id=147884225370550&action_source=12 。如果已登录,这似乎会自动转发到活动中的实际票证链接。
这是我正在处理的页面:http: //danagould.com/live.php。它来自facebook页面 officialdanagould
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<?php
date_default_timezone_set('America/Los_Angeles');
//requiring FB PHP SDK
require 'fb-sdk/src/facebook.php';
//initializing keys
$facebook = new Facebook(array(
'appId' => 'MYAPPID',
'secret' => 'MYAPPSECRET',
'cookie' => true, // enable optional cookie support
));
$fql = "SELECT name, pic, start_time, end_time, location, description, eid, has_profile_pic, venue, ticket_uri
FROM event WHERE eid IN ( SELECT eid FROM event_member WHERE uid = 175890419184371 AND start_time > now() )
ORDER BY start_time asc";
$param = array(
'method' => 'fql.query',
'query' => $fql,
'callback' => ''
);
$fqlResult = $facebook->api($param);
//looping through retrieved data
foreach( $fqlResult as $keys => $values ){
$convertedtime = strtotime($values['start_time']);
$start_date = date( 'F j', $convertedtime );
$content = $values['description'];
//printing the data
echo "<tr>";
echo "<td width='8%'>";
if ( $values['has_profile_pic'] == FALSE) {
echo "<img src=img/spacer.gif width='100%'/>";
} else {
echo "<img src={$values['pic']} width='100%'/>";
}
echo "</td>";
echo "<td width='2%'></td>";
echo "<td width='18%' class='tourdate'>{$start_date}</td>";
echo "<td width='49%'>";
echo "<table><tbody><tr><td class='tourlocation'>{$values['name']}</td></tr>";
echo "<tr><td class='poddesc'><p class='poddesc'>At {$values['location']}</p></td></tr></tbody></table>";
echo "<td width='23%' class='getickets'>";
echo "<a href = " . $values['ticket_uri'] . ">Get Tickets</a>";
echo "</td></tr>";
echo "<tr height='5px'></tr>";
}
?>
</tbody>
</table>