本文整理汇总了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;
}