if ($user) { try { // Proceed knowing you have a logged in user who's authenticated. $user_profile = $facebook->api('/me'); } catch (FacebookApiException $e) { error_log($e); $user = null; } } // Login or logout url will be needed depending on current user state. if ($user_profile) { $logoutUrl = $facebook->getLogoutUrl(); $user_profile['fblogout'] = $facebook->getLogoutUrl(); $user_profile['fblogout'] = str_replace("bind.php", "login.php?logout=1", $user_profile['fblogout']); //Get all app requests for user and delete them FBData::clearcount($user_profile['id']); /* Friend Import Beta */ $friendsd = $facebook->api('/me/friends'); $friends = $friendsd['data']; $user_profile['friends'] = $friends; if ($user_profile['id'] != FBData::adminuser) { //Sandbox area //$uid='45403199'; //FBData::updatecount(FBData::adminuser); //$updatedash=$facebook ->api(array('method' => 'dashboard.incrementCount', 'uid' => FBData::adminuser, 'access_token' => $admintoken, 'format'=>'json')); //$args=array('message'=>'User logged in', 'data'=>'userdata sent','access_token'=>$admintoken, 'method'=>'post'); //$updateme=$facebook->api("/".$uid."/apprequests", "POST", $args); } else {
if (!$sess->CheckValidSession()) { // Validates Session $sess->Login(); } $log = new log($_SERVER["PHP_SELF"]); $db = new Database(); // Creates database object if (!$db->connect()) { echo "<p>Error connecting to the database</p>"; } $message = new Message(); if ($_SERVER['REQUEST_METHOD'] == "POST") { extract($_POST); if ($send == "Send") { $message->send($uid, $subject, $text); FBData::updatecount($uid); } header("Location: viewmessages.php?id=" . $uid); } $id = $sess->Retrieve('id'); $profile = new Profile($id); ?> <title>TheFacebook | View Messages</title> <link rel="stylesheet" href="style.css"> <link rel="shortcut icon" href="favicon.ico"> <center> <table class="bordertable" cellspacing=0 cellpadding=0 border=0 width=700>
<a href="browse.php">Browse My Network</a> </td> </tr> </table> </td> </tr> <?php if ($id == 3) { ?> <tr > <td> <table class='bordertop' cellspacing=0 cellpadding=2 border=0 width=100%> <tr> <td> <a onclick="sendreq('friend',<?php echo FBData::get_fbid('4'); ?> );" href="#">Send Req</a> </td> </tr> </table> </td> </tr> <?php } ?> </table> </td> <td valign=middle align=left width="45%"> You are connected to <b><?php $classcount = $profile->classesnetworkcount($id, 0, 100000);