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


PHP XWB_plugin::N方法代碼示例

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


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

示例1: closeApi

 /**
  * 關閉遠程API
  */
 function closeApi()
 {
     $stx = XWB_plugin::pCfg('switch_to_xweibo');
     if (XWB_plugin::setPCfg(array('switch_to_xweibo' => 0))) {
         $api = XWB_plugin::N('apixwb');
         $response = $api->setNotice(0, '', FALSE);
         //            if( !is_array($response) || 0 != $response['errno']) {
         //                XWB_plugin::setPCfg(array('switch_to_xweibo' => $stx));
         //            }
         exit(json_encode($response));
     } else {
         exit(json_encode(array('errno' => 1, 'err' => '配置文件無法寫入')));
     }
 }
開發者ID:chibimiku,項目名稱:xweibo_for_discuz_x2_php7,代碼行數:17,代碼來源:xwbApiInterface.mod.php

示例2: closeApi

 /**
  * 關閉遠程API
  */
 function closeApi()
 {
     if (!xwb_token::checkInput('p', $this->tokehash, true)) {
         exit(json_encode(array('errno' => 1, 'err' => '令牌驗證失敗,請返回重試')));
     }
     $stx = XWB_plugin::pCfg('switch_to_xweibo');
     if (XWB_plugin::setPCfg(array('switch_to_xweibo' => 0))) {
         $api = XWB_plugin::N('apixwb');
         $response = $api->setNotice(0, '', FALSE);
         //            if( !is_array($response) || 0 != $response['errno']) {
         //                XWB_plugin::setPCfg(array('switch_to_xweibo' => $stx));
         //            }
         exit(json_encode($response));
     } else {
         exit(json_encode(array('errno' => 1, 'err' => '配置文件無法寫入')));
     }
 }
開發者ID:Jaedeok-seol,項目名稱:discuz_template,代碼行數:20,代碼來源:xwbApiInterface.mod.php

示例3: exit

<?php

/*
 * @version $Id: newarticle.hack.php 453 2010-12-23 04:36:02Z yaoying $
 */
if (!defined('IS_IN_XWB_PLUGIN')) {
    exit('Access Denied!');
}
global $_G;
$aid = isset($GLOBALS['aid']) ? (int) $GLOBALS['aid'] : 0;
$subject = isset($_POST['title']) ? (string) $_POST['title'] : '';
if ($aid >= 1) {
    if (XWB_plugin::V('p:syn')) {
        $xp_publish = XWB_plugin::N('xwb_plugins_publish');
        register_shutdown_function(array(&$xp_publish, 'articleSync'), (int) $aid, $subject);
    }
}
開發者ID:chibimiku,項目名稱:xweibo_for_discuz_x2_php7,代碼行數:17,代碼來源:newarticle.hack.php

示例4: addBindUser

 /**
  * 新增用戶綁定關係
  *
  */
 function addBindUser($site_uid, $sina_uid, $access_toke, $token_secret, $nickname = false, $turn = true)
 {
     if ($site_uid < 1) {
         return false;
     }
     $db = $discuz->db;
     $site_uid = DB::mysqli_escape($site_uid);
     $sina_uid = DB::mysqli_escape($sina_uid);
     $access_toke = DB::mysqli_escape($access_toke);
     $token_secret = DB::mysqli_escape($token_secret);
     $sql = "INSERT INTO " . DB::table('xwb_bind_info') . " (`uid`,`sina_uid`,`token`,`tsecret`,`profile`) VALUES('{$site_uid}','{$sina_uid}','{$access_toke}','{$token_secret}','[]')";
     $rst = DB::query($sql, 'UNBUFFERED');
     $switch = XWB_plugin::pCfg('switch_to_xweibo');
     if ($turn && $switch && $rst) {
         $api = XWB_plugin::N('apixwb');
         $api->updateBindUser($site_uid, $sina_uid, $access_toke, $token_secret, $nickname);
     }
     return $rst;
 }
開發者ID:chibimiku,項目名稱:xweibo_for_discuz_x2_php7,代碼行數:23,代碼來源:core.class.php

示例5: 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

示例6:

 /**
  * 獲取WBAPI類
  * @return weibo weibo類
  */
 function &getWB()
 {
     //以下這段代碼原來和plugin.env.php有重合,進行精簡或者棄用
     /*
     if ( !defined('XWB_S_UID') ||  XWB_S_UID < 1 ){
     	$sess = XWB_plugin::getUser();
     	$wBind	= $sess->getInfo('waiting_site_bind');
     	$wReg	= $sess->getInfo('waiting_site_reg');
     	if (empty($wBind) && empty($wReg) ){
     		$sess->clearToken();
     	}
     }
     */
     //echo '<pre>';print_r($_SESSION);exit;
     $wb = XWB_plugin::N('weibo');
     $wb->setConfig();
     return $wb;
 }
開發者ID:YouthAndra,項目名稱:huaitaoo2o,代碼行數:22,代碼來源:core.class.php

示例7: _createUCAvatarPostdata

 /**
  * 生成UC所需的頭像編碼POST數據。
  * @return array 編碼好的數據
  */
 function _createUCAvatarPostdata()
 {
     $postdata = array();
     $imageEncoder = XWB_plugin::N('imageEncoder');
     foreach ($this->faceTempPath as $key => $face) {
         $content = file_get_contents($face);
         if (empty($content)) {
             break;
         }
         $postkey = 'avatar' . $key;
         $postdata[$postkey] = $imageEncoder->flashdata_encode($content);
     }
     $imageEncoder = null;
     return $postdata;
 }
開發者ID:Jaedeok-seol,項目名稱:discuz_template,代碼行數:19,代碼來源:sinaFaceSync.class.php


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