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


PHP Context::getSiteTitle方法代码示例

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


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

示例1: getConfig

 /**
  * 모듈 설정을 불러오는 메소드.
  */
 public function getConfig()
 {
     $config = getModel('module')->getModuleConfig('member_expire');
     if (!is_object($config)) {
         $config = new stdClass();
     }
     if (!$config->expire_threshold) {
         $config->expire_threshold = 365;
     }
     if (!$config->expire_method) {
         $config->expire_method = 'delete';
     }
     if (!$config->auto_expire) {
         $config->auto_expire = 'N';
     }
     if (!$config->auto_restore) {
         $config->auto_restore = 'N';
     }
     if (!$config->auto_start) {
         $config->auto_start = '2015-08-18';
     }
     if (!$config->email_threshold) {
         $config->email_threshold = 0;
     }
     if (!$config->email_subject) {
         $config->email_subject = strval(Context::getSiteTitle());
         if ($config->email_subject !== '') {
             $config->email_subject = '[' . $config->email_subject . ']';
         }
         $config->email_subject .= ' 휴면계정 전환 안내';
     }
     if (!$config->email_content) {
         $config->email_content = file_get_contents($this->module_path . 'tpl/email_default.html');
     }
     return $config;
 }
开发者ID:ned3y2k,项目名称:xe-member-expire,代码行数:39,代码来源:member_expire.class.php

示例2: geturl

</a></p>
	<header class="header">
		<h1>
			<a href="<?php 
echo geturl('');
?>
" id="siteTitle">
				<?php 
if (!Context::getSiteTitle() && !$__Context->layout_info->LOGO_IMG && !$__Context->layout_info->LOGO_TEXT) {
    ?>
<img src="/layouts/default/siteTitle.png" alt="XpressEngine"><?php 
}
?>
				<?php 
if (Context::getSiteTitle() && !$__Context->layout_info->LOGO_IMG && !$__Context->layout_info->LOGO_TEXT) {
    echo Context::getSiteTitle();
}
?>
				<?php 
if ($__Context->layout_info->LOGO_IMG) {
    ?>
<img src="<?php 
    echo $__Context->layout_info->LOGO_IMG;
    ?>
" alt="<?php 
    echo $__Context->layout_info->LOGO_TEXT;
    ?>
"><?php 
}
?>
				<?php 
开发者ID:umjinsun12,项目名称:dngshin,代码行数:31,代码来源:ce8675f88c1be9e20a85e1d710646dbb.compiled.php

示例3: _addOpenGraphMetadata

 /**
  * Add OpenGraph metadata tags.
  * 
  * @param string $output
  * @return void
  */
 function _addOpenGraphMetadata()
 {
     // Get information about the current request.
     $page_type = 'website';
     $current_module_info = Context::get('current_module_info');
     $site_module_info = Context::get('site_module_info');
     $document_srl = Context::get('document_srl');
     if ($document_srl) {
         $oDocument = Context::get('oDocument') ?: getModel('document')->getDocument($document_srl, false, false);
         if ($oDocument instanceof documentItem && $oDocument->document_srl == $document_srl && !$oDocument->isSecret()) {
             $page_type = 'article';
         }
     }
     // Add basic metadata.
     Context::addOpenGraphData('og:title', Context::getBrowserTitle());
     Context::addOpenGraphData('og:site_name', Context::getSiteTitle());
     if ($page_type === 'article' && config('seo.og_extract_description')) {
         $description = trim(utf8_normalize_spaces($oDocument->getContentText(200)));
     } else {
         $description = Context::getMetaTag('description');
     }
     Context::addOpenGraphData('og:description', $description);
     Context::addMetaTag('description', $description);
     // Add metadata about this page.
     Context::addOpenGraphData('og:type', $page_type);
     if ($page_type === 'article') {
         $canonical_url = getFullUrl('', 'mid', $current_module_info->mid, 'document_srl', $document_srl);
     } elseif (($page = Context::get('page')) > 1) {
         $canonical_url = getFullUrl('', 'mid', $current_module_info->mid, 'page', $page);
     } elseif ($current_module_info->module_srl == $site_module_info->module_srl) {
         $canonical_url = getFullUrl('');
     } else {
         $canonical_url = getFullUrl('', 'mid', $current_module_info->mid);
     }
     Context::addOpenGraphData('og:url', $canonical_url);
     Context::setCanonicalURL($canonical_url);
     // Add metadata about the locale.
     $lang_type = Context::getLangType();
     $locales = (include \RX_BASEDIR . 'common/defaults/locales.php');
     if (isset($locales[$lang_type])) {
         Context::addOpenGraphData('og:locale', $locales[$lang_type]['locale']);
     }
     if ($page_type === 'article' && $oDocument->getLangCode() !== $lang_type && isset($locales[$oDocument->getLangCode()])) {
         Context::addOpenGraphData('og:locale:alternate', $locales[$oDocument->getLangCode()]);
     }
     // Add image.
     if ($page_type === 'article' && config('seo.og_extract_images')) {
         if (($document_images = Rhymix\Framework\Cache::get("seo:document_images:{$document_srl}")) === null) {
             $document_images = array();
             if ($oDocument->hasUploadedFiles()) {
                 foreach ($oDocument->getUploadedFiles() as $file) {
                     if ($file->isvalid !== 'Y' || !preg_match('/\\.(?:bmp|gif|jpe?g|png)$/i', $file->uploaded_filename)) {
                         continue;
                     }
                     list($width, $height) = @getimagesize($file->uploaded_filename);
                     if ($width < 100 && $height < 100) {
                         continue;
                     }
                     $image = array('filepath' => $file->uploaded_filename, 'width' => $width, 'height' => $height);
                     if ($file->cover_image === 'Y') {
                         array_unshift($document_images, $image);
                     } else {
                         $document_images[] = $image;
                     }
                     if (count($document_images) >= 1) {
                         break;
                     }
                 }
             }
             Rhymix\Framework\Cache::set("seo:document_images:{$document_srl}", $document_images, 0, true);
         }
     } else {
         $document_images = null;
     }
     if ($document_images) {
         $first_image = reset($document_images);
         $first_image['filepath'] = preg_replace('/^.\\/files\\//', \RX_BASEURL . 'files/', $first_image['filepath']);
         Context::addOpenGraphData('og:image', Rhymix\Framework\URL::getCurrentDomainURL($first_image['filepath']));
         Context::addOpenGraphData('og:image:width', $first_image['width']);
         Context::addOpenGraphData('og:image:height', $first_image['height']);
     } elseif ($default_image = getAdminModel('admin')->getSiteDefaultImageUrl($width, $height)) {
         Context::addOpenGraphData('og:image', Rhymix\Framework\URL::getCurrentDomainURL($default_image));
         if ($width && $height) {
             Context::addOpenGraphData('og:image:width', $width);
             Context::addOpenGraphData('og:image:height', $height);
         }
     }
     // Add datetime for articles.
     if ($page_type === 'article' && config('seo.og_use_timestamps')) {
         Context::addOpenGraphData('article:published_time', $oDocument->getRegdate('c'));
         Context::addOpenGraphData('article:modified_time', $oDocument->getUpdate('c'));
     }
 }
开发者ID:rhymix,项目名称:rhymix,代码行数:99,代码来源:HTMLDisplayHandler.php

示例4: dispBoardContentView

 /**
  * @brief display the board conent view
  **/
 function dispBoardContentView()
 {
     // get the variable value
     $document_srl = Context::get('document_srl');
     $page = Context::get('page');
     // generate document model object
     $oDocumentModel = getModel('document');
     /**
      * if the document exists, then get the document information
      **/
     if ($document_srl) {
         $oDocument = $oDocumentModel->getDocument($document_srl, false, true);
         // if the document is existed
         if ($oDocument->isExists()) {
             // if the module srl is not consistent
             if ($oDocument->get('module_srl') != $this->module_info->module_srl) {
                 return $this->stop('msg_invalid_request');
             }
             // check the manage grant
             if ($this->grant->manager) {
                 $oDocument->setGrant();
             }
             // if the consultation function is enabled, and the document is not a notice
             if ($this->consultation && !$oDocument->isNotice()) {
                 $logged_info = Context::get('logged_info');
                 if ($oDocument->get('member_srl') != $logged_info->member_srl) {
                     $oDocument = $oDocumentModel->getDocument(0);
                 }
             }
             // if the document is TEMP saved, check Grant
             if ($oDocument->getStatus() == 'TEMP') {
                 if (!$oDocument->isGranted()) {
                     $oDocument = $oDocumentModel->getDocument(0);
                 }
             }
         } else {
             // if the document is not existed, then alert a warning message
             Context::set('document_srl', '', true);
             $this->alertMessage('msg_not_founded');
         }
         /**
          * if the document is not existed, get an empty document
          **/
     } else {
         $oDocument = $oDocumentModel->getDocument(0);
     }
     /**
      *check the document view grant
      **/
     if ($oDocument->isExists()) {
         if (!$this->grant->view && !$oDocument->isGranted()) {
             $oDocument = $oDocumentModel->getDocument(0);
             Context::set('document_srl', '', true);
             $this->alertMessage('msg_not_permitted');
         } else {
             // add the document title to the browser
             Context::setCanonicalURL($oDocument->getPermanentUrl());
             $seo_title = config('seo.document_title') ?: '$SITE_TITLE - $DOCUMENT_TITLE';
             getController('module')->replaceDefinedLangCode($seo_title);
             Context::setBrowserTitle($seo_title, array('site_title' => Context::getSiteTitle(), 'site_subtitle' => Context::getSiteSubtitle(), 'subpage_title' => $this->module_info->browser_title, 'document_title' => $oDocument->getTitleText(), 'page' => Context::get('page') ?: 1));
             // update the document view count (if the document is not secret)
             if (!$oDocument->isSecret() || $oDocument->isGranted()) {
                 $oDocument->updateReadedCount();
             }
             // disappear the document if it is secret
             if ($oDocument->isSecret() && !$oDocument->isGranted()) {
                 $oDocument->add('content', lang('thisissecret'));
             }
         }
     }
     Context::set('update_view', $this->grant->update_view);
     // setup the document oject on context
     $oDocument->add('module_srl', $this->module_srl);
     Context::set('oDocument', $oDocument);
     /**
      * add javascript filters
      **/
     Context::addJsFilter($this->module_path . 'tpl/filter', 'insert_comment.xml');
     //            return new Object();
 }
开发者ID:rhymix,项目名称:rhymix,代码行数:83,代码来源:board.view.php

示例5: sendEmail

 /**
  * 휴면 안내메일을 발송하는 메소드.
  */
 public function sendEmail($member_srl, $config = null, $resend = true, $use_transaction = true)
 {
     // 회원 오브젝트를 통째로 받은 경우 member_srl을 추출한다.
     if (is_object($member_srl) && isset($member_srl->member_srl)) {
         $member = $member_srl;
         $member_srl = $member_srl->member_srl;
     } else {
         $args = new stdClass();
         $args->member_srl = $member_srl;
         $member_query = executeQuery('member.getMemberInfoByMemberSrl', $args);
         if (!$member_query->toBool() || !$member_query->data) {
             return -41;
         }
         $member = is_object($member_query->data) ? $member_query->data : reset($member_query->data);
         if (!$member) {
             return -42;
         }
         $member_srl = $member->member_srl;
     }
     // 모듈 설정이 로딩되지 않은 경우 지금 로딩한다.
     if (!$config) {
         $config = $this->getConfig();
     }
     // 이미 발송한 경우, $resend = true가 아니라면 재발송하지 않는다.
     $args = new stdClass();
     $args->member_srl = $member_srl;
     $output = executeQuery('member_expire.getNotifiedDates', $args);
     if (!$output->toBool()) {
         return -43;
     }
     if (count($output->data) && !$resend) {
         return 2;
     }
     // 정리 예정일을 계산한다.
     $start_date = strtotime($config->auto_start) + zgap();
     $base_date = $member->last_login ? $member->last_login : $member->regdate;
     $base_date = $base_date ? ztime($base_date) : 0;
     $expire_date = $base_date + 86400 * $config->expire_threshold;
     if ($expire_date < $start_date) {
         $expire_date = $start_date;
     }
     $member->expire_date = date('YmdHis', $expire_date);
     // 매크로를 변환한다.
     $site_title = Context::getSiteTitle();
     $macros = array('{SITE_NAME}' => htmlspecialchars($site_title, ENT_QUOTES, 'UTF-8', false), '{USER_ID}' => htmlspecialchars($member->user_id, ENT_QUOTES, 'UTF-8', false), '{USER_NAME}' => htmlspecialchars($member->user_name, ENT_QUOTES, 'UTF-8', false), '{NICK_NAME}' => htmlspecialchars($member->nick_name, ENT_QUOTES, 'UTF-8', false), '{EMAIL}' => htmlspecialchars($member->email_address, ENT_QUOTES, 'UTF-8', false), '{LOGIN_DATE}' => $base_date ? date('Y년 n월 j일', $base_date) : '(로그인 기록 없음)', '{EXPIRE_DATE}' => date('Y년 n월 j일', $expire_date), '{TIME_LIMIT}' => $this->translateThreshold($config->expire_threshold), '{CLEAN_METHOD}' => $config->expire_method === 'delete' ? '삭제' : '별도의 저장공간으로 이동');
     // 메일을 작성하여 발송한다.
     $subject = htmlspecialchars_decode(str_replace(array_keys($macros), array_values($macros), $config->email_subject));
     $content = str_replace(array_keys($macros), array_values($macros), $config->email_content);
     $recipient_name = $member->user_name ? $member->user_name : ($member->nick_name ? $member->nick_name : 'member');
     static $sender_name = null;
     static $sender_email = null;
     if ($sender_name === null) {
         $member_config = getModel('module')->getModuleConfig('member');
         $sender_name = $member_config->webmaster_name ? $member_config->webmaster_name : ($site_title ? $site_title : 'webmaster');
         $sender_email = $member_config->webmaster_email;
     }
     $oMail = new Mail();
     $oMail->setTitle($subject);
     $oMail->setContent($content);
     $oMail->setSender($sender_name, $sender_email);
     $oMail->setReceiptor($recipient_name, $member->email_address);
     $oMail->send();
     // 트랜잭션을 시작한다.
     if ($use_transaction) {
         $this->oDB->begin();
     }
     // 발송한 메일을 기록한다.
     $output = executeQuery('member_expire.deleteNotifiedDate', $member);
     if (!$output->toBool()) {
         if ($use_transaction) {
             $this->oDB->rollback();
         }
         return -44;
     }
     $output = executeQuery('member_expire.insertNotifiedDate', $member);
     if (!$output->toBool()) {
         if ($use_transaction) {
             $this->oDB->rollback();
         }
         return -45;
     }
     // 트랜잭션을 커밋한다.
     if ($use_transaction) {
         $this->oDB->commit();
     }
     return 1;
 }
开发者ID:bjrambo,项目名称:xe-member-expire,代码行数:90,代码来源:member_expire.model.php

示例6: init


//.........这里部分代码省略.........
     }
     // redirect, if module_site_srl and site_srl are different
     if (!$this->module && !$module_info && $site_module_info->site_srl == 0 && $site_module_info->module_site_srl > 0) {
         Context::setCacheControl(0);
         $site_info = $oModuleModel->getSiteInfo($site_module_info->module_site_srl);
         header('location: ' . getNotEncodedSiteUrl($site_info->domain, 'mid', $site_module_info->mid), true, 301);
         return false;
     }
     // If module_info is not set still, and $module does not exist, find the default module
     if (!$module_info && !$this->module && !$this->mid) {
         $module_info = $site_module_info;
     }
     if (!$module_info && !$this->module && $site_module_info->module_site_srl) {
         $module_info = $site_module_info;
     }
     // redirect, if site_srl of module_info is different from one of site's module_info
     if ($module_info && $module_info->site_srl != $site_module_info->site_srl && !Rhymix\Framework\UA::isRobot()) {
         // If the module is of virtual site
         if ($module_info->site_srl) {
             $site_info = $oModuleModel->getSiteInfo($module_info->site_srl);
             $redirect_url = getNotEncodedSiteUrl($site_info->domain, 'mid', Context::get('mid'), 'document_srl', Context::get('document_srl'), 'module_srl', Context::get('module_srl'), 'entry', Context::get('entry'));
             // If it's called from a virtual site, though it's not a module of the virtual site
         } else {
             $redirect_url = getNotEncodedSiteUrl(Context::getDefaultUrl(), 'mid', Context::get('mid'), 'document_srl', Context::get('document_srl'), 'module_srl', Context::get('module_srl'), 'entry', Context::get('entry'));
         }
         Context::setCacheControl(0);
         header("Location: {$redirect_url}", true, 301);
         return false;
     }
     // redirect, if site start module
     if (Context::getRequestMethod() === 'GET' && isset($_GET['mid']) && $_GET['mid'] === $site_module_info->mid && count($_GET) === 1) {
         Context::setCacheControl(0);
         header('location: ' . getNotEncodedSiteUrl($site_module_info->domain), true, 301);
         return false;
     }
     // If module info was set, retrieve variables from the module information
     if ($module_info) {
         $this->module = $module_info->module;
         $this->mid = $module_info->mid;
         $this->module_info = $module_info;
         if ($module_info->mid == $site_module_info->mid) {
             $seo_title = config('seo.main_title') ?: '$SITE_TITLE - $SITE_SUBTITLE';
         } else {
             $seo_title = config('seo.subpage_title') ?: '$SITE_TITLE - $SUBPAGE_TITLE';
         }
         getController('module')->replaceDefinedLangCode($seo_title);
         Context::setBrowserTitle($seo_title, array('site_title' => Context::getSiteTitle(), 'site_subtitle' => Context::getSiteSubtitle(), 'subpage_title' => $module_info->browser_title, 'page' => Context::get('page') ?: 1));
         $module_config = $oModuleModel->getModuleConfig('module');
         if ($module_info->meta_keywords) {
             Context::addMetaTag('keywords', $module_info->meta_keywords);
         } elseif ($module_config->meta_keywords) {
             Context::addMetaTag('keywords', $module_config->meta_keywords);
         }
         if ($module_info->meta_description) {
             Context::addMetaTag('description', $module_info->meta_description);
         } elseif ($module_config->meta_description) {
             Context::addMetaTag('description', $module_config->meta_description);
         }
         $viewType = Mobile::isFromMobilePhone() ? 'M' : 'P';
         $targetSrl = Mobile::isFromMobilePhone() ? 'mlayout_srl' : 'layout_srl';
         // use the site default layout.
         if ($module_info->{$targetSrl} == -1) {
             $oLayoutAdminModel = getAdminModel('layout');
             $layoutSrl = $oLayoutAdminModel->getSiteDefaultLayout($viewType, $module_info->site_srl);
         } else {
             $layoutSrl = $module_info->{$targetSrl};
         }
         // reset a layout_srl in module_info.
         $module_info->{$targetSrl} = $layoutSrl;
         $part_config = $oModuleModel->getModulePartConfig('layout', $layoutSrl);
         Context::addHtmlHeader($part_config->header_script);
     }
     // Set module and mid into module_info
     if (!isset($this->module_info)) {
         $this->module_info = new stdClass();
     }
     $this->module_info->module = $this->module;
     $this->module_info->mid = $this->mid;
     // Set site_srl add 2011 08 09
     $this->module_info->site_srl = $site_module_info->site_srl;
     // Still no module? it's an error
     if (!$this->module) {
         $this->error = 'msg_module_is_not_exists';
         $this->httpStatusCode = '404';
         return true;
     }
     // If mid exists, set mid into context
     if ($this->mid) {
         Context::set('mid', $this->mid, TRUE);
     }
     // Call a trigger after moduleHandler init
     $output = self::triggerCall('moduleHandler.init', 'after', $this->module_info);
     if (!$output->toBool()) {
         $this->error = $output->getMessage();
         return true;
     }
     // Set current module info into context
     Context::set('current_module_info', $this->module_info);
     return true;
 }
开发者ID:rhymix,项目名称:rhymix,代码行数:101,代码来源:ModuleHandler.class.php


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