protected function postUpload($tmp_name, $filename) { if (strpos($filename, '..') !== false || strpos($filename, '.php.') !== false || preg_match('/\\.php$/', $filename)) { exit('illegal file type!'); } WindFolder::mkRecur(dirname($filename)); if (function_exists("move_uploaded_file") && @move_uploaded_file($tmp_name, $filename)) { @unlink($tmp_name); @chmod($filename, 0777); return filesize($filename); } elseif (@copy($tmp_name, $filename)) { @unlink($tmp_name); @chmod($filename, 0777); return filesize($filename); } elseif (is_readable($tmp_name)) { Wind::import('WIND:utility.WindFile'); WindFile::write($filename, WindFile::read($tmp_name)); @unlink($tmp_name); if (file_exists($filename)) { @chmod($filename, 0777); return filesize($filename); } } return false; }
public function addlikeAction() { $this->getRequest()->isPost() || $this->showError('operate.fail'); $fromid = (int) $this->getInput('fromid', 'post'); $fromApp = $this->getInput('app', 'post'); $subject = $this->getInput('subject', 'post'); $url = $this->getInput('url', 'post'); if ($fromid < 1 || empty($fromApp)) { $this->showError('BBS:like.fail'); } $source = $this->_getLikeSourceDs()->getSourceByAppAndFromid($fromApp, $fromid); $newId = isset($source['sid']) ? (int) $source['sid'] : 0; Wind::import('SRV:like.dm.PwLikeSourceDm'); if ($newId < 1) { $dm = new PwLikeSourceDm(); $dm->setSubject($subject)->setSourceUrl($url)->setFromApp($fromApp)->setFromid($fromid)->setLikeCount(0); $newId = $this->_getLikeSourceDs()->addSource($dm); } else { $dm = new PwLikeSourceDm($source['sid']); $dm->setLikeCount($source['like_count']); $this->_getLikeSourceDs()->updateSource($dm); } $resource = $this->_getLikeService()->addLike($this->loginUser, 9, $newId); if ($resource instanceof PwError) { $this->showError($resource->getError()); } $this->setOutput($resource, 'data'); $this->showMessage('BBS:like.success'); }
public function doeditAction() { $tpl = $this->getInput('tpl', 'post'); $compid = (int) $this->getInput('compid', 'post'); $tpl = $this->_getDesignService()->filterTemplate($tpl); if (!$this->_getDesignService()->checkTemplate($tpl)) { $this->showError("DESIGN:template.error"); } $property = $this->bo->getProperty(); $limit = $this->compileFor($tpl); $property['limit'] = $limit ? $limit : $property['limit']; Wind::import('SRV:design.dm.PwDesignModuleDm'); $dm = new PwDesignModuleDm($this->bo->moduleid); $dm->setModuleTpl($tpl)->setCompid($compid)->setProperty($property); $resource = $this->_getModuleDs()->updateModule($dm); if ($resource instanceof PwError) { $this->showError($resource->getError()); } $module = $this->bo->getModule(); Wekit::load('design.srv.PwSegmentService')->updateSegmentByPageId($module['page_id']); Wind::import('SRV:design.srv.data.PwAutoData'); $srv = new PwAutoData($this->bo->moduleid); $srv->addAutoData(); $this->_getDesignService()->clearCompile(); if ($module['module_type'] == PwDesignModule::TYPE_SCRIPT) { $this->showMessage("operate.success", "design/module/run?type=api", true); } else { $this->showMessage("operate.success"); } }
public function __construct($forum) { Wind::import('SRV:forum.vo.PwThreadSo'); $this->forum = $forum; $this->so = new PwThreadSo(); $this->so->setFid($forum->fid)->setDisabled(0); }
private function _initInfo() { $this->uid = wekit::getLoginUser()->info['uid']; // dump($this->uid); $this->username = wekit::getLoginUser()->info['username']; $this->onlinetime = intval(intval(wekit::getLoginUser()->info['onlinetime']) / 3600); // $this->ip= wekit::getLoginUser()->info['lastloginip']; // $this->ip=$_SERVER["REMOTE_ADDR"]; $this->ip = $this->GetIP(); Wind::import('SRV:credit.bo.PwCreditBo'); $userBelongSrv = Wekit::load('SRV:user.PwUserBelong'); // dump($userBelongSrv->getUserBelongs(7)); $this->gid = wekit::getLoginUser()->info['groupid']; //$this->gid=8;//0 NULL 1会员2游客3管理员4总版主5论坛版主6禁止发言7未验证会员 if (($group = Wekit::cache()->get('group', $this->gid)) === false) { $group = Wekit::cache()->get('group', 1); } // dump(Wekit::$_app); // dump($this->gid); //2015.1.17关闭group if ($group) { $this->groupInfo = array('name' => $group['name'], 'type' => $group['type'], 'image' => $group['image'], 'points' => $group['points']); $this->permission = $group['permission']; } // dump($this->groupInfo); $this->avatarPath = str_replace('_middle', '', Pw::getAvatar($this->uid)); //获取头像 √ }
protected function getMethod($operation) { $config = (include Wind::getRealPath('WINDID:service.base.WindidNotifyConf.php', true)); $method = isset($config[$operation]['method']) ? $config[$operation]['method'] : ''; $args = isset($config[$operation]['args']) ? $config[$operation]['args'] : array(); return array($method, $args); }
public function afterAction($handlerAdapter) { parent::afterAction($handlerAdapter); $debug = Wekit::C('site', 'debug') || !Wekit::C('site', 'css.compress'); Wekit::setGlobal(array('debug' => $debug ? '/dev' : '/build'), 'theme'); $this->setTheme('site', null); /* @var $resource WindLangResource */ $resource = Wind::getComponent('i18n'); $_error = $this->getForward()->getVars('message'); if ($resource !== null) { foreach ($_error as $key => $value) { if (is_array($value)) { list($value, $var) = $value; } else { $var = array(); } $message = $resource->getMessage($value, $var); $message && ($_error[$key] = $message); } } $this->getForward()->setVars(array('message' => $_error, '__error' => '')); $type = $this->getRequest()->getAcceptTypes(); // 如果是含有上传的递交,不能采用ajax的方式递交,需要以html的方式递交,并且返回的结果需要是json格式,将以json=1传递过来标志 $json = $this->getInput('_json'); $requestJson = $this->getRequest()->getIsAjaxRequest() && strpos(strtolower($type), "application/json") !== false; if ($requestJson || $json == 1) { $this->getResponse()->setHeader('Content-type', 'application/json; charset=' . Wekit::V('charset')); echo Pw::jsonEncode($this->getForward()->getVars()); exit; } }
public function run() { $this->_setNavType('schoolarea'); $allArea = $this->_getAreaDs()->getAreaByParentid(0); $allArea = array_values($allArea); //check if has province id or not, if has, then school list need to based on that //get province from url $choosenProvinceid = $this->getInput('choosenProvinceid'); if (!isset($choosenProvinceid) || $choosenProvinceid <= 0) { $choosenProvinceid = $allArea[0]['areaid']; } $allSchool = $this->_getSchoolDs()->getSchoolByAreaidAndTypeid($choosenProvinceid, 3); $allSchool = array_values($allSchool); $this->setOutput($allSchool, 'allSchool'); $choosenSchoolid = $this->getInput('choosenSchoolid'); if (!isset($choosenSchoolid) || $choosenSchoolid <= 0) { $choosenSchoolid = $allSchool[0]['schoolid']; } //check if it is from search, if from search, then search by selected university if ($this->getInput('search', 'post') === 'search') { $choosenSchoolid = $this->getInput('choosenSchoolid', 'post'); $areaList = $this->_getSchoolAreaDs()->getBySchoolid($choosenSchoolid); $choosenProvinceid = $this->getInput('choosenProvinceid', 'post'); } else { //get first school and show its area Wind::import('EXT:4tschool.service.dm.App_SchoolArea_Dm'); $areaList = $this->_getSchoolAreaDs()->getBySchoolid($choosenSchoolid); //print_r($areaList);die; } $this->setOutput($choosenProvinceid, 'choosenProvinceid'); $this->setOutput($choosenSchoolid, 'choosenSchoolid'); $this->setOutput($areaList, 'areaList'); $this->setOutput($allArea, 'allArea'); }
/** * 初始化安装程序 */ public function __construct() { $this->_appId = 'L000' . time() . WindUtility::generateRandStr(4); $this->_config = @(include Wind::getRealPath(self::CONF_PATH, true)); $this->tmpPath = Wind::getRealPath($this->getConfig('tmp_dir') . '.' . Pw::getTime(), false); $this->tmpInstallLog = Wind::getRealPath($this->getConfig('log_dir'), false); }
/** * 后台设置-ftp设置 */ public function doftpAction() { Wind::import('WINDID:service.config.srv.WindidConfigSet'); $config = new WindidConfigSet('attachment'); $config->set('ftp.url', $this->getInput('ftpUrl', 'post'))->set('ftp.server', $this->getInput('ftpServer', 'post'))->set('ftp.port', $this->getInput('ftpPort', 'post'))->set('ftp.dir', $this->getInput('ftpDir', 'post'))->set('ftp.user', $this->getInput('ftpUser', 'post'))->set('ftp.pwd', $this->getInput('ftpPwd', 'post'))->set('ftp.timeout', abs(intval($this->getInput('ftpTimeout', 'post'))))->flush(); $this->showMessage('WINDID:success'); }
public function setStore($key, $storage) { Wind::import('WINDID:service.config.srv.WindidConfigSet'); $config = new WindidConfigSet('storage'); $config->set($key, serialize($storage))->flush(); return true; }
public static function getAppOutPut($collect) { $data = array(); $sign = ACloudSysCoreCommon::getSiteSign(); $data['src'] = $collect->getSrc(); $data['url'] = ACloudSysCoreCommon::getGlobal('g_siteurl', $_SERVER['SERVER_NAME']); $data['sn'] = ACloudSysCoreCommon::getSiteUnique(); $data['fid'] = $collect->getFid(); $data['uid'] = $collect->getUid(); $data['tid'] = $collect->getTid(); $data[$sign] = ACloudVerCoreApp::getSyncData($sign); $data['charset'] = ACloudSysCoreCommon::getGlobal('g_charset', 'gbk'); $data['username'] = $collect->getUsername(); $data['title'] = $collect->getTitle(); $data['_ua'] = ACloudSysCoreCommon::getSiteUserAgent(); $data['_shr'] = base64_encode(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''); $data['_sqs'] = base64_encode(isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : ''); $data['_ssn'] = base64_encode(isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : ''); $data['_t'] = ACloudSysCoreCommon::getGlobal('timestamp') + 86400; $data['_v'] = rand(1000, 9999); require_once Wind::getRealPath("ACLOUD:system.core.ACloudSysCoreHttp"); $url = sprintf("http://%s/?%s", ACloudSysCoreDefine::ACLOUD_HOST_APP, ACloudSysCoreHttp::httpBuildQuery($data)); $output = "<script type=\"text/javascript\">(function(d,t){var url=\"{$url}\";var g=d.createElement(t);g.async=1;g.src=url;d.body.insertBefore(g,d.body.firstChild);}(document,\"script\"));</script>"; return $output; }
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); }
public function run() { $permissionService = new PwPermissionService(); $categorys = $permissionService->getPermissionPoint($this->_getShowPoint(), array('basic', 'bbs')); $compare = $this->getInput('gid'); if ($compare && $compare != $this->loginUser->gid) { $this->setOutput(true, 'compare'); $compareGroup = $permissionService->getPermissionConfigByGid($compare, $this->_getShowPoint()); $this->setOutput($compareGroup, 'compareGroupPermission'); $this->setOutput($compare, 'comparegid'); } $myGroup = $permissionService->getPermissionConfigByGid($this->loginUser->gid, $this->_getShowPoint()); $this->listGroups(); $attach = array('allow_upload', 'allow_download', 'uploads_perday'); foreach ($categorys['bbs']['sub'] as $_k => $_v) { if (!in_array($_v, $attach)) { continue; } unset($categorys['bbs']['sub'][$_k]); } $totalCredit = Wekit::load('usergroup.srv.PwUserGroupsService')->getCredit($this->loginUser->info); $categorys['attach'] = array('name' => '附件权限', 'sub' => $attach); $this->setOutput($categorys, 'categorys'); $this->setOutput($myGroup, 'myGroupPermission'); $this->setOutput($totalCredit, 'myCredit'); $this->_appendBread('权限查看', WindUrlHelper::createUrl('profile/right/run')); $this->setTemplate('profile_right'); // seo设置 Wind::import('SRV:seo.bo.PwSeoBo'); $seoBo = PwSeoBo::getInstance(); $lang = Wind::getComponent('i18n'); $seoBo->setCustomSeo($lang->getMessage('SEO:profile.right.run.title'), '', ''); Wekit::setV('seo', $seoBo); }
/** * 根据请求的mime类型获得返回内容类型 * * @param string $mime mime类型 * @return string */ public static function getType($mime) { if (self::$mimes === null) { self::$mimes = @(include Wind::getRealPath('WIND:http.mime.mime.php', true)); } return array_search($mime, self::$mimes); }
public function run() { $page = $this->getInput('page'); $this->page = $page < 1 ? 1 : intval($page); list($start, $limit) = Pw::page2limit($this->page, $this->perpage); $total = $this->_getPollVoterDs()->countByUid(Wekit::getLoginUser()->uid); $poll = $total ? $this->_getPollVoterDs()->getPollByUid(Wekit::getLoginUser()->uid, $limit, $start) : array(); $pollInfo = array(); if ($poll) { $pollid = array(); foreach ($poll as $value) { $pollid[] = $value['poll_id']; } Wind::import('SRV:poll.srv.dataSource.PwFetchPollByPollid'); $pollDisplay = new PwPollDisplay(new PwFetchPollByPollid($pollid, count($pollid))); $pollInfo = $this->_buildPoll($pollDisplay->gather(), 'my'); } $latestPollDisplay = new PwPollDisplay(new PwFetchPollByOrder(10, 0, array('created_time' => '0'))); $latestPoll = $latestPollDisplay->gather(); $this->setOutput($total, 'total'); $this->setOutput($pollInfo, 'pollInfo'); $this->setOutput($latestPoll, 'latestPoll'); $this->setOutput($this->page, 'page'); $this->setOutput($this->perpage, 'perpage'); $this->setOutput(array('allowview' => $this->loginUser->getPermission('allow_view_vote'), 'allowvote' => $this->loginUser->getPermission('allow_participate_vote')), 'pollGroup'); // seo设置 Wind::import('SRV:seo.bo.PwSeoBo'); $seoBo = PwSeoBo::getInstance(); $lang = Wind::getComponent('i18n'); $seoBo->setCustomSeo($lang->getMessage('SEO:vote.my.run.title'), '', ''); Wekit::setV('seo', $seoBo); }
public function domodify() { $verifiedWord = $this->getInput('verifiedWord'); $tagnames = $this->getInput('tagnames'); Wind::import('SRV:forum.srv.post.do.PwPostDoWord'); return new PwPostDoWord($this->bp, $verifiedWord, $tagnames); }
/** * 电子邮件用户激活 */ public function emailAction() { list($page, $perpage) = $this->getInput(array('page', 'perpage')); $page = $page ? $page : 1; $perpage = $perpage ? $perpage : $this->perpage; $count = $this->_getDs()->countUnActived(); $list = array(); if ($count > 0) { $totalPage = ceil($count / $perpage); $page > $totalPage && ($page = $totalPage); $result = $this->_getDs()->getUnActivedList($perpage, intval(($page - 1) * $perpage)); /* @var $userDs PwUser */ $userDs = Wekit::load('user.PwUser'); $list = $userDs->fetchUserByUid(array_keys($result), PwUser::FETCH_MAIN); $list = WindUtility::mergeArray($result, $list); } $this->setOutput($count, 'count'); $this->setOutput($page, 'page'); $this->setOutput($perpage, 'perpage'); $this->setOutput(array('perpage' => $perpage), 'args'); $this->setOutput($list, 'list'); // seo设置 Wind::import('SRV:seo.bo.PwSeoBo'); $seoBo = PwSeoBo::getInstance(); $lang = Wind::getComponent('i18n'); $seoBo->setCustomSeo($lang->getMessage('SEO:manage.user.email.title'), '', ''); Wekit::setV('seo', $seoBo); }
public function run() { $order = Wekit::load('pay.PwOrder')->getOrderByOrderNo($this->_var['out_trade_no']); if (empty($order)) { $this->paymsg('onlinepay.order.exists.not'); } $fee = $order['number'] * $order['price']; if ($fee != $this->_var['total_fee'] || $this->_var['seller_email'] != $this->_conf['alipay']) { $this->paymsg('onlinepay.fail'); } if (!in_array($this->_var['trade_status'], array('TRADE_FINISHED', 'TRADE_SUCCESS', 'WAIT_SELLER_SEND_GOODS'))) { $this->paymsg('onlinepay.success'); } if ($order['state'] == 2) { $this->paymsg('onlinepay.order.paid'); } $className = Wind::import('SRV:pay.srv.action.PwPayAction' . $order['paytype']); if (class_exists($className)) { $class = new $className($order); $class->run(); } Wind::import('SRV:pay.dm.PwOrderDm'); $dm = new PwOrderDm($order['id']); $dm->setPayemail($this->_var['buyer_email'])->setState(2)->setPaymethod(1); Wekit::load('pay.PwOrder')->updateOrder($dm); $this->paymsg('onlinepay.success'); }
/** * 获取语音验证码 */ public function getAudioAction() { Wind::import('LIB:utility.PwVerifyCode'); $srv = new PwVerifyCode(); $srv->getAudioVerify(); exit; }
public function run() { $this->setCurrentLeft('avatar'); $isAvatarBan = false; if (Pw::getstatus($this->loginUser->info['status'], PwUser::STATUS_BAN_AVATAR)) { Wind::import('SRV:user.srv.PwBanBp'); $banBp = new PwBanBp($this->loginUser->uid); if (false === $banBp->checkIfBanAvatar()) { $banBp->recoveryBanAvatarError(); } elseif ($banBp->endDateTimeBanAvatar()) { $this->loginUser->info['status'] = $banBp->callEndDateTimeBanAvatar(); } else { $isAvatarBan = true; $info = $banBp->getBanAvatarInfo(); if ($info['created_userid'] == 0) { $info['operator'] = 'system'; } else { $operatorInfo = Wekit::load('user.PwUser')->getUserByUid($info['created_userid']); $info['operator'] = $operatorInfo['username']; } $this->setOutput($info, 'banInfo'); } } $windidApi = $this->_getWindid(); $this->setOutput($windidApi->showFlash($this->loginUser->uid), 'avatarFlash'); $this->setOutput($windidApi->showFlash($this->loginUser->uid, 0), 'avatarArr'); $this->setOutput($isAvatarBan, 'isAvatarBan'); $this->setOutput($this->getInput('type'), 'type'); $this->setLayout(''); $this->setTemplate('profile_avatar'); // seo设置 Wind::import('SRV:seo.bo.PwSeoBo'); $lang = Wind::getComponent('i18n'); PwSeoBo::setCustomSeo($lang->getMessage('SEO:profile.avatar.run.title'), '', ''); }
public function dorunAction() { Wind::import('WINDID:service.config.srv.WindidConfigSet'); $config = new WindidConfigSet('site'); $config->set('timezone', intval($this->getInput('timeTimezone', 'post')))->set('timecv', intval($this->getInput('timecv', 'post')))->flush(); $this->showMessage('ADMIN:success'); }
protected function install($pack) { $manifest = $pack . '/Manifest.xml'; if (!is_file($manifest)) { return false; } /* @var $install PwInstallApplication */ Wind::import('APPS:appcenter.service.srv.PwInstallApplication'); $install = new PwInstallApplication(); /* @var $_install PwStyleInstall */ $_install = Wekit::load('APPS:appcenter.service.srv.do.PwStyleInstall'); $conf = $install->getConfig('install-type', 'style'); $r = $install->initInstall($manifest); if ($r instanceof PwError) { return false; } $r = $_install->install($install); if ($r instanceof PwError) { return false; } $r = $_install->registeApplication($install); if ($r instanceof PwError) { return false; } $install->addInstallLog('packs', $pack); $install->addInstallLog('service', $conf); $fields = array(); foreach ($install->getInstallLog() as $key => $value) { $_tmp = array('app_id' => $install->getAppId(), 'log_type' => $key, 'data' => $value, 'created_time' => time(), 'modified_time' => time()); $fields[] = $_tmp; } Wekit::load('APPS:appcenter.service.PwApplicationLog')->batchAdd($fields); return $install->getAppId(); }
public function run($ids) { Wind::import('SRV:forum.dm.PwTopicDm'); Wind::import('SRV:forum.dm.PwReplyDm'); $threadDs = Wekit::load('forum.PwThread'); $forumSrv = Wekit::load('forum.srv.PwForumService'); foreach ($this->tids as $tid => $value) { $dm1 = new PwReplyDm(true); $dm1->setTid($tid); $value['disabled'] != 2 && $dm1->setDisabled(0); $threadDs->batchUpdatePost($value['ids'], $dm1); $post = current(Wekit::load('forum.PwThread')->getPostByTid($tid, 1, 0, false)); $dm = new PwTopicDm($tid); $dm->addReplies($value['replies']); $post && $dm->setLastpost($post['created_userid'], $post['created_username'], $post['created_time']); $threadDs->updateThread($dm, PwThread::FETCH_MAIN); } foreach ($this->fids as $fid => $value) { $forumSrv->updateStatistics($fid, 0, $value); } foreach ($this->rpids as $rpid => $value) { $dm = new PwReplyDm($rpid); $dm->addReplies($value); $threadDs->updatePost($dm); } Wekit::load('recycle.PwReplyRecycle')->batchDelete($ids); }
public function run() { /* @var $userGroup PwUserGroups */ $userGroup = Wekit::load('usergroup.PwUserGroups'); $groups = $userGroup->getAllGroups(); $groupTypes = $userGroup->getTypeNames(); Wind::import('SRV:credit.bo.PwCreditBo'); /* @var $pwCreditBo PwCreditBo */ $pwCreditBo = PwCreditBo::getInstance(); $config = Wekit::C()->getValues('register'); if (!$config['active.field']) { $config['active.field'] = array(); } $wconfig = WindidApi::C('reg'); $config['security.username.min'] = $wconfig['security.username.min']; $config['security.username.max'] = $wconfig['security.username.max']; $config['security.password.min'] = $wconfig['security.password.min']; $config['security.password.max'] = $wconfig['security.password.max']; $config['security.password'] = $wconfig['security.password']; $config['security.ban.username'] = $wconfig['security.ban.username']; $this->setOutput($config, 'config'); $this->setOutput($pwCreditBo->cType, 'credits'); $this->setOutput($groups, 'groups'); $this->setOutput($groupTypes, 'groupTypes'); }
public function getDB() { if (!$this->_baseInstance) { $this->_baseInstance = Wind::getComponent('db'); } return $this->_baseInstance; }
/** * 淘宝推广图片 * * @access public * @return void */ public function dotaoAction() { if (!($user = $this->_getUser())) { $this->showError('login.not'); } $fid = $this->getInput('fid', 'post'); // $this->_accpetUploadForH5(); // Wind::import('SRV:upload.action.PwTaoUpload'); Wind::import('LIB:upload.PwUpload'); $bhv = new PwTaoUpload(); $bhv->filename = date('YmdHis'); // $upload = new PwUpload($bhv); if (($result = $upload->check()) === true) { $result = $upload->execute(); } if ($result !== true) { $this->showError($result->getError()); } if (!($data = $bhv->getAttachInfo())) { $this->showError('upload.fail'); } $data['path'] = Pw::getPath($data['path'] . $data['filename']); // $this->setOutput($data, 'data'); $this->showMessage('upload.success'); }
public function buildTitle($param = 0, $extendParams = null, $aggregatedNotice = null) { $params = array(); $msg = ''; switch ($extendParams['change_type']) { //转账 case 'transfer': $params['{username}'] = '<a href="' . WindUrlHelper::createUrl('space/index/run', array('uid' => $extendParams['fromUid'])) . '">' . $extendParams['fromUserName'] . '</a>'; $params['{num}'] = $extendParams['num']; $params['{unit}'] = $extendParams['unit']; $params['{credit}'] = $extendParams['credit']; $msg = 'CREDIT:transfer.to.notice.format'; break; //转换: //转换: case 'exchange': $params['{credit1}'] = $extendParams['credit1']; $params['{num1}'] = $extendParams['num1']; $params['{unit1}'] = $extendParams['unit1']; $params['{credit2}'] = $extendParams['credit2']; $params['{num2}'] = $extendParams['num2']; $params['{unit2}'] = $extendParams['unit2']; $msg = 'CREDIT:exchange.notice.format'; break; case 'pay': $params['{credit}'] = $extendParams['credit']; $params['{num}'] = $extendParams['num']; $params['{unit}'] = $extendParams['unit']; $params['{price}'] = $extendParams['price']; $msg = 'CREDIT:pay.notice.format'; break; } return Wind::getComponent('i18n')->getMessage($msg, $params); }
/** * 回复列表 */ public function replyAction() { list($page, $perpage) = $this->getInput(array('page', 'perpage')); $page = $page ? $page : 1; $perpage = $perpage ? $perpage : $this->perpage; list($start, $limit) = Pw::page2limit($page, $perpage); $count = $this->_getThreadExpandDs()->countDisabledPostByUid($this->loginUser->uid); if ($count) { $tmpPosts = $this->_getThreadExpandDs()->getDisabledPostByUid($this->loginUser->uid, $limit, $start); $posts = $tids = array(); foreach ($tmpPosts as $v) { $tids[] = $v['tid']; } $threads = $this->_getThreadDs()->fetchThread($tids); foreach ($tmpPosts as $v) { $v['threadSubject'] = Pw::substrs($threads[$v['tid']]['subject'], 30); $v['content'] = Pw::substrs($v['content'], 30); $v['created_time'] = PW::time2str($v['created_time'], 'auto'); $posts[] = $v; } } $this->setOutput($count, 'count'); $this->setOutput($page, 'page'); $this->setOutput($perpage, 'perpage'); $this->setOutput($posts, 'posts'); // seo设置 Wind::import('SRV:seo.bo.PwSeoBo'); $seoBo = PwSeoBo::getInstance(); $lang = Wind::getComponent('i18n'); $seoBo->setCustomSeo($lang->getMessage('SEO:bbs.article.reply.title'), '', ''); Wekit::setV('seo', $seoBo); }
public function run() { $order = Wekit::load('pay.PwOrder')->getOrderByOrderNo($this->_var['invoice']); if (empty($order)) { $this->paymsg('onlinepay.order.exists.not'); } $fee = $order['number'] * $order['price']; if ($fee != $this->_var['mc_gross']) { $this->paymsg('onlinepay.fail'); } if ($this->_var['payment_status'] != 'Completed') { $this->paymsg('onlinepay.success'); } if ($order['state'] == 2) { $this->paymsg('onlinepay.order.paid'); } $className = Wind::import('SRV:pay.srv.action.PwPayAction' . $order['paytype']); if (class_exists($className)) { $class = new $className($order); $class->run(); } Wind::import('SRV:pay.dm.PwOrderDm'); $dm = new PwOrderDm($order['id']); $dm->setState(2)->setPaymethod(3); Wekit::load('pay.PwOrder')->updateOrder($dm); $this->paymsg('onlinepay.success'); }