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


PHP Wekit::C方法代碼示例

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


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

示例1: appDo

 public function appDo($space)
 {
     if (!in_array('profile', Wekit::C('site', 'app.torrent.showuserinfo'))) {
         return '';
     }
     $user = Wekit::load('EXT:torrent.service.PwTorrentUser')->getTorrentUserByUid($space->{'spaceUid'});
     $torrents = Wekit::load('EXT:torrent.service.PwTorrent')->fetchTorrentByUid($space->{'spaceUid'});
     $histories = Wekit::load('EXT:torrent.service.PwTorrentHistory')->fetchTorrentHistoryByUid($space->{'spaceUid'});
     $passkey = $user['passkey'];
     $posted = count($torrents);
     foreach ($histories as $history) {
         $downloaded_total += $history['downloaded'];
         $uploaded_total += $history['uploaded'];
     }
     $downloaded_total = floor($downloaded_total / 1048567);
     $uploaded_total = floor($uploaded_total / 1048567);
     if ($downloaded_total != 0) {
         $rotio = round($uploaded_total / $downloaded_total, 2);
     } else {
         $rotio = 'Inf.';
     }
     echo '<div class="space_profile"><h3><strong>PT個人信息</strong></h3>';
     if ($space->{'visitUid'} == $space->{'spaceUid'}) {
         echo '<dl class="cc"><dt>Passkey:</dt><dd><span id="passkey" style="background-color:rgb(51,51,51); color:rgb(51,51,51);">' . $passkey . '</span>&nbsp;<button class="btn" id="btnToggle" onclick="if ($(\'#btnToggle\').text() == \'顯示\') {$(\'#passkey\').css(\'background\', \'white\'); $(\'#btnToggle\').text(\'隱藏\');} else {$(\'#passkey\').css(\'background\', \'rgb(51,51,51)\');$(\'#btnToggle\').text(\'顯示\');}">顯示</button></dd></dl>';
         echo '<dl class="cc"><dt>訂閱地址:</dt><dd><a href="' . WindUrlHelper::createUrl('/app/torrent/index/rss?uid=' . $space->{'spaceUid'} . '&passkey=' . $passkey) . '">RSS 鏈接(請勿泄露)</a><a href="' . WindUrlHelper::createUrl('/app/torrent/index/my') . '" class="btn">管理</a></dd></dl>';
     }
     echo '<dl class="cc"><dt>下載:</dt><dd>' . $downloaded_total . ' M</dd></dl>';
     echo '<dl class="cc"><dt>上傳:</dt><dd>' . $uploaded_total . ' M</dd></dl>';
     echo '<dl class="cc"><dt>分享率:</dt><dd>' . $rotio . '</dd></dl>';
     echo '<dl class="cc"><dt>發布:</dt><dd>' . $posted . '</dd></dl>';
     echo '</div>';
 }
開發者ID:Going2333,項目名稱:WindPT,代碼行數:32,代碼來源:PwSpaceProfileDoTorrent.php

示例2: run

 public function run()
 {
     // type表示哪一種第三方平台
     $type = $this->getInput('type', 'get') ? $this->getInput('type', 'get') : 'qq';
     // 管理界麵顯示的名稱
     $lab = $this->_displayText($type);
     // 在數據庫中存儲的字段名稱
     $status = $type . '.status';
     $appId = $type . '.appid';
     $appKey = $type . '.appkey';
     $displayOrder = $type . '.displayOrder';
     //
     $config = Wekit::C()->getValues('webThirdLogin');
     $info = array('status' => $config[$status], 'appId' => $config[$appId], 'appKey' => $config[$appKey], 'displayOrder' => $config[$displayOrder]);
     // 回調地址
     $config = Wekit::C()->getConfigByName('site', 'info.url');
     if ($type == 'qq') {
         // QQ的回調地址填寫比較詭異,提示和文檔都是錯的
         $redirecturl = $config['value'] . '/index.php';
     } else {
         $redirecturl = $config['value'] . '/index.php?m=u&c=login&a=thirdlogincallback&platform=' . $type;
     }
     //
     $this->setOutput($redirecturl, 'redirecturl');
     $this->setOutput($type, 'type');
     $this->setOutput($lab, 'lab');
     $this->setOutput($info, 'info');
     //
     $typeClasses[$type] = 'class="current"';
     $this->setOutput($typeClasses, 'typeClasses');
 }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:31,代碼來源:ThirdOpenPlatformController.php

示例3: dorunAction

 public function dorunAction()
 {
     list($showuserinfo, $titlegenifopen, $titlegendouban, $check, $deniedfts, $torrentnameprefix, $peertimeout, $torrentimeout) = $this->getInput(array('showuserinfo', 'titlegenifopen', 'titlegendouban', 'check', 'deniedfts', 'torrentnameprefix', 'peertimeout', 'torrentimeout'), 'post');
     if (is_array($deniedfts)) {
         foreach ($deniedfts as $key => $value) {
             if (empty($value)) {
                 continue;
             }
             $_deniedfts[$key] = $value;
         }
     }
     if (empty($torrentnameprefix)) {
         $torrentnameprefix = Wekit::C('site', 'info.name');
     }
     if (intval($peertimeout) < 15) {
         $peertimeout = 15;
     }
     $config = new PwConfigSet('site');
     $config->set('app.torrent.showuserinfo', $showuserinfo)->set('app.torrent.titlegen.ifopen', $titlegenifopen)->set('app.torrent.titlegen.douban', $titlegendouban)->set('app.torrent.check', $check)->set('app.torrent.torrentnameprefix', $torrentnameprefix)->set('app.torrent.cron.peertimeout', intval($peertimeout))->set('app.torrent.cron.torrentimeout', intval($torrentimeout));
     if (!empty($deniedfts)) {
         $config->set('app.torrent.deniedfts', $_deniedfts);
     }
     $sconfig = $this->_loadConfigService()->getValues('site');
     if ($sconfig['theme.site.default'] == 'pt') {
         $showpeers = $this->getInput('showpeers', 'post');
         $config->set('app.torrent.theme.showpeers', $showpeers);
     }
     $config->flush();
     $this->showMessage('ADMIN:success');
 }
開發者ID:LastRitter,項目名稱:WindPT,代碼行數:30,代碼來源:ManageController.php

示例4: searchInvitecodeList

 /**
  * 搜索邀請碼列表
  *
  * @param PwInviteCodeSo $search 搜索的條件
  * @param int $page 搜索的開始位置
  * @param int $perpage
  * @return array
  */
 public function searchInvitecodeList(PwInviteCodeSo $search, $limit = 10, $start = 0)
 {
     $data = $this->_getDs()->searchCode($search, $limit, $start);
     if (!$data) {
         return array();
     }
     $result = array();
     $time = Wekit::C('register', 'invite.expired');
     $expire = Pw::getTime() - $time * 86400;
     $_invitedUid = array();
     foreach ($data as $_item) {
         $_item['status'] = $_item['created_time'] < $expire ? '-1' : $_item['ifused'];
         $_item['expired_time'] = $_item['created_time'] + $time * 86400;
         $_item['invited_userid'] && ($_invitedUid[] = $_item['invited_userid']);
         $result[] = $_item;
     }
     if ($_invitedUid) {
         /* @var $userDs PwUser */
         $userDs = Wekit::load('user.PwUser');
         $invitedUsers = $userDs->fetchUserByUid($_invitedUid);
         foreach ($result as $_k => $_item) {
             $result[$_k]['invited_username'] = $invitedUsers[$_item['invited_userid']] ? $invitedUsers[$_item['invited_userid']]['username'] : '';
         }
     }
     return $result;
 }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:34,代碼來源:PwInviteCodeService.php

示例5: beforeAction

 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     $this->_var = $this->getRequest()->getRequest();
     $this->_conf = Wekit::C('pay');
     if (!$this->_conf['ifopen']) {
         $this->paymsg($this->_conf['reason']);
     }
     if (!$this->_conf['alipay']) {
         $this->paymsg('onlinepay.settings.alipay.error');
     }
     $http = Wind::getComponent('httptransfer', array('http://notify.alipay.com/trade/notify_query.do'));
     $veryfy_result2 = trim($http->post(array('notify_id' => $this->_var['notify_id'], 'partner' => $this->_conf['alipaypartnerID'])), "\r\n");
     //兼容支付寶urlencode之後偽靜態+號無法rawurldecode的處理方案
     isset($this->_var['notify_time']) && ($this->_var['notify_time'] = urldecode($this->_var['notify_time']));
     ksort($this->_var);
     reset($this->_var);
     $arg = '';
     foreach ($this->_var as $key => $value) {
         if ($value && !in_array($key, array('p', 'm', 'c', 'a', 'sign', 'sign_type'))) {
             $arg .= "{$key}={$value}&";
         }
     }
     $veryfy_result1 = $this->_var['sign'] == md5(substr($arg, 0, -1) . $this->_conf['alipaykey']) ? true : false;
     if (!$veryfy_result1 || !preg_match("/true/i", $veryfy_result2)) {
         $this->paymsg('onlinepay.auth.fail', 'fail');
     }
 }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:28,代碼來源:AlipayController.php

示例6: __construct

 public function __construct()
 {
     $config = Wekit::C('pay');
     $this->tenpay = $config['tenpay'];
     $this->tenpay_key = $config['tenpaykey'];
     $this->baseurl = WindUrlHelper::createUrl('bbs/tenpay/run');
 }
開發者ID:fanqimeng,項目名稱:4tweb,代碼行數:7,代碼來源:PwTenpay.php

示例7: compile

 public function compile($key, $content)
 {
     $content = substr($content, 8, -1);
     if (!$content) {
         return '';
     }
     $themeBaseUrl = 'Wekit::app()->themes';
     preg_match('/(\\w*.)?(\\w*.)?(css|js|images)(.\\w*)?/i', $content, $matchs);
     if (!$matchs) {
         return '';
     }
     if (empty($matchs[3])) {
         return '';
     }
     $pack = $theme = '';
     if (!empty($matchs[1])) {
         $themeType = trim($matchs[1], '.');
         $pack = Wekit::C('site', 'theme.' . $themeType . '.pack');
         $theme = empty($matchs[2]) ? '\'.Wekit::C(\'site\', \'theme.' . $themeType . '.default\').\'' : trim($matchs[2], '.');
     } else {
         list($theme, $pack) = $this->windViewerResolver->getWindView()->getTheme(0);
         $pack && ($pack = str_replace('THEMES:', '', $pack));
     }
     $content = $pack ? '.\'/' . str_replace('.', '/', $pack) . '\'' : '';
     $content .= $theme ? '.\'/' . $theme . '\'' : '';
     $content .= '.\'/' . $matchs[3] . '\'';
     if ($matchs[3] === 'css') {
         $content .= '.Wekit::getGlobal(\'theme\',\'debug\')';
     }
     $content = '<?php echo ' . $themeBaseUrl . $content . '; ?>';
     $content = str_replace('\'.\'', '', $content);
     return $content;
 }
開發者ID:fanqimeng,項目名稱:4tweb,代碼行數:33,代碼來源:PwTemplateCompilerThemeUrl.php

示例8: __construct

 public function __construct()
 {
     $config = Wekit::C('pay');
     $this->bill = $config['99bill'];
     $this->bill_key = $config['99billkey'];
     $this->baseurl = WindUrlHelper::createUrl('bbs/pay99bill/run');
 }
開發者ID:fanqimeng,項目名稱:4tweb,代碼行數:7,代碼來源:PwBill.php

示例9: run

 public function run()
 {
     $addons = Wekit::load('domain.srv.PwDomainService')->getRewriteAddOns();
     $rewrite = Wekit::C('rewrite');
     $this->setOutput($addons, 'addons');
     $this->setOutput($rewrite, 'rewrite');
 }
開發者ID:fanqimeng,項目名稱:4tweb,代碼行數:7,代碼來源:RewriteController.php

示例10: postHandle

 public function postHandle()
 {
     //門戶管理模式 編譯目錄切換
     if ($this->getRequest()->getPost('design')) {
         $loginUser = Wekit::getLoginUser();
         $designPermission = $loginUser->getPermission('design_allow_manage.push');
         if ($designPermission > 0) {
             $dir = Wind::getRealDir('DATA:design.template');
             if (is_dir($dir)) {
                 WindFolder::rm($dir, true);
             }
             $this->forward->getWindView()->compileDir = 'DATA:design.template';
         }
     }
     // SEO settings
     Wind::import('SRV:seo.bo.PwSeoBo');
     $sitename = Wekit::C('site', 'info.name');
     PwSeoBo::set('{sitename}', $sitename);
     Wekit::setGlobal(NEXT_VERSION . ' ' . NEXT_RELEASE, 'version');
     Wekit::setGlobal(PwSeoBo::getData(), 'seo');
     $this->setOutput($this->getRequest()->getIsAjaxRequest() ? '1' : '0', '_ajax_');
     /*[設置給PwGlobalFilters需要的變量]*/
     $_var = array('current' => $this->forward->getWindView()->templateName, 'a' => $this->router->getAction(), 'c' => $this->router->getController(), 'm' => $this->router->getModule());
     $this->getResponse()->setData($_var, '_aCloud_');
     Wekit::load('APPS:appcenter.service.srv.PwDebugApplication')->compile();
 }
開發者ID:fanqimeng,項目名稱:4tweb,代碼行數:26,代碼來源:PwFilter.php

示例11: run

 public function run()
 {
     $config = Wekit::C()->getValues('reg');
     is_array($config['security.password']) || ($config['security.password'] = array());
     //$config['security.ban.username'] = implode(',', $config['security.ban.username']);
     $this->setOutput($config, 'config');
 }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:7,代碼來源:RegistController.php

示例12: beforeAction

 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     $this->_var = $this->getRequest()->getRequest();
     $this->_conf = Wekit::C('pay');
     if (!$this->_conf['ifopen']) {
         $this->paymsg($this->_conf['reason']);
     }
     if (!$this->_conf['99bill'] || !$this->_conf['99billkey']) {
         $this->paymsg('onlinepay.settings.99bill.error');
     }
     strlen($this->_conf['99bill']) == 11 && ($this->_conf['99bill'] .= '01');
     $arr = array('payType', 'bankId', 'orderId', 'orderTime', 'orderAmount', 'dealId', 'bankDealId', 'dealTime', 'payAmount', 'fee', 'payResult', 'errCode');
     $txt = 'merchantAcctId=' . $this->_conf['99bill'] . '&version=v2.0&language=1&signType=1';
     foreach ($arr as $value) {
         $this->_var[$value] = trim($this->_var[$value]);
         if (strlen($this->_var[$value]) > 0) {
             $txt .= '&' . $value . '=' . $this->_var[$value];
         }
     }
     $mac = strtoupper(md5($txt . '&key=' . $this->_conf['99billkey']));
     if ($mac != strtoupper(trim($this->_var['signMsg']))) {
         $this->paymsg('onlinepay.auth.fail');
     }
     if ($this->_var['payResult'] != '10') {
         $this->paymsg('onlinepay.success');
     }
 }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:28,代碼來源:Pay99billController.php

示例13: run

 public function run()
 {
     if (isset($_POST['submit'])) {
         list($mobile, $password, $username) = $this->getInput(array('mobile', 'password', 'username'), 'post');
         $registeresult = $this->_getCommonDs()->weixinRegisterUser(Wekit::C('site', 'info.url'), $mobile, $password, $username);
     }
 }
開發者ID:fanqimeng,項目名稱:4tweb,代碼行數:7,代碼來源:MobileregisterController.php

示例14: beforeAction

 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     $this->_var = $this->getRequest()->getRequest();
     $this->_conf = Wekit::C('pay');
     if (!$this->_conf['ifopen']) {
         $this->paymsg($this->_conf['reason']);
     }
     if (!$this->_conf['tenpay'] || !$this->_conf['tenpaykey']) {
         $this->paymsg('onlinepay.settings.tenpay.error');
     }
     $arr = array('cmdno', 'pay_result', 'date', 'transaction_id', 'sp_billno', 'total_fee', 'fee_type', 'attach');
     $txt = '';
     foreach ($arr as $value) {
         $txt .= $value . '=' . $this->_var[$value] . '&';
     }
     $mac = strtoupper(md5($txt . 'key=' . $this->_conf['tenpaykey']));
     if ($mac != $this->_var['sign']) {
         $this->paymsg('onlinepay.auth.fail');
     }
     if ($this->_conf['tenpay'] != $this->_var['bargainor_id']) {
         $this->paymsg('onlinepay.tenpay.bargainorid.error');
     }
     if ($this->_var['pay_result'] != "0") {
         $this->paymsg('onlinepay.fail');
     }
 }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:27,代碼來源:TenpayController.php

示例15: checkVerify

 public function checkVerify($inputCode)
 {
     Wind::import('WINDID:service.verify.srv.PwVerifyService');
     $srv = new PwVerifyService('PwVerifyService_getVerifyType');
     $config = Wekit::C('verify');
     return $srv->checkVerify($config['type'], $inputCode);
 }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:7,代碼來源:PwCheckVerifyService.php


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