本文整理汇总了PHP中QC::add_share方法的典型用法代码示例。如果您正苦于以下问题:PHP QC::add_share方法的具体用法?PHP QC::add_share怎么用?PHP QC::add_share使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QC
的用法示例。
在下文中一共展示了QC::add_share方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: QC
<?php
/*
*调用接口代码
*
**/
require_once "../API/qqConnectAPI.php";
$qc = new QC();
$ret = $qc->add_share($_GET);
?>
<meta charset="utf-8" />
<?php
if ($ret['ret'] == 0) {
echo "分享成功";
} else {
echo "分享失败";
}
示例2: qq_share
public function qq_share($share_info, $appid = 0)
{
//@todo 91来电秀分离
if ($appid != 29) {
$appid = 0;
}
$token_info = $this->oauth2_check($this->uid, 'qq', $appid);
if (!$token_info) {
return array('code' => 401);
}
if ($token_info['updated'] + $token_info['expires_in'] < time()) {
return array('code' => 403);
}
require_once Kohana::find_file('vendor', 'qq/qqConnectAPI');
$site_setting = $this->qq_settings($appid);
$c = new QC($token_info['access_token'], '', array('appid' => $site_setting['key'], 'appkey' => $site_setting['secret']));
$status = array();
$status['title'] = $share_info['title'];
$status['url'] = $share_info['url'];
$status['site'] = $site_setting['name'];
$status['fromurl'] = $site_setting['home'];
if ($share_info['text']) {
$status['comment'] = $share_info['text'];
}
if ($share_info['summary']) {
$status['summary'] = $share_info['summary'];
}
if ($share_info['images']) {
$status['images'] = implode('|', $share_info['images']);
}
if ($share_info['video']) {
//$status['images'] = $share_info['video']['snap_url'];
$status['images'] = $share_info['video']['url'] . '?filetype=gif';
}
$r = $c->add_share($status);
if ($r['ret'] == 0) {
return array('code' => 200);
} elseif (in_array(intval($r['ret']), array(100014, 100015, 100030))) {
return array('code' => 403);
} else {
return array('code' => 400, 'data' => $r);
}
}