本文整理匯總了PHP中pc_base::load_plugin_class方法的典型用法代碼示例。如果您正苦於以下問題:PHP pc_base::load_plugin_class方法的具體用法?PHP pc_base::load_plugin_class怎麽用?PHP pc_base::load_plugin_class使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pc_base
的用法示例。
在下文中一共展示了pc_base::load_plugin_class方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: oauth
public function oauth() {
pc_base::load_plugin_class('weibooauth','',0);
$setting = getcache('weibo_var','plugins');
if(!isset($_REQUEST['oauth_verifier']) || $_REQUEST['oauth_verifier'] == '') {
if($this->auth_db->get_one(array('source'=>'sina'))) {
$txt = '授權成功,<a href="?m=zl_admin&c=plugin&a=config&pluginid='.$this->pluginid.'&module=removeauth&pc_hash='.$_SESSION['pc_hash'].'">解除綁定</a>';
} else {
$o = new WeiboOAuth( $setting['wb_akey'] , $setting['wb_skey']);
$keys = $o->getRequestToken();
print_r($keys);
$aurl = $o->getAuthorizeURL( $keys['oauth_token'] ,false , get_url());
$_SESSION['keys'] = $keys;
$txt = '<a href="'.$aurl.'">點擊進行授權</a>';
}
} else {
$o = new WeiboOAuth( $setting['wb_akey'] , $setting['wb_skey'] , $_SESSION['keys']['oauth_token'] , $_SESSION['keys']['oauth_token_secret'] );
$last_key = $o->getAccessToken( $_REQUEST['oauth_verifier'] ) ;
$c = new WeiboClient( $setting['wb_akey'] , $setting['wb_skey'] , $last_key['oauth_token'] , $last_key['oauth_token_secret'] );
$ms = $c->home_timeline(); // done
$me = $c->verify_credentials();
$this->auth_db->insert(array('uid'=>$me['id'],'token'=>$last_key['oauth_token'],'tsecret'=>$last_key['oauth_token_secret'],'source'=>'sina'));
$txt = '授權成功,'.$me['name'].'<a href="?m=zl_admin&c=plugin&a=config&pluginid='.$this->pluginid.'&module=removeauth&pc_hash='.$_SESSION['pc_hash'].'">解除綁定</a>';
}
include $this->op->plugin_tpl('oauth',PLUGIN_ID);
}