diff --git a/modules/comment/comment.item.php b/modules/comment/comment.item.php index cea7371e4d..9c7ee41391 100644 --- a/modules/comment/comment.item.php +++ b/modules/comment/comment.item.php @@ -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() @@ -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 */ diff --git a/modules/document/document.item.php b/modules/document/document.item.php index 50b2a76fc2..2150a11e27 100644 --- a/modules/document/document.item.php +++ b/modules/document/document.item.php @@ -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() diff --git a/widgets/content/content.class.php b/widgets/content/content.class.php index 9eb448cb64..1d3dda80b6 100644 --- a/widgets/content/content.class.php +++ b/widgets/content/content.class.php @@ -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; @@ -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]);