Ejemplo n.º 1
0
<center>
<table cellspacing="0" cellpadding="0" width="750px">
<tr>
	<td>
	<?php 
require_once '../func.php';
require_once '../vars.php';
require_once '../if/src/facebook.php';
try {
    mysqlSetup($db);
    $facebook = new Facebook(array('appId' => $iframe_appid, 'secret' => $iframe_appsecret, 'cookie' => true));
    $user_id = $facebook->getUser();
    $session = $facebook->getSession();
    $has_permission = file_get_contents('https://api.facebook.com/method/users.hasAppPermission?ext_perm=user_about_me&access_token=' . $session['access_token'] . '&format=json');
    if (!$has_permission || strripos($has_permission, 'error_code')) {
        $facebook->request($facebook_iframe_canvas_page_url, 'publish_stream,email,create_event,read_stream,sms,rsvp_event,offline_access,read_friendlists,email' . ',user_about_me,friends_about_me,user_activities,friends_activities,user_birthday,friends_birthday,user_education_history' . ',friends_education_history,user_events,friends_events,user_groups,friends_groups,user_hometown,friends_hometown,user_interests' . ',friends_interests,user_likes,friends_likes,user_location,friends_location,user_notes,friends_notes,user_online_presence' . ',friends_online_presence,user_photo_video_tags,friends_photo_video_tags,user_photos,friends_photos,user_relationships' . ',friends_relationships,user_relationship_details,friends_relationship_details,user_religion_politics,friends_religion_politics' . ',user_status,friends_status,user_videos,friends_videos,user_website,friends_website,user_work_history,friends_work_history' . ',read_insights,read_mailbox,read_requests,read_stream,user_checkins,friends_checkins');
    }
    $results = mysql_query("SELECT transform_add.transform_add_id,\n\t\t\t\t\t\t\t\t   transform_add.add_uid_a,\n\t\t\t\t\t\t\t\t   transform_add.add_time,\n\t\t\t\t\t\t\t\t   transform_add.social_path,\n\t\t\t\t\t\t\t\t   transform_add.status\n\t\t\t\t\t\t\t\t   from transform_add\n\t\t\t\t\t\t\t\t   where transform_add.add_uid_b = {$user_id} AND\n\t\t\t\t\t\t\t\t   \t     transform_add.status = 0\n\t\t\t\t\t\t\t\t   order by transform_add.add_time DESC", $db);
    $div_counter = 0;
    while ($row = mysql_fetch_array($results)) {
        $div_counter++;
    }
    display_header_links_if($div_counter, $user_id);
} catch (Exception $e) {
    echo 'Caught database exception: ', $e->getMessage(), "\n";
}
?>
	</td>
</tr>
	<div id="fb-root"></div>
    <script>