当前位置: 首页>>代码示例>>PHP>>正文


PHP messages::registerNotice方法代码示例

本文整理汇总了PHP中messages::registerNotice方法的典型用法代码示例。如果您正苦于以下问题:PHP messages::registerNotice方法的具体用法?PHP messages::registerNotice怎么用?PHP messages::registerNotice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在messages的用法示例。


在下文中一共展示了messages::registerNotice方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: process

 public function process()
 {
     $affiliate = new \model\affiliate($this->getDbconnection());
     if (!is_null($this->getRequestVar('submsave')) && !is_null($this->getRequestVar('antiSpamAnswer'))) {
         if ($this->getRequestVar('antiSpamAnswer') === $this->getSysconfig()->getAntispamAnswer()) {
             $data = $this->getRequestVar('affiliate');
             foreach ($data as $key => $value) {
                 $data[$key] = $this->filterRequest($value, array(1, 4, 7));
             }
             $affiliate->setPageName($data['pageName']);
             $affiliate->setPageUrl($data['pageUrl']);
             $affiliate->setPageAdminName($data['pageAdminName']);
             $affiliate->setPageAdminEmail($data['pageAdminEmail']);
             $affiliate->setPageButton($data['pageButton']);
             $affiliate->setAffiliateCategory($data['affiliateCategory']);
             $affiliate->setAffiliateAddedTime(time());
             $affiliate->setAffiliateEditedTime(0);
             $affiliate->setAffiliateIsMarked(0);
             $affiliate->setAffiliateIsAccpted(0);
             if ($affiliate->save()) {
                 \messages::registerNotice(\language::returnLanguageConstant('APPLY_OK'));
                 $catgory = new \model\category($this->dbconnection, $affiliate->getAffiliateCategory());
                 $mailData = array('mailTo' => $this->getSysconfig()->getAdminMail(), 'mailSubject' => \language::replaceLanguageConstant(\language::returnLanguageConstant('APPLY_MAIL_SUBJECT'), array('{{affiliateKategory}}' => $catgory->getName())), 'mailText' => \language::replaceLanguageConstant(\language::returnLanguageConstant('APPLY_MAIL_TEXT'), array('{{name}}' => $affiliate->getPageAdminName(), '{{page}}' => $affiliate->getPageUrl(), '{{affiliateKategory}}' => $catgory->getName(), '{{acpLink}}' => \base_config::$rootPath)), 'mailFrom' => $affiliate->getPageAdminEmail());
                 \messages::sendEMail($mailData);
             } else {
                 \messages::registerError(\language::returnLanguageConstant('APPLY_FAILED'));
             }
             $affiliate = new \model\affiliate($this->getDbconnection());
         } else {
             \messages::registerError(\language::returnLanguageConstant('APPLY_FAILED_SPAM'));
         }
     }
     $categoryList = new \model\category_list($this->getDbconnection(), false);
     $categories = array();
     foreach ($categoryList->getCategories() as $category) {
         $categories[$category->getName()] = $category->getId();
     }
     $view = new \model\view_public('apply_form');
     $view->assign('affiliate', $affiliate);
     $view->assign('categories', $categories);
     $view->assign('antiSpamQuestion', $this->getSysconfig()->getAntispamQuestion());
     $view->assign('isNotUtf8', $this->isNotUtf8);
     $view->assign('systemVersion', $this->getSysconfig()->getSysVersion());
     $view->setReturnRender($this->returnRender);
     if ($this->returnRender) {
         $data = $view->render();
         return $data;
     }
     $view->render();
 }
开发者ID:sea75300,项目名称:affiliat_r,代码行数:50,代码来源:apply.php

示例2: checkForUpdates

 /**
  * Prüft ob Update verfügbar sind
  * @return string|null
  */
 public function checkForUpdates()
 {
     $data = array('version' => $this->getSysVersion(), 'language' => $this->getSysLanguage(), 'phpvers' => PHP_VERSION, 'isauto' => (int) \base_config::canConnect());
     $url = \base_config::$updateServer . 'noauto.php?data=' . base64_encode(json_encode($data));
     if (!\base_config::canConnect()) {
         return $url;
     }
     if (file_exists(\base_config::$updateCache)) {
         $updateCache = json_decode(file_get_contents(\base_config::$updateCache), true);
         if ($updateCache['expire'] >= time()) {
             if (!empty($updateCache['message'])) {
                 \messages::registerNotice($updateCache['message'], true);
             }
             return;
         }
     }
     try {
         $url = \base_config::$updateServer . 'newver.php?data=' . base64_encode(json_encode($data));
         $updateData = fopen($url, 'r');
         $updateData = fgets($updateData);
         $updateData = json_decode(base64_decode($updateData), true);
         $updateMessage = '';
         if (version_compare($updateData['newversion'], $this->getSysVersion(), '>')) {
             if (isset($updateData['forceupdate']) && $updateData['forceupdate']) {
                 header("Location: ?module=system/update&file=" . $updateData['updatefile']);
             }
             $updateMessage = \language::replaceLanguageConstant(\language::returnLanguageConstant('UPDATE_NEWVERSION'), array('{{versionlink}}' => '?module=system/update&file=' . $updateData['updatefile']));
             \messages::registerNotice($updateMessage, true);
         }
         $cacheTmp = array('expire' => time() + 43200, 'message' => $updateMessage);
         file_put_contents(\base_config::$updateCache, json_encode($cacheTmp));
     } catch (\Exception $ex) {
         \messages::registerError($ex->getMessage(), true);
     }
     return null;
 }
开发者ID:sea75300,项目名称:affiliat_r,代码行数:40,代码来源:system_config.php

示例3: checkRequirements

 private function checkRequirements()
 {
     if (!class_exists('PDO')) {
         \messages::registerError('PHP PDO extension not found! Unable to proceed. Contact your host!', true);
         die;
     }
     foreach ($this->checkFolders as $checkFolder) {
         if (!is_writable(\base_config::$baseDir . '/' . $checkFolder)) {
             \messages::registerError("Unable to write in folder <b>/{$checkFolder}</b>!", true);
         }
     }
     if (!\base_config::canConnect()) {
         \messages::registerNotice('PHP setting <b>allow_url_fopen</b> is diabled. This is not required, but recommended.', true);
     }
 }
开发者ID:sea75300,项目名称:affiliat_r,代码行数:15,代码来源:installer.php


注:本文中的messages::registerNotice方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。