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


PHP DbConfig::getMetaMain方法代码示例

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


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

示例1: __construct

 public function __construct()
 {
     parent::__construct();
     /***** Securing the server for DDoS attack only! Not for the attacks DoS *****/
     if (!isDebug() && M\DbConfig::getSetting('DDoS')) {
         $oDDoS = new Stop();
         if ($oDDoS->cookie() || $oDDoS->session()) {
             sleep(PH7_DDOS_DELAY_SLEEP);
         }
         unset($oDDoS);
     }
     /*
     if ($this->browser->isMobile())
     {
         \PH7\Framework\Url\HeaderUrl::redirect('mobile');
     }
     */
     /***** Assign the values for Registry Class *****/
     // URL
     $this->registry->site_url = PH7_URL_ROOT;
     $this->registry->url_relative = PH7_RELATIVE;
     $this->registry->page_ext = PH7_PAGE_EXT;
     // Site Name
     $this->registry->site_name = M\DbConfig::getSetting('siteName');
     /***** Internationalization *****/
     // Default path language
     $this->lang->load('global', PH7_PATH_APP_LANG);
     /***** PH7Tpl Template Engine initialization *****/
     /*** Assign the global variables ***/
     /*** Objects ***/
     $this->view->config = $this->config;
     $this->view->design = $this->design;
     /***** Info *****/
     $oInfo = M\DbConfig::getMetaMain(PH7_LANG_NAME);
     $aMetaVars = ['site_name' => $this->registry->site_name, 'page_title' => $oInfo->pageTitle, 'slogan' => $oInfo->slogan, 'meta_description' => $oInfo->metaDescription, 'meta_keywords' => $oInfo->metaKeywords, 'meta_author' => $oInfo->metaAuthor, 'meta_robots' => $oInfo->metaRobots, 'meta_copyright' => $oInfo->metaCopyright, 'meta_rating' => $oInfo->metaRating, 'meta_distribution' => $oInfo->metaDistribution, 'meta_category' => $oInfo->metaCategory, 'header' => 0];
     $this->view->assigns($aMetaVars);
     unset($oInfo);
     /**
      * This test is not necessary because if there is no session,
      * the get() method of the \PH7\Framework\Session\Session object an empty value and revisit this avoids having undefined variables in some modules (such as the "connect" module).
      */
     //if (\PH7\UserCore::auth()) {
     $this->view->count_unread_mail = \PH7\MailCoreModel::countUnreadMsg($this->session->get('member_id'));
     $this->view->count_pen_friend_request = \PH7\FriendCoreModel::getPenFd($this->session->get('member_id'));
     //}
     /***** Display *****/
     $this->view->setTemplateDir($this->registry->path_module_views . PH7_TPL_MOD_NAME);
     /***** End Template Engine PH7Tpl *****/
     // For permission the modules
     if (is_file($this->registry->path_module_config . 'Permission.php')) {
         require $this->registry->path_module_config . 'Permission.php';
         new \PH7\Permission();
     }
 }
开发者ID:joswilson,项目名称:NotJustOK,代码行数:54,代码来源:Controller.class.php

示例2: index

 /**
  * Displaying the main homepage of the website.
  */
 public function index()
 {
     // We must not put the title as this is the homepage, so this is the default title is used.
     // For Profiles Carousel
     $this->view->userDesignModel = new UserDesignCoreModel();
     $this->view->userDesign = new UserDesignCore();
     // Only visitors
     if (!UserCore::auth()) {
         // Set CSS and JS files
         $this->design->addCss(PH7_LAYOUT . PH7_TPL . PH7_TPL_NAME . PH7_SH . PH7_CSS, 'splash.css,tooltip.css,js/jquery/carousel.css');
         $this->design->addJs(PH7_DOT, PH7_STATIC . PH7_JS . 'jquery/carouFredSel.js,' . PH7_LAYOUT . PH7_TPL . PH7_TPL_NAME . PH7_SH . PH7_JS . 'splash.js');
         // Assigns the promo text to the view
         $this->view->promo_text = DbConfig::getMetaMain(PH7_LANG_NAME)->promoText;
         // Assign the background video option
         $this->view->is_bg_video = DbConfig::getSetting('bgSplashVideo');
         // To check if the site is called by a mobile native app
         $bMobApp = $this->view->is_mobapp = MobApp::is();
         /**
          * When you are in the development mode, you can force the guest page by set a "force" GET request with the "splash" or "classic" parameter.
          * Example: "/?force=splash" or "/?force=classic"
          */
         if (isDebug() && $this->httpRequest->getExists('force')) {
             switch ($this->httpRequest->get('force')) {
                 case 'classic':
                     $sPage = 'index.guest';
                     break;
                 case 'splash':
                     $sPage = 'index.guest_splash';
                     break;
                 default:
                     exit('You can only choose between "classic" or "splash"');
             }
         } elseif ($bMobApp) {
             $sPage = 'index.guest_splash';
         } else {
             $bIsSplashPage = (bool) DbConfig::getSetting('splashPage');
             $sPage = $bIsSplashPage ? 'index.guest_splash' : 'index.guest';
         }
         $this->manualTplInclude($sPage . '.inc.tpl');
     } elseif (UserCore::auth()) {
         // Set CSS and JS files
         $this->design->addCss(PH7_LAYOUT . PH7_TPL . PH7_TPL_NAME . PH7_SH . PH7_CSS, 'zoomer.css');
         $this->design->addJs(PH7_STATIC . PH7_JS, 'zoomer.js,Wall.js');
         // Assigns the user's first name to the view for the Welcome Message
         $this->view->first_name = $this->session->get('member_first_name');
         $this->manualTplInclude('index.user.inc.tpl');
     }
     $this->output();
 }
开发者ID:huangciyin,项目名称:pH7-Social-Dating-CMS,代码行数:52,代码来源:MainController.php

示例3: __construct

 public function __construct()
 {
     parent::__construct();
     $sWhereLang = $this->httpRequest->get('meta_lang');
     $oMeta = DbConfig::getMetaMain($sWhereLang);
     if (!$this->str->equals($this->httpRequest->post('lang_id'), $oMeta->langId)) {
         DbConfig::setMetaMain('langId', $this->httpRequest->post('lang_id'), $sWhereLang);
     }
     if (!$this->str->equals($this->httpRequest->post('page_title'), $oMeta->pageTitle)) {
         DbConfig::setMetaMain('pageTitle', $this->httpRequest->post('page_title'), $sWhereLang);
     }
     if (!$this->str->equals($this->httpRequest->post('slogan'), $oMeta->slogan)) {
         DbConfig::setMetaMain('slogan', $this->httpRequest->post('slogan'), $sWhereLang);
     }
     if (!$this->str->equals($this->httpRequest->post('promo_text'), $oMeta->promoText)) {
         DbConfig::setMetaMain('promoText', $this->httpRequest->post('promo_text', Http::ONLY_XSS_CLEAN), $sWhereLang);
     }
     if (!$this->str->equals($this->httpRequest->post('meta_description'), $oMeta->metaDescription)) {
         DbConfig::setMetaMain('metaDescription', $this->httpRequest->post('meta_description'), $sWhereLang);
     }
     if (!$this->str->equals($this->httpRequest->post('meta_keywords'), $oMeta->metaKeywords)) {
         DbConfig::setMetaMain('metaKeywords', $this->httpRequest->post('meta_keywords'), $sWhereLang);
     }
     if (!$this->str->equals($this->httpRequest->post('meta_robots'), $oMeta->metaRobots)) {
         DbConfig::setMetaMain('metaRobots', $this->httpRequest->post('meta_robots'), $sWhereLang);
     }
     if (!$this->str->equals($this->httpRequest->post('meta_author'), $oMeta->metaAuthor)) {
         DbConfig::setMetaMain('metaAuthor', $this->httpRequest->post('meta_author'), $sWhereLang);
     }
     if (!$this->str->equals($this->httpRequest->post('meta_copyright'), $oMeta->metaCopyright)) {
         DbConfig::setMetaMain('metaCopyright', $this->httpRequest->post('meta_copyright'), $sWhereLang);
     }
     if (!$this->str->equals($this->httpRequest->post('meta_rating'), $oMeta->metaRating)) {
         DbConfig::setMetaMain('metaRating', $this->httpRequest->post('meta_rating'), $sWhereLang);
     }
     if (!$this->str->equals($this->httpRequest->post('meta_distribution'), $oMeta->metaDistribution)) {
         DbConfig::setMetaMain('metaDistribution', $this->httpRequest->post('meta_distribution'), $sWhereLang);
     }
     if (!$this->str->equals($this->httpRequest->post('meta_category'), $oMeta->metaCategory)) {
         DbConfig::setMetaMain('metaCategory', $this->httpRequest->post('meta_category'), $sWhereLang);
     }
     /* Clean DbConfig Cache */
     (new Framework\Cache\Cache())->start(DbConfig::CACHE_GROUP, null, null)->clear();
     \PFBC\Form::setSuccess('form_meta', t('The Meta Tags was saved successfully!'));
 }
开发者ID:nsrau,项目名称:pH7-Social-Dating-CMS,代码行数:45,代码来源:MetaMainFormProcess.php

示例4: __construct

 public function __construct()
 {
     parent::__construct();
     $this->_ddosProtection();
     /***** Assign the values for Registry Class *****/
     // URL
     $this->registry->site_url = PH7_URL_ROOT;
     $this->registry->url_relative = PH7_RELATIVE;
     $this->registry->page_ext = PH7_PAGE_EXT;
     // Site Name
     $this->registry->site_name = M\DbConfig::getSetting('siteName');
     /***** Internationalization *****/
     // Default path language
     $this->lang->load('global', PH7_PATH_APP_LANG);
     /***** PH7Tpl Template Engine initialization *****/
     /*** Assign the global variables ***/
     /*** Objects ***/
     $this->view->config = $this->config;
     $this->view->design = $this->design;
     /***** Info *****/
     $oInfo = M\DbConfig::getMetaMain(PH7_LANG_NAME);
     $aMetaVars = ['site_name' => $this->registry->site_name, 'page_title' => $oInfo->pageTitle, 'slogan' => $oInfo->slogan, 'meta_description' => $oInfo->metaDescription, 'meta_keywords' => $oInfo->metaKeywords, 'meta_author' => $oInfo->metaAuthor, 'meta_robots' => $oInfo->metaRobots, 'meta_copyright' => $oInfo->metaCopyright, 'meta_rating' => $oInfo->metaRating, 'meta_distribution' => $oInfo->metaDistribution, 'meta_category' => $oInfo->metaCategory, 'header' => 0, 'is_disclaimer' => (bool) M\DbConfig::getSetting('disclaimer'), 'is_cookie_consent_bar' => (bool) M\DbConfig::getSetting('cookieConsentBar'), 'country' => Geo::getCountry(), 'city' => Geo::getCity()];
     $this->view->assigns($aMetaVars);
     $aModsEnabled = ['is_connect_enabled' => SysMod::isEnabled('connect'), 'is_affiliate_enabled' => SysMod::isEnabled('affiliate'), 'is_game_enabled' => SysMod::isEnabled('game'), 'is_chat_enabled' => SysMod::isEnabled('chat'), 'is_chatroulette_enabled' => SysMod::isEnabled('chatroulette'), 'is_picture_enabled' => SysMod::isEnabled('picture'), 'is_video_enabled' => SysMod::isEnabled('video'), 'is_hotornot_enabled' => SysMod::isEnabled('hotornot'), 'is_forum_enabled' => SysMod::isEnabled('forum'), 'is_note_enabled' => SysMod::isEnabled('note'), 'is_blog_enabled' => SysMod::isEnabled('blog'), 'is_newsletter_enabled' => SysMod::isEnabled('newsletter'), 'is_invite_enabled' => SysMod::isEnabled('invite'), 'is_webcam_enabled' => SysMod::isEnabled('webcam')];
     $this->view->assigns($aModsEnabled);
     unset($oInfo, $aMetaVars, $aModsEnabled);
     /**
      * This below PHP condition is not necessary because if there is no session,
      * the get() method of the \PH7\Framework\Session\Session object an empty value and revisit this avoids having undefined variables in some modules (such as the "connect" module).
      */
     //if (\PH7\UserCore::auth()) {
     $this->view->count_unread_mail = \PH7\MailCoreModel::countUnreadMsg($this->session->get('member_id'));
     $this->view->count_pen_friend_request = \PH7\FriendCoreModel::getPending($this->session->get('member_id'));
     //}
     /***** Display *****/
     $this->view->setTemplateDir($this->registry->path_module_views . PH7_TPL_MOD_NAME);
     /***** End Template Engine PH7Tpl *****/
     $this->_checkPerms();
     $this->_checkModStatus();
     $this->_checkBanStatus();
     $this->_checkSiteStatus();
 }
开发者ID:huangciyin,项目名称:pH7-Social-Dating-CMS,代码行数:42,代码来源:Controller.class.php

示例5: display

 public static function display()
 {
     if (isset($_POST['submit_meta'])) {
         if (\PFBC\Form::isValid($_POST['submit_meta'])) {
             new MetaMainFormProcess();
         }
         Framework\Url\Header::redirect();
     }
     $sWhereLang = (new Http())->get('meta_lang');
     $oMeta = DbConfig::getMetaMain($sWhereLang);
     $oForm = new \PFBC\Form('form_meta');
     $oForm->configure(array('action' => ''));
     $oForm->addElement(new \PFBC\Element\Hidden('submit_meta', 'form_meta'));
     $oForm->addElement(new \PFBC\Element\Token('admin_meta'));
     // Generate the list of languages
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<div class="center divShow">'));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<h3 class="underline"><a href="#showDiv_listLang" title="' . t('Click here to show/hide the languages') . '">' . t('Change language for the Meta Tags') . '</a></h3>'));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<ul class="hidden" id="showDiv_listLang">'));
     $aLangs = (new File())->getDirList(PH7_PATH_APP_LANG);
     for ($i = 0, $iLength = count($aLangs); $i < $iLength; $i++) {
         $sAbbrLang = substr($aLangs[$i], 0, 2);
         $oForm->addElement(new \PFBC\Element\HTMLExternal('<li>' . ($i + 1) . ') ' . '<a class="bold" href="' . Uri::get(PH7_ADMIN_MOD, 'setting', 'metamain', $aLangs[$i], false) . '" title="' . t($sAbbrLang) . '">' . t($sAbbrLang) . ' (' . $aLangs[$i] . ')</a></li>'));
     }
     unset($aLangs);
     $oForm->addElement(new \PFBC\Element\HTMLExternal('</ul></div>'));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Language:'), 'lang_id', array('value' => $oMeta->langId, 'description' => t('EX: "en", "fr", "es", "jp"'), 'validation' => new \PFBC\Validation\Str(5, 5), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Home page title:'), 'page_title', array('value' => $oMeta->pageTitle, 'validation' => new \PFBC\Validation\Str(2, 100), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Slogan:'), 'slogan', array('value' => $oMeta->slogan, 'validation' => new \PFBC\Validation\Str(2, 200), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\CKEditor(t('SEO text:'), 'promo_text', array('description' => t('Promotional text to display on the homepage for visitors.'), 'value' => $oMeta->promoText, 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Description (meta tag):'), 'meta_description', array('value' => $oMeta->metaDescription, 'validation' => new \PFBC\Validation\Str(2, 255), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Keywords (meta tag):'), 'meta_keywords', array('description' => t('Separate keywords by commas.'), 'value' => $oMeta->metaKeywords, 'validation' => new \PFBC\Validation\Str(2, 255), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Robots (meta tag):'), 'meta_robots', array('value' => $oMeta->metaRobots, 'validation' => new \PFBC\Validation\Str(2, 50), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Author (meta tag):'), 'meta_author', array('value' => $oMeta->metaAuthor, 'validation' => new \PFBC\Validation\Str(2, 50), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Copyright (meta tag):'), 'meta_copyright', array('value' => $oMeta->metaCopyright, 'validation' => new \PFBC\Validation\Str(2, 50), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Rating (meta tag):'), 'meta_rating', array('value' => $oMeta->metaRating, 'validation' => new \PFBC\Validation\Str(2, 50), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Distribution (meta tag):'), 'meta_distribution', array('value' => $oMeta->metaDistribution, 'validation' => new \PFBC\Validation\Str(2, 50), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Category (meta tag):'), 'meta_category', array('value' => $oMeta->metaCategory, 'validation' => new \PFBC\Validation\Str(2, 50), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Button());
     $oForm->render();
 }
开发者ID:huangciyin,项目名称:pH7-Social-Dating-CMS,代码行数:40,代码来源:MetaMainForm.php


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