本文整理匯總了PHP中XWB_plugin::redirect方法的典型用法代碼示例。如果您正苦於以下問題:PHP XWB_plugin::redirect方法的具體用法?PHP XWB_plugin::redirect怎麽用?PHP XWB_plugin::redirect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類XWB_plugin
的用法示例。
在下文中一共展示了XWB_plugin::redirect方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: attention
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);
}
示例2: _showBinging
/**
* 根據在首頁中顯示的浮層顯示對應的操作(內部函數,被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);
}
}
示例3: attention
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);
}
示例4: _showBinging
/**
* 根據在首頁中顯示的浮層顯示對應的操作(內部函數,被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);
}
}