本文整理汇总了PHP中Context::getBrowserTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP Context::getBrowserTitle方法的具体用法?PHP Context::getBrowserTitle怎么用?PHP Context::getBrowserTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Context
的用法示例。
在下文中一共展示了Context::getBrowserTitle方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: procWAP
function procWAP(&$oMobile)
{
$content = '';
// 플래닛의 기본 단위인 날짜를 미리 계산 모듈에 있는 동작인데... 애드온이 모듈보다 일찍 실행된다;
$last_date = $this->planet->getContentLastDay();
$date = Context::get('date');
if (!$date || $date > $last_date) {
$date = $last_date;
}
Context::set('date', $date);
Context::set('prev_date', $this->planet->getPrevDate($date));
Context::set('next_date', $this->planet->getNextDate($date));
$type = Context::get('type');
if (!$type) {
$type = 'all';
}
Context::set('type', $type);
$tagtab = null;
switch ($type) {
case 'wantyou':
$sort_index = 'documents.voted_count';
$order = 'desc';
break;
case 'best':
$sort_index = 'documents.comment_count';
$order = 'desc';
break;
case 'all':
$sort_index = 'documents.list_order';
$order = 'asc';
break;
}
$page = Context::get('page');
$oPlanetModel =& getModel('planet');
$output = $oPlanetModel->getNewestContentList(null, $date, $page, 9, $sort_index, $order, $tagtab);
$title = Context::getBrowserTitle() . ' [' . zdate($date, 'Y') . Context::getLang('unit_year') . zdate($date, 'm') . Context::getLang('unit_month') . zdate($date, 'd') . Context::getLang('unit_day') . ']';
// 댓글 보기 일 경우
if ($this->act == 'dispPlanetContentCommentList') {
$page = Context::get('page');
$document_srl = Context::get('document_srl');
$oPlanetModel =& getModel('planet');
$output = $oPlanetModel->getReplyList($document_srl, $page);
$reply_list = $output->data;
$title .= ' - ' . Context::getLang('comment');
if (is_array($reply_list)) {
foreach ($reply_list as $key => $reply) {
$content .= '[<strong>' . $reply->nick_name . '</strong>] ';
$content .= $reply->content;
}
}
// 상위 페이지를 목록으로 돌아가기로 지정
$oMobile->setUpperUrl(getUrl('act', ''), Context::getLang('cmd_go_upper'));
} else {
if ($output->page_navigation->total_page > 1) {
if ($output->page_navigation->cur_page < $output->page_navigation->last_page) {
// next/prevUrl 지정
$oMobile->setPrevUrl(getUrl('page', $output->page_navigation->cur_page + 1), sprintf('%s (%d/%d)', Context::getLang('cmd_prev'), $output->page_navigation->cur_page + 1, $output->page_navigation->total_page));
}
if ($output->page_navigation->cur_page > 1) {
$oMobile->setNextUrl(getUrl('page', $output->page_navigation->cur_page - 1), sprintf('%s (%d/%d)', Context::getLang('cmd_next'), $output->page_navigation->cur_page - 1, $output->page_navigation->total_page));
}
}
if (!$output->data || !count($output->data)) {
$content .= Context::getLang('no_documents');
}
foreach ($output->data as $no => $item) {
$obj = null;
$obj['href'] = getUrl('mid', $_GET['mid'], 'document_srl', $item->get('document_srl'), 'act', 'dispPlanetContentCommentList');
$obj['link'] = '[' . htmlspecialchars($item->getNickName()) . '] ' . "\n";
$obj['link'] .= htmlspecialchars(strip_tags($item->getContent()));
if ($item->getPostScript()) {
$obj['extra'] = Context::getLang('planet_postscript') . htmlspecialchars($item->getPostScript());
}
if (is_array($item->getArrTags())) {
$obj['extra'] .= '<br />TAG:';
$obj['extra'] .= implode(', ', $item->getArrTags());
}
$obj['link'] = $obj['text'] = $obj['link'];
$childs[] = $obj;
}
$oMobile->setChilds($childs);
$prev_date = Context::get('prev_date');
if ($prev_date) {
$oMobile->setEtcBtn(getUrl('date', $prev_date, 'document_srl', ''), '<');
}
$next_date = Context::get('next_date');
if ($next_date) {
$oMobile->setEtcBtn(getUrl('date', $next_date, 'document_srl', ''), '>');
}
}
$oMobile->setTitle($title);
$oMobile->setContent($content);
}
示例2: triggerBeforeDisplay
function triggerBeforeDisplay(&$output_content)
{
if (Context::getResponseMethod() != 'HTML') {
return;
}
if (Context::get('module') == 'admin') {
return;
}
$oModuleModel = getModel('module');
$config = $this->getConfig();
$logged_info = Context::get('logged_info');
$current_module_info = Context::get('current_module_info');
$site_module_info = Context::get('site_module_info');
$document_srl = Context::get('document_srl');
$is_article = false;
$is_index = $current_module_info->module_srl == $site_module_info->module_srl ? true : false;
$piece = new stdClass();
$piece->document_title = null;
$piece->type = 'website';
$piece->url = getFullUrl('');
$piece->title = Context::getBrowserTitle();
$piece->description = $config->site_description;
$piece->keywords = $config->site_keywords;
$piece->image = array();
$piece->author = null;
if ($document_srl) {
$oDocument = Context::get('oDocument');
if (!is_a($oDocument, 'documentItem')) {
$oDocumentModel = getModel('document');
$oDocument = $oDocumentModel->getDocument($document_srl);
}
if (is_a($oDocument, 'documentItem') && $document_srl == $oDocument->document_srl) {
$is_article = true;
}
}
// 문서 데이터 수집
if ($is_article) {
if (!$oDocument->isSecret()) {
$piece->document_title = $oDocument->getTitleText();
$piece->url = getFullUrl('', 'mid', $current_module_info->mid, 'document_srl', $document_srl);
$piece->type = 'article';
$piece->description = trim(str_replace(' ', ' ', $oDocument->getContentText(400)));
$piece->author = $oDocument->getNickName();
if (count($oDocument->get('tag_list'))) {
$tags = implode(',', $oDocument->get('tag_list'));
if ($tags) {
$piece->keywords = $tags;
}
}
if ($oDocument->hasUploadedFiles()) {
$image_ext = array('bmp', 'gif', 'jpg', 'jpeg', 'png');
foreach ($oDocument->getUploadedFiles() as $file) {
if ($file->isvalid != 'Y') {
continue;
}
$ext = array_pop(explode('.', $file->uploaded_filename));
if (!in_array(strtolower($ext), $image_ext)) {
continue;
}
$piece->image[] = Context::get('request_uri') . $file->uploaded_filename;
}
}
} else {
$piece->url = getFullUrl('', 'mid', $current_module_info->mid);
}
} else {
if (!$is_index) {
$page = Context::get('page') > 1 ? Context::get('page') : null;
$piece->url = getNotEncodedFullUrl('mid', $current_module_info->mid, 'page', $page);
}
}
$piece->title = $this->getBrowserTitle($piece->document_title);
if ($config->site_image_url) {
$piece->image[] = $config->site_image_url;
}
$this->addLink('canonical', $piece->url);
$this->addMeta('keywords', $piece->keywords);
$this->addMeta('description', $piece->description);
// Open Graph
$this->addMeta('og:type', $piece->type);
$this->addMeta('og:url', $piece->url);
$this->addMeta('og:site_name', $config->site_name);
$this->addMeta('og:title', $piece->title);
$this->addMeta('og:description', $piece->description);
$this->addMeta('og:article:author', $piece->author);
foreach ($piece->image as $img) {
$this->addMeta('og:image', $img);
}
$this->canonical_url = $piece->url;
$this->applySEO();
if ($config->use_optimize_title == 'Y') {
Context::setBrowserTitle($piece->title);
}
}
示例3: display
/**
* @brief display
*/
function display()
{
// Home button assignments
$this->setHomeUrl(getUrl(), Context::getLang('cmd_go_home'));
// Specify the title
if (!$this->title) {
$this->setTitle(Context::getBrowserTitle());
}
ob_start();
// Output header
$this->printHeader();
// Output title
$this->printTitle();
// Information output
$this->printContent();
// Button output
$this->printBtn();
// Footer output
$this->printFooter();
$content = ob_get_clean();
// After conversion output
if (strtolower($this->charset) == 'utf-8') {
print $content;
} else {
print iconv('UTF-8', $this->charset . "//TRANSLIT//IGNORE", $content);
}
exit;
}
示例4: htmlspecialchars
<?php
if (!defined('__XE__')) {
exit;
}
if ($called_position != "before_display_content") {
return;
}
// 컨텐츠를 표시하는 시점에 호출되어야 합니다.
$title = Context::getBrowserTitle() . ' ' . $addon_info->title_sep . ' ' . $addon_info->homepage_title;
// 문서의 제목을 가져옵니다.
$title = htmlspecialchars($title);
// 이스케이프는 언제 어디서나 필수!
Context::setBrowserTitle($title);
// 설정.
示例5: rss
/**
* Feed output.
* When trying to directly print out the RSS, the results variable can be directly specified through $oRssView->rss($document_list)
*
* @param Object $document_list Document list
* @param string $rss_title Rss title
* @param string $add_description Add description
*/
function rss($document_list = null, $rss_title = null, $add_description = null)
{
$oDocumentModel = getModel('document');
$oModuleModel = getModel('module');
$oModuleController = getController('module');
// Get the content and information for the current requested module if the method is not called from another module
if (!$document_list) {
$site_module_info = Context::get('site_module_info');
$site_srl = $site_module_info->site_srl;
$mid = Context::get('mid');
// The target module id, if absent, then all
$start_date = (int) Context::get('start_date');
$end_date = (int) Context::get('end_date');
$module_srls = array();
$rss_config = array();
$total_config = '';
$total_config = $oModuleModel->getModuleConfig('rss');
// If one is specified, extract only for this mid
if ($mid) {
$module_srl = $this->module_info->module_srl;
$config = $oModuleModel->getModulePartConfig('rss', $module_srl);
if ($config->open_rss && $config->open_rss != 'N') {
$module_srls[] = $module_srl;
$open_rss_config[$module_srl] = $config->open_rss;
}
// If mid is not selected, then get all
} else {
if ($total_config->use_total_feed != 'N') {
$rss_config = $oModuleModel->getModulePartConfigs('rss', $site_srl);
if ($rss_config) {
foreach ($rss_config as $module_srl => $config) {
if ($config && $config->open_rss != 'N' && $config->open_total_feed != 'T_N') {
$module_srls[] = $module_srl;
$open_rss_config[$module_srl] = $config->open_rss;
}
}
}
}
}
if (!count($module_srls) && !$add_description) {
return $this->dispError();
}
$info = new stdClass();
$args = new stdClass();
if ($module_srls) {
$args->module_srl = implode(',', $module_srls);
//$module_list = $oModuleModel->getMidList($args); //perhaps module_list varialbles not use
$args->search_target = 'is_secret';
$args->search_keyword = 'N';
$args->page = (int) Context::get('page');
$args->list_count = 15;
if ($total_config->feed_document_count) {
$args->list_count = $total_config->feed_document_count;
}
if (!$args->page || $args->page < 1) {
$args->page = 1;
}
if ($start_date || $start_date != 0) {
$args->start_date = $start_date;
}
if ($end_date || $end_date != 0) {
$args->end_date = $end_date;
}
if ($start_date == 0) {
unset($start_date);
}
if ($end_date == 0) {
unset($end_date);
}
$args->sort_index = 'list_order';
$args->order_type = 'asc';
$output = $oDocumentModel->getDocumentList($args);
$document_list = $output->data;
// Extract the feed title and information with Context::getBrowserTitle
if ($mid) {
$info->title = Context::getBrowserTitle();
$oModuleController->replaceDefinedLangCode($info->title);
$info->title = str_replace('\'', ''', $info->title);
if ($config->feed_description) {
$info->description = str_replace('\'', ''', htmlspecialchars($config->feed_description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
} else {
$info->description = str_replace('\'', ''', htmlspecialchars($this->module_info->description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
}
$info->link = getUrl('', 'mid', $mid);
$info->feed_copyright = str_replace('\'', ''', htmlspecialchars($feed_config->feed_copyright, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
if (!$info->feed_copyright) {
$info->feed_copyright = str_replace('\'', ''', htmlspecialchars($total_config->feed_copyright, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
}
}
}
}
if (!$info->title) {
//.........这里部分代码省略.........
示例6: procModule
//.........这里部分代码省略.........
if ($xml_info->default_index_act && method_exists($oModule, $xml_info->default_index_act)) {
$this->act = $xml_info->default_index_act;
} else {
$this->error = 'msg_invalid_request';
$oModule->setError(-1);
$oModule->setMessage($this->error);
return $oModule;
}
}
}
// ruleset check...
if (!empty($ruleset)) {
$rulesetModule = $forward->module ? $forward->module : $this->module;
$rulesetFile = $oModuleModel->getValidatorFilePath($rulesetModule, $ruleset, $this->mid);
if (!empty($rulesetFile)) {
if ($_SESSION['XE_VALIDATOR_ERROR_LANG']) {
$errorLang = $_SESSION['XE_VALIDATOR_ERROR_LANG'];
foreach ($errorLang as $key => $val) {
Context::setLang($key, $val);
}
unset($_SESSION['XE_VALIDATOR_ERROR_LANG']);
}
$Validator = new Validator($rulesetFile);
$result = $Validator->validate();
if (!$result) {
$lastError = $Validator->getLastError();
$returnUrl = Context::get('error_return_url');
$errorMsg = $lastError['msg'] ? $lastError['msg'] : 'validation error';
//for xml response
$oModule->setError(-1);
$oModule->setMessage($errorMsg);
//for html redirect
$this->error = $errorMsg;
$_SESSION['XE_VALIDATOR_ERROR'] = -1;
$_SESSION['XE_VALIDATOR_MESSAGE'] = $this->error;
$_SESSION['XE_VALIDATOR_MESSAGE_TYPE'] = 'error';
$_SESSION['XE_VALIDATOR_RETURN_URL'] = $returnUrl;
$_SESSION['XE_VALIDATOR_ID'] = Context::get('xe_validator_id');
$this->_setInputValueToSession();
return $oModule;
}
}
}
$oModule->setAct($this->act);
$this->module_info->module_type = $type;
$oModule->setModuleInfo($this->module_info, $xml_info);
$skipAct = array('dispEditorConfigPreview' => 1, 'dispLayoutPreviewWithModule' => 1);
$db_use_mobile = Mobile::isMobileEnabled();
if ($type == "view" && $this->module_info->use_mobile == "Y" && Mobile::isMobileCheckByAgent() && !isset($skipAct[Context::get('act')]) && $db_use_mobile === true) {
global $lang;
$header = '<style>div.xe_mobile{opacity:0.7;margin:1em 0;padding:.5em;background:#333;border:1px solid #666;border-left:0;border-right:0}p.xe_mobile{text-align:center;margin:1em 0}a.xe_mobile{color:#ff0;font-weight:bold;font-size:24px}@media only screen and (min-width:500px){a.xe_mobile{font-size:15px}}</style>';
$footer = '<div class="xe_mobile"><p class="xe_mobile"><a class="xe_mobile" href="' . getUrl('m', '1') . '">' . $lang->msg_pc_to_mobile . '</a></p></div>';
Context::addHtmlHeader($header);
Context::addHtmlFooter($footer);
}
if ($type == "view" && $kind != 'admin') {
$module_config = $oModuleModel->getModuleConfig('module');
if ($module_config->htmlFooter) {
Context::addHtmlFooter($module_config->htmlFooter);
}
if ($module_config->siteTitle) {
$siteTitle = Context::getBrowserTitle();
if (!$siteTitle) {
Context::setBrowserTitle($module_config->siteTitle);
}
}
}
// if failed message exists in session, set context
$this->_setInputErrorToContext();
$procResult = $oModule->proc();
$methodList = array('XMLRPC' => 1, 'JSON' => 1, 'JS_CALLBACK' => 1);
if (!$oModule->stop_proc && !isset($methodList[Context::getRequestMethod()])) {
$error = $oModule->getError();
$message = $oModule->getMessage();
$messageType = $oModule->getMessageType();
$redirectUrl = $oModule->getRedirectUrl();
if ($messageType == 'error') {
debugPrint($message, 'ERROR');
}
if (!$procResult) {
$this->error = $message;
if (!$redirectUrl && Context::get('error_return_url')) {
$redirectUrl = Context::get('error_return_url');
}
$this->_setInputValueToSession();
} else {
}
$_SESSION['XE_VALIDATOR_ERROR'] = $error;
$_SESSION['XE_VALIDATOR_ID'] = Context::get('xe_validator_id');
if ($message != 'success') {
$_SESSION['XE_VALIDATOR_MESSAGE'] = $message;
}
$_SESSION['XE_VALIDATOR_MESSAGE_TYPE'] = $messageType;
if (Context::get('xeVirtualRequestMethod') != 'xml') {
$_SESSION['XE_VALIDATOR_RETURN_URL'] = $redirectUrl;
}
}
unset($logged_info);
return $oModule;
}
示例7: dispNproductItemDetail
/**
* @brief display item detail info
*/
function dispNproductItemDetail()
{
if ($_COOKIE['mobile'] == "true") {
Context::set('is_mobile', 'true');
}
$oDocumentModel =& getModel('document');
$oFileModel =& getModel('file');
$oNproductModel =& getModel('nproduct');
$oStoreReviewModel =& getModel('store_review');
$item_srl = Context::get('item_srl');
$document_srl = Context::get('document_srl');
Context::set('list_config', $oNproductModel->getDetailListConfig($this->module_info->module_srl));
// get config
$config = $oNproductModel->getModuleConfig();
Context::set('config', $config);
// item info
if ($item_srl) {
$args->item_srl = $item_srl;
} else {
if ($document_srl) {
$args->document_srl = $document_srl;
} else {
return new Object(-1, 'Item Not Found.');
}
}
$output = executeQuery('nproduct.getItemInfo', $args);
if (!$output->toBool()) {
return $output;
}
$item_info = $output->data;
// thumbnail
if ($item_info->thumb_file_srl) {
$file = $oFileModel->getFile($item_info->thumb_file_srl);
if ($file) {
$item_info->thumbnail_url = getFullUrl() . $file->download_url;
}
}
$item_info = new nproductItem($item_info, $config->currency, $config->as_sign, $config->decimals);
// category
$this->getCategoryTree($this->module_info->module_srl);
// document
$oDocument = $oDocumentModel->getDocument($item_info->document_srl);
Context::set('oDocument', $oDocument);
if ($item_info->item_srl) {
$review_list = $oNproductModel->getReviews($item_info);
Context::set('review_list', $review_list);
}
$output = $oNproductModel->discountItem($item_info);
$item_info->discounted_price = $output->discounted_price;
$item_info->discount_amount = $output->discount_amount;
$item_info->discount_info = $output->discount_info;
Context::set('discounted_price', $output->discounted_price);
Context::set('discount_amount', $output->discount_amount);
Context::set('discount_info', $output->discount_info);
// get options
$args->item_srl = $item_info->item_srl;
$output = executeQueryArray('nproduct.getOptions', $args);
Context::set('options', $output->data);
// set browser title
Context::setBrowserTitle(strip_tags($item_info->item_name) . ' - ' . Context::getBrowserTitle());
// get related items information
if ($item_info->related_items) {
if (!$this->isJson($item_info->related_items)) {
$item_info->related_items = $this->convertCsvToJson($item_info->related_items);
}
$relatedItems = json_decode($item_info->related_items);
$relatedItemSrls = array();
foreach ($relatedItems as $key => $val) {
$relatedItemSrls[] = $val->item_srl;
}
if (count($relatedItemSrls)) {
$item_info->related_items = $oNproductModel->getItemList(implode(',', $relatedItemSrls), 999);
}
}
$trigger_output = ModuleHandler::triggerCall('nproduct.dispNproductItemDetail', 'before', $item_info);
if (!$trigger_output->toBool()) {
return $trigger_output;
}
// pass variables to html template
Context::set('category', $item_info->category_id);
Context::set('item_srl', $item_info->item_srl);
Context::set('item_info', $item_info);
$extra_vars = NExtraItemList::getList($item_info);
Context::set('extra_vars', $extra_vars);
$this->setTemplateFile('itemdetail');
}
示例8: _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'));
}
}
示例9: foreach
echo $__Context->val['name'];
?>
"<?php
}
?>
content="<?php
echo $__Context->val['content'];
?>
">
<?php
}
}
?>
<!-- TITLE -->
<title><?php
echo Context::getBrowserTitle();
?>
</title>
<!-- CSS -->
<?php
if ($__Context->css_files && count($__Context->css_files)) {
foreach ($__Context->css_files as $__Context->key => $__Context->css_file) {
if ($__Context->css_file['targetie']) {
?>
<!--[if <?php
echo $__Context->css_file['targetie'];
?>
]><?php
}
?>
<link rel="stylesheet" href="<?php
示例10: sendTrackback
/**
* @brief 엮인글을 발송
*
* 발송 후 결과처리는 하지 않는 구조임
**/
function sendTrackback($oDocument, $trackback_url, $charset)
{
$oModuleController =& getController('module');
// 발송할 정보를 정리
$http = parse_url($trackback_url);
$obj->blog_name = str_replace(array('<', '>', '&', '"'), array('<', '>', '&', '"'), Context::getBrowserTitle());
$oModuleController->replaceDefinedLangCode($obj->blog_name);
$obj->title = $oDocument->getTitleText();
$obj->excerpt = $oDocument->getSummary(200);
$obj->url = getFullUrl('', 'document_srl', $oDocument->document_srl);
// blog_name, title, excerpt, url의 문자열을 요청된 charset으로 변경
if ($charset && function_exists('iconv')) {
foreach ($obj as $key => $val) {
$obj->{$key} = iconv('UTF-8', $charset, $val);
}
}
// socket으로 발송할 내용 작성
if ($http['query']) {
$http['query'] .= "&";
}
if (!$http['port']) {
$http['port'] = 80;
}
$content = sprintf("title=%s&" . "url=%s&" . "blog_name=%s&" . "excerpt=%s", urlencode($obj->title), urlencode($obj->url), urlencode($obj->blog_name), urlencode($obj->excerpt));
if ($http['query']) {
$content .= '&' . $http['query'];
}
$content_length = strlen($content);
// header 정리
$header = sprintf("POST %s HTTP/1.1\r\n" . "Host: %s\r\n" . "Content-Type: %s\r\n" . "Content-Length: %s\r\n\r\n" . "%s\r\n", $http['path'], $http['host'], "application/x-www-form-urlencoded", $content_length, $content);
if (!$http['host'] || !$http['port']) {
return new Object(-1, 'msg_trackback_url_is_invalid');
}
// 발송하려는 대상 서버의 socket을 연다
$fp = @fsockopen($http['host'], $http['port'], $errno, $errstr, 5);
if (!$fp) {
return new Object(-1, 'msg_trackback_url_is_invalid');
}
// 작성한 헤더 정보를 발송
fputs($fp, $header);
// 결과를 기다림 (특정 서버의 경우 EOF가 떨어지지 않을 수가 있음
while (!feof($fp)) {
$line = trim(fgets($fp, 4096));
if (preg_match("/^<error>/i", $line)) {
break;
}
}
// socket 닫음
fclose($fp);
return new Object(0, 'msg_trackback_send_success');
}
示例11: sendTrackback
/**
* Trackbacks sent to
* After sending the results are not sticky and handling
* @param documentItem $oDocument
* @param string $trackback_url
* @param string $charset
* @return Object
*/
function sendTrackback($oDocument, $trackback_url, $charset)
{
$oModuleController =& getController('module');
// Information sent by
$http = parse_url($trackback_url);
$obj->blog_name = str_replace(array('<', '>', '&', '"'), array('<', '>', '&', '"'), Context::getBrowserTitle());
$oModuleController->replaceDefinedLangCode($obj->blog_name);
$obj->title = $oDocument->getTitleText();
$obj->excerpt = $oDocument->getSummary(200);
$obj->url = getFullUrl('', 'document_srl', $oDocument->document_srl);
// blog_name, title, excerpt, url charset of the string to the requested change
if ($charset && function_exists('iconv')) {
foreach ($obj as $key => $val) {
$obj->{$key} = iconv('UTF-8', $charset, $val);
}
}
// written information sent to socket
if ($http['query']) {
$http['query'] .= "&";
}
if (!$http['port']) {
$http['port'] = 80;
}
$content = sprintf("title=%s&" . "url=%s&" . "blog_name=%s&" . "excerpt=%s", urlencode($obj->title), urlencode($obj->url), urlencode($obj->blog_name), urlencode($obj->excerpt));
if ($http['query']) {
$content .= '&' . $http['query'];
}
$content_length = strlen($content);
// header by
$header = sprintf("POST %s HTTP/1.1\r\n" . "Host: %s\r\n" . "Content-Type: %s\r\n" . "Content-Length: %s\r\n\r\n" . "%s\r\n", $http['path'], $http['host'], "application/x-www-form-urlencoded", $content_length, $content);
if (!$http['host'] || !$http['port']) {
return new Object(-1, 'msg_trackback_url_is_invalid');
}
// Opens a socket on the target server you want to send
$fp = @fsockopen($http['host'], $http['port'], $errno, $errstr, 5);
if (!$fp) {
return new Object(-1, 'msg_trackback_url_is_invalid');
}
// Header information sent by
fputs($fp, $header);
// Waiting for the results (in particular the server may not be falling EOF
while (!feof($fp)) {
$line = trim(fgets($fp, 4096));
if (preg_match("/^<error>/i", $line)) {
$error = preg_replace('/[^0-9]/', '', $line);
break;
}
}
// Close socket
fclose($fp);
if ($error == "0") {
return new Object(0, 'msg_trackback_send_success');
}
return new Object(-1, 'msg_trackback_send_failed');
}
示例12: display
/**
* @brief display
**/
function display()
{
// 홈버튼 지정
$this->setHomeUrl(getUrl(), Context::getLang('cmd_go_home'));
// 제목 지정
if (!$this->title) {
$this->setTitle(Context::getBrowserTitle());
}
ob_start();
// 헤더를 출력
$this->printHeader();
// 제목을 출력
$this->printTitle();
// 내용 출력
$this->printContent();
// 버튼 출력
$this->printBtn();
// 푸터를 출력
$this->printFooter();
$content = ob_get_clean();
// 변환 후 출력
if (strtolower($this->charset) == 'utf-8') {
print $content;
} else {
print iconv('UTF-8', $this->charset . "//TRANSLIT//IGNORE", $content);
}
exit;
}