Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

게시물, 댓글 고유 링크에 mid를 포함하도록 수정 #2168

Merged
1 commit merged into from
Nov 24, 2017
Merged
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
13 changes: 12 additions & 1 deletion modules/comment/comment.item.php
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ function getUpdate($format = 'Y.m.d H:i:s')

function getPermanentUrl()
{
return getFullUrl('', 'document_srl', $this->get('document_srl')) . '#comment_' . $this->get('comment_srl');
return getFullUrl('', 'mid', $this->getCommentMid(), 'document_srl', $this->get('document_srl')) . '#comment_' . $this->get('comment_srl');
}

function getUpdateTime()
Expand Down Expand Up @@ -703,6 +703,17 @@ function isCarted()
{
return $_SESSION['comment_management'][$this->comment_srl];
}

/**
* Returns the comment's mid in order to construct SEO friendly URLs
* @return string
*/
function getCommentMid()
{
$model = getModel('module');
Copy link
Contributor

Choose a reason for hiding this comment

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

$model 이렇게 적으면 어떤 모델을 불러오는지 명확한 네이밍이 아닌것 같습니다.

정확하게 $oModuleModel = (ObjectModuleModel) 으로 명확한 이름이 나오도록 하는것이 좋겠습니다.

아래의 $module 이라는 이름도 역시 마찬가지로 $moduleInfo 혹은 $module_info 으로 명확하게...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

지적 감사합니다. 알려주신대로 수정해서 놓겠습니다.

$module = $model->getModuleInfoByModuleSrl($this->get('module_srl'));
return $module->mid;
}

}
/* End of file comment.item.php */
Expand Down
2 changes: 1 addition & 1 deletion modules/document/document.item.php
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ function getUpdateDT()

function getPermanentUrl()
{
return getFullUrl('','document_srl',$this->get('document_srl'));
return getFullUrl('','mid', $this->getDocumentMid('document_srl'), 'document_srl', $this->get('document_srl'));
}

function getTrackbackUrl()
Expand Down
4 changes: 2 additions & 2 deletions widgets/content/content.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function _getCommentItems($args)
$attribute = $oComment->getObjectVars();
$title = $oComment->getSummary($args->content_cut_size);
$thumbnail = $oComment->getThumbnail($args->thumbnail_width,$args->thumbnail_height,$args->thumbnail_type);
$url = sprintf("%s#comment_%s",getUrl('','document_srl',$oComment->get('document_srl')),$oComment->get('comment_srl'));
$url = sprintf("%s#comment_%s",getUrl('','mid', $args->mid_lists[$attribute->module_srl], 'document_srl',$oComment->get('document_srl')),$oComment->get('comment_srl'));

$attribute->mid = $args->mid_lists[$attribute->module_srl];
$browser_title = $args->module_srls_info[$attribute->module_srl]->browser_title;
Expand Down Expand Up @@ -282,7 +282,7 @@ function _getDocumentItems($args)
$content_item->setCategory( $category_lists[$module_srl][$category_srl]->title );
$content_item->setDomain( $args->module_srls_info[$module_srl]->domain );
$content_item->setContent($oDocument->getSummary($args->content_cut_size));
$content_item->setLink( getSiteUrl($domain,'','document_srl',$document_srl) );
$content_item->setLink( getSiteUrl($domain, '', 'mid', $args->mid_lists[$module_srl],'document_srl',$document_srl) );
$content_item->setThumbnail($thumbnail);
$content_item->setExtraImages($oDocument->printExtraImages($args->duration_new * 60 * 60));
$content_item->add('mid', $args->mid_lists[$module_srl]);
Expand Down