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