當前位置: 首頁>>代碼示例>>PHP>>正文


PHP XWB_plugin::showError方法代碼示例

本文整理匯總了PHP中XWB_plugin::showError方法的典型用法代碼示例。如果您正苦於以下問題:PHP XWB_plugin::showError方法的具體用法?PHP XWB_plugin::showError怎麽用?PHP XWB_plugin::showError使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在XWB_plugin的用法示例。


在下文中一共展示了XWB_plugin::showError方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: doCfg4pushback

 /**
  * 評論回推設置:設置和開啟評論回推選項
  */
 function doCfg4pushback()
 {
     if (!defined('XWB_S_IS_ADMIN') || !XWB_S_IS_ADMIN || !XWB_plugin::isRequestBy('POST')) {
         XWB_plugin::deny('');
     } elseif (!xwb_token::checkInput('p', 'pushback', true)) {
         XWB_plugin::showError('令牌驗證失敗,請返回重試');
     }
     $is_pushback_open = 1;
     $pushback_to_thread = intval(XWB_plugin::V('p:pushback_to_thread'));
     $pushback_to_blog = intval(XWB_plugin::V('p:pushback_to_blog'));
     $pushback_to_doing = intval(XWB_plugin::V('p:pushback_to_doing'));
     $pushback_to_share = intval(XWB_plugin::V('p:pushback_to_share'));
     if (!$pushback_to_thread && !$pushback_to_blog && !$pushback_to_doing && !$pushback_to_share) {
         $is_pushback_open = 0;
     }
     $res = XWB_Plugin::setPCfg(array('is_pushback_open' => $is_pushback_open, 'pushback_to_thread' => $pushback_to_thread, 'pushback_to_blog' => $pushback_to_blog, 'pushback_to_doing' => $pushback_to_doing, 'pushback_to_share' => $pushback_to_share));
     if (true == $res) {
         $ret = array(1, '設置保存成功。');
     } else {
         $ret = array(0, '設置保存失敗,請檢查配置文件app.cfg.php是否具有可寫權限?');
     }
     $this->_oScript('xwbSetTips', $ret);
     $pushInstance = XWB_Plugin::O('pushbackCommunicator');
     if (1 == $is_pushback_open) {
         $pushInstance->setPushback('comment');
     } else {
         $pushInstance->cancelPushback();
     }
 }
開發者ID:Jaedeok-seol,項目名稱:discuz_template,代碼行數:32,代碼來源:pushbackInterface.mod.php

示例2: setError

 /**
  * 設置錯誤提示
  *
  * @param string $error
  * @return unknown
  */
 function setError($error)
 {
     $errmsg = isset($error['error']) ? strtolower($error['error']) : 'UNDEFINED ERROR';
     if (strpos($errmsg, 'token_')) {
         $msg = XWB_plugin::L('xwb_token_error');
     } elseif (strpos($errmsg, 'user does not exists')) {
         $msg = XWB_plugin::L('xwb_user_not_exists');
     } elseif (strpos($errmsg, 'target weibo does not exist')) {
         $msg = XWB_plugin::L('xwb_target_weibo_not_exist');
     } elseif (strpos($errmsg, 'weibo id is null')) {
         $msg = XWB_plugin::L('xwb_weibo_id_null');
     } elseif (strpos($errmsg, 'system error')) {
         $msg = XWB_plugin::L('xwb_system_error');
     } elseif (strpos($errmsg, 'consumer_key')) {
         $msg = XWB_plugin::L('xwb_app_key_error');
     } elseif (strpos($errmsg, 'ip request')) {
         $msg = XWB_plugin::L('xwb_request_reach_api_maxium');
     } elseif (strpos($errmsg, 'update comment')) {
         $msg = XWB_plugin::L('xwb_comment_reach_api_maxium');
     } elseif (strpos($errmsg, 'update weibo')) {
         $msg = XWB_plugin::L('xwb_update_reach_api_maxium');
     } elseif (strpos($errmsg, 'high level')) {
         $msg = XWB_plugin::L('xwb_access_resource_api_denied');
     } else {
         $msg = XWB_plugin::L('xwb_system_error');
     }
     //DEBUG 日誌
     $req_url = $this->last_req_url;
     XWB_plugin::LOG("[WEIBO CLASS]\t[ERROR]\t#{$this->req_error_count}\t{$msg}\t{$req_url}\tERROR ARRAY:\r\n" . print_r($error, 1));
     //DEBUG END
     if (!$this->is_exit_error) {
         return false;
     }
     if ('utf8' != strtolower(XWB_S_CHARSET)) {
         $msg = XWB_plugin::convertEncoding($msg, XWB_S_CHARSET, 'UTF-8');
     }
     XWB_plugin::showError($msg);
 }
開發者ID:Jaedeok-seol,項目名稱:discuz_template,代碼行數:44,代碼來源:weibo2_0.class.php

示例3: doShare

 /**
  * 帖子轉發
  */
 function doShare()
 {
     if (!XWB_plugin::pCfg('is_rebutton_display')) {
         XWB_plugin::showError('新浪微博資料頁功能已經關閉!');
     }
     /* 判斷是否外部轉發 */
     if (!isset($_SESSION['forshare']) || TRUE !== $_SESSION['forshare']) {
         XWB_plugin::showError('禁止外部轉發');
     }
     /* 銷毀 SESSION['forshare'] 變量*/
     unset($_SESSION['forshare']);
     /* 判斷轉發時間間隔 */
     $shareTime = intval(XWB_plugin::pCfg('wbx_share_time'));
     if ($shareTime >= time() - intval(@$_SESSION['sharetime'])) {
         XWB_plugin::showError("轉發過快,轉發間隔為 {$shareTime} 秒");
     }
     /* 獲取用戶信息 */
     $rst = $this->_getUserInfo();
     if (isset($rst['error_no']) && 0 < $rst['error_no']) {
         $this->_showTip($rst['error']);
     }
     /* 獲取傳遞信息 */
     $message = trim(strval(XWB_plugin::V('p:message')));
     $pic = trim(strval(XWB_plugin::V('p:share_pic')));
     if (empty($message)) {
         $this->_showTip('錯誤:轉發信息不能為空.', $rst);
     }
     /* 轉發主題 */
     $xp_publish = XWB_plugin::N('xwb_plugins_publish');
     $ret = $xp_publish->sendShare($message, $pic);
     /* 寫入 SESSION 發布時間 */
     $_SESSION['sharetime'] = time();
     /* 錯誤處理 */
     if ($ret === false || $ret === null) {
         $this->_showTip('錯誤:係統錯誤!', $rst);
     }
     if (isset($ret['error_code']) && isset($ret['error'])) {
         $error_code_se = substr($ret['error'], 0, 5);
         if ('400' == $ret['error_code'] && '40025' == $error_code_se) {
             $ret['error'] = '錯誤:不能發布相同的微博!';
         } else {
             $ret['error'] = '錯誤:係統錯誤!';
         }
         $this->_showTip($ret['error'], $rst);
     }
     $this->_showTip('轉發成功!', $rst);
 }
開發者ID:YouthAndra,項目名稱:huaitaoo2o,代碼行數:50,代碼來源:xwbSiteInterface.mod.php

示例4: setError

 function setError($error)
 {
     if (!$this->error_exit) {
         return;
     }
     $err = array('Access time failure' => '請求時間失效', 'Signature is not correct' => '簽名不正確', 'Request path is not correct' => '請求路徑不正確', 'Save faileds' => '數據保存失敗', 'Update faileds' => '數據更新失敗');
     $errmsg = isset($error['error']) ? strtolower($error['error']) : 'UNDEFINED ERROR';
     $msg = isset($err[$errmsg]) ? $err[$errmsg] : '未知錯誤';
     if ('utf8' != strtolower(XWB_S_CHARSET)) {
         $msg = XWB_plugin::convertEncoding($msg, XWB_S_CHARSET, 'UTF-8');
     }
     XWB_plugin::showError($msg);
 }
開發者ID:Jaedeok-seol,項目名稱:discuz_template,代碼行數:13,代碼來源:apixwb.class.php

示例5: _getOAuthUrl

 function _getOAuthUrl()
 {
     static $aurl = null;
     if (!empty($aurl)) {
         return $aurl;
     }
     $sess = XWB_plugin::getUser();
     $sess->clearToken();
     $wbApi = XWB_plugin::getWB();
     $keys = $wbApi->getRequestToken();
     if (!isset($keys['oauth_token']) || !isset($keys['oauth_token_secret'])) {
         $api_error_origin = isset($keys['error']) ? $keys['error'] : 'UNKNOWN ERROR. MAYBE SERVER CAN NOT CONNECT TO SINA API SERVER';
         $api_error = isset($keys['error_CN']) && !empty($keys['error_CN']) && 'null' != $keys['error_CN'] ? $keys['error_CN'] : '';
         XWB_plugin::LOG("[WEIBO CLASS]\t[ERROR]\t#{$wbApi->req_error_count}\t{$api_error}\t{$wbApi->last_req_url}\tERROR ARRAY:\r\n" . print_r($keys, 1));
         XWB_plugin::showError("服務器獲取Request Token失敗;請稍候再試。<br />錯誤原因:{$api_error}[{$api_error_origin}]");
     }
     //print_r($keys);
     $aurl = $wbApi->getAuthorizeURL($keys['oauth_token'], false, XWB_plugin::getEntryURL('xwbAuth.authCallBack'));
     $sess->setOAuthKey($keys, false);
     return rtrim($aurl, '&');
 }
開發者ID:Jaedeok-seol,項目名稱:discuz_template,代碼行數:21,代碼來源:xwbAuth.mod.php

示例6: setSync

 function setSync()
 {
     $uid = max(0, (int) MEMBER_ID);
     if ($uid < 1) {
         $this->Messager("請先<a href='index.php?mod=login'>點此登錄</a>或者<a href='index.php?mod=member'>點此注冊</a>一個帳號", null);
     }
     $setting = (int) $this->Get['setting'];
     if ('sina' == $this->Get['type']) {
         define('IS_IN_XWB_PLUGIN', true);
         define('XWB_P_ROOT', ROOT_PATH . 'include/ext/xwb/');
         require_once XWB_P_ROOT . 'sina.php';
         require_once XWB_P_ROOT . 'lib/core.class.php';
         if (XWB_S_UID < 1 || !XWB_plugin::pCfg('is_account_binding')) {
             XWB_plugin::showError('新浪微博綁定功能已經關閉!');
         }
         $tojishigou = XWB_plugin::V('G:tojishigou');
         $reply_tojishigou = XWB_plugin::V('G:reply_tojishigou');
         $profile = XWB_plugin::O('xwbUserProfile');
         $profile->set(array('bind_setting' => (int) $setting, 'synctopic_tojishigou' => (int) $tojishigou, 'syncreply_tojishigou' => (int) $reply_tojishigou));
         $r = jclass('misc')->update_account_bind_info(XWB_S_UID, '', '', 1);
     } elseif ('qq' == $this->Get['type']) {
         $this->DatabaseHandler->Query("update " . TABLE_PREFIX . "qqwb_bind_info set `synctoqq`='{$setting}' where `uid`='{$uid}'");
         $r = jclass('misc')->update_account_bind_info($uid, '', '', 1);
     } elseif ('renren' == $this->Get['type'] && !$setting) {
         $r = $this->DatabaseHandler->Query("delete from " . TABLE_PREFIX . "renren_bind_info where `uid`='{$uid}'");
     } elseif ('kaixin' == $this->Get['type']) {
         $this->DatabaseHandler->Query("delete from " . TABLE_PREFIX . "kaixin_bind_info where `uid`='{$uid}'");
     }
     json_result('ok', $setting ? 0 : 1);
 }
開發者ID:YouthAndra,項目名稱:huaitaoo2o,代碼行數:30,代碼來源:misc.mod.php


注:本文中的XWB_plugin::showError方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。