本文整理匯總了PHP中Twitter::hasTwitter方法的典型用法代碼示例。如果您正苦於以下問題:PHP Twitter::hasTwitter方法的具體用法?PHP Twitter::hasTwitter怎麽用?PHP Twitter::hasTwitter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Twitter
的用法示例。
在下文中一共展示了Twitter::hasTwitter方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Member
<?php
/*
* Bluethrust Clan Scripts v4
* Copyright 2014
*
* Author: Bluethrust Web Development
* E-mail: support@bluethrust.com
* Website: http://www.bluethrust.com
*
* License: http://www.bluethrust.com/license.php
*
*/
include_once "../../_setup.php";
include_once "../../classes/member.php";
$prevFolder = "../../";
include "twitter.php";
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$twitterObj = new Twitter($mysqli);
if ($member->authorizeLogin($_SESSION['btPassword']) && $twitterObj->hasTwitter($member->get_info("member_id"))) {
$twitterObj->delete();
echo "\n\t\t\n\t\t<div class='shadedBox' style='width: 75%; margin-left: auto; margin-right: auto'>\n\t\t\n\t\t\t<p class='main' style='padding: 20px'>\n\t\t\t\tSuccessfully disconnected your Twitter account!<br><br>\n\t\t\t\tTo complete the process you must go to the <a href='https://twitter.com/settings/applications' target='_blank'>Application Settings</a> page in your Twitter account and click the revoke access button.\n\t\t\t</p>\n\t\t\n\t\t</div>\n\t\n\t";
}
示例2: Twitter
* Bluethrust Clan Scripts v4
* Copyright 2014
*
* Author: Bluethrust Web Development
* E-mail: support@bluethrust.com
* Website: http://www.bluethrust.com
*
* License: http://www.bluethrust.com/license.php
*
*/
if (!defined("SHOW_PROFILE_MAIN")) {
exit;
}
include_once $prevFolder . "plugins/twitter/twitter.php";
$twitterObj = new Twitter($mysqli);
if ($twitterObj->hasTwitter($memberInfo['member_id'])) {
$twitterObj->oauthToken = $twitterObj->get_info("oauth_token");
$twitterObj->oauthTokenSecret = $twitterObj->get_info("oauth_tokensecret");
$twitterObj->reloadCacheInfo();
$twitterInfo = $twitterObj->get_info();
if ($twitterInfo['infocard'] + $twitterInfo['embedtweet'] + $twitterInfo['showfeed'] > 0) {
echo "\n\t\t\t\t<div class='formTitle' style='position: relative; text-align: center; margin-top: 20px'>Twitter</div>\n\t\t\t\t\n\t\t\t\t<table class='profileTable' style='border-top-width: 0px'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='main' align='center'>\n\t\t\t\t\t\t\t";
if ($twitterInfo['infocard'] == 1) {
echo "<div class='shadedBox' style='margin: 20px auto; width: 70%; overflow: auto'>" . $twitterObj->dispCard() . "</div>";
}
if ($twitterInfo['embedtweet']) {
echo "<div style='position: relative; margin-left: auto; margin-right: auto; margin-top: 20px'>";
echo $twitterInfo['lasttweet_html'];
echo "</div>";
}
if ($twitterInfo['showfeed']) {
示例3: Twitter
exit;
} else {
$memberInfo = $member->get_info_filtered();
$consoleObj->select($_GET['cID']);
if (!$member->hasAccess($consoleObj)) {
exit;
}
}
if (trim($_SERVER['HTTPS']) == "" || $_SERVER['HTTPS'] == "off") {
$dispHTTP = "http://";
} else {
$dispHTTP = "https://";
}
include_once "../plugins/twitter/twitter.php";
$twitterObj = new Twitter($mysqli);
if (isset($_GET['oauth_token']) && isset($_GET['oauth_verifier']) && $_GET['oauth_token'] == $_SESSION['btOauth_Token'] && !$twitterObj->hasTwitter($memberInfo['member_id'])) {
// CALLBACK
$twitterObj->oauthTokenSecret = $_SESSION['btOauth_Token_Secret'];
$response = $twitterObj->getAccessToken($_GET['oauth_token'], $_GET['oauth_verifier']);
if ($twitterObj->httpCode == 200) {
parse_str($response, $oauthArray);
$arrColumns = array("member_id", "oauth_token", "oauth_tokensecret", "loginhash");
$arrValues = array($memberInfo['member_id'], $oauthArray['oauth_token'], $oauthArray['oauth_token_secret'], md5($oauthArray['oauth_token']));
if (!$twitterObj->authorizeLogin($oauthArray['oauth_token'], $oauthArray['oauth_token_secret'])) {
$twitterObj->addNew($arrColumns, $arrValues);
echo "\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\twindow.location = '" . $MAIN_ROOT . "members/console.php?cID=" . $_GET['cID'] . "';\n\t\t\t\t</script>\n\t\t\t";
} else {
echo "\n\t\t\t\n\t\t\t\t<div class='shadedBox' style='margin-left: auto; margin-right: auto; width: 50%'>\n\t\t\t\t\t<p class='main' align='center'>\n\t\t\t\t\t\tThe chosen twitter account is already associated with a member on this site!<br><br>\n\t\t\t\t\t\t<a href='" . $MAIN_ROOT . "members/console.php?cID=" . $_GET['cID'] . "'>Retry</a>\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\n\t\t\t";
}
} else {
echo "\n\t\t\n\t\t\t<div class='shadedBox' style='margin-left: auto; margin-right: auto; width: 50%'>\n\t\t\t\t<p class='main' align='center'>\n\t\t\t\t\tUnable to connect account! Please Try Again.<br><br>\n\t\t\t\t\t<a href='" . $MAIN_ROOT . "members/console.php?cID=" . $_GET['cID'] . "'>Retry</a>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\n\t\t";