本文整理匯總了PHP中QC::add_idol方法的典型用法代碼示例。如果您正苦於以下問題:PHP QC::add_idol方法的具體用法?PHP QC::add_idol怎麽用?PHP QC::add_idol使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類QC
的用法示例。
在下文中一共展示了QC::add_idol方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: QC
<?php
session_start();
include_once '../../config.php';
$site = get_site(__DIR__);
define('SITE_PATH', $site);
include_once CONFIG_PATH . '/' . $site . PHP_EXT;
include_once QQ_PATH . '/qqConnectAPI.php';
$Mac_ID = $_SESSION['Mac_ID'];
$qc = new QC();
$acs = $qc->qq_callback();
$oid = $qc->get_openid();
$qc = new QC($acs, $oid);
$user = $qc->get_user_info();
$idol = array('name' => QQ_ADD_IDOL_BY_NAME);
$content = array('content' => QQ_SEND_WEIBO_MESSAGE);
$idol_ret = $qc->add_idol($idol);
$content_ret = $qc->add_t($content);
UniFi::set_site($site);
UniFi::sendAuthorization($Mac_ID, WIFI_EXPIRED_TIME);
sleep(5);
header('Location: ' . DEFAULT_URL);
示例2: QC
<?php
if ($_POST) {
/*
*調用接口代碼
*
**/
require_once "../../API/qqConnectAPI.php";
$qc = new QC();
$ret = $qc->add_idol($_POST);
echo "<meta charset='utf-8' />";
if ($ret['ret'] == 0) {
echo "收聽成功,請查看微博";
} else {
echo "收聽失敗,請開啟調試查看原因";
}
} else {
//load view
require_once "add_idol.html";
}
示例3: qq_userinfo
public function qq_userinfo($access_token, $follow = FALSE, $appid = 0)
{
require_once Kohana::find_file('vendor', 'qq/qqConnectAPI');
$site_setting = $this->qq_settings($appid);
$c = new QC($access_token, '', array('appid' => $site_setting['key'], 'appkey' => $site_setting['secret']));
$data = array();
if ($c) {
$uid = $c->get_uid();
$ret = $c->get_info();
//獲取用戶等基本信息
$user_info = $ret['data'];
$avatar = '';
if ($user_info['head']) {
$avatar = $user_info['head'] + '/100';
}
//關注官方微博
if ($follow) {
$c->add_idol(array('name' => $site_setting['uid']));
}
$data['uid'] = $uid;
$data['name'] = $user_info['name'];
$data['avatar'] = $avatar;
}
return $data;
}