function attention() { if (!XWB_plugin::pCfg('is_tips_display')) { XWB_plugin::deny('新浪微博资料页功能已经关闭!'); } $att_id = XWB_plugin::V('g:att_id'); $wbApi = XWB_plugin::getWB(); $wbApi->is_exit_error = false; $mySinaUid = XWB_plugin::getBindInfo('sina_uid', ''); if (empty($mySinaUid)) { XWB_plugin::deny('你不是绑定用户,不能关注其它用户'); } $rst = $wbApi->createFriendship($att_id); $url = 'http:/' . '/t.sina.com.cn/' . $att_id; XWB_plugin::redirect($url, 3); }
/** * 根据在首页中显示的浮层显示对应的操作(内部函数,被authCallback最后调用) * 所有跟站点相关的对接,必须放到_showBinging * @param string $tipsType 类型 * @uses showmessage(dz函数) */ function _showBinging($tipsType) { global $_G; $sess = XWB_plugin::getUser(); $referer = $sess->getInfo('referer'); if (empty($referer)) { $referer = 'index.php'; } //用于启动浮层 $GLOBALS['xwb_tips_type'] = $tipsType; //不完美解决方案 if (0 != $_G['config']['output']['forceheader'] && 'UTF8' != XWB_S_CHARSET) { @header("Content-type: text/html; charset=" . $_G['config']['output']['charset']); } if ('autoLogin' == $tipsType) { $_G['cookie'][$this->_getBindCookiesName((int) $_G['uid'])] = 99999; //仅为了不显示绑定按钮 $_G['username'] = empty($_G['username']) ? 'SinaAPIUser' : $_G['username']; if ($_G['setting']['allowsynlogin'] && 0 < $_G['uid']) { loaducenter(); $ucsynlogin = $_G['setting']['allowsynlogin'] ? uc_user_synlogin($_G['uid']) : ''; $param = array('username' => $_G['username'], 'uid' => $_G['uid'], 'usergroup' => ''); showmessage('login_succeed', $referer, $param, array('showdialog' => 1, 'locationtime' => true, 'extrajs' => $ucsynlogin)); } else { showmessage('login_succeed', $referer, array('username' => $_G['username'], 'uid' => 0, 'usergroup' => '')); } } elseif ('siteuserNotExist' == $tipsType) { showmessage(XWB_plugin::L('xwb_site_user_not_exist'), '', array(), array(), 1); } elseif ('reg' == $tipsType) { showmessage(XWB_plugin::L('xwb_process_binding', 'openReg4dx'), null, array(), array(), 1); } elseif ('hasBinded' == $tipsType) { showmessage(XWB_plugin::L('xwb_process_binding', 'hasBind'), null, array(), array(), 1); //直接跳转到bind页面 } else { if (version_compare(XWB_S_VERSION, '2', '>=')) { $pluginid = 'sina_xweibo_x2'; } else { $pluginid = 'sina_xweibo'; } XWB_plugin::redirect(XWB_plugin::siteUrl(0) . 'home.php?mod=spacecp&ac=plugin&id=' . $pluginid . ':home_binding', 3); } }
function attention() { $att_id = strval(XWB_plugin::V('g:att_id')); if (!is_numeric($att_id)) { XWB_plugin::showError('要关注的用户参数错误!'); } $mySinaUid = XWB_plugin::getBindInfo('sina_uid', ''); if (empty($mySinaUid)) { XWB_plugin::redirect('xwbSiteInterface.bind', 2); } $wbApi = XWB_plugin::getWB(); $wbApi->is_exit_error = false; $rst = $wbApi->createFriendship($att_id); $url = XWB_plugin::getWeiboProfileLink($att_id); XWB_plugin::redirect($url, 3); }
/** * 根据在首页中显示的浮层显示对应的操作(内部函数,被authCallback最后调用) * 所有跟站点相关的对接,必须放到_showBinging * @param string $tipsType 类型 * @uses showmessage(dz函数) */ function _showBinging($tipsType) { //用于启动浮层 $GLOBALS['xwb_tips_type'] = $tipsType; //不完美解决方案 if ('UTF-8' != strtoupper($GLOBALS['_J']['config']['charset'])) { @header("Content-type: text/html; charset=utf-8"); } if ('autoLogin' == $tipsType) { $synlogin_result = ''; if (true === UCENTER) { //加载Ucenter客户端文件 include_once ROOT_PATH . './api/uc_client/client.php'; $ucuid = (int) $GLOBALS['_J']['config']['login_user']['ucuid']; if ($ucuid > 0) { $synlogin_result = uc_user_synlogin($ucuid); } } //直接跳转到首页 jsg_showmessage("登录成功{$synlogin_result}", $this->redirect_to, 5); } elseif ('siteuserNotExist' == $tipsType) { jsg_showmessage(XWB_plugin::L('xwb_site_user_not_exist')); } elseif ('reg' == $tipsType) { jsg_showmessage(XWB_plugin::L('xwb_process_binding', 'openReg4jsg')); } elseif ('hasBinded' == $tipsType) { jsg_showmessage(XWB_plugin::L('xwb_process_binding', 'hasBind')); //直接跳转到bind页面 } else { XWB_plugin::redirect(XWB_plugin::siteUrl(0) . 'index.php?mod=account&code=sina', 3); } }