Skip to content
This repository has been archived by the owner on Jul 17, 2018. It is now read-only.

Meta description 최적화 추가 #22

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions seo.admin.controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ function procSeoAdminSaveSetting()
$config->site_name = $vars->site_name;
$config->site_slogan = $vars->site_slogan;
$config->site_description = $vars->site_description;
$config->use_menu_desc = $vars->use_menu_desc;
$config->site_keywords = $vars->site_keywords;
if ($vars->site_image) {
$path = _XE_PATH_ . 'files/attach/site_image/';
Expand Down
27 changes: 25 additions & 2 deletions seo.controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ function triggerBeforeDisplay(&$output_content)
);

$oModuleModel = getModel('module');
$oModuleController = getController('module');
$config = $this->getConfig();

$logged_info = Context::get('logged_info');
Expand All @@ -72,17 +73,39 @@ function triggerBeforeDisplay(&$output_content)
$is_article = false;
$single_image = 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->tags = array();
$piece->image = array();
$piece->author = null;

$args_desc = new stdClass();
$args_desc->url = $current_module_info->mid;
$args_desc->site_srl = $site_module_info->site_srl;
$args_desc->is_shortcut = 'N';
$output = executeQuery('menu.getMenuItemByUrl', $args_desc);

if(!$output->data)
{
$output->data = new stdClass();
$output->data->desc = '';
}

$desc = $output->data->desc;
if($config->use_menu_desc === 'Y' && $desc)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$desc 가 모듈안에 없는듯?

{
$oModuleController->replaceDefinedLangCode($desc,TRUE);
$piece->description = htmlspecialchars($desc, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
}
else
{
$piece->description = $config->site_description;
}

if(stristr($_SERVER['HTTP_USER_AGENT'], 'facebookexternalhit') != FALSE) {
$single_image = true;
Expand Down
7 changes: 7 additions & 0 deletions tpl/AdminSetting.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ <h1>문서 제목 최적화</h1>
<p class="x_help-block">사이트의 부제, 슬로건, 캐치프레이즈. 시작 페이지에서만 표시되며 '사이트 이름 - 사이트 부제'와 같이 표시됩니다.</p>
</div>
</div>
<div class="x_control-group">
<label for="use_menu_desc" class="x_control-label">Meta description 최적화</label>
<div class="x_controls">
<label><input type="checkbox" name="use_menu_desc" id="use_menu_desc" value="Y" checked="checked"|cond="$config->use_menu_desc == 'Y'" /> Meta description 최적화 기능 사용</label>
<p class="x_help-block">접속한 메뉴의 설명 부분을 Meta description으로 사용합니다.</p>
</div>
</div>
</section>

<section class="section">
Expand Down