function FacebookSignUp($url) { global $facebook; try { // Proceed knowing you have a logged in user who's authenticated. $user_profile = $facebook->api('/me'); $facebookId = $user_profile['id']; $facebookUserName = $user_profile['first_name'] . ' ' . $user_profile['last_name']; } catch (FacebookApiException $e) { error_log($e); $user = null; } echo "facebookId : " . $facebookId; $result = DBCheckFacebookUser($facebookId); if ($result['ResultCode'] == 0) { $result = DBSaveUser(-1, $facebookUserName, '', $facebookId, null, $facebookId, null); if ($result['ResultCode'] == 0) { $userInfo = DBEnableUser($facebookId); FacebookLogin($url); } } }
} else { if ($_GET['t'] == 6) { for ($i = 0; $i < sizeof($addedTags); $i++) { echo $addedTags[$i] . " "; } echo DBSavePost(-1, $_GET['pinned'], $_GET['bName'], $_GET['title'], $_GET['content'], $_GET['UserID'], $_GET['addedTags'], $_GET['deletedTags']); } else { if ($_GET['t'] == 7) { echo EnableUser(fnDecrypt($_GET['c'])); } else { if ($_GET['t'] == 8) { if ($_GET['c'] == "signup") { FacebookSignUp($_GET['url']); } else { if ($_GET['c'] == "login") { FacebookLogin($_GET['url']); } } } else { if ($_GET['t'] == 9) { echo FacebookUrl($_GET['c'], $_GET['url']); // c = "login" or "signup" } else { if ($_GET['t'] == 'special') { /*DBNewComment(138, -1, 'main comment 1'); //1 DBNewComment(138, -1, 'main comment 2'); //2 DBNewComment(138, -1, 'main comment 3'); //3 DBNewComment(138, -1, 'main comment 4'); //4 DBNewComment(138, -1, 'main comment 5'); //5 DBNewComment(138, 1, '1-1 sub comment'); //6