当前位置: 首页>>代码示例>>PHP>>正文


PHP Facebook::delete方法代码示例

本文整理汇总了PHP中Facebook::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Facebook::delete方法的具体用法?PHP Facebook::delete怎么用?PHP Facebook::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Facebook的用法示例。


在下文中一共展示了Facebook::delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete

 /**
  * Delete the object from facebook.
  *
  * @return bool
  */
 function delete()
 {
     if (empty($this->id)) {
         throw new \Exception('Can\'t delete an object without an id');
     }
     return Facebook::delete($this->id);
 }
开发者ID:sledgehammer,项目名称:facebook,代码行数:12,代码来源:GraphObject.php

示例2: Facebook

    $dispHTTP = "http://";
} else {
    $dispHTTP = "https://";
}
include_once "../plugins/facebook/facebook.php";
$fbObj = new Facebook($mysqli);
$blnCheckForFacebook = $fbObj->hasFacebook($memberInfo['member_id']);
if ($blnCheckForFacebook) {
    $fbInfo = $fbObj->get_info_filtered();
    $fbID = $fbInfo['fbconnect_id'];
    if (time() - $fbInfo['lastupdate'] > 1800) {
        $fbObj->accessToken = $fbInfo['access_token'];
        $fbInfo = $fbObj->getFBInfo();
        if ($fbInfo == "") {
            // User revoked access through Facebook, refresh page and re-ask for access
            $fbObj->delete();
            echo "\n\t\t\t\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\n\t\t\t\t\twindow.location = '" . $MAIN_ROOT . "members/console.php?cID=" . $_GET['cID'] . "';\n\t\t\t\t\n\t\t\t\t</script>\n\t\t\t\n\t\t\t";
            exit;
        }
        $arrColumns = array("name", "lastupdate");
        $arrValues = array($fbInfo['name'], time());
        $fbObj->select($fbID);
        $fbObj->update($arrColumns, $arrValues);
        $fbInfo = $fbObj->get_info_filtered();
    }
    echo "\n\t\n\t\t<div id='loadingSpiral' class='loadingSpiral'>\n\t\t\t<p align='center'>\n\t\t\t\t<img src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/loading-spiral.gif'><br>Loading\n\t\t\t</p>\n\t\t</div>\n\t\t<div id='connectedDiv'>\n\t\t\t<div class='formDiv'>\n\t\t\t\t<table class='formTable'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class='main dottedLine' style='margin-bottom: 20px; padding-bottom: 3px'>\n\t\t\t\t\t\t\t\t<b>Connected:</b>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t<div class='shadedBox' style='margin-left: auto; margin-right: auto; width: 50%; overflow: auto'>\n\t\n\t\t\t\t\t\t\t\t<div style='float: left; margin: 3px; padding: 0px' class='solidBox'><img src='" . $fbObj->getProfilePic("normal") . "'></div>\n\t\t\t\t\t\t\t\t<div style='float: left; padding-left: 8px; padding-top: 30px'>\n\t\t\t\t\t\t\t\t\t<span class='breadCrumbTitle' style='padding: 0px'><a href='https://www.facebook.com/profile.php?id=" . $fbInfo['facebook_id'] . "'>" . $fbInfo['name'] . "</a></span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div style='font-style: italic; text-align: center; margin-top: 3px; margin-left: auto; margin-right: auto; position: relative' class='main'>\n\t\t\t\t\t\t\t\tLast updated " . getPreciseTime($fbInfo['lastupdate']) . "\n\t\t\t\t\t\t\t\t<p class='largeFont' style='font-style: normal; font-weight: bold' align='center'>\n\t\t\t\t\t\t\t\t\t<a style='cursor: pointer' id='btnDisconnect'>DISCONNECT ACCOUNT</a>\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\t\t\n\t\t\t</div>\n\t\t</div>\n\t\t<div id='disconnectDiv' style='display: none'>\n\t\t\t<p class='main' align='center'>\n\t\t\t\tAre you sure you want to disconnect your Facebook account?\n\t\t\t</p>\n\t\t</div>\n\t\t\n\t\t<script type='text/javascript'>\n\t\t\n\t\t\t\$(document).ready(function() {\n\t\t\t\n\t\t\t\t\$('#btnDisconnect').click(function() {\n\t\t\t\t\t\n\t\t\t\t\t\$('#disconnectDiv').dialog({\n\t\t\t\t\t\ttitle: 'Disconnect Facebook',\n\t\t\t\t\t\tmodal: true,\n\t\t\t\t\t\tzIndex: 99999,\n\t\t\t\t\t\twidth: 400,\n\t\t\t\t\t\tresizable: false,\n\t\t\t\t\t\tshow: 'scale',\n\t\t\t\t\t\tbuttons: {\n\t\t\t\t\t\t\t'Yes': function() {\n\t\t\t\t\t\t\t\t\$('#connectedDiv').fadeOut(250);\n\t\t\t\t\t\t\t\t\$('#loadingSpiral').show();\n\t\t\t\t\t\t\t\t\$.post('" . $MAIN_ROOT . "plugins/facebook/disconnect.php', { }, function(data) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\$('#connectedDiv').html(data);\n\t\t\t\t\t\t\t\t\t\$('#loadingSpiral').hide();\n\t\t\t\t\t\t\t\t\t\$('#connectedDiv').fadeIn(250);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\$(this).dialog('close');\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t'Cancel': function() {\n\t\t\t\t\t\t\t\t\$(this).dialog('close');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t\t\$('.ui-dialog :button').blur();\n\t\t\t\t\n\t\t\t\t});\n\t\t\t\n\t\t\t});\n\t\t\n\t\t</script>\n\t\n\t";
} elseif (!$blnCheckForFacebook && isset($_GET['code'])) {
    $fbObj->tokenNonce = $_SESSION['btFacebookNonce'];
    $arrURLInfo = parse_url($dispHTTP . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']);
    $arrAccessToken = $fbObj->getAccessToken($_GET['code'], $_GET['state'], $arrURLInfo['scheme'] . "://" . $arrURLInfo['host'] . $arrURLInfo['path'] . "?cID=" . $_GET['cID']);
    $_SESSION['btFBAccessToken'] = $arrAccessToken['access_token'];
开发者ID:nsystem1,项目名称:clanscripts,代码行数:31,代码来源:facebookconnect.php

示例3: deleteFromFacebook

 protected function deleteFromFacebook($confession, $user = null)
 {
     if (env('MANUAL_MODE', false)) {
         $confession->fb_post_id = '';
         return 0;
     }
     try {
         if ($confession->images) {
             \Facebook::delete('/' . $confession->fb_post_id, [], $this->getPageToken($user));
         } else {
             \Facebook::delete('/' . env('FACEBOOK_PAGE_ID', '') . '_' . $confession->fb_post_id, [], $this->getPageToken($user));
         }
     } catch (\Exception $e) {
     }
     $confession->fb_post_id = '';
 }
开发者ID:nekonekonik,项目名称:nuswhispers,代码行数:16,代码来源:ConfessionsRepository.php


注:本文中的Facebook::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。