Skip to content

Commit

Permalink
Merge pull request #2168 from smaker/develop
Browse files Browse the repository at this point in the history
게시물, 댓글 고유 링크에 mid를 포함하도록 수정
  • Loading branch information
bnu authored Nov 24, 2017
2 parents 824bdaf + 8c5ac13 commit 108408c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
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');
$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

0 comments on commit 108408c

Please sign in to comment.